ROHC compression/decompression library
Functions
c_tcp_static.c File Reference

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

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

Functions

static int tcp_code_static_ipv4_part (const struct rohc_comp_ctxt *const context, const struct ipv4_hdr *const ipv4, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the static part of the IPv4 header. More...
 
static int tcp_code_static_ipv6_part (const struct rohc_comp_ctxt *const context, const struct ipv6_hdr *const ipv6, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the static part of the IPv6 header. More...
 
static int tcp_code_static_ipv6_opt_part (const struct rohc_comp_ctxt *const context, const struct rohc_pkt_ip_ext_hdr *const ext, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the static part of the IPv6 option header. More...
 
static int tcp_code_static_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 static part of the TCP header. More...
 
int tcp_code_static_part (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)
 Code the static part of an IR packet. More...
 

Detailed Description

Handle the static chain of the TCP compression profile.

Author
FWX rohc_.nosp@m.team.nosp@m.@dial.nosp@m.ine..nosp@m.fr
Didier Barvaux didie.nosp@m.r@ba.nosp@m.rvaux.nosp@m..org
Didier Barvaux didie.nosp@m.r.ba.nosp@m.rvaux.nosp@m.@tou.nosp@m.louse.nosp@m..viv.nosp@m.eris..nosp@m.com

Function Documentation

◆ tcp_code_static_ipv4_part()

static int tcp_code_static_ipv4_part ( const struct rohc_comp_ctxt *const  context,
const struct ipv4_hdr *const  ipv4,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the static part of the IPv4 header.

Parameters
contextThe compression context
ipv4The IPv4 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_static_ipv6_opt_part()

static int tcp_code_static_ipv6_opt_part ( const struct rohc_comp_ctxt *const  context,
const struct rohc_pkt_ip_ext_hdr *const  ext,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the static part of the IPv6 option header.

Parameters
contextThe compression context
extThe 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_static_ipv6_part()

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

Build the static part of the IPv6 header.

Parameters
contextThe 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_static_part()

int tcp_code_static_part ( 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 
)

Code the static part of an IR packet.

Parameters
contextThe compression context
uncomp_pkt_hdrsThe uncompressed headers to encode
rohc_pktOUT: The ROHC packet
rohc_pkt_max_lenThe maximum length of the ROHC packet
Returns
The length of the ROHC packet if successful, -1 otherwise

◆ tcp_code_static_tcp_part()

static int tcp_code_static_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 static part of the TCP header.

 Static part of TCP header:

    +---+---+---+---+---+---+---+---+
 1  /  Source port                  /   2 octets
    +---+---+---+---+---+---+---+---+
 2  /  Destination port             /   2 octets
    +---+---+---+---+---+---+---+---+
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