ROHC compression/decompression library
Functions
decomp_list_ipv6.c File Reference

ROHC list decompression of IPv6 extension headers. More...

#include "schemes/decomp_list_ipv6.h"
#include "rohc_traces_internal.h"
#include <string.h>
Include dependency graph for decomp_list_ipv6.c:

Functions

static bool check_ip6_item (const struct list_decomp *const decomp, const size_t index_table)
 Check if the item is correct in IPv6 table. More...
 
static int get_ip6_ext_size (const uint8_t *data, const size_t data_len)
 Get the size (in bytes) of the extension. More...
 
static bool cmp_ipv6_ext (const struct rohc_list_item *const item, const uint8_t ext_type, const uint8_t *const ext_data, const size_t ext_len)
 Compare two IPv6 items. More...
 
static bool create_ip6_item (const uint8_t *const data, const size_t length, const size_t index_table, struct list_decomp *const decomp)
 Create an IPv6 item extension list. More...
 
static size_t rohc_build_ip6_extension (const struct list_decomp *const decomp, const uint8_t ip_nh_type, uint8_t *const dest)
 Build an extension list in IPv6 header. More...
 
void rohc_decomp_list_ipv6_new (struct list_decomp *const decomp, rohc_trace_callback2_t trace_cb, void *const trace_cb_priv, const int profile_id)
 Create one context for decompressing lists of IPv6 extension headers. More...
 
void rohc_decomp_list_ipv6_free (struct list_decomp *const decomp)
 Free one context for decompressing lists of IPv6 extension headers. More...
 

Detailed Description

ROHC list decompression of IPv6 extension headers.

Author
Didier Barvaux didie.nosp@m.r@ba.nosp@m.rvaux.nosp@m..org

Function Documentation

static bool check_ip6_item ( const struct list_decomp *const  decomp,
const size_t  index_table 
)
static

Check if the item is correct in IPv6 table.

Parameters
decompThe list decompressor
index_tableThe index of the item to check the presence
Returns
true if item is found, false if not
static bool cmp_ipv6_ext ( const struct rohc_list_item *const  item,
const uint8_t  ext_type,
const uint8_t *const  ext_data,
const size_t  ext_len 
)
static

Compare two IPv6 items.

Parameters
itemThe IPv6 item to compare
ext_typeThe IPv6 Next Header type
ext_dataThe IPv6 extension context
ext_lenThe length (in bytes) of the IPv6 extension context
Returns
true if the two items are equal, false if they are different
static bool create_ip6_item ( const uint8_t *const  data,
const size_t  length,
const size_t  index_table,
struct list_decomp *const  decomp 
)
static

Create an IPv6 item extension list.

Parameters
dataThe data in the item
lengthThe length of the item
index_tableThe index of the item in based table
decompThe list decompressor
Returns
true in case of success, false otherwise
static int get_ip6_ext_size ( const uint8_t *  data,
const size_t  data_len 
)
static

Get the size (in bytes) of the extension.

Parameters
dataThe extension data
data_lenThe length (in bytes) of the extension data
Returns
The size of the extension in case of success, -1 otherwise
static size_t rohc_build_ip6_extension ( const struct list_decomp *const  decomp,
const uint8_t  ip_nh_type,
uint8_t *const  dest 
)
static

Build an extension list in IPv6 header.

Parameters
decompThe list decompressor
ip_nh_typeThe Next Header value of the base IPv6 header
destThe buffer to store the IPv6 header
Returns
The size of the list
void rohc_decomp_list_ipv6_free ( struct list_decomp *const  decomp)

Free one context for decompressing lists of IPv6 extension headers.

Parameters
decompThe context to destroy
void rohc_decomp_list_ipv6_new ( struct list_decomp *const  decomp,
rohc_trace_callback2_t  trace_cb,
void *const  trace_cb_priv,
const int  profile_id 
)

Create one context for decompressing lists of IPv6 extension headers.

Parameters
decompThe context to create
trace_cbThe function to call for printing traces
trace_cb_privAn optional private context, may be NULL
profile_idThe ID of the associated decompression profile