27 #ifndef ROHC_COMP_INTERNALS_H 28 #define ROHC_COMP_INTERNALS_H 46 #define C_NUM_PROFILES 10U 50 #define CHANGE_TO_IR_COUNT 1700 54 #define CHANGE_TO_IR_TIME 1000U 58 #define CHANGE_TO_FO_COUNT 700 62 #define CHANGE_TO_FO_TIME 500U 66 #define MAX_IR_COUNT 3U 70 #define MAX_CR_COUNT MAX_IR_COUNT 74 #define MAX_FO_COUNT 3U 78 #define ROHC_INIT_TS_STRIDE_MIN 3U 86 #define ROHC_LIST_DEFAULT_L 5U 90 #define rohc_comp_warn(context, format, ...) \ 91 rohc_warning((context)->compressor, ROHC_TRACE_COMP, \ 92 (context)->profile->id, \ 93 format, ##__VA_ARGS__) 96 #define rohc_comp_debug(context, format, ...) \ 97 rohc_debug((context)->compressor, ROHC_TRACE_COMP, \ 98 (context)->profile->id, \ 99 format, ##__VA_ARGS__) 102 #define rohc_comp_dump_buf(context, descr, buf, buf_len) \ 104 if(((context)->compressor->features & ROHC_COMP_FEATURE_DUMP_PACKETS) != 0) { \ 105 rohc_dump_buf((context)->compressor->trace_callback, \ 106 (context)->compressor->trace_callback_priv, \ 107 ROHC_TRACE_COMP, ROHC_TRACE_DEBUG, \ 108 descr, buf, buf_len); \ 159 #define ROHC_MAX_MRRU 65535 253 const struct net_pkt *
const packet)
254 __attribute__((warn_unused_result, nonnull(1, 2)));
262 __attribute__((warn_unused_result, nonnull(1, 2)));
269 __attribute__((nonnull(1)));
275 bool (*check_profile)(
const struct rohc_comp *
const comp,
276 const struct net_pkt *
const packet)
277 __attribute__((warn_unused_result, nonnull(1, 2)));
284 const struct net_pkt *
const packet,
285 size_t *
const cr_score)
286 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
302 const struct net_pkt *
const uncomp_pkt,
303 uint8_t *
const rohc_pkt,
304 const size_t rohc_pkt_max_len,
306 size_t *
const payload_offset)
307 __attribute__((warn_unused_result, nonnull(1, 2, 3, 5, 6)));
315 const uint8_t *
const packet,
316 const size_t packet_len,
317 const uint8_t *
const feedback_data,
318 const size_t feedback_data_len)
319 __attribute__((warn_unused_result, nonnull(1, 3, 5)));
421 __attribute__((nonnull(1)));
425 __attribute__((nonnull(1)));
429 __attribute__((nonnull(1)));
432 __attribute__((warn_unused_result, nonnull(1)));
435 const uint8_t *
const packet,
436 const size_t packet_len,
437 const uint8_t *
const feedback_data,
438 const size_t feedback_data_len,
440 uint32_t *
const sn_bits,
441 size_t *
const sn_bits_nr,
443 uint8_t crc_in_packet,
444 size_t crc_pos_from_end)
445 __attribute__((warn_unused_result, nonnull(1, 2, 4, 6, 7, 8)));
int total_last_uncompressed_size
Definition: rohc_comp_internals.h:406
rohc_reordering_offset_t reorder_ratio
Definition: rohc_comp_internals.h:204
int(* rohc_comp_random_cb_t)(const struct rohc_comp *const comp, void *const user_context)
The prototype of the callback for random numbers.
Definition: rohc_comp.h:289
struct rohc_comp_ctxt * contexts
Definition: rohc_comp_internals.h:138
void * random_cb_ctxt
Definition: rohc_comp_internals.h:195
size_t rohc_cid_t
Definition: rohc.h:195
int total_compressed_size
Definition: rohc_comp_internals.h:184
rohc_comp_features_t features
Definition: rohc_comp_internals.h:135
rohc_cid_t cid
Definition: rohc_comp_internals.h:336
rohc_reordering_offset_t
The different values of reordering offset.
Definition: rohc.h:203
rohc_mode_t
ROHC operation modes.
Definition: rohc.h:111
int connection_type
Definition: rohc_comp_internals.h:220
int header_last_uncompressed_size
Definition: rohc_comp_internals.h:410
int header_uncompressed_size
Definition: rohc_comp_internals.h:401
bool rohc_comp_reinit_context(struct rohc_comp_ctxt *const context)
Re-initialize the given context.
Definition: rohc_comp.c:3125
uint8_t crc_table_7[256]
Definition: rohc_comp_internals.h:151
void rohc_comp_change_mode(struct rohc_comp_ctxt *const context, const rohc_mode_t new_mode)
Change the mode of the context.
Definition: rohc_comp.c:2977
ROHC compression routines.
const unsigned short protocol
The IP protocol ID used to find out which profile is able to compress an IP packet.
Definition: rohc_comp_internals.h:246
The ROHC compressor.
Definition: rohc_comp_internals.h:129
int num_sent_packets
Definition: rohc_comp_internals.h:415
size_t num_contexts_used
Definition: rohc_comp_internals.h:140
uint64_t periodic_refreshes_fo_timeout_time
Definition: rohc_comp_internals.h:216
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, const rohc_feedback_crc_t crc_type, uint8_t crc_in_packet, size_t crc_pos_from_end)
Parse FEEDBACK-2 options.
Definition: rohc_comp.c:3224
rohc_comp_random_cb_t random_cb
Definition: rohc_comp_internals.h:193
uint64_t latest_used
Definition: rohc_comp_internals.h:331
struct rohc_comp * compressor
Definition: rohc_comp_internals.h:339
Network packet (may contains several IP headers)
struct rohc_comp_ctxt * last_context
Definition: rohc_comp_internals.h:187
void * trace_callback_priv
Definition: rohc_comp_internals.h:227
void(* rohc_trace_callback2_t)(void *const priv_ctxt, const rohc_trace_level_t level, const rohc_trace_entity_t entity, const int profile, const char *const format,...)
The function prototype for the trace callback.
Definition: rohc_traces.h:118
int total_compressed_size
Definition: rohc_comp_internals.h:399
Window-based Least Significant Bits (W-LSB) encoding.
size_t go_back_fo_count
The number of packet sent while in SO state, used for the periodic refreshes of the context...
Definition: rohc_comp_internals.h:376
The ROHC compression profile.
Definition: rohc_comp_internals.h:237
struct rohc_medium medium
Definition: rohc_comp_internals.h:132
rohc_rtp_detection_callback_t rtp_callback
Definition: rohc_comp_internals.h:172
size_t wlsb_window_width
Definition: rohc_comp_internals.h:201
bool(* rohc_rtp_detection_callback_t)(const unsigned char *const ip, const unsigned char *const udp, const unsigned char *const payload, const unsigned int payload_size, void *const rtp_private)
The prototype of the RTP detection callback.
Definition: rohc_comp.h:264
The ROHC compression context.
Definition: rohc_comp_internals.h:326
rohc_mode_t mode
Definition: rohc_comp_internals.h:353
const struct rohc_comp_profile * profile
Definition: rohc_comp_internals.h:342
int used
Definition: rohc_comp_internals.h:329
size_t rru_off
Definition: rohc_comp_internals.h:164
const rohc_profile_t id
Definition: rohc_comp_internals.h:240
void * specific
Definition: rohc_comp_internals.h:344
rohc_comp_state_t state
Definition: rohc_comp_internals.h:355
bool do_ctxt_replication
Definition: rohc_comp_internals.h:347
size_t rru_len
Definition: rohc_comp_internals.h:166
int total_uncompressed_size
Definition: rohc_comp_internals.h:182
size_t so_count
Definition: rohc_comp_internals.h:367
int total_last_compressed_size
Definition: rohc_comp_internals.h:408
int total_uncompressed_size
Definition: rohc_comp_internals.h:397
bool enabled_profiles[C_NUM_PROFILES]
Definition: rohc_comp_internals.h:143
#define C_NUM_PROFILES
Definition: rohc_comp_internals.h:46
uint8_t crc_table_3[256]
Definition: rohc_comp_internals.h:149
A timestamp for the ROHC library.
Definition: rohc_time.h:51
rohc_packet_t packet_type
Definition: rohc_comp_internals.h:360
size_t fo_count
Definition: rohc_comp_internals.h:365
uint64_t first_used
Definition: rohc_comp_internals.h:333
rohc_comp_features_t
The different features of the ROHC compressor.
Definition: rohc_comp.h:226
rohc_comp_state_t
The different ROHC compressor states.
Definition: rohc_comp.h:83
size_t ir_count
Definition: rohc_comp_internals.h:363
rohc_trace_callback2_t trace_callback
Definition: rohc_comp_internals.h:225
Definition of ROHC packets and extensions.
int header_compressed_size
Definition: rohc_comp_internals.h:403
void rohc_comp_change_state(struct rohc_comp_ctxt *const context, const rohc_comp_state_t new_state)
Change the state of the context.
Definition: rohc_comp.c:3012
int header_last_compressed_size
Definition: rohc_comp_internals.h:412
size_t list_trans_nr
Definition: rohc_comp_internals.h:222
void * rtp_private
Definition: rohc_comp_internals.h:174
size_t go_back_ir_count
The number of packet sent while in FO or SO state, used for the periodic refreshes of the context...
Definition: rohc_comp_internals.h:388
ROHC medium (CID characteristics)
Definition: rohc_internal.h:146
int num_packets
Definition: rohc_comp_internals.h:180
ROHC private common definitions and routines.
Definition: feedback.h:95
size_t periodic_refreshes_ir_timeout_pkts
Definition: rohc_comp_internals.h:207
size_t cr_count
Definition: rohc_comp_internals.h:369
size_t periodic_refreshes_fo_timeout_pkts
Definition: rohc_comp_internals.h:213
rohc_cid_t cr_base_cid
Definition: rohc_comp_internals.h:349
rohc_feedback_type
Definition: feedback.h:42
rohc_profile_t
The different ROHC compression/decompression profiles.
Definition: rohc_profiles.h:70
uint8_t crc_table_8[256]
Definition: rohc_comp_internals.h:153
uint8_t rru[ROHC_MAX_MRRU]
Definition: rohc_comp_internals.h:162
uint64_t periodic_refreshes_ir_timeout_time
Definition: rohc_comp_internals.h:210
rohc_packet_t
The different types of ROHC packets.
Definition: rohc_packets.h:55
void rohc_comp_periodic_down_transition(struct rohc_comp_ctxt *const context, const struct rohc_ts pkt_time)
Periodically change the context state after a certain number of packets.
Definition: rohc_comp.c:3039
size_t mrru
Definition: rohc_comp_internals.h:218
#define ROHC_MAX_MRRU
Definition: rohc_comp_internals.h:159
ROHC feedback definitions and formats.
rohc_feedback_crc_t
Whether the feedback is protected by a CRC or not.
Definition: feedback.h:62
Internal ROHC macros and functions for traces.