ROHC compression/decompression library
Data Structures | Macros | Functions
rohc_comp_internals.h File Reference

Internal structures for ROHC compression. More...

#include "rohc_internal.h"
#include "rohc_traces_internal.h"
#include "rohc_packets.h"
#include "rohc_comp.h"
#include "schemes/comp_wlsb.h"
#include "net_pkt.h"
#include "feedback.h"
#include <stdbool.h>
Include dependency graph for rohc_comp_internals.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rohc_comp
 The ROHC compressor. More...
 
struct  rohc_comp_profile
 The ROHC compression profile. More...
 
struct  rohc_comp_ctxt
 The ROHC compression context. More...
 

Macros

#define C_NUM_PROFILES   7U
 
#define CHANGE_TO_IR_COUNT   1700
 
#define CHANGE_TO_FO_COUNT   700
 
#define MAX_IR_COUNT   3U
 
#define MAX_FO_COUNT   3U
 
#define ROHC_INIT_TS_STRIDE_MIN   3U
 
#define ROHC_LIST_DEFAULT_L   5U
 Default number of transmission for lists to become a reference list. More...
 
#define rohc_comp_warn(context, format, ...)
 
#define rohc_comp_debug(context, format, ...)
 
#define rohc_comp_dump_buf(context, descr, buf, buf_len)
 
#define ROHC_MAX_MRRU   65535
 

Functions

void rohc_comp_change_mode (struct rohc_comp_ctxt *const context, const rohc_mode_t new_mode)
 Change the mode of the context. More...
 
void rohc_comp_change_state (struct rohc_comp_ctxt *const context, const rohc_comp_state_t new_state)
 Change the state of the context. More...
 
void rohc_comp_periodic_down_transition (struct rohc_comp_ctxt *const context)
 Periodically change the context state after a certain number of packets. More...
 
bool rohc_comp_reinit_context (struct rohc_comp_ctxt *const context)
 Re-initialize the given context. More...
 
bool rohc_comp_feedback_parse_opts (const struct rohc_comp_ctxt *const context, const uint8_t *const packet, const size_t packet_len, const uint8_t *const feedback_data, const size_t feedback_data_len, size_t opts_present[ROHC_FEEDBACK_OPT_MAX], uint32_t *const sn_bits, size_t *const sn_bits_nr, uint8_t crc_in_packet, size_t crc_pos_from_end)
 Parse FEEDBACK-2 options. More...
 

Detailed Description

Internal structures for ROHC compression.

Author
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
Didier Barvaux didie.nosp@m.r@ba.nosp@m.rvaux.nosp@m..org

Macro Definition Documentation

#define C_NUM_PROFILES   7U

The number of ROHC profiles ready to be used

#define CHANGE_TO_FO_COUNT   700

The default maximal number of packets sent in > FO states (= SO state) before changing back the state to FO (periodic refreshes)

#define CHANGE_TO_IR_COUNT   1700

The default maximal number of packets sent in > IR states (= FO and SO states) before changing back the state to IR (periodic refreshes)

#define MAX_FO_COUNT   3U

The minimal number of packets that must be sent while in FO state before being able to switch to the SO state

#define MAX_IR_COUNT   3U

The minimal number of packets that must be sent while in IR state before being able to switch to the FO state

#define rohc_comp_debug (   context,
  format,
  ... 
)
Value:
rohc_debug((context)->compressor, ROHC_TRACE_COMP, \
(context)->profile->id, \
format, ##__VA_ARGS__)
Definition: rohc_traces.h:83
#define rohc_debug(entity_struct, entity, profile, format,...)
Definition: rohc_traces_internal.h:61

Print a debug trace for the given compression context

#define rohc_comp_dump_buf (   context,
  descr,
  buf,
  buf_len 
)
Value:
do { \
if(((context)->compressor->features & ROHC_COMP_FEATURE_DUMP_PACKETS) != 0) { \
rohc_dump_buf((context)->compressor->trace_callback, \
(context)->compressor->trace_callback_priv, \
descr, buf, buf_len); \
} \
} while(0)
Definition: rohc_traces.h:61
Definition: rohc_traces.h:83
Definition: rohc_comp.h:236
void rohc_dump_buf(const rohc_trace_callback2_t trace_cb, void *const trace_cb_priv, const rohc_trace_entity_t trace_entity, const rohc_trace_level_t trace_level, const char *const descr, const uint8_t *const packet, const size_t length)
Dump the content of the given buffer.
Definition: rohc_traces_internal.c:77

Dump a buffer for the given compression context

#define rohc_comp_warn (   context,
  format,
  ... 
)
Value:
rohc_warning((context)->compressor, ROHC_TRACE_COMP, \
(context)->profile->id, \
format, ##__VA_ARGS__)
Definition: rohc_traces.h:83
#define rohc_warning(entity_struct, entity, profile, format,...)
Definition: rohc_traces_internal.h:71

Print a warning trace for the given compression context

#define ROHC_INIT_TS_STRIDE_MIN   3U

The minimal number of packets that must be sent while in INIT_STRIDE state before being able to switch to the SEND_SCALED state

#define ROHC_LIST_DEFAULT_L   5U

Default number of transmission for lists to become a reference list.

The minimal number of times of compressed list shall be sent to become a reference list. L is the name specified in the RFC.

#define ROHC_MAX_MRRU   65535

The maximal value for MRRU

Function Documentation

void rohc_comp_change_mode ( struct rohc_comp_ctxt *const  context,
const rohc_mode_t  new_mode 
)

Change the mode of the context.

Parameters
contextThe compression context
new_modeThe new mode the context must enter in
void rohc_comp_change_state ( struct rohc_comp_ctxt *const  context,
const rohc_comp_state_t  new_state 
)

Change the state of the context.

Parameters
contextThe compression context
new_stateThe new state the context must enter in
bool rohc_comp_feedback_parse_opts ( const struct rohc_comp_ctxt *const  context,
const uint8_t *const  packet,
const size_t  packet_len,
const uint8_t *const  feedback_data,
const size_t  feedback_data_len,
size_t  opts_present[ROHC_FEEDBACK_OPT_MAX],
uint32_t *const  sn_bits,
size_t *const  sn_bits_nr,
uint8_t  crc_in_packet,
size_t  crc_pos_from_end 
)

Parse FEEDBACK-2 options.

Parameters
contextThe ROHC decompression context
packetThe whole feedback packet with CID bits
packet_lenThe length of the whole feedback packet with CID bits
feedback_dataThe feedback data without the CID bits
feedback_data_lenThe length of the feedback data without the CID bits
[out]opts_presentWhether options are present or not
[out]sn_bitsin: the SN bits collected in base header out: the SN bits collected in base header and options
[out]sn_bits_nrin: the number of SN bits collected in base header out: the number of SN bits collected in base header and options
crc_in_packetThe CRC of the feedback packet
crc_pos_from_endThe position of the CRC byte from the end of the feedback packet
Returns
true if feedback options were successfully parsed, false if feedback options were malformed or CRC is wrong
void rohc_comp_periodic_down_transition ( struct rohc_comp_ctxt *const  context)

Periodically change the context state after a certain number of packets.

Parameters
contextThe compression context
bool rohc_comp_reinit_context ( struct rohc_comp_ctxt *const  context)

Re-initialize the given context.

Make the context restart its initialization with decompressor, ie. it goes in the lowest compression state.

Parameters
contextThe compression context to re-initialize
Returns
true in case of success, false otherwise