ROHC compression/decompression library
Functions
c_tcp_replicate.c File Reference

Handle the replicate chain of the TCP compression profile. More...

#include "c_tcp_replicate.h"
#include "c_tcp_defines.h"
#include "schemes/rfc4996.h"
#include "protocols/ip_numbers.h"
#include "protocols/ip.h"
#include <assert.h>
Include dependency graph for c_tcp_replicate.c:

Functions

static int tcp_code_replicate_ipv4_part (const struct rohc_comp_ctxt *const context, ip_context_t *const ip_context, const struct ipv4_hdr *const ipv4, const bool is_innermost, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the replicate part of the IPv4 header. More...
 
static int tcp_code_replicate_ipv6_part (const struct rohc_comp_ctxt *const context, ip_context_t *const ip_context, const struct ipv6_hdr *const ipv6, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the replicate part of the IPv6 header. More...
 
static int tcp_code_replicate_ipv6_opt_part (const struct rohc_comp_ctxt *const context, const struct ipv6_opt *const ipv6_opt, const uint8_t protocol, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the replicate part of the IPv6 option header. More...
 
static int tcp_code_replicate_tcp_part (const struct rohc_comp_ctxt *const context, const struct tcphdr *const tcp, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the replicate part of the TCP header. More...
 
int tcp_code_replicate_chain (struct rohc_comp_ctxt *const context, const struct ip_packet *const ip, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len, size_t *const parsed_len)
 Code the replicate chain of an IR packet. More...
 

Detailed Description

Handle the replicate chain of the TCP compression profile.

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

Function Documentation

◆ tcp_code_replicate_chain()

int tcp_code_replicate_chain ( struct rohc_comp_ctxt *const  context,
const struct ip_packet *const  ip,
uint8_t *const  rohc_pkt,
const size_t  rohc_pkt_max_len,
size_t *const  parsed_len 
)

Code the replicate chain of an IR packet.

Parameters
contextThe compression context
ipThe outer IP header
rohc_pktOUT: The ROHC packet
rohc_pkt_max_lenThe maximum length of the ROHC packet
[out]parsed_lenThe length of uncompressed data parsed
Returns
The length of the ROHC packet if successful, -1 otherwise

◆ tcp_code_replicate_ipv4_part()

static int tcp_code_replicate_ipv4_part ( const struct rohc_comp_ctxt *const  context,
ip_context_t *const  ip_context,
const struct ipv4_hdr *const  ipv4,
const bool  is_innermost,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the replicate part of the IPv4 header.

Parameters
contextThe compression context
ip_contextThe specific IP compression context
ipv4The IPv4 header
is_innermosttrue if the IP header is the innermost of the packet, false otherwise
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error

◆ tcp_code_replicate_ipv6_opt_part()

static int tcp_code_replicate_ipv6_opt_part ( const struct rohc_comp_ctxt *const  context,
const struct ipv6_opt *const  ipv6_opt,
const uint8_t  protocol,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the replicate part of the IPv6 option header.

Parameters
contextThe compression context
ipv6_optThe IPv6 extension header
protocolThe protocol of the IPv6 extension header
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error

◆ tcp_code_replicate_ipv6_part()

static int tcp_code_replicate_ipv6_part ( const struct rohc_comp_ctxt *const  context,
ip_context_t *const  ip_context,
const struct ipv6_hdr *const  ipv6,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the replicate part of the IPv6 header.

Parameters
contextThe compression context
ip_contextThe specific IP compression context
ipv6The IPv6 header
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error

◆ tcp_code_replicate_tcp_part()

static int tcp_code_replicate_tcp_part ( const struct rohc_comp_ctxt *const  context,
const struct tcphdr *const  tcp,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the replicate part of the TCP header.

Parameters
contextThe compression context
tcpThe TCP header
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error