1gensio_accepter_event(3) Library Functions Manual gensio_accepter_event(3)
2
3
4
6 gensio_accepter_event - Event handler for events from a gensio
7
9 #include <gensio/gensio.h>
10
11 typedef int (*gensio_accepter_event)(struct gensio_accepter *acc,
12 void *user_data,
13 int event, void *data);
14
16 When an event happens on a gensio accepter that is reported to the
17 user, the gensio library calls the gensio_accepter_event type handler
18 that was registered with the gensio accepter.
19
20 The use of the various parameters depends on the particular event. The
21 parameters that don't vary are:
22
23 acc - The gensio_accepter the event is being reported for.
24
25 user_data
26 - The user_data supplied when the event handler was registered.
27
28 event - The particular event being reported.
29
30 data - Data specific to the event (may not be used).
31
32 Events follow.
33
34 GENSIO_ACC_EVENT_NEW_CONNECTION
35 Got a new connection on the accepter. data points to the new gensio.
36
37 GENSIO_ACC_EVENT_LOG
38 struct gensio_loginfo {
39 enum gensio_log_levels level;
40 char *str;
41 va_list args;
42 };
43
44 The gensio accepter had an issue that wouldn't otherwise be reported as
45 an error return. data points to a struct gensio_loginfo.
46
47 GENSIO_ACC_EVENT_PRECERT_VERIFY
48 Called right before certificate verification on a new incoming connec‐
49 tion. See GENSIO_EVENT_PRECERT_VERIFY in gensio_event(3) for details.
50 data points to the new gensio object. Note that this gensio has not
51 yet been reported in a new connection.
52
53 GENSIO_ACC_EVENT_AUTH_BEGIN
54 Called at the start of an authorization process for a new connection.
55 See GENSIO_EVENT_AUTH_BEGIN in gensio_event(3) for details. data
56 points to the new gensio object. Note that this gensio has not yet
57 been reported in a new connection.
58
59 GENSIO_ACC_EVENT_PASSWORD_VERIFY
60 struct gensio_acc_password_verify_data {
61 struct gensio *io;
62 char *password;
63 gensiods password_len;
64 };
65
66 A server gensio has received a password that requires verification.
67 The gensio handlers do not actually verify the passwords, they transfer
68 them and provide them for the user to verify. data points to a struct
69 gensio_acc_password_verify_data that holds the new gensio and the pass‐
70 word information. See GENSIO_EVENT_PASSWORD_VERIFY in gensio_event(3)
71 for details.
72
73
74 GENSIO_ACC_EVENT_REQUEST_PASSWORD
75 A remote server gensio has requested that a password be sent for veri‐
76 fication data points to a struct gensio_acc_password_verify_data that
77 holds the new gensio and the password information. See GEN‐
78 SIO_EVENT_REQUEST_PASSWORD in gensio_event(3) for details.
79
80 GENSIO_ACC_EVENT_POSTCERT_VERIFY
81 struct gensio_acc_postcert_verify_data {
82 struct gensio *io;
83 int err;
84 const char *errstr;
85 };
86
87 A server gensio has finished certificate verification (and has not done
88 any password verification). data points to a struct gen‐
89 sio_acc_postcert_verify_data that holds the new gensio and error infor‐
90 mation. See GENSIO_EVENT_POSTCERT_VERIFY in gensio_event(3) for de‐
91 tails.
92
94 Other gensio accepters that are not part of the gensio library proper
95 may have their own events, too.
96
98 See the individual events for the values you should return. If an
99 event is not handled by the event handler, the handler must return
100 GE_NOTSUP, except in the case of GENSIO_ACC_EVENT_NEW_CONNECTION which
101 must be handled.
102
104 gensio_err(3), gensio(5), gensio_event(3), gensio_acc_set_callback(3),
105 str_to_gensio_accepter(3)
106
107
108
109 27 Feb 2019 gensio_accepter_event(3)