27 #ifndef ROHC_COMP_INTERNALS_H 
   28 #define ROHC_COMP_INTERNALS_H 
   39 #  include <linux/types.h> 
   50 #define C_NUM_PROFILES 7U 
   54 #define CHANGE_TO_IR_COUNT  1700 
   58 #define CHANGE_TO_FO_COUNT  700 
   62 #define MAX_IR_COUNT  3U 
   66 #define MAX_FO_COUNT  3U 
   70 #define ROHC_INIT_TS_STRIDE_MIN  3U 
   78 #define ROHC_LIST_DEFAULT_L  5U 
   82 #define rohc_comp_warn(context, format, ...) \ 
   83         rohc_warning((context)->compressor, ROHC_TRACE_COMP, \ 
   84                      (context)->profile->id, \ 
   85                      format, ##__VA_ARGS__) 
   88 #define rohc_comp_debug(context, format, ...) \ 
   89         rohc_debug((context)->compressor, ROHC_TRACE_COMP, \ 
   90                    (context)->profile->id, \ 
   91                    format, ##__VA_ARGS__) 
   94 #define rohc_comp_dump_buf(context, descr, buf, buf_len) \ 
   96                 if(((context)->compressor->features & ROHC_COMP_FEATURE_DUMP_PACKETS) != 0) { \ 
   97                         rohc_dump_buf((context)->compressor->trace_callback, \ 
   98                                       (context)->compressor->trace_callback_priv, \ 
   99                                       ROHC_TRACE_COMP, ROHC_TRACE_DEBUG, \ 
  100                                       descr, buf, buf_len); \ 
  151 #define ROHC_MAX_MRRU 65535 
  236                        const struct net_pkt *
const packet)
 
  237                 __attribute__((warn_unused_result, nonnull(1, 2)));
 
  244                 __attribute__((nonnull(1)));
 
  251                               const struct net_pkt *
const packet)
 
  252                 __attribute__((warn_unused_result, nonnull(1, 2)));
 
  259                               const struct net_pkt *
const packet)
 
  260                 __attribute__((warn_unused_result, nonnull(1, 2)));
 
  276                       const struct net_pkt *
const uncomp_pkt,
 
  277                       uint8_t *
const rohc_pkt,
 
  278                       const size_t rohc_pkt_max_len,
 
  280                       size_t *
const payload_offset)
 
  281                 __attribute__((warn_unused_result, nonnull(1, 2, 3, 5, 6)));
 
  287                 __attribute__((nonnull(1), warn_unused_result));
 
  295                          const uint8_t *
const packet,
 
  296                          const size_t packet_len,
 
  297                          const uint8_t *
const feedback_data,
 
  298                          const size_t feedback_data_len)
 
  299                 __attribute__((warn_unused_result, nonnull(1, 3, 5)));
 
  385         __attribute__((nonnull(1)));
 
  389         __attribute__((nonnull(1)));
 
  392         __attribute__((nonnull(1)));
 
  395         __attribute__((warn_unused_result, nonnull(1)));
 
  398                                    const uint8_t *
const packet,
 
  399                                    const size_t packet_len,
 
  400                                    const uint8_t *
const feedback_data,
 
  401                                    const size_t feedback_data_len,
 
  403                                    uint32_t *
const sn_bits,
 
  404                                    size_t *
const sn_bits_nr,
 
  405                                    uint8_t crc_in_packet,
 
  406                                    size_t crc_pos_from_end)
 
  407         __attribute__((warn_unused_result, nonnull(1, 2, 4, 6, 7, 8)));
 
int total_last_uncompressed_size
Definition: rohc_comp_internals.h:370
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
void(* destroy)(struct rohc_comp_ctxt *const context)
The handler used to destroy the profile-specific part of the compression context. ...
Definition: rohc_comp_internals.h:243
size_t periodic_refreshes_ir_timeout
Definition: rohc_comp_internals.h:196
rohc_ctxt_key_t key
Definition: rohc_comp_internals.h:319
struct rohc_comp_ctxt * contexts
Definition: rohc_comp_internals.h:130
void * random_cb_ctxt
Definition: rohc_comp_internals.h:187
size_t rohc_cid_t
Definition: rohc.h:195
int total_compressed_size
Definition: rohc_comp_internals.h:176
rohc_comp_features_t features
Definition: rohc_comp_internals.h:127
rohc_cid_t cid
Definition: rohc_comp_internals.h:316
rohc_mode_t
ROHC operation modes. 
Definition: rohc.h:111
int connection_type
Definition: rohc_comp_internals.h:203
int header_last_uncompressed_size
Definition: rohc_comp_internals.h:374
int header_uncompressed_size
Definition: rohc_comp_internals.h:365
bool rohc_comp_reinit_context(struct rohc_comp_ctxt *const context)
Re-initialize the given context. 
Definition: rohc_comp.c:2694
uint8_t crc_table_7[256]
Definition: rohc_comp_internals.h:143
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:2585
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:229
The ROHC compressor. 
Definition: rohc_comp_internals.h:121
int num_sent_packets
Definition: rohc_comp_internals.h:379
size_t num_contexts_used
Definition: rohc_comp_internals.h:132
rohc_comp_random_cb_t random_cb
Definition: rohc_comp_internals.h:185
uint64_t latest_used
Definition: rohc_comp_internals.h:311
struct rohc_comp * compressor
Definition: rohc_comp_internals.h:322
Network packet (may contains several IP headers) 
struct rohc_comp_ctxt * last_context
Definition: rohc_comp_internals.h:179
void * trace_callback_priv
Definition: rohc_comp_internals.h:210
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:2788
int total_compressed_size
Definition: rohc_comp_internals.h:363
bool(* feedback)(struct rohc_comp_ctxt *const context, const enum rohc_feedback_type feedback_type, const uint8_t *const packet, const size_t packet_len, const uint8_t *const feedback_data, const size_t feedback_data_len)
The handler used to warn the profile-specific part of the context about the arrival of feedback data...
Definition: rohc_comp_internals.h:293
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:352
The ROHC compression profile. 
Definition: rohc_comp_internals.h:220
struct rohc_medium medium
Definition: rohc_comp_internals.h:124
int(* encode)(struct rohc_comp_ctxt *const context, const struct net_pkt *const uncomp_pkt, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len, rohc_packet_t *const packet_type, size_t *const payload_offset)
The handler used to encode uncompressed IP packets. 
Definition: rohc_comp_internals.h:275
void rohc_comp_periodic_down_transition(struct rohc_comp_ctxt *const context)
Periodically change the context state after a certain number of packets. 
Definition: rohc_comp.c:2647
rohc_rtp_detection_callback_t rtp_callback
Definition: rohc_comp_internals.h:164
size_t wlsb_window_width
Definition: rohc_comp_internals.h:193
uint32_t rohc_ctxt_key_t
Definition: net_pkt.h:35
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:306
rohc_mode_t mode
Definition: rohc_comp_internals.h:331
const struct rohc_comp_profile * profile
Definition: rohc_comp_internals.h:325
int used
Definition: rohc_comp_internals.h:309
size_t rru_off
Definition: rohc_comp_internals.h:156
const rohc_profile_t id
Definition: rohc_comp_internals.h:223
void * specific
Definition: rohc_comp_internals.h:327
rohc_comp_state_t state
Definition: rohc_comp_internals.h:333
size_t rru_len
Definition: rohc_comp_internals.h:158
int total_uncompressed_size
Definition: rohc_comp_internals.h:174
size_t so_count
Definition: rohc_comp_internals.h:345
int total_last_compressed_size
Definition: rohc_comp_internals.h:372
bool(* reinit_context)(struct rohc_comp_ctxt *const context)
The handler used to re-initialize a context. 
Definition: rohc_comp_internals.h:286
int total_uncompressed_size
Definition: rohc_comp_internals.h:361
bool(* check_context)(const struct rohc_comp_ctxt *const context, const struct net_pkt *const packet)
The handler used to check whether an uncompressed IP packet belongs to a context or not...
Definition: rohc_comp_internals.h:258
bool enabled_profiles[C_NUM_PROFILES]
Definition: rohc_comp_internals.h:135
#define C_NUM_PROFILES
Definition: rohc_comp_internals.h:50
uint8_t crc_table_3[256]
Definition: rohc_comp_internals.h:141
rohc_packet_t packet_type
Definition: rohc_comp_internals.h:338
size_t fo_count
Definition: rohc_comp_internals.h:343
uint64_t first_used
Definition: rohc_comp_internals.h:313
rohc_comp_features_t
The different features of the ROHC compressor. 
Definition: rohc_comp.h:227
rohc_comp_state_t
The different ROHC compressor states. 
Definition: rohc_comp.h:86
size_t ir_count
Definition: rohc_comp_internals.h:341
rohc_trace_callback2_t trace_callback
Definition: rohc_comp_internals.h:208
Definition of ROHC packets and extensions. 
int header_compressed_size
Definition: rohc_comp_internals.h:367
bool(* create)(struct rohc_comp_ctxt *const context, const struct net_pkt *const packet)
The handler used to create the profile-specific part of the compression context. 
Definition: rohc_comp_internals.h:235
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:2621
int header_last_compressed_size
Definition: rohc_comp_internals.h:376
bool(* check_profile)(const struct rohc_comp *const comp, const struct net_pkt *const packet)
The handler used to check whether an uncompressed IP packet fits the current profile or not...
Definition: rohc_comp_internals.h:250
size_t list_trans_nr
Definition: rohc_comp_internals.h:205
void * rtp_private
Definition: rohc_comp_internals.h:166
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:358
ROHC medium (CID characteristics) 
Definition: rohc_internal.h:124
int num_packets
Definition: rohc_comp_internals.h:172
ROHC private common definitions and routines. 
Definition: feedback.h:81
rohc_feedback_type
Definition: feedback.h:42
rohc_profile_t
The different ROHC compression/decompression profiles. 
Definition: rohc.h:212
uint8_t crc_table_8[256]
Definition: rohc_comp_internals.h:145
uint8_t rru[ROHC_MAX_MRRU]
Definition: rohc_comp_internals.h:154
size_t periodic_refreshes_fo_timeout
Definition: rohc_comp_internals.h:199
rohc_packet_t
The different types of ROHC packets. 
Definition: rohc_packets.h:49
size_t mrru
Definition: rohc_comp_internals.h:201
#define ROHC_MAX_MRRU
Definition: rohc_comp_internals.h:151
ROHC feedback definitions and formats. 
Internal ROHC macros and functions for traces.