ROHC compression/decompression library
Functions
comp/schemes/tcp_sack.c File Reference

Handle encoding of TCP Selective ACKnowledgement (SACK) option. More...

#include "tcp_sack.h"
Include dependency graph for comp/schemes/tcp_sack.c:

Functions

static int c_tcp_sack_code_block (const struct rohc_comp_ctxt *const context, const uint32_t reference, const sack_block_t *const sack_block, uint8_t *const rohc_data, const size_t rohc_max_len)
 Compress one SACK block. More...
 
static int c_tcp_sack_code_pure_lsb (const struct rohc_comp_ctxt *const context, const uint32_t base, const uint32_t field, uint8_t *const rohc_data, const size_t rohc_max_len)
 Compress one SACK field value. More...
 
int c_tcp_opt_sack_code (const struct rohc_comp_ctxt *const context, const uint32_t ack_value, const sack_block_t *const sack_blocks, const uint8_t length, const bool is_unchanged, uint8_t *const rohc_data, const size_t rohc_max_len)
 Compress one TCP Selective ACKnowledgement (SACK) option. More...
 

Detailed Description

Handle encoding of TCP Selective ACKnowledgement (SACK) option.

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

Function Documentation

int c_tcp_opt_sack_code ( const struct rohc_comp_ctxt *const  context,
const uint32_t  ack_value,
const sack_block_t *const  sack_blocks,
const uint8_t  length,
const bool  is_unchanged,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)

Compress one TCP Selective ACKnowledgement (SACK) option.

See RFC6846 page 68 (and RFC2018 for Selective Acknowledgement option)

Parameters
contextThe compression context
ack_valueThe ack value
sack_blocksThe SACK blocks to compress
lengthThe length of the SACK blocks
is_unchangedWhether the SACK option is unchanged or not (only for irregular chain, use false for list item)
[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
static int c_tcp_sack_code_block ( const struct rohc_comp_ctxt *const  context,
const uint32_t  reference,
const sack_block_t *const  sack_block,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Compress one SACK block.

See RFC6846 page 68 (and RFC2018 for Selective Acknowledgement option)

Parameters
contextThe compression context
referenceThe reference value
sack_blockThe SACK block to compress
[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
static int c_tcp_sack_code_pure_lsb ( const struct rohc_comp_ctxt *const  context,
const uint32_t  base,
const uint32_t  field,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Compress one SACK field value.

See RFC6846 page 67 (and RFC2018 for Selective Acknowledgement option)

Parameters
contextThe compression context
baseThe base value
fieldThe value to compress
[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