ROHC compression/decompression library
Functions
decomp/schemes/rfc4996.h File Reference

Library of decoding methods from RFC4997 and RFC4996. More...

#include "interval.h"
#include "decomp_wlsb.h"
#include <stdint.h>
Include dependency graph for decomp/schemes/rfc4996.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int d_static_or_irreg8 (const uint8_t *const rohc_data, const size_t rohc_len, const int indicator, struct rohc_lsb_field8 *const lsb)
 Decompress the 8-bit given value, according to the indicator. More...
 
int d_static_or_irreg16 (const uint8_t *const rohc_data, const size_t rohc_len, const int indicator, struct rohc_lsb_field16 *const lsb)
 Decompress the 16-bit given value, according to the indicator. More...
 
int variable_length_32_dec (const uint8_t *const rohc_data, const size_t rohc_len, const int indicator, struct rohc_lsb_field32 *const lsb)
 Decode the 32 bits value, according to the indicator. More...
 
unsigned int rsf_index_dec (const unsigned int rsf_index)
 Calculate the rsf flags from the rsf index. More...
 
bool d_ip_id_lsb (const struct rohc_decomp_ctxt *const context, const struct rohc_lsb_decode *const ip_id_lsb_ctxt, const uint16_t msn, const uint32_t ip_id_bits, const size_t ip_id_bits_nr, const rohc_lsb_shift_t p, uint16_t *const ip_id)
 Decompress the lower bits of IP-ID. More...
 
int d_optional_ip_id_lsb (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_data, const size_t data_len, const int behavior, const int indicator, struct rohc_lsb_field16 *const lsb)
 Decompress the IP-ID. More...
 

Detailed Description

Library of decoding methods from RFC4997 and RFC4996.

Author
FWX rohc_.nosp@m.team.nosp@m.@dial.nosp@m.ine..nosp@m.fr
Didier Barvaux didie.nosp@m.r@ba.nosp@m.rvaux.nosp@m..org

Function Documentation

bool d_ip_id_lsb ( const struct rohc_decomp_ctxt *const  context,
const struct rohc_lsb_decode *const  ip_id_lsb_ctxt,
const uint16_t  msn,
const uint32_t  ip_id_bits,
const size_t  ip_id_bits_nr,
const rohc_lsb_shift_t  p,
uint16_t *const  ip_id 
)

Decompress the lower bits of IP-ID.

See RFC4996 page 75

Parameters
contextThe decompression context
ip_id_lsb_ctxtThe LSB decoding context for the IP-ID offset
msnThe Master Sequence Number
ip_id_bitsThe received IP-ID offset bits to decode
ip_id_bits_nrThe number of received IP-ID offset bits to decode
pThe offset parameter p to use for LSB decoding
[out]ip_idThe decoded IP-ID value
Returns
true if IP-ID was successfully decoded, false if decoding failed
Todo:
TODO: could be merged with decomp/schemes/ip_id_offset.[ch] module
int d_optional_ip_id_lsb ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_data,
const size_t  data_len,
const int  behavior,
const int  indicator,
struct rohc_lsb_field16 *const  lsb 
)

Decompress the IP-ID.

See RFC4996 page 76

Parameters
contextThe decompression context
rohc_dataThe ROHC data to parse
data_lenThe length of the ROHC data to parse (in bytes)
behaviorThe IP-ID behavior
indicatorThe compression indicator
[out]lsbThe LSB bits extracted from the ROHC packet
Returns
The length (in bytes) of the compressed value, -1 if ROHC data is malformed
int d_static_or_irreg16 ( const uint8_t *const  rohc_data,
const size_t  rohc_len,
const int  indicator,
struct rohc_lsb_field16 *const  lsb 
)

Decompress the 16-bit given value, according to the indicator.

Parameters
rohc_dataThe ROHC data to parse
rohc_lenThe length of the ROHC data to parse (in bytes)
indicatorThe indicator of compression
[out]lsbThe LSB bits extracted from the ROHC packet
Returns
The length (in bytes) of the compressed value, -1 if ROHC data is malformed
int d_static_or_irreg8 ( const uint8_t *const  rohc_data,
const size_t  rohc_len,
const int  indicator,
struct rohc_lsb_field8 *const  lsb 
)

Decompress the 8-bit given value, according to the indicator.

Parameters
rohc_dataThe ROHC data to parse
rohc_lenThe length of the ROHC data to parse (in bytes)
indicatorThe indicator of compression
[out]lsbThe LSB bits extracted from the ROHC packet
Returns
The length (in bytes) of the compressed value, -1 if ROHC data is malformed
unsigned int rsf_index_dec ( const unsigned int  rsf_index)

Calculate the rsf flags from the rsf index.

See RFC4996 page 71

Parameters
rsf_indexThe rsf index
Returns
The rsf flags
int variable_length_32_dec ( const uint8_t *const  rohc_data,
const size_t  rohc_len,
const int  indicator,
struct rohc_lsb_field32 *const  lsb 
)

Decode the 32 bits value, according to the indicator.

See RFC4996 page 46

Parameters
rohc_dataThe ROHC data to parse
rohc_lenThe length of the ROHC data to parse (in bytes)
indicatorThe indicator of compression
[out]lsbThe LSB bits extracted from the ROHC packet
Returns
The length (in bytes) of the compressed value, -1 if ROHC data is malformed