assh/helper_client.h header reference

Description  

This header file provides helper functions designed to ease development of simple ssh2 client applications.

Implementation of client applications may want to reuse and adapt code from this module, as allowed by the license exception covering the source code of this module.

Members  

Types  

Functions  

Constant  

Members detail  

assh_status_t asshh_client_add_known_hosts(assh_context_s *c, const char *filename, const char *host, const assh_key_s *key)  

This function is declared in assh/helper_client.h source file, line 71.

Preprocessor condition: defined( CONFIG_ASSH_CLIENT )

This function adds a public key at the end of the ssh_knwon_host file.

void asshh_client_event_auth(assh_session_s *s, FILE *out, FILE *in, const char *user, const char *host, assh_userauth_methods_e *methods, const asshh_client_user_key_s *key_files, assh_event_s *event)  

This function is declared in assh/helper_client.h source file, line 158.

Preprocessor condition: defined( CONFIG_ASSH_CLIENT )

This function implements a default user authentication events handler which interacts with the user on the UNIX terminal and fetches keys in openssh standard locations.

This function is designed to handle the following events:

The authentication methods initially specified in methods will be tried, provided that they are enabled by the server.

The key_files parameter specifies the list of user key files which will be loaded. The user keys are loaded from the user .ssh directory. The asshh_client_user_key_default array can be passed as key_files.

This function takes care of calling the assh_event_done function in any case.

void asshh_client_event_hk_add(assh_session_s *s, const char *host, assh_event_s *event)  

This function is declared in assh/helper_client.h source file, line 110.

Preprocessor condition: defined( CONFIG_ASSH_CLIENT )

This handles the ASSH_EVENT_KEX_DONE event by adding the host key to the openssh known hosts file if needed. This works along with the asshh_client_event_hk_lookup function.

This function takes care of calling the assh_event_done function in any case.

void asshh_client_event_hk_lookup(assh_session_s *s, FILE *out, FILE *in, const char *host, assh_event_s *event)  

This function is declared in assh/helper_client.h source file, line 98.

Preprocessor condition: defined( CONFIG_ASSH_CLIENT )

This function calls the asshh_client_event_hk_lookup_va function with system and user known hosts files.

This function takes care of calling the assh_event_done function in any case.

void asshh_client_event_hk_lookup_va(assh_session_s *s, FILE *out, FILE *in, const char *host, assh_event_s *event, ...)  

This function is declared in assh/helper_client.h source file, line 87.

Preprocessor condition: defined( CONFIG_ASSH_CLIENT )

This function handles the ASSH_EVENT_KEX_HOSTKEY_LOOKUP event by reading some known host files in openssh format. A NULL terminated list of file names is expected.

The user is queried the usual way about key verification and fingerprints. If the standard input is not a tty and user interaction is required, the host key is not accepted.

This function takes care of calling the assh_event_done function in any case.

void asshh_client_event_inter_session(assh_session_s *s, assh_event_s *event, asshh_client_inter_session_s *state)  

This function is declared in assh/helper_client.h source file, line 224.

Preprocessor condition: defined( CONFIG_ASSH_CLIENT )

This function implements an events handler which starts an interactive session and requests execution of a command on the remote server.

This function is designed to handle the following events:

This function takes care of calling the assh_event_done function.

assh_status_t asshh_client_get_known_hosts(assh_context_s *c, assh_key_s **keys, const char *filename, const char *host)  

This function is declared in assh/helper_client.h source file, line 64.

Preprocessor condition: defined( CONFIG_ASSH_CLIENT )

This function loads all public keys associated to a given host name and recognized by one of the registered algorithms. The input file must be in openssh ssh_knwon_host file format.

The keys are loaded by the asshh_key_load_file function and must be released by calling assh_key_flush.

A comment string containing the location (file name and line number) is attached to each loaded key.

void asshh_client_init_inter_session(asshh_client_inter_session_s *state, const char *command, const char *term)  

This function is declared in assh/helper_client.h source file, line 205.

Preprocessor condition: defined( CONFIG_ASSH_CLIENT )

This function initializes an interactive session object for execution of the specified command. This must be used along with the asshh_client_event_inter_session event handler function.

This is a simple helper designed to start a command on a remote server. The associated event handler takes care of sending the appropriate requests to the remote host when the ssh-connection service is started.

When the command parameter is NULL, execution of a shell is requested. When the term parameter is NULL, no pty allocation is requested.

struct asshh_client_inter_session_s  

This struct is declared in assh/helper_client.h source file, line 181.

Preprocessor condition: defined( CONFIG_ASSH_CLIENT )

This struct stores the state of the simple interactive session helper between calls to the asshh_client_event_inter_session function.

This struct must be initialized by calling the asshh_client_init_inter_session function.

FieldDescription
asshh_client_inter_session_state_e state;
const char * command;
const char * term;
uint_fast16_t char_width;
uint_fast16_t char_height;
assh_channel_s * channel;
assh_request_s * request;

enum asshh_client_inter_session_state_e  

This enum is declared in assh/helper_client.h source file, line 163.

Preprocessor condition: defined( CONFIG_ASSH_CLIENT )

This enum specifies the current state of an interactive session.

See also asshh_client_inter_session_s.

IdentifierDescription
ASSH_CLIENT_INTER_ST_INIT
ASSH_CLIENT_INTER_ST_SESSION
ASSH_CLIENT_INTER_ST_PTY
ASSH_CLIENT_INTER_ST_EXEC
ASSH_CLIENT_INTER_ST_OPEN
ASSH_CLIENT_INTER_ST_CLOSING
ASSH_CLIENT_INTER_ST_CLOSED

const asshh_client_user_key_s asshh_client_user_key_default[]  

This constant is declared in assh/helper_client.h source file, line 127.

Preprocessor condition: defined( CONFIG_ASSH_CLIENT )

This constant contains a default list of user key file for use with the asshh_client_event_auth function.

struct asshh_client_user_key_s  

This struct is declared in assh/helper_client.h source file, line 116.

Preprocessor condition: defined( CONFIG_ASSH_CLIENT )

This struct is used to specify the list of user key files for the asshh_client_event_auth function.

See also asshh_client_user_key_default.

FieldDescription
const char * filename;key filename to lookup in the .ssh user directory
const char * key_algo;
assh_algo_class_e role;
assh_key_format_e format;
Valid XHTML 1.0 StrictGenerated by diaxen on Sun Sep 27 13:33:12 2020 using MkDoc