Helium
Functions
utils.h File Reference

Utility functions for ease of use. More...

#include "he.h"
Include dependency graph for utils.h:

Go to the source code of this file.

Functions

const char * he_return_code_name (he_return_code_t rc)
 
const char * he_client_state_name (he_conn_state_t st)
 
const char * he_client_event_name (he_conn_event_t ev)
 
const char * he_connection_protocol_name (he_connection_protocol_t protocol)
 
const char * he_pmtud_state_name (he_pmtud_state_t state)
 
char * he_safe_strncpy (char *dst, const char *src, size_t dst_size)
 Safe version of strncpy strncpy has a pitfall that dst will not be null terminated if there is no null byte in the first dst_size bytes of the array pointed to by src This function is a wrapper over strncpy which adds null byte as the last byte. More...
 

Detailed Description

Utility functions for ease of use.

Function Documentation

◆ he_client_event_name()

const char* he_client_event_name ( he_conn_event_t  ev)

Returns stringified version of an he_conn_event_t.

Returns
The stringified name of the event ev or "HE_EVENT_UNKNOWN".

◆ he_client_state_name()

const char* he_client_state_name ( he_conn_state_t  st)

Returns stringified version of an he_conn_state_t.

Returns
The stringified name of the state st or "HE_STATE_UNKNOWN".

◆ he_connection_protocol_name()

const char* he_connection_protocol_name ( he_connection_protocol_t  protocol)

Returns stringified version of an he_connection_protocol_t.

Returns
The stringified name of the protocol protocol or "HE_CONNECTION_PROTOCOL_UNKNOWN".

◆ he_pmtud_state_name()

const char* he_pmtud_state_name ( he_pmtud_state_t  state)

Returns stringified version of an he_pmtud_state_t.

◆ he_return_code_name()

const char* he_return_code_name ( he_return_code_t  rc)

Returns stringified version of an he_return_code_t.

Returns
The stringified name of the return code rc or "HE_ERR_UNKNOWN".

◆ he_safe_strncpy()

char* he_safe_strncpy ( char *  dst,
const char *  src,
size_t  dst_size 
)

Safe version of strncpy strncpy has a pitfall that dst will not be null terminated if there is no null byte in the first dst_size bytes of the array pointed to by src This function is a wrapper over strncpy which adds null byte as the last byte.

Parameters
dstPointer to the destination char array
srcPointer to the source char array
dst_sizesize of the destination char array