29 #ifndef ROHC_COMP_RFC3095_H 30 #define ROHC_COMP_RFC3095_H 223 const struct net_pkt *
const uncomp_pkt)
224 __attribute__((warn_unused_result, nonnull(1, 2)));
238 const uint8_t *
const next_header);
242 const struct net_pkt *
const uncomp_pkt)
243 __attribute__((warn_unused_result, nonnull(1, 2)));
248 const uint8_t *
const next_header,
250 const size_t counter)
251 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
256 const uint8_t *
const next_header,
258 const size_t counter)
259 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
265 const size_t dest_max_len,
266 const size_t counter)
267 __attribute__((warn_unused_result, nonnull(1, 2)));
272 const uint8_t *
const next_header,
274 const size_t counter,
275 size_t *
const first_position)
276 __attribute__((warn_unused_result, nonnull(1,2, 3, 5)));
281 const uint8_t *
const next_header,
283 const size_t counter)
284 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
288 const uint8_t *
const ip2,
289 const uint8_t *
const next_header,
291 const uint8_t init_val,
292 const uint8_t *
const crc_table)
293 __attribute__((nonnull(1, 3, 6), warn_unused_result));
297 const uint8_t *
const ip2,
298 const uint8_t *
const next_header,
300 const uint8_t init_val,
301 const uint8_t *
const crc_table)
302 __attribute__((nonnull(1, 3, 6), warn_unused_result));
314 const size_t sn_bits_nr,
316 const struct net_pkt *
const packet)
317 __attribute__((warn_unused_result, nonnull(1, 4)));
320 __attribute__((nonnull(1)));
323 const struct net_pkt *
const packet)
324 __attribute__((warn_unused_result, nonnull(1, 2)));
327 __attribute__((warn_unused_result, nonnull(1)));
330 const struct net_pkt *
const uncomp_pkt,
331 uint8_t *
const rohc_pkt,
332 const size_t rohc_pkt_max_len,
334 size_t *
const payload_offset)
335 __attribute__((warn_unused_result, nonnull(1, 2, 3, 5, 6)));
339 const uint8_t *
const packet,
340 const size_t packet_len,
341 const uint8_t *
const feedback_data,
342 const size_t feedback_data_len)
343 __attribute__((warn_unused_result, nonnull(1, 3, 5)));
346 __attribute__((nonnull(1)));
349 size_t *
const nr_innermost_bits,
350 size_t *
const nr_outermost_bits)
351 __attribute__((nonnull(1, 2, 3)));
354 const size_t bits_nr,
355 const size_t add_bits_nr)
356 __attribute__((warn_unused_result, nonnull(1), pure));
383 const size_t max_ip_id_bits_nr)
415 const size_t max_ip_id_bits_nr)
431 size_t nr_ipv4_non_rnd = 0;
447 return nr_ipv4_non_rnd;
461 size_t nr_ipv4_non_rnd_with_bits = 0;
468 nr_ipv4_non_rnd_with_bits++;
477 nr_ipv4_non_rnd_with_bits++;
480 return nr_ipv4_non_rnd_with_bits;
uint8_t crc_static_7_cached
Definition: rohc_comp_rfc3095.h:208
uint32_t sn
The Sequence Number (SN), may be 16-bit or 32-bit long.
Definition: rohc_comp_rfc3095.h:184
unsigned short changed_fields2
The number of fields that changed in the inner IP header.
Definition: rohc_comp_rfc3095.h:153
rohc_lsb_shift_t
the different values of the shift parameter of the LSB algorithm
Definition: interval.h:45
unsigned int next_header_len
The length of the next header.
Definition: rohc_comp_rfc3095.h:219
struct ip_header_info inner_ip_flags
Information about the inner IP header.
Definition: rohc_comp_rfc3095.h:199
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:519
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:382
int send_dynamic
The number of dynamic fields that changed in the two IP headers.
Definition: rohc_comp_rfc3095.h:157
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:7367
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:429
void * specific
Profile-specific data.
Definition: rohc_comp_rfc3095.h:305
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:160
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:391
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:217
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:398
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:414
rohc_ext_t
The different types of extensions for UO-1-ID and UOR-2* packets.
Definition: rohc_packets.h:115
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:165
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:167
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:329
size_t nr_sn_bits_more_than_4
The number of bits needed to encode the Sequence Number (SN)
Definition: rohc_comp_rfc3095.h:162
Structure that contains variables that are used during one single compression of packet.
Definition: rohc_comp_rfc3095.h:148
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:366
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:660
rohc_packet_t packet_type
The type of packet the compressor must send: IR, IR-DYN, UO*.
Definition: rohc_comp_rfc3095.h:170
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:6739
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:6907
struct ip_header_info outer_ip_flags
Information about the outer IP header.
Definition: rohc_comp_rfc3095.h:197
rohc_crc_type_t
Definition: crc.h:56
uint32_t msn_of_last_ctxt_updating_pkt
Definition: rohc_comp_rfc3095.h:190
int send_static
The number of static fields that changed in the two IP headers.
Definition: rohc_comp_rfc3095.h:155
size_t ip_hdr_nr
Definition: rohc_comp_rfc3095.h:195
struct generic_tmp_vars tmp
Temporary variables that are used during one single compression of packet.
Definition: rohc_comp_rfc3095.h:211
rohc_packet_t packet_type
Definition: rohc_comp_internals.h:363
unsigned short changed_fields
The number of fields that changed in the outer IP header.
Definition: rohc_comp_rfc3095.h:151
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:459
void rohc_comp_rfc3095_destroy(struct rohc_comp_ctxt *const context)
Destroy the context.
Definition: rohc_comp_rfc3095.c:620
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:7318
Definition of ROHC packets and extensions.
uint8_t crc_static_3_cached
Definition: rohc_comp_rfc3095.h:204
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:206
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:1368
rohc_feedback_type
Definition: feedback.h:42
bool is_crc_static_3_cached_valid
Definition: rohc_comp_rfc3095.h:202
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:793
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:298
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:2591
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:881
The generic decompression context for RFC3095-based profiles.
Definition: rohc_comp_rfc3095.h:181