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.
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.

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]

Create one ROHC compressor.

Parameters:
max_cidThe maximal CID value the compressor should use for contexts
jam_useThe parameter which indicates if the use of the jamming is activated 0 if not activated else 1
adapt_sizeThe size of the header or trailer of the adaptation layer
encap_sizeThe packet size of the encapsulation layer
Returns:
The newly-created compressor if successful, NULL otherwise

References adapt_size, c_create_contexts(), C_NUM_PROFILES, medium::cid_type, rohc_feedback::data, enabled, encap_size, FEEDBACK_BUFFER_SIZE, feedbacks, feedbacks_first, feedbacks_first_unlocked, feedbacks_next, rohc_feedback::is_locked, jam_use, last_context, rohc_feedback::length, medium::max_cid, medium, mrru, num_packets, profiles, rohc_debugf, total_compressed_size, total_uncompressed_size, and zfree.

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, and version.

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, and medium.

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, and medium.

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(), total_compressed_size, total_uncompressed_size, c_profile::version, 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, and medium.

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.

void rohc_free_compressor ( struct rohc_comp comp)

Destroy one ROHC compressor.

Parameters:
compThe compressor to destroy

References c_destroy_contexts(), rohc_debugf, and zfree.