rohc_decomp_rfc3095.h File Reference

#include "rohc_decomp.h"
#include "rohc_decomp_internals.h"
#include "rohc_packets.h"
#include "rohc_utils.h"
#include "schemes/decomp_wlsb.h"
#include "schemes/ip_id_offset.h"
#include "schemes/decomp_list.h"
#include "protocols/udp_lite.h"
#include "ip.h"
#include "crc.h"
#include <stddef.h>
#include <stdbool.h>
Include dependency graph for rohc_decomp_rfc3095.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  rohc_decomp_rfc3095_changes
 Store information about an IP header between the different decompressions of IP packets. More...
struct  rohc_decomp_rfc3095_ctxt
 The generic decompression context for RFC3095-based profiles. More...

Functions

bool rohc_decomp_rfc3095_create (const struct rohc_decomp_ctxt *const context, struct rohc_decomp_rfc3095_ctxt **const persist_ctxt, struct rohc_decomp_volat_ctxt *const volat_ctxt, rohc_trace_callback2_t trace_cb, void *const trace_cb_priv, const int profile_id)
 Create the RFC3095 volatile and persistent parts of the context.
void rohc_decomp_rfc3095_destroy (struct rohc_decomp_rfc3095_ctxt *const rfc3095_ctxt, const struct rohc_decomp_volat_ctxt *const volat_ctxt)
 Destroy the context.
bool rfc3095_decomp_parse_pkt (const struct rohc_decomp_ctxt *const context, const struct rohc_buf rohc_packet, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse one IR, IR-DYN, UO-0, UO-1*, or UOR-2* packet.
rohc_status_t rfc3095_decomp_build_hdrs (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const rohc_packet_t packet_type, const struct rohc_decomp_crc *const extr_crc, const struct rohc_decoded_values *const decoded, const size_t payload_len, struct rohc_buf *const uncomp_hdrs, size_t *const uncomp_hdrs_len)
 Build the uncompressed headers.
bool rfc3095_decomp_decode_bits (const struct rohc_decomp_ctxt *const context, const struct rohc_extr_bits *const bits, const size_t payload_len, struct rohc_decoded_values *const decoded)
 Decode values from extracted bits.
void rfc3095_decomp_update_ctxt (struct rohc_decomp_ctxt *const context, const struct rohc_decoded_values *const decoded, const size_t payload_len, bool *const do_change_mode)
 Update context with decoded values.
bool rfc3095_decomp_attempt_repair (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const struct rohc_ts pkt_arrival_time, struct rohc_decomp_crc_corr_ctxt *const crc_corr, struct rohc_extr_bits *const extr_bits)
 Attempt a packet/context repair upon CRC failure.
uint32_t rohc_decomp_rfc3095_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 *const bits)
 Is the given IP header IPV4 wrt packet?
static bool is_ipv4_rnd_pkt (const struct rohc_extr_ip_bits *const 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 *const bits)
 Is the given IP header IPv4 and its IP-ID non-random wrt packet?

Function Documentation

static bool is_ipv4_non_rnd_pkt ( const struct rohc_extr_ip_bits *const   bits  )  [inline, static]

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

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

Is the given IP header IPV4 wrt packet?

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

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

Parameters:
bits The bits extracted from packet
Returns:
true if IPv4 and random, false otherwise
bool rfc3095_decomp_attempt_repair ( const struct rohc_decomp *const   decomp,
const struct rohc_decomp_ctxt *const   context,
const struct rohc_ts  pkt_arrival_time,
struct rohc_decomp_crc_corr_ctxt *const   crc_corr,
struct rohc_extr_bits *const   extr_bits 
)

Attempt a packet/context repair upon CRC failure.

Parameters:
decomp The ROHC decompressor
context The decompression context
pkt_arrival_time The arrival time of the ROHC packet that caused the CRC failure
[in,out] crc_corr The context for corrections upon CRC failures
[in,out] extr_bits The bits extracted from the ROHC header
Returns:
true if repair is possible, false if not
rohc_status_t rfc3095_decomp_build_hdrs ( const struct rohc_decomp *const   decomp,
const struct rohc_decomp_ctxt *const   context,
const rohc_packet_t  packet_type,
const struct rohc_decomp_crc *const   extr_crc,
const struct rohc_decoded_values *const   decoded,
const size_t  payload_len,
struct rohc_buf *const   uncomp_hdrs,
size_t *const   uncomp_hdrs_len 
)

Build the uncompressed headers.

Todo:
check for uncomp_hdrs size before writing into it
Parameters:
decomp The ROHC decompressor
context The decompression context
packet_type The type of ROHC packet
extr_crc The CRC bits extracted from the ROHC header
decoded The values decoded from ROHC header
payload_len The length of the packet payload
[out] uncomp_hdrs The buffer to store the uncompressed headers
[out] uncomp_hdrs_len The length of the uncompressed headers written into the buffer
Returns:
Possible values:
  • ROHC_STATUS_OK if headers are built successfully,
  • ROHC_STATUS_BAD_CRC if headers do not match CRC,
  • ROHC_STATUS_OUTPUT_TOO_SMALL if the output buffer is too small
bool rfc3095_decomp_decode_bits ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_extr_bits *const   bits,
const size_t  payload_len,
struct rohc_decoded_values *const   decoded 
)

Decode values from extracted bits.

The following values are decoded:

  • SN
  • fields related to the outer IP header
  • fields related to the inner IP header (if it exists)

Other fields may be decoded by the profile-specific callback named decode_values_from_bits.

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

Parameters:
context The decompression context
bits The bits extracted from the ROHC packet
payload_len The length of the packet payload (in bytes)
[out] decoded The corresponding decoded values
Returns:
true if decoding is successful, false otherwise
bool rfc3095_decomp_parse_pkt ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_buf  rohc_packet,
const size_t  large_cid_len,
rohc_packet_t *const   packet_type,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_extr_bits *const   bits,
size_t *const   rohc_hdr_len 
)

Parse one IR, IR-DYN, UO-0, UO-1*, or UOR-2* packet.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
large_cid_len The length of the optional large CID field
[in,out] packet_type IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the ROHC header
[out] rohc_hdr_len The length of the ROHC header (in bytes)
Returns:
true if packet is successfully parsed, false otherwise
See also:
parse_ir
parse_irdyn
parse_uo0
parse_uo1
parse_uo1rtp
parse_uo1id
parse_uo1ts
parse_uor2
parse_uor2rtp
parse_uor2id
parse_uor2ts
void rfc3095_decomp_update_ctxt ( struct rohc_decomp_ctxt *const   context,
const struct rohc_decoded_values *const   decoded,
const size_t  payload_len,
bool *const   do_change_mode 
)

Update context with decoded values.

The following decoded values are updated in context:

  • SN
  • static & dynamic fields of the outer IP header
  • static & dynamic fields of the inner IP header (if it exists)
  • fields for the next header (optional, depends on profile)

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

Parameters:
context The decompression context
decoded The decoded values to update in the context
payload_len The length of the packet payload
[out] do_change_mode Whether the profile context wants to change its operational mode or not
bool rohc_decomp_rfc3095_create ( const struct rohc_decomp_ctxt *const   context,
struct rohc_decomp_rfc3095_ctxt **const   persist_ctxt,
struct rohc_decomp_volat_ctxt *const   volat_ctxt,
rohc_trace_callback2_t  trace_cb,
void *const   trace_cb_priv,
const int  profile_id 
)

Create the RFC3095 volatile and persistent parts of the context.

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

Parameters:
context The decompression context
[out] persist_ctxt The persistent part of the decompression context
[out] volat_ctxt The volatile part of the decompression context
trace_cb The function to call for printing traces
trace_cb_priv An optional private context, may be NULL
profile_id The ID of the associated decompression profile
Returns:
true if the Uncompressed context was successfully created, false if a problem occurred
void rohc_decomp_rfc3095_destroy ( struct rohc_decomp_rfc3095_ctxt *const   rfc3095_ctxt,
const struct rohc_decomp_volat_ctxt *const   volat_ctxt 
)

Destroy the context.

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

Parameters:
rfc3095_ctxt The generic decompression context
volat_ctxt The volatile part of the decompression context
uint32_t rohc_decomp_rfc3095_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:
context The decompression context
Returns:
The reference SN value

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