29 #ifndef ROHC_COMP_RFC3095_H
30 #define ROHC_COMP_RFC3095_H
208 const struct net_pkt *
const uncomp_pkt)
209 __attribute__((warn_unused_result, nonnull(1, 2)));
223 const uint8_t *
const next_header);
227 const struct net_pkt *
const uncomp_pkt)
228 __attribute__((warn_unused_result, nonnull(1, 2)));
233 const uint8_t *
const next_header,
235 const size_t counter)
236 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
241 const uint8_t *
const next_header,
243 const size_t counter)
244 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
250 const size_t dest_max_len,
251 const size_t counter)
252 __attribute__((warn_unused_result, nonnull(1, 2)));
257 const uint8_t *
const next_header,
259 const size_t counter,
260 size_t *
const first_position)
261 __attribute__((warn_unused_result, nonnull(1,2, 3, 5)));
266 const uint8_t *
const next_header,
268 const size_t counter)
269 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
273 const uint8_t *
const ip2,
274 const uint8_t *
const next_header,
276 const uint8_t init_val,
277 const uint8_t *
const crc_table)
278 __attribute__((nonnull(1, 3, 6), warn_unused_result));
282 const uint8_t *
const ip2,
283 const uint8_t *
const next_header,
285 const uint8_t init_val,
286 const uint8_t *
const crc_table)
287 __attribute__((nonnull(1, 3, 6), warn_unused_result));
300 const struct net_pkt *
const packet)
301 __attribute__((warn_unused_result, nonnull(1, 3)));
304 __attribute__((nonnull(1)));
307 const struct net_pkt *
const packet)
308 __attribute__((warn_unused_result, nonnull(1, 2)));
311 __attribute__((warn_unused_result, nonnull(1)));
314 const struct net_pkt *
const uncomp_pkt,
315 uint8_t *
const rohc_pkt,
316 const size_t rohc_pkt_max_len,
318 size_t *
const payload_offset)
319 __attribute__((warn_unused_result, nonnull(1, 2, 3, 5, 6)));
323 const uint8_t *
const packet,
324 const size_t packet_len,
325 const uint8_t *
const feedback_data,
326 const size_t feedback_data_len)
327 __attribute__((warn_unused_result, nonnull(1, 3, 5)));
330 __attribute__((nonnull(1)));
333 size_t *
const nr_innermost_bits,
334 size_t *
const nr_outermost_bits)
335 __attribute__((nonnull(1, 2, 3)));
338 const size_t bits_nr,
339 const size_t add_bits_nr)
340 __attribute__((warn_unused_result, nonnull(1), pure));
367 const size_t max_ip_id_bits_nr)
399 const size_t max_ip_id_bits_nr)
415 size_t nr_ipv4_non_rnd = 0;
431 return nr_ipv4_non_rnd;
445 size_t nr_ipv4_non_rnd_with_bits = 0;
452 nr_ipv4_non_rnd_with_bits++;
461 nr_ipv4_non_rnd_with_bits++;
464 return nr_ipv4_non_rnd_with_bits;
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:42
unsigned int next_header_len
The length of the next header.
Definition: rohc_comp_rfc3095.h:204
struct c_wlsb * sn_window
A window used to encode the SN.
Definition: rohc_comp_rfc3095.h:186
struct ip_header_info inner_ip_flags
Information about the inner IP header.
Definition: rohc_comp_rfc3095.h:193
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:265
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:366
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:7261
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:413
void * specific
Profile-specific data.
Definition: rohc_comp_rfc3095.h:290
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
rohc_packet_t(* decide_FO_packet)(const struct rohc_comp_ctxt *context)
The handler used to decide which packet to send in FO state.
Definition: rohc_comp_rfc3095.h:215
The ROHC compressor.
Definition: rohc_comp_internals.h:121
unsigned int next_header_proto
The protocol number registered by IANA for the next header protocol.
Definition: rohc_comp_rfc3095.h:202
rohc_ext_t(* decide_extension)(const struct rohc_comp_ctxt *context)
Definition: rohc_comp_rfc3095.h:219
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:382
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:240
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:398
rohc_ext_t
The different types of extensions for UO-1-ID and UOR-2* packets.
Definition: rohc_packets.h:106
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
Defines a W-LSB encoding object.
Definition: comp_wlsb.c:55
The IPv4 header.
Definition: ipv4.h:53
Internal structures for ROHC compression.
The ROHC compression context.
Definition: rohc_comp_internals.h:306
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:248
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:350
size_t(* code_UO_packet_head)(const struct rohc_comp_ctxt *const context, const uint8_t *const next_header, uint8_t *const dest, const size_t counter, size_t *const first_position)
The handler used to add an additional header in the head of the UO-0, UO-1 and UO-2 packets...
Definition: rohc_comp_rfc3095.h:256
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:232
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:693
bool rohc_comp_rfc3095_create(struct rohc_comp_ctxt *const context, 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:538
rohc_packet_t packet_type
The type of packet the compressor must send: IR, IR-DYN, UO*.
Definition: rohc_comp_rfc3095.h:170
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:6801
struct ip_header_info outer_ip_flags
Information about the outer IP header.
Definition: rohc_comp_rfc3095.h:191
rohc_crc_type_t
Definition: crc.h:56
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:189
struct generic_tmp_vars tmp
Temporary variables that are used during one single compression of packet.
Definition: rohc_comp_rfc3095.h:196
rohc_packet_t packet_type
Definition: rohc_comp_internals.h:338
void(* init_at_IR)(struct rohc_comp_ctxt *const context, const uint8_t *const next_header)
The handler used to initialize some data just before the IR packet build.
Definition: rohc_comp_rfc3095.h:222
uint8_t(* compute_crc_static)(const uint8_t *const ip, const uint8_t *const ip2, const uint8_t *const next_header, const rohc_crc_type_t crc_type, const uint8_t init_val, const uint8_t *const crc_table)
The handler used to compute the CRC-STATIC value.
Definition: rohc_comp_rfc3095.h:272
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:443
void rohc_comp_rfc3095_destroy(struct rohc_comp_ctxt *const context)
Destroy the context.
Definition: rohc_comp_rfc3095.c:652
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:7212
Definition of ROHC packets and extensions.
void(* decide_state)(struct rohc_comp_ctxt *const context)
The handler used to decide the state that should be used for the next packet.
Definition: rohc_comp_rfc3095.h:213
bool(* encode_uncomp_fields)(struct rohc_comp_ctxt *const context, const struct net_pkt *const uncomp_pkt)
Definition: rohc_comp_rfc3095.h:207
The list compressor.
Definition: comp_list.h:42
rohc_packet_t(* decide_SO_packet)(const struct rohc_comp_ctxt *context)
The handler used to decide which packet to send in SO state.
Definition: rohc_comp_rfc3095.h:217
ip_version
IP version.
Definition: ip.h:53
IP version 4.
Definition: ip.h:56
uint32_t(* get_next_sn)(const struct rohc_comp_ctxt *const context, const struct net_pkt *const uncomp_pkt)
Definition: rohc_comp_rfc3095.h:226
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:1322
rohc_feedback_type
Definition: feedback.h:42
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:826
rohc_packet_t
The different types of ROHC packets.
Definition: rohc_packets.h:49
uint8_t(* compute_crc_dynamic)(const uint8_t *const ip, const uint8_t *const ip2, const uint8_t *const next_header, const rohc_crc_type_t crc_type, const uint8_t init_val, const uint8_t *const crc_table)
The handler used to compute the CRC-DYNAMIC value.
Definition: rohc_comp_rfc3095.h:281
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:908
The generic decompression context for RFC3095-based profiles.
Definition: rohc_comp_rfc3095.h:181