ROHC compression/decompression library
Functions
ROHC compression API

Functions

struct rohc_comprohc_alloc_compressor (int max_cid, int jam_use, int adapt_size, int encap_size)
 Create one ROHC compressor.
void rohc_free_compressor (struct rohc_comp *comp)
 Destroy one ROHC compressor.
bool rohc_comp_set_random_cb (struct rohc_comp *const comp, rohc_comp_random_cb_t callback, void *const user_context)
 Set the user-defined callback for random numbers.
int rohc_compress (struct rohc_comp *comp, unsigned char *ibuf, int isize, unsigned char *obuf, int osize)
 Compress a ROHC packet.
void rohc_activate_profile (struct rohc_comp *comp, int profile)
 Activate a profile for a compressor.
int rohc_c_using_small_cid (struct rohc_comp *comp)
 Whether the compressor uses small CID or not.
void rohc_c_set_header (struct rohc_comp *comp, int header)
 Set the maximal header size. The maximal header size is ignored for the moment.
void rohc_c_set_mrru (struct rohc_comp *comp, int value)
 Set the Maximum Reconstructed Reception Unit (MRRU). The MRRU is ignored for the moment.
void rohc_c_set_max_cid (struct rohc_comp *comp, int value)
 Set the maximal CID value the compressor should use.
void rohc_c_set_large_cid (struct rohc_comp *comp, int large_cid)
 Tell the compressor to use large CIDs.
void rohc_c_set_enable (struct rohc_comp *comp, int enable)
 Enable the ROHC compressor.
int rohc_c_is_enabled (struct rohc_comp *comp)
 Whether the ROHC compressor is enabled or not.
int rohc_c_info (char *buffer)
 Get information about available compression profiles.
int rohc_c_statistics (struct rohc_comp *comp, unsigned int indent, char *buffer)
 Get information about a ROHC compressor.
int rohc_feedback_flush (struct rohc_comp *comp, unsigned char *obuf, int osize)
 Send as much feedback data as possible.
int rohc_comp_get_last_packet_info (const struct rohc_comp *const comp, rohc_comp_last_packet_info_t *const info)
 Get some information about the last compressed packet.
const char * rohc_comp_get_state_descr (const rohc_c_state state)
 Give a description for the given ROHC compression context state.

Function Documentation

void rohc_activate_profile ( struct rohc_comp comp,
int  profile 
)

Activate a profile for a compressor.

Parameters:
compThe ROHC compressor
profileThe ID of the profile to activate

References C_NUM_PROFILES, profiles, and rohc_debugf.

struct rohc_comp* rohc_alloc_compressor ( int  max_cid,
int  jam_use,
int  adapt_size,
int  encap_size 
) [read]
int rohc_c_info ( char *  buffer)

Get information about available compression profiles.

This function outputs XML.

Parameters:
bufferThe buffer where to store profile information
Returns:
The length of the data stored in the buffer

References C_NUM_PROFILES.

int rohc_c_is_enabled ( struct rohc_comp comp)

Whether the ROHC compressor is enabled or not.

Parameters:
compThe ROHC compressor
Returns:
Whether the compressor is enabled or not

References enabled.

void rohc_c_set_enable ( struct rohc_comp comp,
int  enable 
)

Enable the ROHC compressor.

Parameters:
compThe ROHC compressor
enableWhether to enable the compressor or not

References enabled.

void rohc_c_set_header ( struct rohc_comp comp,
int  header 
)

Set the maximal header size. The maximal header size is ignored for the moment.

Parameters:
compThe ROHC compressor
headerThe maximal header size

References max_header_size.

void rohc_c_set_large_cid ( struct rohc_comp comp,
int  large_cid 
)

Tell the compressor to use large CIDs.

Parameters:
compThe ROHC compressor
large_cidWhether to use large CIDs or not

References medium::cid_type, medium::max_cid, medium, ROHC_LARGE_CID, ROHC_SMALL_CID, and ROHC_SMALL_CID_MAX.

void rohc_c_set_max_cid ( struct rohc_comp comp,
int  value 
)

Set the maximal CID value the compressor should use.

Parameters:
compThe ROHC compressor
valueThe new maximal CID value

References medium::cid_type, medium::max_cid, medium, ROHC_LARGE_CID, ROHC_LARGE_CID_MAX, and ROHC_SMALL_CID_MAX.

void rohc_c_set_mrru ( struct rohc_comp comp,
int  value 
)

Set the Maximum Reconstructed Reception Unit (MRRU). The MRRU is ignored for the moment.

Parameters:
compThe ROHC compressor
valueThe new MRRU value

References mrru.

int rohc_c_statistics ( struct rohc_comp comp,
unsigned int  indent,
char *  buffer 
)

Get information about a ROHC compressor.

This function outputs XML.

Parameters:
compThe ROHC compressor
indentThe indent level to beautify the XML output
bufferThe buffer where to store the information
Returns:
The length of the data stored in the buffer if successful, -1 if an error occurs

References C_NUM_PROFILES, medium::cid_type, c_profile::description, enabled, c_profile::id, medium::max_cid, medium, mrru, num_contexts_used, num_packets, profiles, rohc_c_context(), ROHC_LARGE_CID, total_compressed_size, total_uncompressed_size, and zfree.

int rohc_c_using_small_cid ( struct rohc_comp comp)

Whether the compressor uses small CID or not.

Parameters:
compThe ROHC compressor
Returns:
Whether the compressor uses small CID or not

References medium::cid_type, medium, and ROHC_SMALL_CID.

int rohc_comp_get_last_packet_info ( const struct rohc_comp *const  comp,
rohc_comp_last_packet_info_t *const  info 
)
const char* rohc_comp_get_state_descr ( const rohc_c_state  state)

Give a description for the given ROHC compression context state.

The descriptions are not part of the API. They may change between releases without any warning. Do NOT use them for other means that providing to users a textual description of compression context states used by the library. If unsure, ask on the mailing list.

Parameters:
stateThe compression context state to get a description for
Returns:
A string that describes the given compression context state

References FO, IR, and SO.

Referenced by rohc_c_context().

bool rohc_comp_set_random_cb ( struct rohc_comp *const  comp,
rohc_comp_random_cb_t  callback,
void *const  user_context 
)

Set the user-defined callback for random numbers.

If no callback is defined, an internal one that always returns 0 will be defined for compatibility reasons.

Parameters:
compThe ROHC compressor to set the random callback for
callbackThe random callback to set
user_contextPrivate data that will be given to the callback, may be used as a context by user

References random_cb, and random_cb_ctxt.

int rohc_compress ( struct rohc_comp comp,
unsigned char *  ibuf,
int  isize,
unsigned char *  obuf,
int  osize 
)
int rohc_feedback_flush ( struct rohc_comp comp,
unsigned char *  obuf,
int  osize 
)

Send as much feedback data as possible.

Parameters:
compThe ROHC compressor
obufThe buffer where to store the feedback-only packet
osizeThe size of the buffer for the feedback-only packet
Returns:
The size of the feedback-only packet, 0 if there is no feedback data to send

References rohc_debugf, and c_feedback::size.

void rohc_free_compressor ( struct rohc_comp comp)

Destroy one ROHC compressor.

Parameters:
compThe compressor to destroy

References rohc_debugf, and zfree.