27 #ifndef ROHC_COMP_INTERNALS_H 28 #define ROHC_COMP_INTERNALS_H 46 #define C_NUM_PROFILES 7U 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 250 const struct net_pkt *
const packet)
251 __attribute__((warn_unused_result, nonnull(1, 2)));
259 __attribute__((warn_unused_result, nonnull(1, 2)));
266 __attribute__((nonnull(1)));
272 bool (*check_profile)(
const struct rohc_comp *
const comp,
273 const struct net_pkt *
const packet)
274 __attribute__((warn_unused_result, nonnull(1, 2)));
281 const struct net_pkt *
const packet,
282 size_t *
const cr_score)
283 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
299 const struct net_pkt *
const uncomp_pkt,
300 uint8_t *
const rohc_pkt,
301 const size_t rohc_pkt_max_len,
303 size_t *
const payload_offset)
304 __attribute__((warn_unused_result, nonnull(1, 2, 3, 5, 6)));
310 __attribute__((nonnull(1), warn_unused_result));
318 const uint8_t *
const packet,
319 const size_t packet_len,
320 const uint8_t *
const feedback_data,
321 const size_t feedback_data_len)
322 __attribute__((warn_unused_result, nonnull(1, 3, 5)));
424 __attribute__((nonnull(1)));
428 __attribute__((nonnull(1)));
432 __attribute__((nonnull(1)));
435 __attribute__((warn_unused_result, nonnull(1)));
438 const uint8_t *
const packet,
439 const size_t packet_len,
440 const uint8_t *
const feedback_data,
441 const size_t feedback_data_len,
443 uint32_t *
const sn_bits,
444 size_t *
const sn_bits_nr,
445 uint8_t crc_in_packet,
446 size_t crc_pos_from_end)
447 __attribute__((warn_unused_result, nonnull(1, 2, 4, 6, 7, 8)));
int total_last_uncompressed_size
Definition: rohc_comp_internals.h:409
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:288
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:193
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:339
rohc_mode_t
ROHC operation modes.
Definition: rohc.h:109
int connection_type
Definition: rohc_comp_internals.h:217
int header_last_uncompressed_size
Definition: rohc_comp_internals.h:413
int header_uncompressed_size
Definition: rohc_comp_internals.h:404
bool rohc_comp_reinit_context(struct rohc_comp_ctxt *const context)
Re-initialize the given context.
Definition: rohc_comp.c:2986
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:2838
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:243
The ROHC compressor.
Definition: rohc_comp_internals.h:129
int num_sent_packets
Definition: rohc_comp_internals.h:418
size_t num_contexts_used
Definition: rohc_comp_internals.h:140
uint64_t periodic_refreshes_fo_timeout_time
Definition: rohc_comp_internals.h:213
rohc_comp_random_cb_t random_cb
Definition: rohc_comp_internals.h:193
uint64_t latest_used
Definition: rohc_comp_internals.h:334
struct rohc_comp * compressor
Definition: rohc_comp_internals.h:342
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:224
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
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.
Definition: rohc_comp.c:3080
int total_compressed_size
Definition: rohc_comp_internals.h:402
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:379
The ROHC compression profile.
Definition: rohc_comp_internals.h:234
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:263
The ROHC compression context.
Definition: rohc_comp_internals.h:329
rohc_mode_t mode
Definition: rohc_comp_internals.h:356
const struct rohc_comp_profile * profile
Definition: rohc_comp_internals.h:345
int used
Definition: rohc_comp_internals.h:332
size_t rru_off
Definition: rohc_comp_internals.h:164
const rohc_profile_t id
Definition: rohc_comp_internals.h:237
void * specific
Definition: rohc_comp_internals.h:347
rohc_comp_state_t state
Definition: rohc_comp_internals.h:358
bool do_ctxt_replication
Definition: rohc_comp_internals.h:350
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:370
int total_last_compressed_size
Definition: rohc_comp_internals.h:411
int total_uncompressed_size
Definition: rohc_comp_internals.h:400
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:363
size_t fo_count
Definition: rohc_comp_internals.h:368
uint64_t first_used
Definition: rohc_comp_internals.h:336
rohc_comp_features_t
The different features of the ROHC compressor.
Definition: rohc_comp.h:225
rohc_comp_state_t
The different ROHC compressor states.
Definition: rohc_comp.h:82
size_t ir_count
Definition: rohc_comp_internals.h:366
rohc_trace_callback2_t trace_callback
Definition: rohc_comp_internals.h:222
Definition of ROHC packets and extensions.
int header_compressed_size
Definition: rohc_comp_internals.h:406
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:2873
int header_last_compressed_size
Definition: rohc_comp_internals.h:415
size_t list_trans_nr
Definition: rohc_comp_internals.h:219
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:391
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:81
size_t periodic_refreshes_ir_timeout_pkts
Definition: rohc_comp_internals.h:204
size_t cr_count
Definition: rohc_comp_internals.h:372
size_t periodic_refreshes_fo_timeout_pkts
Definition: rohc_comp_internals.h:210
rohc_cid_t cr_base_cid
Definition: rohc_comp_internals.h:352
rohc_feedback_type
Definition: feedback.h:42
rohc_profile_t
The different ROHC compression/decompression profiles.
Definition: rohc.h:210
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:207
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:2900
size_t mrru
Definition: rohc_comp_internals.h:215
#define ROHC_MAX_MRRU
Definition: rohc_comp_internals.h:159
ROHC feedback definitions and formats.
Internal ROHC macros and functions for traces.