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>
◆ c_esp_create()
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.
- Parameters
-
context | The compression context |
uncomp_pkt_hdrs | The uncompressed headers to initialize the new context |
- Returns
- true if successful, false otherwise
◆ c_esp_get_next_sn()
Determine the SN value for the next packet.
Profile SN is the ESP SN.
- Parameters
-
context | The compression context |
uncomp_pkt_hdrs | The uncompressed headers to encode |
- Returns
- The SN
◆ esp_code_dynamic_esp_part()
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 |
|
) |
| |
|
static |
Build the dynamic part of the ESP header.
Dynamic part of ESP header (5.7.7.7):
+---+---+---+---+---+---+---+---+
1 / Sequence Number / 4 octets
+---+---+---+---+---+---+---+---+
- Parameters
-
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 |
- Returns
- The new position in the rohc-packet-under-build buffer
◆ esp_code_static_esp_part()
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 |
|
) |
| |
|
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
- Parameters
-
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 |
- Returns
- The new position in the rohc-packet-under-build buffer
◆ c_esp_profile
Initial value:=
{
}
void rohc_comp_rfc3095_destroy(struct rohc_comp_ctxt *const context)
Destroy the context.
Definition: rohc_comp_rfc3095.c:649
int rohc_comp_rfc3095_encode(struct rohc_comp_ctxt *const context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len, rohc_packet_t *const packet_type)
Encode an IP packet according to a pattern decided by several different factors.
Definition: rohc_comp_rfc3095.c:691
bool rohc_comp_rfc3095_feedback(struct rohc_comp_ctxt *const context, const enum rohc_feedback_type feedback_type, const uint8_t *const packet, const size_t packet_len, const uint8_t *const feedback_data, const size_t feedback_data_len)
Update the profile when feedback is received.
Definition: rohc_comp_rfc3095.c:756
static bool c_esp_create(struct rohc_comp_ctxt *const context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs)
Create a new ESP context and initialize it thanks to the given IP/ESP packet.
Definition: c_esp.c:80
Definition: rohc_profiles.h:91
Define the compression part of the ESP profile as described in the RFC 3095.