d_esp.c File Reference

ROHC ESP decompression profile. More...

#include "rohc_decomp_rfc3095.h"
#include "d_ip.h"
#include "rohc_traces_internal.h"
#include "rohc_debug.h"
#include "rohc_utils.h"
#include "crc.h"
#include "protocols/esp.h"
#include "schemes/decomp_wlsb.h"
#include <stdint.h>
#include <string.h>
#include <assert.h>
Include dependency graph for d_esp.c:

Data Structures

struct  d_esp_context
 Define the ESP part of the decompression profile context. More...

Functions

static bool d_esp_create (const struct rohc_decomp_ctxt *const context, struct rohc_decomp_rfc3095_ctxt **const persist_ctxt, struct rohc_decomp_volat_ctxt *const volat_ctxt)
 Create the ESP decompression context.
static void d_esp_destroy (struct rohc_decomp_rfc3095_ctxt *const rfc3095_ctxt, const struct rohc_decomp_volat_ctxt *const volat_ctxt)
 Destroy the context.
static int esp_parse_static_esp (const struct rohc_decomp_ctxt *const context, const uint8_t *packet, size_t length, struct rohc_extr_bits *const bits)
 Parse the ESP static part of the ROHC packet.
static int esp_parse_dynamic_esp (const struct rohc_decomp_ctxt *const context, const uint8_t *packet, const size_t length, struct rohc_extr_bits *const bits)
 Parse the ESP dynamic part of the ROHC packet.
static bool esp_decode_values_from_bits (const struct rohc_decomp_ctxt *context, const struct rohc_extr_bits *const bits, struct rohc_decoded_values *const decoded)
 Decode ESP values from extracted bits.
static int esp_build_uncomp_esp (const struct rohc_decomp_ctxt *const context, const struct rohc_decoded_values *const decoded, uint8_t *const dest, const unsigned int payload_len)
 Build an uncompressed ESP header.
static void esp_update_context (struct rohc_decomp_ctxt *const context, const struct rohc_decoded_values *const decoded)
 Update context with decoded ESP values.

Variables

struct rohc_decomp_profile d_esp_profile
 Define the decompression part of the ESP profile as described in the RFC 3095.

Detailed Description

ROHC ESP decompression profile.

Author:
FWX <rohc_team@dialine.fr>
Didier Barvaux <didier@barvaux.org>

Function Documentation

static bool d_esp_create ( const struct rohc_decomp_ctxt *const   context,
struct rohc_decomp_rfc3095_ctxt **const   persist_ctxt,
struct rohc_decomp_volat_ctxt *const   volat_ctxt 
) [static]

Create the ESP decompression 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
Returns:
true if the ESP context was successfully created, false if a problem occurred
static void d_esp_destroy ( struct rohc_decomp_rfc3095_ctxt *const   rfc3095_ctxt,
const struct rohc_decomp_volat_ctxt *const   volat_ctxt 
) [static]

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 persistent decompression context for the RFC3095 profiles
volat_ctxt The volatile decompression context
static int esp_build_uncomp_esp ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_decoded_values *const   decoded,
uint8_t *const   dest,
const unsigned int  payload_len 
) [static]

Build an uncompressed ESP header.

Parameters:
context The decompression context
decoded The values decoded from the ROHC header
dest The buffer to store the ESP header (MUST be at least of sizeof(struct esphdr) length)
payload_len The length of the ESP payload
Returns:
The length of the next header (ie. the ESP header), -1 in case of error
static bool esp_decode_values_from_bits ( const struct rohc_decomp_ctxt context,
const struct rohc_extr_bits *const   bits,
struct rohc_decoded_values *const   decoded 
) [static]

Decode ESP values from extracted bits.

The following values are decoded:

  • ESP SPI
Parameters:
context The decompression context
bits The extracted bits
decoded OUT: The corresponding decoded values
Returns:
true if decoding is successful, false otherwise
static int esp_parse_dynamic_esp ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *  packet,
const size_t  length,
struct rohc_extr_bits *const   bits 
) [static]

Parse the ESP dynamic part of the ROHC packet.

Parameters:
context The decompression context
packet The ROHC packet to decode
length The length of the ROHC packet
bits OUT: The bits extracted from the ROHC header
Returns:
The number of bytes read in the ROHC packet, -1 in case of failure
static int esp_parse_static_esp ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *  packet,
size_t  length,
struct rohc_extr_bits *const   bits 
) [static]

Parse the ESP static part of the ROHC packet.

Parameters:
context The decompression context
packet The ROHC packet to decode
length The length of the ROHC packet
bits OUT: The bits extracted from the ROHC header
Returns:
The number of bytes read in the ROHC packet, -1 in case of failure
static void esp_update_context ( struct rohc_decomp_ctxt *const   context,
const struct rohc_decoded_values *const   decoded 
) [static]

Update context with decoded ESP values.

The following decoded values are updated in context:

  • ESP SPI
Parameters:
context The decompression context
decoded The decoded values to update in the context

Variable Documentation

Initial value:

Define the decompression part of the ESP profile as described in the RFC 3095.


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