---
name: "gensio_accepter_event"
section: "3"
platform: "linux"
package: "gensio"
version: "3.0.4-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/gensio_accepter_event"
---

# gensio\_accepter\_event(3)

Event handler for events from a gensio

## 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

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)](/gensio_event/3.md) 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)](/gensio_event/3.md) 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)](/gensio_event/3.md) 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)](/gensio_event/3.md) 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)](/gensio_event/3.md) 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_err/3.md), [gensio(5)](/gensio/5.md), [gensio\_event(3)](/gensio_event/3.md), [gensio\_acc\_set\_callback(3)](/gensio_acc_set_callback/3.md), [str\_to\_gensio\_accepter(3)](/str_to_gensio_accepter/3.md)
