29 #ifndef ROHC_COMP_RFC3095_H 30 #define ROHC_COMP_RFC3095_H 224 const struct net_pkt *
const uncomp_pkt)
225 __attribute__((warn_unused_result, nonnull(1, 2)));
239 const uint8_t *
const next_header);
243 const struct net_pkt *
const uncomp_pkt)
244 __attribute__((warn_unused_result, nonnull(1, 2)));
249 const uint8_t *
const next_header,
251 const size_t counter)
252 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
257 const uint8_t *
const next_header,
259 const size_t counter)
260 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
266 const size_t dest_max_len,
267 const size_t counter)
268 __attribute__((warn_unused_result, nonnull(1, 2)));
273 const uint8_t *
const next_header,
275 const size_t counter,
276 size_t *
const first_position)
277 __attribute__((warn_unused_result, nonnull(1,2, 3, 5)));
282 const uint8_t *
const next_header,
284 const size_t counter)
285 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
289 const uint8_t *
const ip2,
290 const uint8_t *
const next_header,
292 const uint8_t init_val,
293 const uint8_t *
const crc_table)
294 __attribute__((nonnull(1, 3, 6), warn_unused_result));
298 const uint8_t *
const ip2,
299 const uint8_t *
const next_header,
301 const uint8_t init_val,
302 const uint8_t *
const crc_table)
303 __attribute__((nonnull(1, 3, 6), warn_unused_result));
315 const size_t sn_bits_nr,
317 const struct net_pkt *
const packet)
318 __attribute__((warn_unused_result, nonnull(1, 4)));
321 __attribute__((nonnull(1)));
324 const struct net_pkt *
const packet)
325 __attribute__((warn_unused_result, nonnull(1, 2)));
328 __attribute__((warn_unused_result, nonnull(1)));
331 const struct net_pkt *
const uncomp_pkt,
332 uint8_t *
const rohc_pkt,
333 const size_t rohc_pkt_max_len,
335 size_t *
const payload_offset)
336 __attribute__((warn_unused_result, nonnull(1, 2, 3, 5, 6)));
340 const uint8_t *
const packet,
341 const size_t packet_len,
342 const uint8_t *
const feedback_data,
343 const size_t feedback_data_len)
344 __attribute__((warn_unused_result, nonnull(1, 3, 5)));
347 __attribute__((nonnull(1)));
350 size_t *
const nr_innermost_bits,
351 size_t *
const nr_outermost_bits)
352 __attribute__((nonnull(1, 2, 3)));
355 const size_t bits_nr,
356 const size_t add_bits_nr)
357 __attribute__((warn_unused_result, nonnull(1), pure));
384 const size_t max_ip_id_bits_nr)
416 const size_t max_ip_id_bits_nr)
432 size_t nr_ipv4_non_rnd = 0;
448 return nr_ipv4_non_rnd;
462 size_t nr_ipv4_non_rnd_with_bits = 0;
469 nr_ipv4_non_rnd_with_bits++;
478 nr_ipv4_non_rnd_with_bits++;
481 return nr_ipv4_non_rnd_with_bits;
uint8_t crc_static_7_cached
Definition: rohc_comp_rfc3095.h:209
uint32_t sn
The Sequence Number (SN), may be 16-bit or 32-bit long.
Definition: rohc_comp_rfc3095.h:185
unsigned short changed_fields2
The number of fields that changed in the inner IP header.
Definition: rohc_comp_rfc3095.h:154
rohc_lsb_shift_t
the different values of the shift parameter of the LSB algorithm
Definition: interval.h:47
unsigned int next_header_len
The length of the next header.
Definition: rohc_comp_rfc3095.h:220
struct ip_header_info inner_ip_flags
Information about the inner IP header.
Definition: rohc_comp_rfc3095.h:200
bool rohc_comp_rfc3095_create(struct rohc_comp_ctxt *const context, const size_t sn_bits_nr, const rohc_lsb_shift_t sn_shift, const struct net_pkt *const packet)
Create a new context and initialize it thanks to the given IP packet.
Definition: rohc_comp_rfc3095.c:515
static bool is_outer_ip_id_bits_possible(const struct rohc_comp_rfc3095_ctxt *const ctxt, const size_t max_ip_id_bits_nr)
May the outer IP header transmit the required non-random IP-ID bits?
Definition: rohc_comp_rfc3095.h:383
int send_dynamic
The number of dynamic fields that changed in the two IP headers.
Definition: rohc_comp_rfc3095.h:158
bool rohc_comp_rfc3095_is_sn_possible(const struct rohc_comp_rfc3095_ctxt *const rfc3095_ctxt, const size_t bits_nr, const size_t add_bits_nr)
Are the given SN field sizes possible?
Definition: rohc_comp_rfc3095.c:7351
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:430
void * specific
Profile-specific data.
Definition: rohc_comp_rfc3095.h:306
size_t nr_sn_bits_less_equal_than_4
The number of bits needed to encode the Sequence Number (SN)
Definition: rohc_comp_rfc3095.h:161
uint8_t compute_crc_dynamic(const uint8_t *const outer_ip, const uint8_t *const inner_ip, const uint8_t *const next_header, const rohc_crc_type_t crc_type, const uint8_t init_val, const uint8_t *const crc_table)
Compute the CRC-DYNAMIC part of an IP header.
Definition: crc.c:388
The ROHC compressor.
Definition: rohc_comp_internals.h:129
unsigned int next_header_proto
The protocol number registered by IANA for the next header protocol.
Definition: rohc_comp_rfc3095.h:218
static bool no_inner_ip_id_bits_required(const struct rohc_comp_rfc3095_ctxt *const ctxt)
Does the inner IP header require to transmit no non-random IP-ID bit?
Definition: rohc_comp_rfc3095.h:399
static bool is_inner_ip_id_bits_possible(const struct rohc_comp_rfc3095_ctxt *const ctxt, const size_t max_ip_id_bits_nr)
May the inner IP header transmit the required non-random IP-ID bits?
Definition: rohc_comp_rfc3095.h:415
rohc_ext_t
The different types of extensions for UO-1-ID and UOR-2* packets.
Definition: rohc_packets.h:133
ROHC generic list compression.
The IPv6 header.
Definition: ipv6.h:88
size_t nr_ip_id_bits
The number of bits needed to encode the IP-ID of the outer IP header.
Definition: rohc_comp_rfc3095.h:166
size_t nr_ip_id_bits2
The number of bits needed to encode the IP-ID of the inner IP header.
Definition: rohc_comp_rfc3095.h:168
One W-LSB encoding object.
Definition: comp_wlsb.h:56
The IPv4 header.
Definition: ipv4.h:53
Internal structures for ROHC compression.
The ROHC compression context.
Definition: rohc_comp_internals.h:326
size_t nr_sn_bits_more_than_4
The number of bits needed to encode the Sequence Number (SN)
Definition: rohc_comp_rfc3095.h:163
Structure that contains variables that are used during one single compression of packet.
Definition: rohc_comp_rfc3095.h:149
static bool no_outer_ip_id_bits_required(const struct rohc_comp_rfc3095_ctxt *const ctxt)
Does the outer IP header require to transmit no non-random IP-ID bit?
Definition: rohc_comp_rfc3095.h:367
bool rohc_comp_rfc3095_check_profile(const struct rohc_comp *const comp, const struct net_pkt *const packet)
Check if the given packet corresponds to an IP-based profile.
Definition: rohc_comp_rfc3095.c:668
rohc_packet_t packet_type
The type of packet the compressor must send: IR, IR-DYN, UO*.
Definition: rohc_comp_rfc3095.h:171
static bool encode_uncomp_fields(struct rohc_comp_ctxt *const context, const struct net_pkt *const uncomp_pkt)
Encode uncompressed fields with the corresponding encoding scheme.
Definition: rohc_comp_rfc3095.c:6736
rohc_ext_t decide_extension(const struct rohc_comp_ctxt *const context)
Decide what extension shall be used in the UO-1-ID/UOR-2 packet.
Definition: rohc_comp_rfc3095.c:6899
struct ip_header_info outer_ip_flags
Information about the outer IP header.
Definition: rohc_comp_rfc3095.h:198
rohc_crc_type_t
Definition: crc.h:58
uint32_t msn_of_last_ctxt_updating_pkt
Definition: rohc_comp_rfc3095.h:191
int send_static
The number of static fields that changed in the two IP headers.
Definition: rohc_comp_rfc3095.h:156
size_t ip_hdr_nr
Definition: rohc_comp_rfc3095.h:196
struct generic_tmp_vars tmp
Temporary variables that are used during one single compression of packet.
Definition: rohc_comp_rfc3095.h:212
rohc_packet_t packet_type
Definition: rohc_comp_internals.h:360
unsigned short changed_fields
The number of fields that changed in the outer IP header.
Definition: rohc_comp_rfc3095.h:152
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:460
void rohc_comp_rfc3095_destroy(struct rohc_comp_ctxt *const context)
Destroy the context.
Definition: rohc_comp_rfc3095.c:628
void rohc_get_ipid_bits(const struct rohc_comp_ctxt *const context, size_t *const nr_innermost_bits, size_t *const nr_outermost_bits)
Get the number of non-random outer/inner IP-ID bits.
Definition: rohc_comp_rfc3095.c:7302
Definition of ROHC packets and extensions.
uint8_t crc_static_3_cached
Definition: rohc_comp_rfc3095.h:205
The list compressor.
Definition: comp_list.h:42
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:207
void rohc_comp_rfc3095_decide_state(struct rohc_comp_ctxt *const context)
Decide the state that should be used for the next packet.
Definition: rohc_comp_rfc3095.c:1383
rohc_feedback_type
Definition: feedback.h:42
bool is_crc_static_3_cached_valid
Definition: rohc_comp_rfc3095.h:203
int rohc_comp_rfc3095_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)
Encode an IP packet according to a pattern decided by several different factors.
Definition: rohc_comp_rfc3095.c:798
rohc_packet_t
The different types of ROHC packets.
Definition: rohc_packets.h:55
uint8_t compute_crc_static(const uint8_t *const outer_ip, const uint8_t *const inner_ip, const uint8_t *const next_header, const rohc_crc_type_t crc_type, const uint8_t init_val, const uint8_t *const crc_table)
Compute the CRC-STATIC part of an IP header.
Definition: crc.c:295
static int code_uo_remainder(struct rohc_comp_ctxt *const context, const struct net_pkt *const uncomp_pkt, uint8_t *const dest, int counter)
Build the tail of the UO packet.
Definition: rohc_comp_rfc3095.c:2603
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:882
The generic decompression context for RFC3095-based profiles.
Definition: rohc_comp_rfc3095.h:182