ROHC compression/decompression library
Data Structures | Functions
decomp/schemes/ip_id_offset.h File Reference

Offset IP-ID decoding. More...

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

Go to the source code of this file.

Data Structures

struct  ip_id_offset_decode
 Defines a IP-ID object to help computing the IP-ID value from an IP-ID offset. More...
 

Functions

void ip_id_offset_init (struct ip_id_offset_decode *const ipid)
 Create a new Offset IP-ID decoding context. More...
 
bool ip_id_offset_decode (const struct ip_id_offset_decode *const ipid, const rohc_lsb_ref_t ref_type, const uint16_t m, const size_t k, const uint32_t sn, uint16_t *const decoded)
 Decode the given IP-ID offset. More...
 
void ip_id_offset_set_ref (struct ip_id_offset_decode *const ipid, const uint16_t id_ref, const uint32_t sn_ref, const bool keep_ref_minus_1)
 Update the reference values for the IP-ID and the SN. More...
 

Detailed Description

Offset IP-ID decoding.

Author
Didier Barvaux didie.nosp@m.r.ba.nosp@m.rvaux.nosp@m.@tou.nosp@m.louse.nosp@m..viv.nosp@m.eris..nosp@m.com
Didier Barvaux didie.nosp@m.r@ba.nosp@m.rvaux.nosp@m..org

Function Documentation

◆ ip_id_offset_decode()

bool ip_id_offset_decode ( const struct ip_id_offset_decode *const  ipid,
const rohc_lsb_ref_t  ref_type,
const uint16_t  m,
const size_t  k,
const uint32_t  sn,
uint16_t *const  decoded 
)

Decode the given IP-ID offset.

Parameters
ipidThe Offset IP-ID object
ref_typeThe reference value to use to decode (used for context repair upon CRC failure)
mThe IP-ID offset to decode
kThe number of bits used to code the IP-ID offset
snThe SN of the ROHC packet that contains the IP-ID offset
decodedOUT: The computed IP-ID
Returns
true in case of success, false otherwise

◆ ip_id_offset_init()

void ip_id_offset_init ( struct ip_id_offset_decode *const  ipid)

Create a new Offset IP-ID decoding context.

See 4.5.5 in the RFC 3095 for details about Offset IP-ID encoding.

Parameters
[in,out]ipidThe Offset IP-ID decoding context to init

◆ ip_id_offset_set_ref()

void ip_id_offset_set_ref ( struct ip_id_offset_decode *const  ipid,
const uint16_t  id_ref,
const uint32_t  sn_ref,
const bool  keep_ref_minus_1 
)

Update the reference values for the IP-ID and the SN.

Parameters
ipidThe Offset IP-ID decoding object
id_refThe new IP-ID reference
sn_refThe new SN reference
keep_ref_minus_1Keep ref -1 unchanged (used for SN context repair after CRC failure, see RFC3095 ยง5.3.2.2.5)