ROHC compression/decompression library
Data Structures | Defines | Enumerations | Functions
d_generic.h File Reference

ROHC generic decompression context for IP-only, UDP and UDP Lite profiles. More...

#include "rohc_decomp.h"
#include "rohc_decomp_internals.h"
#include "rohc_packets.h"
#include "comp_list.h"
#include "schemes/wlsb.h"
#include "schemes/ip_id_offset.h"
#include "schemes/list.h"
#include "ip.h"
#include "crc.h"
#include <stddef.h>
#include <stdbool.h>
Include dependency graph for d_generic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rohc_extr_ip_bits
struct  rohc_extr_bits
 The bits extracted from ROHC UO* base headers. More...
struct  rohc_decoded_ip_values
struct  rohc_decoded_values
 The values decoded from the bits extracted from ROHC header. More...
struct  d_generic_changes
 Store information about an IP header between the different decompressions of IP packets. More...
struct  d_generic_context
 The generic decompression context. More...

Defines

#define ROHC_MAX_ARRIVAL_TIMES   10U

Enumerations

enum  rohc_decomp_crc_corr_t { ROHC_DECOMP_CRC_CORR_SN_NONE = 0, ROHC_DECOMP_CRC_CORR_SN_WRAP = 1, ROHC_DECOMP_CRC_CORR_SN_UPDATES = 2 }
 The different correction algorithms available in case of CRC failure. More...

Functions

void * d_generic_create (const struct rohc_decomp_ctxt *const context, rohc_trace_callback_t trace_cb, rohc_trace_callback2_t trace_cb2, void *const trace_cb_priv, const int profile_id)
 Create the generic decompression context.
void d_generic_destroy (void *const context)
 Destroy the context.
rohc_status_t d_generic_decode (struct rohc_decomp *const decomp, struct rohc_decomp_ctxt *const context, const struct rohc_buf rohc_packet, const size_t add_cid_len, const size_t large_cid_len, struct rohc_buf *const uncomp_packet, rohc_packet_t *const packet_type)
 Decode one IR, IR-DYN or UO* packet.
uint32_t d_generic_get_sn (const struct rohc_decomp_ctxt *const context)
 Get the reference SN value of the context.
static bool is_ipv4_pkt (const struct rohc_extr_ip_bits bits)
 Is the given IP header IPV4 wrt packet?
static bool is_ipv4_rnd_pkt (const struct rohc_extr_ip_bits bits)
 Is the given IP header IPv4 and its IP-ID random wrt packet?
static bool is_ipv4_non_rnd_pkt (const struct rohc_extr_ip_bits bits)
 Is the given IP header IPv4 and its IP-ID non-random wrt packet?

Detailed Description

ROHC generic decompression context for IP-only, UDP and UDP Lite profiles.

Author:
Didier Barvaux <didier.barvaux@toulouse.viveris.com>
Didier Barvaux <didier@barvaux.org>
David Moreau from TAS

Define Documentation

#define ROHC_MAX_ARRIVAL_TIMES   10U

The number of last packets to record arrival times for


Enumeration Type Documentation

The different correction algorithms available in case of CRC failure.

Enumerator:
ROHC_DECOMP_CRC_CORR_SN_NONE 

No correction

ROHC_DECOMP_CRC_CORR_SN_WRAP 

Correction of SN wraparound

ROHC_DECOMP_CRC_CORR_SN_UPDATES 

Correction of incorrect SN updates


Function Documentation

void* d_generic_create ( const struct rohc_decomp_ctxt *const  context,
rohc_trace_callback_t  trace_cb,
rohc_trace_callback2_t  trace_cb2,
void *const  trace_cb_priv,
const int  profile_id 
)

Create the generic decompression context.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters:
contextThe decompression context
trace_cbThe old function to call for printing traces
trace_cb2The new function to call for printing traces
trace_cb_privAn optional private context, may be NULL
profile_idThe ID of the associated decompression profile
Returns:
The newly-created generic decompression context
rohc_status_t d_generic_decode ( struct rohc_decomp *const  decomp,
struct rohc_decomp_ctxt *const  context,
const struct rohc_buf  rohc_packet,
const size_t  add_cid_len,
const size_t  large_cid_len,
struct rohc_buf *const  uncomp_packet,
rohc_packet_t *const  packet_type 
)

Decode one IR, IR-DYN or UO* packet.

This function is one of the functions that must exist in one profile for the framework to work.

Steps:

  • A. Parsing of ROHC base header, extension header and tail of header
  • B. For IR and IR-DYN packet, check for correct compressed header (CRC)
  • C. Decode extracted bits
  • D. Build uncompressed headers (and check for correct decompression for UO* packets)
  • E. Copy the payload (if any)
  • F. Update the compression context

Steps C and D may be repeated if packet or context repair is attempted upon CRC failure.

Parameters:
decompThe ROHC decompressor
contextThe decompression context
rohc_packetThe ROHC packet to decode
add_cid_lenThe length of the optional Add-CID field
large_cid_lenThe length of the optional large CID field
[out]uncomp_packetThe uncompressed packet
packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
Returns:
ROHC_STATUS_OK if packet is successfully decoded, ROHC_STATUS_MALFORMED if packet is malformed, ROHC_STATUS_BAD_CRC if a CRC error occurs, ROHC_STATUS_OUTPUT_TOO_SMALL if the output buffer is too small ROHC_STATUS_ERROR if an error occurs
void d_generic_destroy ( void *const  context)

Destroy the context.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters:
contextThe compression context
uint32_t d_generic_get_sn ( const struct rohc_decomp_ctxt *const  context)

Get the reference SN value of the context.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters:
contextThe decompression context
Returns:
The reference SN value
static bool is_ipv4_non_rnd_pkt ( const struct rohc_extr_ip_bits  bits) [inline, static]

Is the given IP header IPv4 and its IP-ID non-random wrt packet?

Parameters:
bitsThe bits extracted from packet
Returns:
true if IPv4 and non-random, false otherwise
static bool is_ipv4_pkt ( const struct rohc_extr_ip_bits  bits) [inline, static]

Is the given IP header IPV4 wrt packet?

Parameters:
bitsThe bits extracted from packet
Returns:
true if IPv4, false if IPv6
static bool is_ipv4_rnd_pkt ( const struct rohc_extr_ip_bits  bits) [inline, static]

Is the given IP header IPv4 and its IP-ID random wrt packet?

Parameters:
bitsThe bits extracted from packet
Returns:
true if IPv4 and random, false otherwise