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

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

#include "rfc4996.h"
#include "rohc_bit_ops.h"
#include "rohc_traces_internal.h"
#include "rohc_decomp_internals.h"
#include "rohc_debug.h"
#include "rohc_utils.h"
#include "crc.h"
#include "protocols/tcp.h"
#include "protocols/rfc6846.h"
#include "rohc_packets.h"
#include "rohc_decomp.h"
#include <string.h>
#include <assert.h>
Include dependency graph for decomp/schemes/rfc4996.c:

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 d_static_or_irreg32 (const uint8_t *const rohc_data, const size_t rohc_len, const int indicator, struct rohc_lsb_field32 *const lsb)
 Decompress the 32-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

◆ d_ip_id_lsb()

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

◆ d_optional_ip_id_lsb()

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

◆ d_static_or_irreg16()

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

◆ d_static_or_irreg32()

int d_static_or_irreg32 ( const uint8_t *const  rohc_data,
const size_t  rohc_len,
const int  indicator,
struct rohc_lsb_field32 *const  lsb 
)

Decompress the 32-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

◆ d_static_or_irreg8()

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

◆ rsf_index_dec()

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

◆ variable_length_32_dec()

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