|
ROHC compression/decompression library
|
ROHC decompression routines. More...


Go to the source code of this file.
Classes | |
| struct | d_decode_data |
| Decompression-related data. More... | |
| struct | d_statistics |
| Some compressor statistics. More... | |
| struct | rohc_decomp |
| The ROHC decompressor. More... | |
| struct | d_context |
| The ROHC decompression context. More... | |
| struct | d_profile |
| The ROHC decompression profile. More... | |
Defines | |
| #define | D_NUM_PROFILES 5 |
| The number of ROHC profiles ready to be used. | |
Enumerations | |
| enum | rohc_d_state { NO_CONTEXT = 1, STATIC_CONTEXT = 2, FULL_CONTEXT = 3 } |
| ROHC decompressor states (see 4.3.2 in the RFC 3095) More... | |
Functions | |
| void | context_array_increase (struct rohc_decomp *decomp, int highestcid) |
| Increases the context array size in sizes of 2^x (max 16384). | |
| void | context_array_decrease (struct rohc_decomp *decomp) |
| Decreases the context array size in sizes of 2^x (min 16). | |
| 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. | |
| int | d_decode_header (struct rohc_decomp *decomp, unsigned char *ibuf, int isize, unsigned char *obuf, int osize, struct d_decode_data *ddata) |
| Decompress the compressed headers. | |
| struct d_context * | find_context (struct rohc_decomp *decomp, int cid) |
| Find one decompression context thanks to its CID. | |
| struct d_context * | context_create (struct rohc_decomp *decomp, int with_cid, struct d_profile *profile) |
| Create one new decompression context with profile specific data. | |
| void | context_free (struct d_context *context) |
| Destroy one decompression context and the profile specific data associated with it. | |
| void | d_operation_mode_feedback (struct rohc_decomp *decomp, int rohc_status, int cid, int addcidUsed, int largecidUsed, int mode, struct d_context *context) |
| Send feedback depending on the mode: Unidirectional, Optimistic or Reliable. | |
| void | d_change_mode_feedback (struct rohc_decomp *decomp, struct d_context *context) |
| Create a feedback ACK packet telling the compressor to change state. | |
| int | rohc_ir_packet_crc_ok (struct d_context *context, unsigned char *walk, unsigned int plen, const int largecid, const int addcidUsed, const struct d_profile *profile) |
| Check the CRC of one IR packet. | |
| int | rohc_ir_dyn_packet_crc_ok (unsigned char *walk, unsigned int plen, const int largecid, const int addcidUsed, const struct d_profile *profile, struct d_context *context) |
| Check the CRC of one IR-DYN packet. | |
| 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. | |
| int | rohc_d_context (struct rohc_decomp *decomp, int index, unsigned int indent, char *buffer) |
| Output the statistics of one decompression context to a buffer. | |
| void | clear_statistics (struct rohc_decomp *decomp) |
| Clear all the statistics. | |
| void | user_interactions (struct rohc_decomp *decomp, int feedback_maxval) |
| Update feedback interval by the user. | |
ROHC decompression routines.
| #define D_NUM_PROFILES 5 |
The number of ROHC profiles ready to be used.
Referenced by find_profile(), and rohc_d_statistics().
| enum rohc_d_state |
| void context_array_decrease | ( | struct rohc_decomp * | decomp | ) |
Decreases the context array size in sizes of 2^x (min 16).
| decomp | The ROHC decompressor |
References rohc_decomp::contexts, rohc_decomp::num_contexts, rohc_debugf, and zfree.
| void context_array_increase | ( | struct rohc_decomp * | decomp, |
| int | highest_cid | ||
| ) |
Increases the context array size in sizes of 2^x (max 16384).
| decomp | The ROHC decompressor |
| highest_cid | Highest CID to adapt context array size with |
References rohc_decomp::contexts, rohc_decomp::num_contexts, rohc_debugf, and zfree.
Referenced by d_decode_header(), and rohc_alloc_decompressor().
| struct d_context* context_create | ( | struct rohc_decomp * | decomp, |
| int | with_cid, | ||
| struct d_profile * | profile | ||
| ) | [read] |
Create one new decompression context with profile specific data.
| decomp | The ROHC decompressor |
| with_cid | The CID of the new context (not implemented) |
| profile | The profile to be assigned with the new context |
References d_profile::allocate_decode_data, c_create_wlsb(), c_destroy_wlsb(), d_context::curval, d_context::first_used, d_profile::free_decode_data, d_context::header_16_compressed, d_context::header_16_uncompressed, d_context::header_compressed_size, d_context::header_uncompressed_size, d_context::latest_used, d_context::mode, NO_CONTEXT, d_context::num_decomp_failures, d_context::num_decomp_repairs, d_context::num_recv_ir, d_context::num_recv_ir_dyn, d_context::num_recv_packets, d_context::num_sent_feedbacks, d_context::profile, rohc_debugf, d_context::specific, d_context::state, d_context::total_16_compressed, d_context::total_16_uncompressed, d_context::total_compressed_size, d_context::total_uncompressed_size, U_MODE, and zfree.
Referenced by d_decode_header().
| void context_free | ( | struct d_context * | context | ) |
Destroy one decompression context and the profile specific data associated with it.
| context | The context to destroy |
References c_destroy_wlsb(), d_profile::free_decode_data, d_context::header_16_compressed, d_context::header_16_uncompressed, d_context::profile, d_context::specific, d_context::total_16_compressed, d_context::total_16_uncompressed, and zfree.
Referenced by d_decode_header(), and rohc_free_decompressor().
| int d_decode_header | ( | struct rohc_decomp * | decomp, |
| unsigned char * | ibuf, | ||
| int | isize, | ||
| unsigned char * | obuf, | ||
| int | osize, | ||
| struct d_decode_data * | ddata | ||
| ) |
Decompress the compressed headers.
| 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 |
| ddata | Decompression-related data (e.g. the context) |
References d_decode_data::active, d_decode_data::addcidUsed, d_decode_data::cid, context_array_increase(), context_create(), context_free(), rohc_decomp::contexts, rohc_decomp::curval, d_is_ir(), d_is_irdyn(), d_profile::decode, d_profile::decode_ir, find_context(), find_profile(), d_decode_data::large_cid_size, rohc_decomp::last_context, d_context::latest_used, rohc_decomp::maxval, rohc_decomp::num_contexts, d_context::num_recv_ir, d_context::num_recv_ir_dyn, d_context::profile, rohc_debugf, ROHC_ERROR_CRC, ROHC_ERROR_NO_CONTEXT, ROHC_FEEDBACK_ONLY, rohc_ir_dyn_packet_crc_ok(), rohc_ir_packet_crc_ok(), and ROHC_OK.
Referenced by rohc_decompress().
| void d_operation_mode_feedback | ( | struct rohc_decomp * | decomp, |
| int | rohc_status, | ||
| int | cid, | ||
| int | addcidUsed, | ||
| int | largecidUsed, | ||
| int | mode, | ||
| struct d_context * | context | ||
| ) |
Send feedback depending on the mode: Unidirectional, Optimistic or Reliable.
| decomp | The ROHC decompressor |
| rohc_status | The type of feedback to send: 0 = OK (ack), -1 = ContextInvalid (S-nack), -2 = PackageFailed (Nack) |
| cid | The Context ID (CID) to which the feedback is related |
| addcidUsed | Whether add-CID is used or not |
| largecidUsed | Whether large CIDs are used or not |
| mode | The mode in which the ROHC decompressor operates: U_MODE, O_MODE or R_MODE |
| context | The context to which the feedback is related |
References d_optimistic_feedback(), O_MODE, R_MODE, and U_MODE.
Referenced by rohc_decompress().
| struct d_context* find_context | ( | struct rohc_decomp * | decomp, |
| int | cid | ||
| ) | [read] |
Find one decompression context thanks to its CID.
| decomp | The ROHC decompressor |
| cid | The CID of the context to find out |
References rohc_decomp::contexts, and rohc_decomp::num_contexts.
Referenced by d_decode_header().
| int rohc_d_context | ( | struct rohc_decomp * | decomp, |
| int | index, | ||
| unsigned int | indent, | ||
| char * | buffer | ||
| ) |
Output the statistics of one decompression context to a buffer.
The buffer must be large enough to store the statistics of one context.
| decomp | The ROHC decompressor |
| index | The index of the decompression context in the contexts array |
| indent | The level of indentation to add during output |
| buffer | The buffer where to outputs the statistics |
References c_mean_wlsb(), c_sum_wlsb(), rohc_decomp::contexts, d_profile::description, d_context::first_used, d_context::header_16_compressed, d_context::header_16_uncompressed, d_context::header_compressed_size, d_context::header_uncompressed_size, d_context::latest_used, d_context::mode, rohc_decomp::num_contexts, d_context::num_decomp_failures, d_context::num_decomp_repairs, d_context::num_recv_ir, d_context::num_recv_ir_dyn, d_context::num_recv_packets, d_context::num_sent_feedbacks, d_context::profile, d_context::state, d_context::total_16_compressed, d_context::total_16_uncompressed, d_context::total_compressed_size, and d_context::total_uncompressed_size.
Referenced by rohc_d_statistics().
| 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 medium::cid_type, rohc_decomp::medium, and rohc_decompress().
| int rohc_ir_dyn_packet_crc_ok | ( | unsigned char * | walk, |
| unsigned int | plen, | ||
| const int | largecid, | ||
| const int | addcidUsed, | ||
| const struct d_profile * | profile, | ||
| struct d_context * | context | ||
| ) |
Check the CRC of one IR-DYN packet.
| walk | The ROHC packet |
| plen | The length of the ROHC packet |
| largecid | The large CID value |
| addcidUsed | Whether add-CID is used or not |
| profile | The profile associated with the ROHC packet |
| context | The decompression context associated with the ROHC packet |
References crc_calculate(), CRC_INIT_8, CRC_TYPE_8, d_profile::detect_ir_dyn_size, and rohc_debugf.
Referenced by d_decode_header().
| int rohc_ir_packet_crc_ok | ( | struct d_context * | context, |
| unsigned char * | walk, | ||
| unsigned int | plen, | ||
| const int | largecid, | ||
| const int | addcidUsed, | ||
| const struct d_profile * | profile | ||
| ) |
Check the CRC of one IR packet.
| context | The decompression context |
| walk | The ROHC IR packet |
| plen | The length of the ROHC packet |
| largecid | The size of the large CID field |
| addcidUsed | Whether add-CID is used or not |
| profile | The profile associated with the ROHC packet |
References crc_calculate(), CRC_INIT_8, CRC_TYPE_8, d_profile::description, d_profile::detect_ir_size, d_profile::id, and rohc_debugf.
Referenced by d_decode_header().
1.7.6.1