ip_id_offset.c File Reference

Offset IP-ID decoding. More...

#include "ip_id_offset.h"
#include <stdlib.h>
#include <assert.h>
Include dependency graph for decomp/schemes/ip_id_offset.c:

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

struct ip_id_offset_decodeip_id_offset_new (void)
 Create a new Offset IP-ID decoding context.
void ip_id_offset_free (struct ip_id_offset_decode *const ipid)
 Destroy a given Offset IP-ID decoding context.
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.
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.

Detailed Description

Offset IP-ID decoding.

Author:
Didier Barvaux <didier.barvaux@toulouse.viveris.com>
Didier Barvaux <didier@barvaux.org>

Function Documentation

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:
ipid The Offset IP-ID object
ref_type The reference value to use to decode (used for context repair upon CRC failure)
m The IP-ID offset to decode
k The number of bits used to code the IP-ID offset
sn The SN of the ROHC packet that contains the IP-ID offset
decoded OUT: The computed IP-ID
Returns:
true in case of success, false otherwise
void ip_id_offset_free ( struct ip_id_offset_decode *const   ipid  ) 

Destroy a given Offset IP-ID decoding context.

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

Parameters:
ipid The Offset IP-ID decoding context to destroy
struct ip_id_offset_decode* ip_id_offset_new ( void   )  [read]

Create a new Offset IP-ID decoding context.

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

Returns:
The new Offset IP-ID decoding context in case of success, NULL otherwise
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:
ipid The Offset IP-ID decoding object
id_ref The new IP-ID reference
sn_ref The new SN reference
keep_ref_minus_1 Keep ref -1 unchanged (used for SN context repair after CRC failure, see RFC3095 ยง5.3.2.2.5)

Generated on 4 Jul 2018 for ROHC compression/decompression library by  doxygen 1.6.1