Go to the documentation of this file.
48 #define HE_WOLF_TIMEOUT_MULTIPLIER 100
49 #define HE_WOLF_RENEGOTIATION_TIMEOUT_MULTIPLIER 100
56 #define HE_WOLF_QUICK_TIMEOUT_DIVIDER 4
455 uint8_t minor_version);
465 uint8_t *minor_version);
521 void he_conn_set_ssl_error(
he_conn_t *conn,
int error);
he_return_code_t he_conn_send_server_config(he_conn_t *conn, uint8_t *buffer, size_t length)
Tell Helium to send a server config message to client.
Definition: conn.c:550
he_return_code_t he_conn_pmtud_probe_timeout(he_conn_t *conn)
Called when a PMTUD probe timer expired.
Definition: conn.c:1232
const char * he_conn_get_curve_name(he_conn_t *conn)
Returns the name of the curve used by the ssl context.
Definition: conn.c:1199
Core internal header file for libhelium.
const char * he_conn_get_current_cipher(he_conn_t *conn)
Returns the name of the cipher used by the ssl context.
Definition: conn.c:1169
uint64_t he_conn_get_session_id(he_conn_t *conn)
Returns the session ID for this connection.
Definition: conn.c:1138
int he_conn_get_ssl_error(he_conn_t *conn)
Returns detailed SSL error that corresponds to WolfSSL's detailed errors.
Definition: conn.c:1254
he_return_code_t he_conn_set_outside_mtu(he_conn_t *conn, uint16_t mtu)
Set the MTU for the outside transport mechanism. Usually this will be the MTU of the device's interne...
Definition: conn.c:1049
uint16_t he_conn_get_outside_mtu(he_conn_t *conn)
Get the MTU value for the outside transport mechanism.
Definition: conn.c:1065
enum he_conn_state he_conn_state_t
Status codes for a Helium connection.
enum he_return_code he_return_code_t
All possible return codes for helium.
he_conn_t * he_conn_create(void)
Creates a Helium connection struct.
Definition: conn.c:143
he_return_code_t he_conn_send_keepalive(he_conn_t *conn)
Tell Helium to send a keepalive message. This can be used to avoid NAT timing out.
Definition: conn.c:503
bool he_conn_is_error_fatal(he_conn_t *conn, he_return_code_t error_msg)
Returns true if a given error (a return from libhelium where he_return_code_t != HE_SUCCESS) is obvio...
Definition: conn.c:35
he_return_code_t he_conn_server_connect(he_conn_t *conn, he_ssl_ctx_t *ssl_ctx, he_plugin_chain_t *inside_plugins, he_plugin_chain_t *outside_plugins)
Tries to establish a connection with a Helium client.
Definition: conn.c:343
bool he_conn_supports_renegotiation(he_conn_t *conn)
Whether this particular connection supports renegotiation.
Definition: conn.c:909
bool he_conn_is_username_set(const he_conn_t *conn)
Check if the password has been set.
Definition: conn.c:964
he_return_code_t he_conn_rotate_session_id(he_conn_t *conn, uint64_t *new_session_id)
Rotate the session ID for this connection.
Definition: conn.c:883
void * he_conn_get_context(he_conn_t *conn)
Retrieve the pointer to the user supplied context.
Definition: conn.c:1129
int he_conn_set_username(he_conn_t *conn, const char *username)
Set the username to authenticate with.
Definition: conn.c:945
he_return_code_t he_conn_is_valid_server(he_ssl_ctx_t *ssl_ctx, he_conn_t *conn)
Checks whether the client conn has the basic values to allow Helium to connect.
Definition: conn.c:115
int he_conn_get_nudge_time(he_conn_t *conn)
Returns the number of milliseconds that host application should wait before nudging Helium.
Definition: conn.c:795
he_return_code_t he_conn_set_sni_hostname(he_conn_t *conn, const char *hostname)
Set SNI hostname.
Definition: conn.c:133
he_conn_state_t he_conn_get_state(he_conn_t *conn)
Returns the state that the conn is currently in.
Definition: conn.c:847
he_return_code_t he_conn_set_auth_token(he_conn_t *conn, const uint8_t *token, size_t len)
Sets the authentication token the Lightway client should use to authenticate with.
Definition: conn.c:992
he_return_code_t he_conn_client_connect(he_conn_t *conn, he_ssl_ctx_t *ssl_ctx, he_plugin_chain_t *inside_plugins, he_plugin_chain_t *outside_plugins)
Tries to establish a connection with a Helium server.
Definition: conn.c:324
he_return_code_t he_conn_set_password(he_conn_t *conn, const char *password)
Sets the password Helium should use to authenticate with.
Definition: conn.c:973
he_return_code_t he_conn_start_pmtu_discovery(he_conn_t *conn)
Tell Helium to start a PMTU discovery.
Definition: conn.c:1206
he_return_code_t he_conn_set_auth_buffer2(he_conn_t *conn, const uint8_t *buffer, uint16_t length)
Sets the opaque buffer Helium should use to authenticate with.
Definition: conn.c:1020
bool he_conn_is_auth_buffer_set(const he_conn_t *conn)
Check if the auth buffer has been set.
Definition: conn.c:1040
Definition: he_internal.h:92
Definition: he_internal.h:297
bool he_conn_is_auth_token_set(const he_conn_t *conn)
Check if the auth token has been set.
Definition: conn.c:1011
bool he_conn_is_outside_mtu_set(he_conn_t *conn)
Check if the outside MTU has been set.
Definition: conn.c:1074
bool he_conn_is_password_set(const he_conn_t *conn)
Check if the password has been set.
Definition: conn.c:983
he_return_code_t he_conn_set_context(he_conn_t *conn, void *data)
Store a pointer in the context that will be made available in all Helium callbacks.
Definition: conn.c:1118
he_return_code_t he_conn_get_protocol_version(he_conn_t *conn, uint8_t *major_version, uint8_t *minor_version)
On the server, get the current major/minor version number for this connection.
Definition: conn.c:932
void he_conn_destroy(he_conn_t *conn)
Releases all memory allocate by Helium for this connection.
Definition: conn.c:147
he_return_code_t he_conn_set_protocol_version(he_conn_t *conn, uint8_t major_version, uint8_t minor_version)
On the server, sets the major/minor version number for this connection.
Definition: conn.c:921
uint64_t he_conn_get_pending_session_id(he_conn_t *conn)
Returns the pending session ID for this connection, if there is one.
Definition: conn.c:1147
he_return_code_t he_conn_set_session_id(he_conn_t *conn, uint64_t session_id)
Sets the session ID for this connection.
Definition: conn.c:1156
he_return_code_t he_conn_schedule_renegotiation(he_conn_t *conn)
Tell Helium to schedule a renegotiation.
Definition: conn.c:696
he_return_code_t he_conn_is_valid_client(he_ssl_ctx_t *ssl_ctx, he_conn_t *conn)
Checks whether the client conn has the basic values to allow Helium to connect.
Definition: conn.c:85
Definition: he_internal.h:170
he_connection_protocol_t he_conn_get_current_protocol(he_conn_t *conn)
Returns the current connection protocol.
Definition: conn.c:1180
enum he_connection_protocol he_connection_protocol_t
Lightway can use different underlying protocols. This enum defines those protocols.
he_return_code_t he_conn_disconnect(he_conn_t *conn)
Try to cleanly disconnect from the remote Helium instance (client or server).
Definition: conn.c:378
uint16_t he_conn_get_effective_pmtu(he_conn_t *conn)
Get current effective PMTU of the connection.
Definition: conn.c:1225
const char * he_conn_get_username(const he_conn_t *conn)
Get the username that Helium will authenticate with, previously set by he_conn_set_username.
Definition: conn.c:955
he_return_code_t he_conn_nudge(he_conn_t *conn)
Nudges Helium.
Definition: conn.c:807