assh/assh_session.h header reference
Description [link]
This header file provides declaration of the struct assh_session_s structure and related functions, used to create and manage ssh2 sessions.
Members [link]
Types [link]
- struct assh_event_session_error_s
- union assh_event_session_u
- typedef assh_bool_t (assh_kex_filter_t)(struct assh_session_s *s, const struct assh_algo_s *algo, const struct assh_algo_name_s *name, assh_bool_t out)
- struct assh_session_s
Functions [link]
- assh_status_t assh_session_algo_filter(struct assh_session_s *s, assh_kex_filter_t *filter)
- void assh_session_cleanup(struct assh_session_s *s)
- assh_bool_t assh_session_closed(const struct assh_session_s *s)
- struct assh_context_s * assh_session_context(struct assh_session_s *s)
- assh_status_t assh_session_create(struct assh_context_s *c, struct assh_session_s **s)
- assh_time_t assh_session_deadline(const struct assh_session_s *s)
- assh_time_t assh_session_delay(const struct assh_session_s *s, assh_time_t time)
- assh_status_t assh_session_disconnect(struct assh_session_s *s, enum assh_ssh_disconnect_e reason, const char *desc)
- void * assh_session_get_pv(const struct assh_session_s *ctx)
- assh_status_t assh_session_init(struct assh_context_s *c, struct assh_session_s *s)
- void assh_session_release(struct assh_session_s *s)
- assh_safety_t assh_session_safety(const struct assh_session_s *s)
- void assh_session_set_pv(struct assh_session_s *ctx, void *private)
- void assh_session_userauth_done(struct assh_session_s *s)
Macro [link]
Members detail [link]
#define ASSH_KEX_FILTER_FCN(n) [link]
This macro is declared in assh/assh_session.h source file, line 42.
See also assh_kex_filter_t.
struct assh_event_session_error_s [link]
This struct is declared in assh/assh_session.h source file, line 234.
The ASSH_EVENT_SESSION_ERROR event is reported when an error occurs. Because not all errors are fatal, the event may be reported multiple times during a single session.
See also ASSH_STATUS and ASSH_SEVERITY.
Field | Description |
---|---|
const assh_status_t code; | The error code reported by the library. (ro) |
union assh_event_session_u [link]
This union is declared in assh/assh_session.h source file, line 241.
This union contains all session related event structures.
Field | Description |
---|---|
struct assh_event_session_error_s error; |
typedef assh_bool_t (assh_kex_filter_t)(struct assh_session_s *s, const struct assh_algo_s *algo, const struct assh_algo_name_s *name, assh_bool_t out) [link]
This typedef is declared in assh/assh_session.h source file, line 64.
This declaration involves expansion of the ASSH_KEX_FILTER_FCN macro.
This is a per session algorithm filtering function.
1 must be returned in order to make the algorithm available for the session key-exchange. This can not be used to prevent registered signature algorithms from being used during the user authentication process.
The result of this function must not vary between calls for a given algorithm, unless the assh_session_algo_filter function has been called successfully.
The out parameter specifies the direction and is relevant for cipher, mac and compression algorithms.
See also Algorithms and methods.
assh_status_t assh_session_algo_filter(struct assh_session_s *s, assh_kex_filter_t *filter) [link]
This function is declared in assh/assh_session.h source file, line 319.
This function setups a per session algorithm filter for the key-exchange. The filter parameter may be NULL to disable filtering. It will fail if a key exchange is currently running.
See also Algorithms and methods.
void assh_session_cleanup(struct assh_session_s *s) [link]
This function is declared in assh/assh_session.h source file, line 275.
This function releases the resources associated with an user allocated struct assh_session_s instance.
assh_bool_t assh_session_closed(const struct assh_session_s *s) [link]
This function is declared in assh/assh_session.h source file, line 344.
This function returns true when the assh_event_get function will not report more events.
struct assh_context_s * assh_session_context(struct assh_session_s *s) [link]
This function is declared in assh/assh_session.h source file, line 354.
This function returns the context associated to the given session.
assh_status_t assh_session_create(struct assh_context_s *c, struct assh_session_s **s) [link]
This function is declared in assh/assh_session.h source file, line 270.
This function allocates and initializes an struct assh_session_s instance.
See also assh_session_release.
assh_time_t assh_session_deadline(const struct assh_session_s *s) [link]
This function is declared in assh/assh_session.h source file, line 329.
This function returns the next protocol deadline. In order for the library to handle protocol timeouts properly, the process must not wait forever on a blocking io operation. The assh_event_get function must be called again when the deadline is reached.
See also assh_session_delay.
assh_time_t assh_session_delay(const struct assh_session_s *s, assh_time_t time) [link]
This function is declared in assh/assh_session.h source file, line 339.
This function returns the delay between the next protocol deadline and the current time. The current time must be passed to the function in second units. If the next deadline is in the past, the function returns 0.
See also assh_session_deadline.
assh_status_t assh_session_disconnect(struct assh_session_s *s, enum assh_ssh_disconnect_e reason, const char *desc) [link]
This function is declared in assh/assh_session.h source file, line 305.
This function schedules the end of the session and sends an SSH_MSG_DISCONNECT message to the remote host. The assh_event_get function must still be called until no more events are available.
void * assh_session_get_pv(const struct assh_session_s *ctx) [link]
This function is declared in assh/assh_session.h source file, line 252.
This function retrieves the user private pointer of the session.
See also assh_session_set_pv.
assh_status_t assh_session_init(struct assh_context_s *c, struct assh_session_s *s) [link]
This function is declared in assh/assh_session.h source file, line 262.
This function initializes an user allocated session instance. When a stable ABI is needed, the assh_session_create function muse be used instead.
See also assh_session_cleanup.
void assh_session_release(struct assh_session_s *s) [link]
This function is declared in assh/assh_session.h source file, line 280.
This function releases an struct assh_session_s instance created by the assh_session_create function as well as associated resources.
struct assh_session_s [link]
This struct is declared in assh/assh_session.h source file, line 79.
This struct is the ssh2 session state structure.
A session instance is associated to an struct assh_context_s object which holds resources shared between multiple sessions.
It is not related to interactive sessions which are part of the connection protocol.
assh_safety_t assh_session_safety(const struct assh_session_s *s) [link]
This function is declared in assh/assh_session.h source file, line 311.
This function returns the current session safety factor which depends on algorithms and keys involved in the last key-exchange process. The safety factor may change during the session lifetime.
See also assh_algo_register_va.
void assh_session_set_pv(struct assh_session_s *ctx, void *private) [link]
This function is declared in assh/assh_session.h source file, line 248.
This function sets the user private pointer of the session.
See also assh_session_get_pv.
void assh_session_userauth_done(struct assh_session_s *s) [link]
This function is declared in assh/assh_session.h source file, line 350.
This function marks the user as authenticated. This is usually called by the user authentication services. On rare cases when one of these services is not used, it may be called directly by the application.