gensio_accepter_event - Man Page

Event handler for events from a gensio

Synopsis

#include <gensio/gensio.h>

typedef int (*gensio_accepter_event)(struct gensio_accepter *acc,

void *user_data,
int event, void *data);

Description

When an event happens on a gensio accepter that is reported to the user, the gensio library calls the gensio_accepter_event type handler that was registered with the gensio accepter.

The use of the various parameters depends on the particular event. The parameters that don't vary are:

acc

- The gensio_accepter the event is being reported for.

user_data

- The user_data supplied when the event handler was registered.

event

- The particular event being reported.

data

- Data specific to the event (may not be used).

Events follow.

Gensio_acc_event_new_connection

Got a new connection on the accepter. data points to the new gensio.

Gensio_acc_event_log

struct gensio_loginfo {
   enum gensio_log_levels level;
   char *str;
   va_list args;
};

The gensio accepter had an issue that wouldn't otherwise be reported as an error return. data points to a struct gensio_loginfo.

Gensio_acc_event_precert_verify

Called right before certificate verification on a new incoming connection.  See GENSIO_EVENT_PRECERT_VERIFY in gensio_event(3) for details. data points to the new gensio object.  Note that this gensio has not yet been reported in a new connection.

Gensio_acc_event_auth_begin

Called at the start of an authorization process for a new connection. See GENSIO_EVENT_AUTH_BEGIN in gensio_event(3) for details. data points to the new gensio object.  Note that this gensio has not yet been reported in a new connection.

Gensio_acc_event_password_verify

struct gensio_acc_password_verify_data {
   struct gensio *io;
   char *password;
   gensiods password_len;
};

A server gensio has received a password that requires verification. The gensio handlers do not actually verify the passwords, they transfer them and provide them for the user to verify. data points to a struct gensio_acc_password_verify_data that holds the new gensio and the password information.  See GENSIO_EVENT_PASSWORD_VERIFY in gensio_event(3) for details.

Gensio_acc_event_request_password

A remote server gensio has requested that a password be sent for verification data points to a struct gensio_acc_password_verify_data that holds the new gensio and the password information.  See GENSIO_EVENT_REQUEST_PASSWORD in gensio_event(3) for details.

Gensio_acc_event_postcert_verify

struct gensio_acc_postcert_verify_data {
   struct gensio *io;
   int err;
   const char *errstr;
};

A server gensio has finished certificate verification (and has not done any password verification). data points to a struct gensio_acc_postcert_verify_data that holds the new gensio and error information.  See GENSIO_EVENT_POSTCERT_VERIFY in gensio_event(3) for details.

Other Events

Other gensio accepters that are not part of the gensio library proper may have their own events, too.

Return Values

See the individual events for the values you should return.  If an event is not handled by the event handler, the handler must return GE_NOTSUP, except in the case of Gensio_acc_event_new_connection which must be handled.

See Also

gensio_err(3), gensio(5), gensio_event(3), gensio_acc_set_callback(3), str_to_gensio_accepter(3)

Referenced By

gensio_acc_set_callback(3), gensio_set_callback(3).

27 Feb 2019