29 #ifndef ROHC_COMP_RFC3095_H    30 #define ROHC_COMP_RFC3095_H   251                 __attribute__((warn_unused_result, 
nonnull(1, 2)));
   255                 __attribute__((warn_unused_result, 
nonnull(1)));
   258                 __attribute__((warn_unused_result, 
nonnull(1)));
   262                 __attribute__((warn_unused_result, 
nonnull(1)));
   267                 __attribute__((warn_unused_result, 
nonnull(1, 2)));
   272                                    const uint8_t *
const next_header,
   274                                    const size_t counter)
   275                 __attribute__((warn_unused_result, 
nonnull(1, 2, 3)));
   280                                     const uint8_t *
const next_header,
   282                                     const size_t counter)
   283                 __attribute__((warn_unused_result, 
nonnull(1, 2, 3)));
   289                                  const size_t dest_max_len,
   290                                  const size_t counter)
   291                 __attribute__((warn_unused_result, 
nonnull(1, 2)));
   296                                     const uint8_t *
const next_header,
   298                                     const size_t counter)
   299                 __attribute__((warn_unused_result, 
nonnull(1, 2, 3)));
   304                                       const uint8_t init_val)
   305                 __attribute__((
nonnull(1), warn_unused_result));
   310                                        const uint8_t init_val)
   311                 __attribute__((
nonnull(1), warn_unused_result));
   324         __attribute__((warn_unused_result, 
nonnull(1, 2)));
   331         __attribute__((warn_unused_result, 
nonnull(1)));
   335                              uint8_t *
const rohc_pkt,
   336                              const size_t rohc_pkt_max_len,
   338         __attribute__((warn_unused_result, 
nonnull(1, 2, 3, 5)));
   342                                 const uint8_t *
const packet,
   343                                 const size_t packet_len,
   344                                 const uint8_t *
const feedback_data,
   345                                 const size_t feedback_data_len)
   346         __attribute__((warn_unused_result, 
nonnull(1, 3, 5)));
   349                         bool *
const innermost_ip_id_changed,
   350                         bool *
const innermost_ip_id_3bits_possible,
   351                         bool *
const innermost_ip_id_5bits_possible,
   352                         bool *
const innermost_ip_id_8bits_possible,
   353                         bool *
const innermost_ip_id_11bits_possible,
   354                         bool *
const outermost_ip_id_changed,
   355                         bool *
const outermost_ip_id_11bits_possible)
   356         __attribute__((
nonnull(1, 2, 3, 4, 5, 6, 7, 8)));
   367         size_t nr_ipv4_non_rnd = 0;
   370         for(ip_hdr_pos = 0; ip_hdr_pos < ctxt->
ip_hdr_nr; ip_hdr_pos++)
   380         return nr_ipv4_non_rnd;
   394         size_t nr_ipv4_non_rnd_with_bits = 0;
   397         for(ip_hdr_pos = 0; ip_hdr_pos < ctxt->
ip_hdr_nr; ip_hdr_pos++)
   407                         nr_ipv4_non_rnd_with_bits++;
   411         return nr_ipv4_non_rnd_with_bits;
   424                                                 const uint8_t oa_repetitions_nr)
   426         bool at_least_one_sid_change = 
false;
   429         for(ip_hdr_pos = 0; ip_hdr_pos < ctxt->
ip_hdr_nr; ip_hdr_pos++)
   435                         at_least_one_sid_change = 
true;
   439         return at_least_one_sid_change;
   452                                                 const uint8_t oa_repetitions_nr)
   454         bool at_least_one_rnd_change = 
false;
   457         for(ip_hdr_pos = 0; ip_hdr_pos < ctxt->
ip_hdr_nr; ip_hdr_pos++)
   463                         at_least_one_rnd_change = 
true;
   467         return at_least_one_rnd_change;
 uint8_t crc_static_7_cached
Definition: rohc_comp_rfc3095.h:235
 
uint32_t sn
The Sequence Number (SN), may be 16-bit or 32-bit long. 
Definition: rohc_comp_rfc3095.h:213
 
bool sn_6bits_possible
Definition: rohc_comp_rfc3095.h:197
 
unsigned int next_header_len
The length of the next header. 
Definition: rohc_comp_rfc3095.h:246
 
uint8_t ip_id_6bits_possible
Definition: rohc_comp_rfc3095.h:156
 
uint8_t tos_tc_just_changed
Definition: rohc_comp_rfc3095.h:140
 
bool sn_13bits_possible
Definition: rohc_comp_rfc3095.h:195
 
uint8_t ip_id_5bits_possible
Definition: rohc_comp_rfc3095.h:155
 
size_t(* code_uo_remainder)(const struct rohc_comp_ctxt *const context, const uint8_t *const next_header, uint8_t *const dest, const size_t counter)
The handler used to add an additional header in the tail of the UO-0, UO-1 and UO-2 packets...
Definition: rohc_comp_rfc3095.h:295
 
static bool does_at_least_one_sid_change(const struct rohc_comp_rfc3095_ctxt *const ctxt, const uint8_t oa_repetitions_nr)
at least one SID flag changed now or in the last few packets? 
Definition: rohc_comp_rfc3095.h:423
 
uint8_t ip_id_changed
Definition: rohc_comp_rfc3095.h:153
 
Definition: rohc_comp_rfc3095.h:138
 
rohc_ext_t decide_extension(const struct rohc_comp_ctxt *const context, const rohc_packet_t packet_type)
Decide what extension shall be used in the UO-1-ID/UOR-2 packet. 
Definition: rohc_comp_rfc3095.c:6337
 
static size_t get_nr_ipv4_non_rnd(const struct rohc_comp_rfc3095_ctxt *const ctxt)
How many IP headers are IPv4 headers with non-random IP-IDs ? 
Definition: rohc_comp_rfc3095.h:365
 
uint8_t sid_changed
Definition: rohc_comp_rfc3095.h:152
 
void * specific
Profile-specific data. 
Definition: rohc_comp_rfc3095.h:314
 
uint8_t ip_id_8bits_possible
Definition: rohc_comp_rfc3095.h:158
 
uint8_t rnd_just_changed
Definition: rohc_comp_rfc3095.h:149
 
rohc_packet_t(* decide_SO_packet)(const struct rohc_comp_ctxt *const context)
The handler used to decide which packet to send in SO state. 
Definition: rohc_comp_rfc3095.h:257
 
unsigned int next_header_proto
The protocol number registered by IANA for the next header protocol. 
Definition: rohc_comp_rfc3095.h:244
 
uint8_t(* compute_crc_static)(const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, const rohc_crc_type_t crc_type, const uint8_t init_val)
The handler used to compute the CRC-STATIC value. 
Definition: rohc_comp_rfc3095.h:302
 
size_t(* code_dynamic_part)(const struct rohc_comp_ctxt *const context, const uint8_t *const next_header, uint8_t *const dest, const size_t counter)
The handler used to add the dynamic part of the next header to the ROHC pachet. 
Definition: rohc_comp_rfc3095.h:279
 
rohc_ext_t
The different types of extensions for UO-1-ID and UOR-2* packets. 
Definition: rohc_packets.h:157
 
ROHC generic list compression. 
 
uint8_t nbo_just_changed
Definition: rohc_comp_rfc3095.h:146
 
The IPv6 header. 
Definition: ipv6.h:82
 
bool sn_7bits_possible
Definition: rohc_comp_rfc3095.h:190
 
uint8_t ttl_hl_just_changed
Definition: rohc_comp_rfc3095.h:142
 
uint8_t tos_tc_changed
Definition: rohc_comp_rfc3095.h:141
 
One W-LSB encoding object. 
Definition: comp_wlsb.h:68
 
rohc_ext_t(* decide_extension)(const struct rohc_comp_ctxt *const context, const rohc_packet_t packet_type)
Definition: rohc_comp_rfc3095.h:260
 
uint8_t unused
Definition: rohc_comp_rfc3095.h:168
 
The IPv4 header. 
Definition: ipv4.h:53
 
Internal structures for ROHC compression. 
 
The ROHC compression context. 
Definition: rohc_comp_internals.h:278
 
bool rohc_comp_rfc3095_create(struct rohc_comp_ctxt *const context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs)
Create a new context and initialize it thanks to the given IP packet. 
Definition: rohc_comp_rfc3095.c:525
 
int(* code_ir_remainder)(const struct rohc_comp_ctxt *const context, uint8_t *const dest, const size_t dest_max_len, const size_t counter)
The handler used to add the IR/IR-DYN remainder header to the ROHC pachet. 
Definition: rohc_comp_rfc3095.h:287
 
uint8_t rnd_changed
Definition: rohc_comp_rfc3095.h:150
 
Information about the uncompressed packet headers. 
 
Structure that contains variables that are used during one single compression of packet. 
Definition: rohc_comp_rfc3095.h:182
 
uint8_t ttl_hl_changed
Definition: rohc_comp_rfc3095.h:143
 
size_t(* code_static_part)(const struct rohc_comp_ctxt *const context, const uint8_t *const next_header, uint8_t *const dest, const size_t counter)
The handler used to add the static part of the next header to the ROHC packet. 
Definition: rohc_comp_rfc3095.h:271
 
uint8_t ip_id_11bits_possible
Definition: rohc_comp_rfc3095.h:159
 
uint8_t sid_just_changed
Definition: rohc_comp_rfc3095.h:151
 
size_t ip_hdr_nr
Definition: rohc_comp_rfc3095.h:185
 
uint8_t df_changed
Definition: rohc_comp_rfc3095.h:145
 
bool sn_12bits_possible
Definition: rohc_comp_rfc3095.h:191
 
rohc_crc_type_t
Definition: crc.h:56
 
uint8_t df_just_changed
Definition: rohc_comp_rfc3095.h:144
 
uint32_t msn_of_last_ctxt_updating_pkt
Definition: rohc_comp_rfc3095.h:219
 
uint8_t ext_list_content_just_changed
Definition: rohc_comp_rfc3095.h:165
 
uint8_t ip_id_3bits_possible
Definition: rohc_comp_rfc3095.h:154
 
size_t ip_hdr_nr
Definition: rohc_comp_rfc3095.h:224
 
struct generic_tmp_vars tmp
Temporary variables that are used during one single compression of packet. 
Definition: rohc_comp_rfc3095.h:238
 
rohc_packet_t packet_type
Definition: rohc_comp_internals.h:318
 
bool sn_9bits_possible
Definition: rohc_comp_rfc3095.h:198
 
The information collected about the packet headers. 
Definition: uncomp_pkt_hdrs.h:102
 
uint8_t ext_list_struct_changed
Definition: rohc_comp_rfc3095.h:163
 
bool sn_5bits_possible
Definition: rohc_comp_rfc3095.h:193
 
static size_t get_nr_ipv4_non_rnd_with_bits(const struct rohc_comp_rfc3095_ctxt *const ctxt)
How many IP headers are IPv4 headers with non-random IP-IDs and some bits to transmit ...
Definition: rohc_comp_rfc3095.h:392
 
void rohc_comp_rfc3095_destroy(struct rohc_comp_ctxt *const context)
Destroy the context. 
Definition: rohc_comp_rfc3095.c:649
 
uint8_t(* compute_crc_dynamic)(const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, const rohc_crc_type_t crc_type, const uint8_t init_val)
The handler used to compute the CRC-DYNAMIC value. 
Definition: rohc_comp_rfc3095.h:308
 
bool(* encode_uncomp_fields)(struct rohc_comp_ctxt *const context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs)
Definition: rohc_comp_rfc3095.h:249
 
Definition of ROHC packets and extensions. 
 
int rohc_comp_rfc3095_encode(struct rohc_comp_ctxt *const context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len, rohc_packet_t *const packet_type)
Encode an IP packet according to a pattern decided by several different factors. 
Definition: rohc_comp_rfc3095.c:691
 
struct c_wlsb sn_window
A window used to encode the SN. 
Definition: rohc_comp_rfc3095.h:215
 
bool sn_8bits_possible
Definition: rohc_comp_rfc3095.h:194
 
uint8_t crc_static_3_cached
Definition: rohc_comp_rfc3095.h:231
 
uint8_t ext_list_struct_just_changed
Definition: rohc_comp_rfc3095.h:161
 
struct rfc3095_ip_hdr_changes ip_hdr_changes[ROHC_MAX_IP_HDRS]
Definition: rohc_comp_rfc3095.h:187
 
The list compressor. 
Definition: comp_list.h:43
 
uint8_t ext_list_content_changed
Definition: rohc_comp_rfc3095.h:167
 
bool sn_4bits_possible
Definition: rohc_comp_rfc3095.h:189
 
ip_version
IP version. 
Definition: ip.h:49
 
IP version 4. 
Definition: ip.h:52
 
bool is_crc_static_7_cached_valid
Definition: rohc_comp_rfc3095.h:233
 
rohc_packet_t(* decide_FO_packet)(const struct rohc_comp_ctxt *const context)
The handler used to decide which packet to send in FO state. 
Definition: rohc_comp_rfc3095.h:254
 
uint8_t nbo_changed
Definition: rohc_comp_rfc3095.h:147
 
rohc_feedback_type
Definition: feedback.h:42
 
bool is_crc_static_3_cached_valid
Definition: rohc_comp_rfc3095.h:229
 
rohc_packet_t
The different types of ROHC packets. 
Definition: rohc_packets.h:55
 
struct c_wlsb msn_non_acked
Definition: rohc_comp_rfc3095.h:221
 
bool sn_14bits_possible
Definition: rohc_comp_rfc3095.h:199
 
static bool does_at_least_one_rnd_change(const struct rohc_comp_rfc3095_ctxt *const ctxt, const uint8_t oa_repetitions_nr)
at least one RND flag changed now or in the last few packets? 
Definition: rohc_comp_rfc3095.h:451
 
struct ip_header_info ip_ctxts[ROHC_MAX_IP_HDRS]
Definition: rohc_comp_rfc3095.h:226
 
uint32_t(* get_next_sn)(const struct rohc_comp_ctxt *const context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs)
Definition: rohc_comp_rfc3095.h:265
 
void rohc_get_ipid_bits(const struct rohc_comp_ctxt *const context, bool *const innermost_ip_id_changed, bool *const innermost_ip_id_3bits_possible, bool *const innermost_ip_id_5bits_possible, bool *const innermost_ip_id_8bits_possible, bool *const innermost_ip_id_11bits_possible, bool *const outermost_ip_id_changed, bool *const outermost_ip_id_11bits_possible)
Get the number of non-random outer/inner IP-ID bits. 
Definition: rohc_comp_rfc3095.c:6823
 
#define ROHC_MAX_IP_HDRS
The maximum number of IP headers supported. 
Definition: protocols/ip.h:46
 
bool rohc_comp_rfc3095_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)
Update the profile when feedback is received. 
Definition: rohc_comp_rfc3095.c:756
 
The generic decompression context for RFC3095-based profiles. 
Definition: rohc_comp_rfc3095.h:210