ROHC compression/decompression library
|
Functions | |
struct rohc_comp * | rohc_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. |
void rohc_activate_profile | ( | struct rohc_comp * | comp, |
int | profile | ||
) |
Activate a profile for a compressor.
comp | The ROHC compressor |
profile | The 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.
max_cid | The maximal CID value the compressor should use for contexts |
jam_use | not used anymore, must be 0 |
adapt_size | not used anymore, ignored |
encap_size | not used anymore, ignored |
References C_NUM_PROFILES, C_WINDOW_WIDTH, CHANGE_TO_FO_COUNT, CHANGE_TO_IR_COUNT, medium::cid_type, crc_table_2, crc_table_3, crc_table_6, crc_table_7, crc_table_8, rohc_feedback::data, enabled, FEEDBACK_RING_SIZE, feedbacks, feedbacks_first, feedbacks_first_unlocked, feedbacks_next, rohc_feedback::is_locked, last_context, rohc_feedback::length, medium::max_cid, medium, mrru, num_packets, profiles, random_cb, random_cb_ctxt, rohc_comp_set_periodic_refreshes(), rohc_comp_set_wlsb_window_width(), 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, total_compressed_size, total_uncompressed_size, and zfree.
int rohc_c_info | ( | char * | buffer | ) |
Get information about available compression profiles.
This function outputs XML.
buffer | The buffer where to store profile information |
References C_NUM_PROFILES.
int rohc_c_is_enabled | ( | struct rohc_comp * | comp | ) |
Whether the ROHC compressor is enabled or not.
comp | The ROHC compressor |
References enabled.
void rohc_c_set_enable | ( | struct rohc_comp * | comp, |
int | enable | ||
) |
Enable the ROHC compressor.
comp | The ROHC compressor |
enable | Whether 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.
comp | The ROHC compressor |
header | The 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.
comp | The ROHC compressor |
large_cid | Whether 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.
comp | The ROHC compressor |
value | The 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.
comp | The ROHC compressor |
value | The 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.
comp | The ROHC compressor |
indent | The indent level to beautify the XML output |
buffer | The buffer where to store the information |
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.
comp | The ROHC compressor |
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 | ||
) |
Get some information about the last compressed packet.
comp | The ROHC compressor to get information from |
info | IN/OUT: the structure where information will be stored |
References rohc_comp_last_packet_info_t::context_mode, rohc_comp_last_packet_info_t::context_state, rohc_comp_last_packet_info_t::header_last_comp_size, c_context::header_last_compressed_size, rohc_comp_last_packet_info_t::header_last_uncomp_size, c_context::header_last_uncompressed_size, last_context, c_context::mode, rohc_comp_last_packet_info_t::packet_type, c_context::packet_type, rohc_debugf, ROHC_ERROR, ROHC_OK, c_context::state, rohc_comp_last_packet_info_t::total_last_comp_size, c_context::total_last_compressed_size, rohc_comp_last_packet_info_t::total_last_uncomp_size, and c_context::total_last_uncompressed_size.
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.
state | The compression context state to get a description for |
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.
comp | The ROHC compressor to set the random callback for |
callback | The random callback to set |
user_context | Private 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 | ||
) |
Compress a ROHC packet.
comp | The ROHC compressor |
ibuf | The uncompressed packet to compress |
isize | The size of the uncompressed packet |
obuf | The buffer where to store the ROHC packet |
osize | The size of the buffer for the ROHC packet |
References c_add_wlsb(), c_profile::description, c_profile::destroy, c_profile::encode, c_context::header_16_compressed, c_context::header_16_uncompressed, c_context::header_compressed_size, c_context::header_last_compressed_size, c_context::header_last_uncompressed_size, c_context::header_uncompressed_size, c_profile::id, ip_create(), ip_get_inner_packet(), ip_get_protocol(), ip_get_raw_data(), ip_get_totlen(), last_context, c_context::latest_used, num_contexts_used, num_packets, c_context::num_sent_packets, c_context::packet_type, c_context::profile, rohc_debugf, ROHC_IPPROTO_IPIP, ROHC_IPPROTO_IPV6, ROHC_PROFILE_UNCOMPRESSED, c_context::total_16_compressed, c_context::total_16_uncompressed, total_compressed_size, c_context::total_compressed_size, c_context::total_last_compressed_size, c_context::total_last_uncompressed_size, total_uncompressed_size, c_context::total_uncompressed_size, and c_context::used.
int rohc_feedback_flush | ( | struct rohc_comp * | comp, |
unsigned char * | obuf, | ||
int | osize | ||
) |
Send as much feedback data as possible.
comp | The ROHC compressor |
obuf | The buffer where to store the feedback-only packet |
osize | The size of the buffer for the feedback-only packet |
References rohc_debugf, and c_feedback::size.
void rohc_free_compressor | ( | struct rohc_comp * | comp | ) |
Destroy one ROHC compressor.
comp | The compressor to destroy |
References rohc_debugf, and zfree.