30 #ifndef ROHC_DECOMP_RFC3095_H
31 #define ROHC_DECOMP_RFC3095_H
38 #include "schemes/ip_id_offset.h"
46 # include <linux/types.h>
373 const uint8_t *packet,
380 const uint8_t *packet,
398 const uint8_t *
const rohc_data,
399 const size_t rohc_data_len,
402 __attribute__((warn_unused_result, nonnull(1, 2, 5)));
406 const uint8_t *packet,
414 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
420 const unsigned int payload_len);
424 const uint8_t *
const ip2,
425 const uint8_t *
const next_header,
427 const uint8_t init_val,
428 const uint8_t *
const crc_table);
432 const uint8_t *
const ip2,
433 const uint8_t *
const next_header,
435 const uint8_t init_val,
436 const uint8_t *
const crc_table);
441 __attribute__((nonnull(1, 2)));
456 void *
const trace_cb_priv,
457 const int profile_id)
458 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
462 __attribute__((nonnull(1, 2)));
466 const size_t large_cid_len,
470 size_t *
const rohc_hdr_len)
471 __attribute__((warn_unused_result, nonnull(1, 4, 5, 6, 7)));
478 const size_t payload_len,
480 size_t *
const uncomp_hdrs_len)
481 __attribute__((warn_unused_result, nonnull(1, 2, 4, 5, 7, 8)));
485 const size_t payload_len __attribute__((unused)),
487 __attribute__((warn_unused_result, nonnull(1, 2, 4)));
491 const size_t payload_len,
492 bool *
const do_change_mode)
493 __attribute__((nonnull(1, 2, 4)));
497 const struct rohc_ts pkt_arrival_time,
500 __attribute__((warn_unused_result, nonnull(1, 2, 4, 5)));
503 __attribute__((warn_unused_result, nonnull(1)));
513 __attribute__((warn_unused_result, pure, always_inline));
516 __attribute__((warn_unused_result, pure, always_inline));
519 __attribute__((warn_unused_result, pure, always_inline));
bool rfc3095_decomp_parse_pkt(const struct rohc_decomp_ctxt *const context, const struct rohc_buf rohc_packet, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
Parse one IR, IR-DYN, UO-0, UO-1*, or UOR-2* packet.
Definition: rohc_decomp_rfc3095.c:536
rohc_lsb_shift_t
the different values of the shift parameter of the LSB algorithm
Definition: interval.h:42
struct rohc_extr_ip_bits inner_ip
Definition: rohc_decomp_rfc3095.h:133
static bool is_ipv4_pkt(const struct rohc_extr_ip_bits *const bits)
Is the given IP header IPV4 wrt packet?
Definition: rohc_decomp_rfc3095.h:528
uint32_t sn
Definition: rohc_decomp_rfc3095.h:260
uint8_t proto
Definition: rohc_decomp_rfc3095.h:76
uint32_t esp_spi
Definition: rohc_decomp_rfc3095.h:226
The ROHC decompressor.
Definition: rohc_decomp_internals.h:142
size_t udp_dst_nr
Definition: rohc_decomp_rfc3095.h:152
size_t rtp_ssrc_nr
Definition: rohc_decomp_rfc3095.h:219
uint8_t rtp_pt
Definition: rohc_decomp_rfc3095.h:204
rohc_tristate_t cfi
Definition: rohc_decomp_rfc3095.h:283
uint8_t saddr[16]
Definition: rohc_decomp_rfc3095.h:245
int(* parse_static_next_hdr)(const struct rohc_decomp_ctxt *const context, const uint8_t *packet, size_t length, struct rohc_extr_bits *const bits)
The handler used to parse the static part of the next header in the ROHC packet.
Definition: rohc_decomp_rfc3095.h:372
uint16_t udp_lite_cc
Definition: rohc_decomp_rfc3095.h:168
uint32_t sn
Definition: rohc_decomp_rfc3095.h:118
rohc_mode_t
ROHC operation modes.
Definition: rohc.h:111
int(* parse_ext3)(const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_data, const size_t rohc_data_len, const rohc_packet_t packet_type, struct rohc_extr_bits *const bits)
The handler used to parse the extension 3 of the UO* ROHC packet.
Definition: rohc_decomp_rfc3095.h:397
size_t rtp_pt_nr
Definition: rohc_decomp_rfc3095.h:207
static bool is_ipv4_non_rnd_pkt(const struct rohc_extr_ip_bits *const bits)
Is the given IP header IPv4 and its IP-ID non-random wrt packet?
Definition: rohc_decomp_rfc3095.h:552
uint16_t udp_lite_cc
Definition: rohc_decomp_rfc3095.h:284
The generic decompression context for RFC3095-based profiles.
Definition: rohc_decomp_rfc3095.h:337
rohc_tristate_t udp_check_present
Definition: rohc_decomp_rfc3095.h:154
The volatile part of the ROHC decompression context.
Definition: rohc_decomp_internals.h:256
bool rohc_decomp_rfc3095_create(const struct rohc_decomp_ctxt *const context, struct rohc_decomp_rfc3095_ctxt **const persist_ctxt, struct rohc_decomp_volat_ctxt *const volat_ctxt, rohc_trace_callback2_t trace_cb, void *const trace_cb_priv, const int profile_id)
Create the RFC3095 volatile and persistent parts of the context.
Definition: rohc_decomp_rfc3095.c:364
rohc_packet_t packet_type
Definition: rohc_decomp_internals.h:310
uint8_t rnd
Definition: rohc_decomp_rfc3095.h:242
size_t nbo_nr
Definition: rohc_decomp_rfc3095.h:82
uint8_t rtp_cc
Definition: rohc_decomp_rfc3095.h:193
rohc_status_t
The status code of several functions in the library API.
Definition: rohc.h:79
uint8_t version
Definition: rohc_decomp_rfc3095.h:235
size_t tos_nr
Definition: rohc_decomp_rfc3095.h:60
struct rohc_decomp_rfc3095_changes * inner_ip_changes
Information about the inner IP header.
Definition: rohc_decomp_rfc3095.h:342
unsigned int next_header_len
The length of the next header.
Definition: rohc_decomp_rfc3095.h:368
uint8_t sid
Definition: rohc_decomp_rfc3095.h:88
uint16_t udp_src
Definition: rohc_decomp_rfc3095.h:146
The bits extracted from ROHC UO* base headers.
Definition: rohc_decomp_rfc3095.h:113
The context for list decompression.
Definition: decomp_list.h:51
struct rohc_decomp_rfc3095_changes * outer_ip_changes
Information about the outer IP header.
Definition: rohc_decomp_rfc3095.h:340
uint8_t rtp_m
Definition: rohc_decomp_rfc3095.h:292
rohc_packet_cce_t cce_pkt
Definition: rohc_decomp_rfc3095.h:165
size_t rtp_x_nr
Definition: rohc_decomp_rfc3095.h:190
size_t rtp_p_nr
Definition: rohc_decomp_rfc3095.h:185
uint32_t ts
Definition: rohc_decomp_rfc3095.h:210
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_decomp_rfc3095.h:431
size_t rtp_m_nr
Definition: rohc_decomp_rfc3095.h:201
Internal structures for ROHC decompression.
bool(* decode_values_from_bits)(const struct rohc_decomp_ctxt *context, const struct rohc_extr_bits *const bits, struct rohc_decoded_values *const decoded)
Definition: rohc_decomp_rfc3095.h:411
struct list_decomp list_decomp1
The list decompressor of the outer IP header.
Definition: rohc_decomp_rfc3095.h:354
rohc_lsb_ref_t lsb_ref_type
Definition: rohc_decomp_rfc3095.h:121
The Least Significant Bits (LSB) decoding object.
Definition: decomp_wlsb.c:45
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
int(* parse_dyn_next_hdr)(const struct rohc_decomp_ctxt *const context, const uint8_t *packet, const size_t length, struct rohc_extr_bits *const bits)
The handler used to parse the dynamic part of the next header in the ROHC packet. ...
Definition: rohc_decomp_rfc3095.h:379
size_t saddr_nr
Definition: rohc_decomp_rfc3095.h:98
rohc_tristate_t cfi
Definition: rohc_decomp_rfc3095.h:167
rohc_packet_cce_t
Definition: udp_lite.h:32
Miscellaneous utils for ROHC libraries.
rohc_lsb_shift_t sn_lsb_p
Definition: rohc_decomp_rfc3095.h:345
size_t id_nr
Definition: rohc_decomp_rfc3095.h:65
Defines a IP-ID object to help computing the IP-ID value from an IP-ID offset.
Definition: decomp/schemes/ip_id_offset.c:41
uint8_t rtp_p
Definition: rohc_decomp_rfc3095.h:289
uint16_t id
Definition: rohc_decomp_rfc3095.h:237
Define the UDP-Lite protocol.
uint8_t rtp_version
Definition: rohc_decomp_rfc3095.h:288
void rfc3095_decomp_update_ctxt(struct rohc_decomp_ctxt *const context, const struct rohc_decoded_values *const decoded, const size_t payload_len, bool *const do_change_mode)
Update context with decoded values.
Definition: rohc_decomp_rfc3095.c:6110
uint8_t df
Definition: rohc_decomp_rfc3095.h:238
uint16_t udp_check
Definition: rohc_decomp_rfc3095.h:156
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_decomp_rfc3095.h:423
rohc_tristate_t cfp
Definition: rohc_decomp_rfc3095.h:166
void(* update_context)(struct rohc_decomp_ctxt *const context, const struct rohc_decoded_values *const decoded)
Definition: rohc_decomp_rfc3095.h:439
void * next_header
The next header located after the IP header(s)
Definition: rohc_decomp_rfc3095.h:324
bool is_sn_enc
Definition: rohc_decomp_rfc3095.h:120
rohc_status_t rfc3095_decomp_build_hdrs(const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const rohc_packet_t packet_type, const struct rohc_decomp_crc *const extr_crc, const struct rohc_decoded_values *const decoded, const size_t payload_len, struct rohc_buf *const uncomp_hdrs, size_t *const uncomp_hdrs_len)
Build the uncompressed headers.
Definition: rohc_decomp_rfc3095.c:4961
size_t esp_spi_nr
Definition: rohc_decomp_rfc3095.h:228
size_t rnd_nr
Definition: rohc_decomp_rfc3095.h:86
uint8_t rtp_x
Definition: rohc_decomp_rfc3095.h:188
uint16_t udp_dst
Definition: rohc_decomp_rfc3095.h:274
void * specific
Profile-specific data.
Definition: rohc_decomp_rfc3095.h:444
uint8_t daddr[16]
Definition: rohc_decomp_rfc3095.h:100
uint8_t df
Definition: rohc_decomp_rfc3095.h:68
uint8_t ttl
Definition: rohc_decomp_rfc3095.h:239
uint8_t proto
Definition: rohc_decomp_rfc3095.h:240
uint16_t udp_src
Definition: rohc_decomp_rfc3095.h:273
size_t rtp_version_nr
Definition: rohc_decomp_rfc3095.h:180
uint8_t sid
Definition: rohc_decomp_rfc3095.h:243
uint32_t flowid
Definition: rohc_decomp_rfc3095.h:244
size_t daddr_nr
Definition: rohc_decomp_rfc3095.h:102
uint8_t rnd
Definition: rohc_decomp_rfc3095.h:84
size_t rtp_cc_nr
Definition: rohc_decomp_rfc3095.h:195
bool multiple_ip
Definition: rohc_decomp_rfc3095.h:127
uint16_t id
Definition: rohc_decomp_rfc3095.h:62
struct rohc_extr_ip_bits outer_ip
Definition: rohc_decomp_rfc3095.h:130
unsigned int next_header_len
The length of the next header.
Definition: rohc_decomp_rfc3095.h:326
uint32_t ts
Definition: rohc_decomp_rfc3095.h:294
int(* build_next_header)(const struct rohc_decomp_ctxt *const context, const struct rohc_decoded_values *const decoded, uint8_t *const dest, const unsigned int payload_len)
Definition: rohc_decomp_rfc3095.h:417
Window-based Least Significant Bits (W-LSB) decoding.
size_t udp_check_nr
Definition: rohc_decomp_rfc3095.h:159
size_t udp_src_nr
Definition: rohc_decomp_rfc3095.h:148
size_t proto_nr
Definition: rohc_decomp_rfc3095.h:78
uint32_t rtp_ssrc
Definition: rohc_decomp_rfc3095.h:295
rohc_crc_type_t
Definition: crc.h:56
A network buffer for the ROHC library.
Definition: rohc_buf.h:104
Store information about an IP header between the different decompressions of IP packets.
Definition: rohc_decomp_rfc3095.h:311
struct ip_id_offset_decode * outer_ip_id_offset_ctxt
The IP-ID of the outer IP header.
Definition: rohc_decomp_rfc3095.h:349
uint8_t rtp_cc
Definition: rohc_decomp_rfc3095.h:291
unsigned short next_header_proto
The IP protocol ID of the protocol the context is able to decompress.
Definition: rohc_decomp_rfc3095.h:365
A timestamp for the ROHC library.
Definition: rohc_time.h:51
uint16_t udp_check
Definition: rohc_decomp_rfc3095.h:275
rohc_tristate_t udp_check_present
Definition: rohc_decomp_rfc3095.h:276
uint8_t tos
Definition: rohc_decomp_rfc3095.h:236
struct ip_packet ip
The IP header.
Definition: rohc_decomp_rfc3095.h:314
bool rfc3095_decomp_decode_bits(const struct rohc_decomp_ctxt *const context, const struct rohc_extr_bits *const bits, const size_t payload_len, struct rohc_decoded_values *const decoded)
Decode values from extracted bits.
Definition: rohc_decomp_rfc3095.c:5604
uint8_t rtp_x
Definition: rohc_decomp_rfc3095.h:290
ROHC generic list decompression.
Definition: rohc_decomp_rfc3095.h:233
static bool is_ipv4_rnd_pkt(const struct rohc_extr_ip_bits *const bits)
Is the given IP header IPv4 and its IP-ID random wrt packet?
Definition: rohc_decomp_rfc3095.h:540
size_t mode_nr
Definition: rohc_decomp_rfc3095.h:140
size_t df_nr
Definition: rohc_decomp_rfc3095.h:70
int(* parse_uo_remainder)(const struct rohc_decomp_ctxt *const context, const uint8_t *packet, unsigned int length, struct rohc_extr_bits *const bits)
The handler used to parse the tail of the UO* ROHC packet.
Definition: rohc_decomp_rfc3095.h:405
size_t ttl_nr
Definition: rohc_decomp_rfc3095.h:74
uint32_t rtp_ssrc
Definition: rohc_decomp_rfc3095.h:217
bool is_ts_scaled
Definition: rohc_decomp_rfc3095.h:214
struct rohc_lsb_decode * sn_lsb_ctxt
The LSB decoding context for the Sequence Number (SN)
Definition: rohc_decomp_rfc3095.h:347
int rnd
Whether the IP-ID is considered as random or not (IPv4 only)
Definition: rohc_decomp_rfc3095.h:317
Definition: rohc_decomp_internals.h:241
Definition of ROHC packets and extensions.
uint8_t version
Definition: rohc_decomp_rfc3095.h:55
struct rohc_decoded_ip_values outer_ip
Definition: rohc_decomp_rfc3095.h:267
The ROHC decompression context.
Definition: rohc_decomp_internals.h:274
uint8_t nbo
Definition: rohc_decomp_rfc3095.h:241
uint8_t rtp_m
Definition: rohc_decomp_rfc3095.h:198
rohc_tristate_t cfp
Definition: rohc_decomp_rfc3095.h:282
uint16_t udp_dst
Definition: rohc_decomp_rfc3095.h:150
struct ip_id_offset_decode * inner_ip_id_offset_ctxt
The IP-ID of the inner IP header.
Definition: rohc_decomp_rfc3095.h:351
bool is_context_reused
Definition: rohc_decomp_rfc3095.h:115
Definition: rohc_decomp_internals.h:223
uint8_t rtp_p
Definition: rohc_decomp_rfc3095.h:183
int nbo
Whether the IP-ID is considered as coded in NBO or not (IPv4 only)
Definition: rohc_decomp_rfc3095.h:319
rohc_lsb_ref_t
Definition: decomp_wlsb.h:47
void rohc_decomp_rfc3095_destroy(struct rohc_decomp_rfc3095_ctxt *const rfc3095_ctxt, const struct rohc_decomp_volat_ctxt *const volat_ctxt)
Destroy the context.
Definition: rohc_decomp_rfc3095.c:482
bool multiple_ip
Definition: rohc_decomp_rfc3095.h:265
size_t flowid_nr
Definition: rohc_decomp_rfc3095.h:94
bool sn_ref_offset
Definition: rohc_decomp_rfc3095.h:123
bool is_context_reused
Definition: rohc_decomp_rfc3095.h:258
Defines an IP-agnostic packet that can handle an IPv4 or IPv6 packet.
Definition: ip.h:81
IP version 4.
Definition: ip.h:56
size_t udp_lite_cc_nr
Definition: rohc_decomp_rfc3095.h:171
uint8_t saddr[16]
Definition: rohc_decomp_rfc3095.h:96
struct rohc_decoded_ip_values inner_ip
Definition: rohc_decomp_rfc3095.h:269
uint8_t ext_flag
Definition: rohc_decomp_rfc3095.h:136
size_t sid_nr
Definition: rohc_decomp_rfc3095.h:90
rohc_mode_t mode
Definition: rohc_decomp_rfc3095.h:262
The values decoded from the bits extracted from ROHC header.
Definition: rohc_decomp_rfc3095.h:256
uint32_t rohc_decomp_rfc3095_get_sn(const struct rohc_decomp_ctxt *const context)
Get the reference SN value of the context.
Definition: rohc_decomp_rfc3095.c:1354
uint32_t flowid
Definition: rohc_decomp_rfc3095.h:92
size_t sn_nr
Definition: rohc_decomp_rfc3095.h:119
uint8_t rtp_version
Definition: rohc_decomp_rfc3095.h:178
uint8_t nbo
Definition: rohc_decomp_rfc3095.h:80
uint8_t ttl
Definition: rohc_decomp_rfc3095.h:72
rohc_tristate_t
Definition: rohc_utils.h:33
rohc_packet_cce_t cce_pkt
Definition: rohc_decomp_rfc3095.h:281
uint8_t tos
Definition: rohc_decomp_rfc3095.h:58
ROHC decompression routines.
struct list_decomp list_decomp2
The list decompressor of the inner IP header.
Definition: rohc_decomp_rfc3095.h:356
uint8_t rtp_pt
Definition: rohc_decomp_rfc3095.h:293
Definition: rohc_decomp_rfc3095.h:53
rohc_packet_t
The different types of ROHC packets.
Definition: rohc_packets.h:49
uint8_t daddr[16]
Definition: rohc_decomp_rfc3095.h:246
uint8_t mode
Definition: rohc_decomp_rfc3095.h:139
int sid
Whether the IP-ID is considered as static or not (IPv4 only)
Definition: rohc_decomp_rfc3095.h:321
uint32_t esp_spi
Definition: rohc_decomp_rfc3095.h:299
bool is_id_enc
Definition: rohc_decomp_rfc3095.h:66
int multiple_ip
Whether the decompressed packet contains a 2nd IP header.
Definition: rohc_decomp_rfc3095.h:359
bool rfc3095_decomp_attempt_repair(const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const struct rohc_ts pkt_arrival_time, struct rohc_decomp_crc_corr_ctxt *const crc_corr, struct rohc_extr_bits *const extr_bits)
Attempt a packet/context repair upon CRC failure.
Definition: rohc_decomp_rfc3095.c:5407
size_t ts_nr
Definition: rohc_decomp_rfc3095.h:213