assh/assh_event.h header reference
Description [link]
The API of the library is event based, as explained in the Event based API section.
This header contains declaration of the struct assh_event_s structure as well as event management functions.
Members [link]
Types [link]
- enum assh_event_id_e
- struct assh_event_s
Functions [link]
- void assh_event_done(struct assh_session_s *s, struct assh_event_s *e, enum assh_status_e err)
- assh_bool_t assh_event_get(struct assh_session_s *s, struct assh_event_s *e, assh_time_t time)
Members detail [link]
void assh_event_done(struct assh_session_s *s, struct assh_event_s *e, enum assh_status_e err) [link]
This function is declared in assh/assh_event.h source file, line 248.
This function acknowledges the last event returned by the assh_event_get function.
If an error occurred during event processing by the caller, it should be reported to this function, especially if the error must terminate the session.
When an error is reported, the content of the event object is considered undefined by the library. The error will later be reported by an ASSH_EVENT_SESSION_ERROR event unless shadowed by an other error of higher severity.
See also State machines and Event based API.
assh_bool_t assh_event_get(struct assh_session_s *s, struct assh_event_s *e, assh_time_t time) [link]
This function is declared in assh/assh_event.h source file, line 229.
This function runs the various state machines which implement the ssh2 protocol, including the currently running service and key-exchange. It then reports the next available event to the caller.
The assh_event_done function must be called after each successful call to this function, before requesting the next event.
This function can be called again unless 0 is returned eventually. This occurs when the session terminates.
When the function returns 1, the passed object event is initialized and can be examined by the application.
In order for the library to handle protocol timeouts properly, the current time in seconds has to be passed to this function. When this is the case, the assh_session_deadline function can be used to get the next ssh2 protocol deadline.
See also State machines, Event based API and assh_session_closed.
enum assh_event_id_e [link]
This enum is declared in assh/assh_event.h source file, line 42.
This enum specifies event types.
Identifier | Description |
---|---|
ASSH_EVENT_READ | See struct assh_event_transport_read_s. |
ASSH_EVENT_WRITE | See struct assh_event_transport_write_s. |
ASSH_EVENT_DISCONNECT | See struct assh_event_transport_disconnect_s. |
ASSH_EVENT_DEBUG | See struct assh_event_transport_debug_s. |
ASSH_EVENT_SESSION_ERROR | See struct assh_event_session_error_s. |
ASSH_EVENT_KEX_HOSTKEY_LOOKUP | See struct assh_event_kex_hostkey_lookup_s. |
ASSH_EVENT_KEX_DONE | See struct assh_event_kex_done_s. |
ASSH_EVENT_SERVICE_START | See struct assh_event_service_start_s. |
ASSH_EVENT_USERAUTH_CLIENT_USER | See struct assh_event_userauth_client_user_s. |
ASSH_EVENT_USERAUTH_CLIENT_METHODS | See struct assh_event_userauth_client_methods_s. |
ASSH_EVENT_USERAUTH_CLIENT_BANNER | See struct assh_event_userauth_client_banner_s. |
ASSH_EVENT_USERAUTH_CLIENT_PWCHANGE | See struct assh_event_userauth_client_pwchange_s. |
ASSH_EVENT_USERAUTH_CLIENT_KEYBOARD | See struct assh_event_userauth_client_keyboard_s. |
ASSH_EVENT_USERAUTH_CLIENT_SUCCESS | |
ASSH_EVENT_USERAUTH_CLIENT_SIGN | See struct assh_event_userauth_client_sign_s. |
ASSH_EVENT_USERAUTH_SERVER_METHODS | See struct assh_event_userauth_server_methods_s. |
ASSH_EVENT_USERAUTH_SERVER_NONE | See struct assh_event_userauth_server_none_s. |
ASSH_EVENT_USERAUTH_SERVER_USERKEY | See struct assh_event_userauth_server_userkey_s. |
ASSH_EVENT_USERAUTH_SERVER_PASSWORD | See struct assh_event_userauth_server_password_s. |
ASSH_EVENT_USERAUTH_SERVER_KBINFO | See struct assh_event_userauth_server_kbinfo_s. |
ASSH_EVENT_USERAUTH_SERVER_KBRESPONSE | See struct assh_event_userauth_server_kbresponse_s. |
ASSH_EVENT_USERAUTH_SERVER_HOSTBASED | See struct assh_event_userauth_server_hostbased_s. |
ASSH_EVENT_USERAUTH_SERVER_SUCCESS | See struct assh_event_userauth_server_success_s. |
ASSH_EVENT_REQUEST | See struct assh_event_request_s. |
ASSH_EVENT_REQUEST_ABORT | See struct assh_event_request_abort_s. |
ASSH_EVENT_REQUEST_SUCCESS | See struct assh_event_request_success_s. |
ASSH_EVENT_REQUEST_FAILURE | See struct assh_event_request_failure_s. |
ASSH_EVENT_CHANNEL_OPEN | See struct assh_event_channel_open_s. |
ASSH_EVENT_CHANNEL_CONFIRMATION | See struct assh_event_channel_confirmation_s. |
ASSH_EVENT_CHANNEL_FAILURE | See struct assh_event_channel_failure_s. |
ASSH_EVENT_CHANNEL_DATA | See struct assh_event_channel_data_s. |
ASSH_EVENT_CHANNEL_WINDOW | See struct assh_event_channel_window_s. |
ASSH_EVENT_CHANNEL_EOF | See struct assh_event_channel_eof_s. |
ASSH_EVENT_CHANNEL_CLOSE | See struct assh_event_channel_close_s. |
ASSH_EVENT_CHANNEL_ABORT | See struct assh_event_channel_abort_s. |
struct assh_event_s [link]
This struct is declared in assh/assh_event.h source file, line 145.
This struct holds an event reported by the assh_event_get function.
Field | Description |
---|---|
enum assh_event_id_e id; | Id of the event. |
union <anonymous> { | |
union assh_event_session_u session; | |
union assh_event_transport_u transport; | |
union assh_event_kex_u kex; | |
union assh_event_service_u service; | |
union assh_event_userauth_client_u userauth_client; | |
union assh_event_userauth_server_u userauth_server; | |
union assh_event_connection_u connection; | |
}; |