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>
|
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...
|
|
◆ 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
-
| context | The decompression context |
| ip_id_lsb_ctxt | The LSB decoding context for the IP-ID offset |
| msn | The Master Sequence Number |
| ip_id_bits | The received IP-ID offset bits to decode |
| ip_id_bits_nr | The number of received IP-ID offset bits to decode |
| p | The offset parameter p to use for LSB decoding |
[out] | ip_id | The 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
-
| context | The decompression context |
| rohc_data | The ROHC data to parse |
| data_len | The length of the ROHC data to parse (in bytes) |
| behavior | The IP-ID behavior |
| indicator | The compression indicator |
[out] | lsb | The 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_data | The ROHC data to parse |
| rohc_len | The length of the ROHC data to parse (in bytes) |
| indicator | The indicator of compression |
[out] | lsb | The 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_data | The ROHC data to parse |
| rohc_len | The length of the ROHC data to parse (in bytes) |
| indicator | The indicator of compression |
[out] | lsb | The 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_data | The ROHC data to parse |
| rohc_len | The length of the ROHC data to parse (in bytes) |
| indicator | The indicator of compression |
[out] | lsb | The 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
-
- 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_data | The ROHC data to parse |
| rohc_len | The length of the ROHC data to parse (in bytes) |
| indicator | The indicator of compression |
[out] | lsb | The LSB bits extracted from the ROHC packet |
- Returns
- The length (in bytes) of the compressed value, -1 if ROHC data is malformed