ROHC compression/decompression library
Data Structures | Functions | Variables
c_esp.c File Reference

ROHC ESP compression profile. More...

#include "c_esp.h"
#include "c_generic.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>
Include dependency graph for c_esp.c:

Data Structures

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

Functions

bool c_esp_check_profile (const struct rohc_comp *const comp, const struct ip_packet *const outer_ip, const struct ip_packet *const inner_ip, const uint8_t protocol, rohc_ctxt_key_t *const ctxt_key)
 Check if the given packet corresponds to the ESP profile.

Variables

struct c_profile c_esp_profile
 Define the compression part of the ESP profile as described in the RFC 3095.

Detailed Description

ROHC ESP compression profile.

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

Function Documentation

bool c_esp_check_profile ( const struct rohc_comp *const  comp,
const struct ip_packet *const  outer_ip,
const struct ip_packet *const  inner_ip,
const uint8_t  protocol,
rohc_ctxt_key_t *const  ctxt_key 
)

Check if the given packet corresponds to the ESP profile.

Conditions are:

  • the transport protocol is ESP
  • the version of the outer IP header is 4 or 6
  • the outer IP header is not an IP fragment
  • if there are at least 2 IP headers, the version of the inner IP header is 4 or 6
  • if there are at least 2 IP headers, the inner IP header is not an IP fragment
See also:
c_generic_check_profile

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

Parameters:
compThe ROHC compressor
outer_ipThe outer IP header of the IP packet to check
inner_ip
  • The inner IP header of the IP packet to check if the IP packet contains at least 2 IP headers,
  • NULL if the IP packet to check contains only one IP header
protocolThe transport protocol carried by the IP packet:
  • the protocol carried by the outer IP header if there is only one IP header,
  • the protocol carried by the inner IP header if there are at least two IP headers.
ctxt_keyThe key to help finding the context associated with packet
Returns:
Whether the IP packet corresponds to the profile:
  • true if the IP packet corresponds to the profile,
  • false if the IP packet does not correspond to the profile

References c_generic_check_profile(), ip_get_next_layer(), ip_get_plen(), ROHC_IPPROTO_ESP, and esphdr::spi.


Variable Documentation

Initial value:

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