Helium
Functions
flow.h File Reference

Functions for the flow of packets through Helium. More...

#include <he.h>
Include dependency graph for flow.h:

Go to the source code of this file.

Functions

he_return_code_t he_conn_inside_packet_received (he_conn_t *conn, uint8_t *packet, size_t length)
 Called when the host application needs to deliver an inside packet to Helium. More...
 
he_return_code_t he_conn_outside_data_received (he_conn_t *conn, uint8_t *buffer, size_t length)
 Called when the host application needs to deliver outside data to be processed by Helium. More...
 
he_return_code_t he_internal_flow_process_message (he_conn_t *conn)
 
he_return_code_t he_internal_flow_fetch_message (he_conn_t *conn)
 
he_return_code_t he_internal_update_session_incoming (he_conn_t *conn, he_wire_hdr_t *hdr)
 
he_return_code_t he_internal_flow_outside_packet_received (he_conn_t *conn, uint8_t *packet, size_t length)
 
he_return_code_t he_internal_flow_outside_stream_received (he_conn_t *conn, uint8_t *buffer, size_t length)
 
he_return_code_t he_internal_flow_outside_data_verify_connection (he_conn_t *conn)
 
he_return_code_t he_internal_flow_outside_data_handle_messages (he_conn_t *conn)
 

Detailed Description

Functions for the flow of packets through Helium.

Function Documentation

he_return_code_t he_conn_inside_packet_received ( he_conn_t conn,
uint8_t *  packet,
size_t  length 
)

Called when the host application needs to deliver an inside packet to Helium.

Parameters
connA valid connection
packetA pointer to the packet data
lengthThe length of the packet
Returns
HE_ERR_INVALID_CLIENT_STATE Helium will reject packets if it is not in the HE_STATE_ONLINE state
HE_ERR_PACKET_TOO_SMALL The packet is too small to be a valid Helium packet
HE_ERR_UNSUPPORTED_PACKET_TYPE The packet is not an IPv4 packet
HE_SUCCESS Packet was processed normally
Note
It is expected that Helium will support IPv6 almost immediately, so it is worth keeping this in mind.
These error codes may change before final release as new issues come to light.
he_return_code_t he_conn_outside_data_received ( he_conn_t conn,
uint8_t *  buffer,
size_t  length 
)

Called when the host application needs to deliver outside data to be processed by Helium.

Parameters
connA valid Helium connection
bufferA pointer to the packet data
lengthThe length of the packet
Returns
HE_ERR_NULL_POINTER The pointer provided is a NULL pointer
HE_ERR_PACKET_TOO_SMALL The packet is too small to be a valid Helium packet
HE_ERR_NOT_HE_PACKET The packet is not a Helium packet (it does not have the Helium header)
HE_ERR_SSL_ERROR Something went wrong decrypting the packet - this is a FATAL error for the connection
HE_ERR_SERVER_DN_MISMATCH The name in the server's cert did not match local configuration
HE_ERR_CANNOT_VERIFY_SERVER_CERT The server certificate couldn't be verified using the configured CA Cert
HE_SUCCESS The packet was processed normally.
Note
These error codes may change before final release as new issues come to light.
If the conn has registered plugins, they may arbitrarily change the packet data, but are restricted here to not exceeding the provided length. Users who wish to have more control over this should not register plugins upon connection, but instead call the plugin API explicitly prior to invoking this function.

Streaming Stuff

he_return_code_t he_internal_update_session_incoming ( he_conn_t conn,
he_wire_hdr_t hdr 
)

Exit early if the session ID is not set