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. | |
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. |
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 | The parameter which indicates if the use of the jamming is activated 0 if not activated else 1 |
adapt_size | The size of the header or trailer of the adaptation layer |
encap_size | The packet size of the encapsulation layer |
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.
buffer | The buffer where to store profile information |
References C_NUM_PROFILES, and version.
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, and medium.
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, 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.
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(), 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.
comp | The ROHC compressor |
References medium::cid_type, and medium.
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_create_context(), c_find_context(), c_get_profile_from_id(), c_get_profile_from_packet(), 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::profile, rohc_debugf, 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.
void rohc_free_compressor | ( | struct rohc_comp * | comp | ) |
Destroy one ROHC compressor.
comp | The compressor to destroy |
References c_destroy_contexts(), rohc_debugf, and zfree.