gensio_accepter_event(3)
π gensio_accepter_event β the manual page, but make it make sense π
ok so real talk, bestie: this is from the Library Functions Manual, and it's all about gensio_accepter_event, the callback that fires when stuff happens on a gensio accepter. it's giving "your accepter has gossip and it needs to tell you." let's get into it π«Ά
β¨ NAME β¨
gensio_accepter_event β 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 β¨
okay so when an event happens on a gensio accepter and it gets reported to you, the gensio library calls the gensio_accepter_event type handler that you registered with the gensio accepter. that's it, that's the whole job. you signed up for the tea, now you're getting the tea π
the way the various parameters work depends on which event it is, but some of them are always the same, no cap:
accβ thegensio_accepterthe event is being reported for. the main character in question πuser_dataβ theuser_datayou supplied back when the event handler got registered. your little snack you left for future you πeventβ the particular event being reported. the plot twist.dataβ data specific to the event (may not be used). sometimes it's a whole struct, sometimes it's just vibes and nothing.
now. the events. buckle up β¨
π 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. lowkey it's just logging the drama instead of throwing it at you. 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 β it's the sneak peek before the official announcement, iykyk.
π 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. same warning as above, bestie: 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. plot twist: the gensio handlers do not actually verify the passwords β they just transfer them and hand them over so you can verify them. it's giving "not my job, that's yours π
". 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). the cert arc concluded, no password subplot. 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 aren't part of the gensio library proper may have their own events too. so like, if you're working with a custom accepter, don't be surprised if it shows up with events you've never met. it's got lore π¦
β¨ RETURN VALUES β¨
see the individual events for the values you should return. and here's the important part, no skipping:
if an event is not handled by the event handler, the handler must returnGE_NOTSUPβ except in the case ofGENSIO_ACC_EVENT_NEW_CONNECTION, which must be handled. that one is non-negotiable. it's the main character of events and you cannot ghost it π
β¨ SEE ALSO β¨
ok that's the whole page bestie, you ate it up π
β¨ this was gensio_accepter_event(3) from the Library Functions Manual, dated 27 Feb 2019 β and yeah, that date is giving vintage, but the callback energy is timeless. go register that handler, slay, periodt ππ¦π
π¦ where this page comes from
- alpine 3.22: gensio-doc 2.8.14-r0 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- alpine 3.23: gensio-doc 2.8.14-r0 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- alpine 3.24: gensio-doc 2.8.14-r0 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- arch rolling: gensio 3.0.4-1 Β· GPL
- debian bookworm: libgensio-dev 2.6.2-4 Β· GPL-2.0-only
- debian trixie: libgensio-dev 2.8.13-7 Β· GPL-2.0-only
- epel 9: libgensio-devel 2.8.15-1.el9 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 2.8.15-5.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 2.8.15-5.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 3.0.4-1.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 3.0.4-1.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.2-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.2-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.4-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.4-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- nixos 26.05: gensio 3.0.2
- nixpkgs unstable: gensio 3.0.2
- opensuse-leap 16.0: gensio-devel 2.8.2-bp160.1.13 Β· Apache-2.0 AND GPL-2.0-only AND LGPL-2.1-only
- opensuse-leap 16.0: gensio-devel 2.8.2-bp160.1.13 Β· Apache-2.0 AND GPL-2.0-only AND LGPL-2.1-only
- opensuse-leap 16.0: gensio-devel 2.8.2-bp160.1.13 Β· Apache-2.0 AND GPL-2.0-only AND LGPL-2.1-only
- opensuse-leap 16.0: gensio-devel 2.8.2-bp160.1.13 Β· Apache-2.0 AND GPL-2.0-only AND LGPL-2.1-only
- ubuntu jammy: libgensio-dev 2.3.5-1build2 Β· GPL-2.0-only
- ubuntu noble: libgensio-dev 2.8.2-6.1build1 Β· GPL-2.0-only
- ubuntu questing: libgensio-dev 2.8.13-7
- ubuntu resolute: libgensio-dev 3.0.0-1build1 Β· GPL-2.0-only
- ubuntu stonking: libgensio-dev 3.0.0-1ubuntu1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms