ROHC compression/decompression library
Functions
ROHC decompression API

Functions

struct rohc_decomprohc_alloc_decompressor (struct rohc_comp *compressor)
 Create one ROHC decompressor.
void rohc_free_decompressor (struct rohc_decomp *decomp)
 Destroy one ROHC decompressor.
int rohc_decompress (struct rohc_decomp *decomp, unsigned char *ibuf, int isize, unsigned char *obuf, int osize)
 Decompress a ROHC packet.
int rohc_decompress_both (struct rohc_decomp *decomp, unsigned char *ibuf, int isize, unsigned char *obuf, int osize, int large)
 Decompress both large and small CID packets.
void clear_statistics (struct rohc_decomp *decomp)
 Clear all the statistics.
int rohc_d_statistics (struct rohc_decomp *decomp, unsigned int indent, char *buffer)
 Output the decompression statistics of one decompressor to a buffer. The buffer must be large enough to store all the statistics.
const char * rohc_decomp_get_state_descr (const rohc_d_state state)
 Give a description for the given ROHC decompression context state.
void d_change_mode_feedback (struct rohc_decomp *decomp, struct d_context *context)
 Create a feedback ACK packet telling the compressor to change state.
void user_interactions (struct rohc_decomp *decomp, int feedback_maxval)
 Update feedback interval by the user.
bool rohc_decomp_set_cid_type (struct rohc_decomp *const decomp, const rohc_cid_type_t cid_type)
 Set the type of CID to use for the given decompressor.
bool rohc_decomp_set_max_cid (struct rohc_decomp *const decomp, const size_t max_cid)
 Set the MAX_CID allowed for the given decompressor.

Function Documentation

void clear_statistics ( struct rohc_decomp decomp)

Clear all the statistics.

Parameters:
decompThe ROHC decompressor

References d_statistics::failed_crc, d_statistics::failed_decomp, d_statistics::failed_no_context, d_statistics::feedbacks, d_statistics::received, and stats.

Referenced by rohc_alloc_decompressor().

void d_change_mode_feedback ( struct rohc_decomp decomp,
struct d_context context 
)

Create a feedback ACK packet telling the compressor to change state.

Parameters:
decompThe ROHC decompressor
contextThe decompression context

References ACKTYPE_ACK, c_piggyback_feedback(), medium::cid_type, compressor, contexts, crc_table_8, f_feedback2(), f_wrap_feedback(), d_profile::get_sn, medium::max_cid, medium, d_context::mode, d_context::profile, rohc_debugf, WITH_CRC, and zfree.

struct rohc_decomp* rohc_alloc_decompressor ( struct rohc_comp compressor) [read]

Create one ROHC decompressor.

Parameters:
compressor
  • The ROHC compressor to associate the decompressor with
  • NULL to disable feedback and force undirectional mode
Returns:
The newly-created decompressor if successful, NULL otherwise

References medium::cid_type, clear_statistics(), compressor, contexts, crc_table_2, crc_table_3, crc_table_6, crc_table_7, crc_table_8, curval, errval, last_context, medium::max_cid, maxval, medium, okval, rohc_crc_init_table(), ROHC_CRC_TYPE_2, ROHC_CRC_TYPE_3, ROHC_CRC_TYPE_6, ROHC_CRC_TYPE_7, ROHC_CRC_TYPE_8, rohc_debugf, ROHC_SMALL_CID, ROHC_SMALL_CID_MAX, and zfree.

int rohc_d_statistics ( struct rohc_decomp decomp,
unsigned int  indent,
char *  buffer 
)

Output the decompression statistics of one decompressor to a buffer. The buffer must be large enough to store all the statistics.

Parameters:
decompThe ROHC decompressor
indentThe level of indentation to add during output
bufferThe buffer where to outputs the statistics
Returns:
The length of data written to the buffer

References D_NUM_PROFILES, d_profile::description, d_profile::id, rohc_d_context(), and zfree.

const char* rohc_decomp_get_state_descr ( const rohc_d_state  state)

Give a description for the given ROHC decompression 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 decompression context states used by the library. If unsure, ask on the mailing list.

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

References FULL_CONTEXT, NO_CONTEXT, and STATIC_CONTEXT.

Referenced by rohc_d_context().

bool rohc_decomp_set_cid_type ( struct rohc_decomp *const  decomp,
const rohc_cid_type_t  cid_type 
)

Set the type of CID to use for the given decompressor.

Warning:
Changing the CID type while library is used may lead to destruction of decompression contexts
Parameters:
decompThe decompressor for which to set CID type
cid_typeThe new CID type among ROHC_SMALL_CID or ROHC_LARGE_CID
Returns:
true if the CID type was successfully set, false otherwise

References medium::cid_type, medium::max_cid, medium, rohc_debugf, rohc_decomp_set_max_cid(), ROHC_LARGE_CID, and ROHC_SMALL_CID.

Referenced by rohc_decompress_both().

bool rohc_decomp_set_max_cid ( struct rohc_decomp *const  decomp,
const size_t  max_cid 
)

Set the MAX_CID allowed for the given decompressor.

Warning:
Changing the MAX_CID value while library is used may lead to destruction of decompression contexts
Parameters:
decompThe decompressor for which to set MAX_CID
max_cidThe new MAX_CID value:
Returns:
true if the MAX_CID was successfully set, false otherwise

References medium::cid_type, medium::max_cid, medium, rohc_debugf, ROHC_LARGE_CID_MAX, ROHC_SMALL_CID, and ROHC_SMALL_CID_MAX.

Referenced by rohc_decomp_set_cid_type().

int rohc_decompress ( struct rohc_decomp decomp,
unsigned char *  ibuf,
int  isize,
unsigned char *  obuf,
int  osize 
)
int rohc_decompress_both ( struct rohc_decomp decomp,
unsigned char *  ibuf,
int  isize,
unsigned char *  obuf,
int  osize,
int  large 
)

Decompress both large and small CID packets.

Deprecated:
do not use this function anymore, use rohc_decomp_set_cid_type() and rohc_decomp_set_max_cid() instead
Parameters:
decompThe ROHC decompressor
ibufThe ROHC packet to decompress
isizeThe size of the ROHC packet
obufThe buffer where to store the decompressed packet
osizeThe size of the buffer for the decompressed packet
largeWhether the packet use large CID or not
Returns:
The size of the decompressed packet

References rohc_decomp_set_cid_type(), rohc_decompress(), ROHC_ERROR, ROHC_LARGE_CID, and ROHC_SMALL_CID.

void rohc_free_decompressor ( struct rohc_decomp decomp)

Destroy one ROHC decompressor.

Parameters:
decompThe decompressor to destroy

References context_free(), contexts, medium::max_cid, medium, rohc_debugf, and zfree.

void user_interactions ( struct rohc_decomp decomp,
int  feedback_maxval 
)

Update feedback interval by the user.

Parameters:
decompThe ROHC decompressor
feedback_maxvalThe feedback interval given by user

References maxval.