ROHC compression/decompression library
|
Functions | |
struct rohc_decomp * | rohc_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. |
void clear_statistics | ( | struct rohc_decomp * | decomp | ) |
Clear all the statistics.
decomp | The 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.
decomp | The ROHC decompressor |
context | The 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.
compressor |
|
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.
decomp | The ROHC decompressor |
indent | The level of indentation to add during output |
buffer | The buffer where to outputs the statistics |
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.
state | The decompression context state to get a description for |
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.
decomp | The decompressor for which to set CID type |
cid_type | The new CID type among ROHC_SMALL_CID or ROHC_LARGE_CID |
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.
decomp | The decompressor for which to set MAX_CID |
max_cid | The new MAX_CID value:
|
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 | ||
) |
Decompress a ROHC packet.
decomp | The ROHC decompressor |
ibuf | The ROHC packet to decompress |
isize | The size of the ROHC packet |
obuf | The buffer where to store the decompressed packet |
osize | The size of the buffer for the decompressed packet |
References d_decode_data::active, d_decode_data::addcidUsed, c_add_wlsb(), d_decode_data::cid, medium::cid_type, compressor, curval, d_context::curval, d_decode_header(), d_operation_mode_feedback(), errval, d_statistics::failed_crc, d_statistics::failed_decomp, d_statistics::failed_no_context, d_statistics::feedbacks, maxval, medium, d_context::mode, d_context::num_decomp_failures, d_context::num_recv_packets, O_MODE, okval, d_statistics::received, rohc_debugf, ROHC_ERROR, ROHC_ERROR_CRC, ROHC_ERROR_NO_CONTEXT, ROHC_ERROR_PACKET_FAILED, ROHC_FEEDBACK_ONLY, ROHC_OK, d_context::state, stats, d_context::total_16_compressed, d_context::total_16_uncompressed, d_context::total_compressed_size, d_context::total_uncompressed_size, and U_MODE.
Referenced by rohc_decompress_both().
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.
decomp | The ROHC decompressor |
ibuf | The ROHC packet to decompress |
isize | The size of the ROHC packet |
obuf | The buffer where to store the decompressed packet |
osize | The size of the buffer for the decompressed packet |
large | Whether the packet use large CID or not |
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.
decomp | The 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.
decomp | The ROHC decompressor |
feedback_maxval | The feedback interval given by user |
References maxval.