ROHC compression/decompression library
|
ROHC ESP compression profile. More...
#include "rohc_comp_rfc3095.h"
#include "c_ip.h"
#include "rohc_traces_internal.h"
#include "crc.h"
#include "protocols/esp.h"
#include "rohc_utils.h"
#include <stdbool.h>
#include <string.h>
#include <assert.h>
Data Structures | |
struct | sc_esp_context |
Define the ESP part of the profile decompression context. More... | |
Functions | |
static bool | c_esp_create (struct rohc_comp_ctxt *const context, const struct net_pkt *const packet) |
Create a new ESP context and initialize it thanks to the given IP/ESP packet. More... | |
static bool | c_esp_check_profile (const struct rohc_comp *const comp, const struct net_pkt *const packet) |
Check if the given packet corresponds to the ESP profile. More... | |
static bool | c_esp_check_context (const struct rohc_comp_ctxt *const context, const struct net_pkt *const packet) |
Check if the IP/ESP packet belongs to the context. More... | |
static int | c_esp_encode (struct rohc_comp_ctxt *const context, const struct net_pkt *const uncomp_pkt, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len, rohc_packet_t *const packet_type, size_t *const payload_offset) |
Encode an IP/ESP packet according to a pattern decided by several different factors. More... | |
static uint32_t | c_esp_get_next_sn (const struct rohc_comp_ctxt *const context, const struct net_pkt *const uncomp_pkt) |
Determine the SN value for the next packet. More... | |
static size_t | esp_code_static_esp_part (const struct rohc_comp_ctxt *const context, const uint8_t *const next_header, uint8_t *const dest, const size_t counter) |
Build the static part of the ESP header. More... | |
static size_t | esp_code_dynamic_esp_part (const struct rohc_comp_ctxt *const context, const uint8_t *const next_header, uint8_t *const dest, const size_t counter) |
Build the dynamic part of the ESP header. More... | |
Variables | |
const struct rohc_comp_profile | c_esp_profile |
Define the compression part of the ESP profile as described in the RFC 3095. More... | |
ROHC ESP compression profile.
|
static |
Check if the IP/ESP packet belongs to the context.
Conditions are:
This function is one of the functions that must exist in one profile for the framework to work.
context | The compression context |
packet | The IP/UDP packet to check |
|
static |
Check if the given packet corresponds to the ESP profile.
Conditions are:
This function is one of the functions that must exist in one profile for the framework to work.
comp | The ROHC compressor |
packet | The packet to check |
|
static |
Create a new ESP context and initialize it thanks to the given IP/ESP packet.
This function is one of the functions that must exist in one profile for the framework to work.
context | The compression context |
packet | The IP/ESP packet given to initialize the new context |
|
static |
Encode an IP/ESP packet according to a pattern decided by several different factors.
context | The compression context |
uncomp_pkt | The uncompressed packet to encode |
rohc_pkt | OUT: The ROHC packet |
rohc_pkt_max_len | The maximum length of the ROHC packet |
packet_type | OUT: The type of ROHC packet that is created |
payload_offset | OUT: The offset for the payload in the IP packet |
|
static |
Determine the SN value for the next packet.
Profile SN is the ESP SN.
context | The compression context |
uncomp_pkt | The uncompressed packet to encode |
|
static |
Build the dynamic part of the ESP header.
Dynamic part of ESP header (5.7.7.7): +---+---+---+---+---+---+---+---+ 1 / Sequence Number / 4 octets +---+---+---+---+---+---+---+---+
context | The compression context |
next_header | The ESP header |
dest | The rohc-packet-under-build buffer |
counter | The current position in the rohc-packet-under-build buffer |
|
static |
Build the static part of the ESP header.
Static part of ESP header (5.7.7.7): +---+---+---+---+---+---+---+---+ 1 / SPI / 4 octets +---+---+---+---+---+---+---+---+ SPI = Security Parameters Index
context | The compression context |
next_header | The ESP header |
dest | The rohc-packet-under-build buffer |
counter | The current position in the rohc-packet-under-build buffer |
const struct rohc_comp_profile c_esp_profile |
Define the compression part of the ESP profile as described in the RFC 3095.