30 #ifndef ROHC_DECOMP_RFC3095_H 31 #define ROHC_DECOMP_RFC3095_H 38 #include "schemes/ip_id_offset.h" 378 const uint8_t *packet,
385 const uint8_t *packet,
403 const uint8_t *
const rohc_data,
404 const size_t rohc_data_len,
407 __attribute__((warn_unused_result, nonnull(1, 2, 5)));
411 const uint8_t *packet,
419 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
425 const unsigned int payload_len);
429 const uint8_t *
const ip2,
430 const uint8_t *
const next_header,
432 const uint8_t init_val,
433 const uint8_t *
const crc_table);
437 const uint8_t *
const ip2,
438 const uint8_t *
const next_header,
440 const uint8_t init_val,
441 const uint8_t *
const crc_table);
446 __attribute__((nonnull(1, 2)));
461 void *
const trace_cb_priv,
462 const int profile_id)
463 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
467 __attribute__((nonnull(1, 2)));
471 const size_t large_cid_len,
475 size_t *
const rohc_hdr_len)
476 __attribute__((warn_unused_result, nonnull(1, 4, 5, 6, 7)));
483 const size_t payload_len,
485 size_t *
const uncomp_hdrs_len)
486 __attribute__((warn_unused_result, nonnull(1, 2, 4, 5, 7, 8)));
490 const size_t payload_len __attribute__((unused)),
492 __attribute__((warn_unused_result, nonnull(1, 2, 4)));
496 const size_t payload_len,
497 bool *
const do_change_mode)
498 __attribute__((nonnull(1, 2, 4)));
502 const struct rohc_ts pkt_arrival_time,
505 __attribute__((warn_unused_result, nonnull(1, 2, 4, 5)));
508 __attribute__((warn_unused_result, nonnull(1)));
518 __attribute__((warn_unused_result, pure, always_inline));
521 __attribute__((warn_unused_result, pure, always_inline));
524 __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:505
rohc_lsb_shift_t
the different values of the shift parameter of the LSB algorithm
Definition: interval.h:45
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:533
uint32_t sn
Definition: rohc_decomp_rfc3095.h:256
uint8_t proto
Definition: rohc_decomp_rfc3095.h:72
uint32_t esp_spi
Definition: rohc_decomp_rfc3095.h:222
The ROHC decompressor.
Definition: rohc_decomp_internals.h:142
size_t udp_dst_nr
Definition: rohc_decomp_rfc3095.h:148
size_t rtp_ssrc_nr
Definition: rohc_decomp_rfc3095.h:215
uint8_t rtp_pt
Definition: rohc_decomp_rfc3095.h:200
rohc_tristate_t cfi
Definition: rohc_decomp_rfc3095.h:279
uint8_t crc_static_7_cached
Definition: rohc_decomp_rfc3095.h:364
bool is_crc_static_7_cached_valid
Definition: rohc_decomp_rfc3095.h:362
uint16_t udp_lite_cc
Definition: rohc_decomp_rfc3095.h:164
uint32_t sn
Definition: rohc_decomp_rfc3095.h:114
rohc_mode_t
ROHC operation modes.
Definition: rohc.h:109
size_t rtp_pt_nr
Definition: rohc_decomp_rfc3095.h:203
static bool parse_uo_remainder(const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
Parse the remainder of the UO* header.
Definition: rohc_decomp_rfc3095.c:4277
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:557
uint16_t udp_lite_cc
Definition: rohc_decomp_rfc3095.h:280
The generic decompression context for RFC3095-based profiles.
Definition: rohc_decomp_rfc3095.h:333
static void update_context(struct rohc_comp_ctxt *const context, const struct net_pkt *const uncomp_pkt)
Update the compression context with the successfully compressed packet.
Definition: rohc_comp_rfc3095.c:6150
rohc_tristate_t udp_check_present
Definition: rohc_decomp_rfc3095.h:150
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:362
rohc_packet_t packet_type
Definition: rohc_decomp_internals.h:310
uint8_t rnd
Definition: rohc_decomp_rfc3095.h:238
size_t nbo_nr
Definition: rohc_decomp_rfc3095.h:78
uint8_t rtp_cc
Definition: rohc_decomp_rfc3095.h:189
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
rohc_status_t
The status code of several functions in the library API.
Definition: rohc.h:77
uint8_t version
Definition: rohc_decomp_rfc3095.h:231
size_t tos_nr
Definition: rohc_decomp_rfc3095.h:56
struct rohc_decomp_rfc3095_changes * inner_ip_changes
Information about the inner IP header.
Definition: rohc_decomp_rfc3095.h:338
unsigned int next_header_len
The length of the next header.
Definition: rohc_decomp_rfc3095.h:373
uint8_t sid
Definition: rohc_decomp_rfc3095.h:84
uint16_t udp_src
Definition: rohc_decomp_rfc3095.h:142
The bits extracted from ROHC UO* base headers.
Definition: rohc_decomp_rfc3095.h:109
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:336
uint8_t rtp_m
Definition: rohc_decomp_rfc3095.h:288
rohc_packet_cce_t cce_pkt
Definition: rohc_decomp_rfc3095.h:161
size_t rtp_x_nr
Definition: rohc_decomp_rfc3095.h:186
size_t rtp_p_nr
Definition: rohc_decomp_rfc3095.h:181
bool is_crc_static_3_cached_valid
Definition: rohc_decomp_rfc3095.h:358
uint32_t ts
Definition: rohc_decomp_rfc3095.h:206
size_t rtp_m_nr
Definition: rohc_decomp_rfc3095.h:197
Internal structures for ROHC decompression.
rohc_lsb_ref_t lsb_ref_type
Definition: rohc_decomp_rfc3095.h:117
The Least Significant Bits (LSB) decoding object.
Definition: decomp_wlsb.h:57
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
size_t saddr_nr
Definition: rohc_decomp_rfc3095.h:94
rohc_tristate_t cfi
Definition: rohc_decomp_rfc3095.h:163
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:341
size_t id_nr
Definition: rohc_decomp_rfc3095.h:61
Defines a IP-ID object to help computing the IP-ID value from an IP-ID offset.
Definition: decomp/schemes/ip_id_offset.h:45
uint32_t sn_ref_offset
Definition: rohc_decomp_rfc3095.h:119
uint8_t rtp_p
Definition: rohc_decomp_rfc3095.h:285
uint16_t id
Definition: rohc_decomp_rfc3095.h:233
Define the UDP-Lite protocol.
uint8_t rtp_version
Definition: rohc_decomp_rfc3095.h:284
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:6141
uint8_t df
Definition: rohc_decomp_rfc3095.h:234
uint16_t udp_check
Definition: rohc_decomp_rfc3095.h:152
rohc_tristate_t cfp
Definition: rohc_decomp_rfc3095.h:162
uint8_t crc_static_3_cached
Definition: rohc_decomp_rfc3095.h:360
void * next_header
The next header located after the IP header(s)
Definition: rohc_decomp_rfc3095.h:320
bool is_sn_enc
Definition: rohc_decomp_rfc3095.h:116
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:224
size_t rnd_nr
Definition: rohc_decomp_rfc3095.h:82
uint8_t rtp_x
Definition: rohc_decomp_rfc3095.h:184
uint16_t udp_dst
Definition: rohc_decomp_rfc3095.h:270
void * specific
Profile-specific data.
Definition: rohc_decomp_rfc3095.h:449
uint8_t daddr[16]
Definition: rohc_decomp_rfc3095.h:96
uint8_t df
Definition: rohc_decomp_rfc3095.h:64
uint8_t ttl
Definition: rohc_decomp_rfc3095.h:235
uint8_t proto
Definition: rohc_decomp_rfc3095.h:236
uint16_t udp_src
Definition: rohc_decomp_rfc3095.h:269
size_t rtp_version_nr
Definition: rohc_decomp_rfc3095.h:176
uint8_t sid
Definition: rohc_decomp_rfc3095.h:239
uint32_t flowid
Definition: rohc_decomp_rfc3095.h:240
size_t daddr_nr
Definition: rohc_decomp_rfc3095.h:98
uint8_t rnd
Definition: rohc_decomp_rfc3095.h:80
size_t rtp_cc_nr
Definition: rohc_decomp_rfc3095.h:191
bool multiple_ip
Definition: rohc_decomp_rfc3095.h:123
uint16_t id
Definition: rohc_decomp_rfc3095.h:58
unsigned int next_header_len
The length of the next header.
Definition: rohc_decomp_rfc3095.h:322
uint32_t ts
Definition: rohc_decomp_rfc3095.h:290
Window-based Least Significant Bits (W-LSB) decoding.
size_t udp_check_nr
Definition: rohc_decomp_rfc3095.h:155
size_t udp_src_nr
Definition: rohc_decomp_rfc3095.h:144
size_t proto_nr
Definition: rohc_decomp_rfc3095.h:74
uint32_t rtp_ssrc
Definition: rohc_decomp_rfc3095.h:291
rohc_crc_type_t
Definition: crc.h:56
A network buffer for the ROHC library.
Definition: rohc_buf.h:102
Store information about an IP header between the different decompressions of IP packets.
Definition: rohc_decomp_rfc3095.h:307
uint8_t rtp_cc
Definition: rohc_decomp_rfc3095.h:287
unsigned short next_header_proto
The IP protocol ID of the protocol the context is able to decompress.
Definition: rohc_decomp_rfc3095.h:370
A timestamp for the ROHC library.
Definition: rohc_time.h:51
uint16_t udp_check
Definition: rohc_decomp_rfc3095.h:271
rohc_tristate_t udp_check_present
Definition: rohc_decomp_rfc3095.h:272
uint8_t tos
Definition: rohc_decomp_rfc3095.h:232
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:5635
uint8_t rtp_x
Definition: rohc_decomp_rfc3095.h:286
ROHC generic list decompression.
Definition: rohc_decomp_rfc3095.h:229
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:545
size_t mode_nr
Definition: rohc_decomp_rfc3095.h:136
size_t df_nr
Definition: rohc_decomp_rfc3095.h:66
size_t ttl_nr
Definition: rohc_decomp_rfc3095.h:70
uint32_t rtp_ssrc
Definition: rohc_decomp_rfc3095.h:213
bool is_ts_scaled
Definition: rohc_decomp_rfc3095.h:210
int rnd
Whether the IP-ID is considered as random or not (IPv4 only)
Definition: rohc_decomp_rfc3095.h:313
Definition: rohc_decomp_internals.h:241
Definition of ROHC packets and extensions.
uint8_t version
Definition: rohc_decomp_rfc3095.h:51
The ROHC decompression context.
Definition: rohc_decomp_internals.h:274
uint8_t nbo
Definition: rohc_decomp_rfc3095.h:237
uint8_t rtp_m
Definition: rohc_decomp_rfc3095.h:194
rohc_tristate_t cfp
Definition: rohc_decomp_rfc3095.h:278
uint16_t udp_dst
Definition: rohc_decomp_rfc3095.h:146
bool is_context_reused
Definition: rohc_decomp_rfc3095.h:111
Definition: rohc_decomp_internals.h:223
uint8_t rtp_p
Definition: rohc_decomp_rfc3095.h:179
int nbo
Whether the IP-ID is considered as coded in NBO or not (IPv4 only)
Definition: rohc_decomp_rfc3095.h:315
rohc_lsb_ref_t
Definition: decomp_wlsb.h:43
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:460
bool multiple_ip
Definition: rohc_decomp_rfc3095.h:261
size_t flowid_nr
Definition: rohc_decomp_rfc3095.h:90
bool is_context_reused
Definition: rohc_decomp_rfc3095.h:254
Defines an IP-agnostic packet that can handle an IPv4 or IPv6 packet.
Definition: ip.h:77
IP version 4.
Definition: ip.h:52
size_t udp_lite_cc_nr
Definition: rohc_decomp_rfc3095.h:167
uint8_t saddr[16]
Definition: rohc_decomp_rfc3095.h:92
uint8_t ext_flag
Definition: rohc_decomp_rfc3095.h:132
size_t sid_nr
Definition: rohc_decomp_rfc3095.h:86
rohc_mode_t mode
Definition: rohc_decomp_rfc3095.h:258
The values decoded from the bits extracted from ROHC header.
Definition: rohc_decomp_rfc3095.h:252
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:1327
uint32_t flowid
Definition: rohc_decomp_rfc3095.h:88
size_t sn_nr
Definition: rohc_decomp_rfc3095.h:115
uint8_t rtp_version
Definition: rohc_decomp_rfc3095.h:174
uint8_t nbo
Definition: rohc_decomp_rfc3095.h:76
uint8_t ttl
Definition: rohc_decomp_rfc3095.h:68
rohc_tristate_t
Definition: rohc_utils.h:33
rohc_packet_cce_t cce_pkt
Definition: rohc_decomp_rfc3095.h:277
uint8_t tos
Definition: rohc_decomp_rfc3095.h:54
ROHC decompression routines.
uint8_t rtp_pt
Definition: rohc_decomp_rfc3095.h:289
Definition: rohc_decomp_rfc3095.h:49
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
uint8_t mode
Definition: rohc_decomp_rfc3095.h:135
int sid
Whether the IP-ID is considered as static or not (IPv4 only)
Definition: rohc_decomp_rfc3095.h:317
uint32_t esp_spi
Definition: rohc_decomp_rfc3095.h:295
bool is_id_enc
Definition: rohc_decomp_rfc3095.h:62
int multiple_ip
Whether the decompressed packet contains a 2nd IP header.
Definition: rohc_decomp_rfc3095.h:355
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:5438
size_t ts_nr
Definition: rohc_decomp_rfc3095.h:209