30 #ifndef ROHC_DECOMP_RFC3095_H 31 #define ROHC_DECOMP_RFC3095_H 38 #include "schemes/ip_id_offset.h" 380 const uint8_t *packet,
387 const uint8_t *packet,
405 const uint8_t *
const rohc_data,
406 const size_t rohc_data_len,
409 __attribute__((warn_unused_result, nonnull(1, 2, 5)));
413 const uint8_t *packet,
421 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
427 const unsigned int payload_len);
431 const uint8_t *
const ip2,
432 const uint8_t *
const next_header,
434 const uint8_t init_val,
435 const uint8_t *
const crc_table);
439 const uint8_t *
const ip2,
440 const uint8_t *
const next_header,
442 const uint8_t init_val,
443 const uint8_t *
const crc_table);
448 __attribute__((nonnull(1, 2)));
463 void *
const trace_cb_priv,
464 const int profile_id)
465 __attribute__((warn_unused_result, nonnull(1, 2, 3)));
469 __attribute__((nonnull(1, 2)));
473 const size_t large_cid_len,
477 size_t *
const rohc_hdr_len)
478 __attribute__((warn_unused_result, nonnull(1, 4, 5, 6, 7)));
485 const size_t payload_len,
487 size_t *
const uncomp_hdrs_len)
488 __attribute__((warn_unused_result, nonnull(1, 2, 4, 5, 7, 8)));
492 const size_t payload_len,
494 __attribute__((warn_unused_result, nonnull(1, 2, 4)));
498 const size_t payload_len,
499 bool *
const do_change_mode)
500 __attribute__((nonnull(1, 2, 4)));
504 const struct rohc_ts pkt_arrival_time,
507 __attribute__((warn_unused_result, nonnull(1, 2, 4, 5)));
510 __attribute__((warn_unused_result, nonnull(1)));
520 __attribute__((warn_unused_result, pure, always_inline));
523 __attribute__((warn_unused_result, pure, always_inline));
526 __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:47
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:535
uint32_t sn
Definition: rohc_decomp_rfc3095.h:258
uint8_t proto
Definition: rohc_decomp_rfc3095.h:74
uint32_t esp_spi
Definition: rohc_decomp_rfc3095.h:224
The ROHC decompressor.
Definition: rohc_decomp_internals.h:142
size_t udp_dst_nr
Definition: rohc_decomp_rfc3095.h:150
size_t rtp_ssrc_nr
Definition: rohc_decomp_rfc3095.h:217
uint8_t rtp_pt
Definition: rohc_decomp_rfc3095.h:202
rohc_tristate_t cfi
Definition: rohc_decomp_rfc3095.h:281
uint8_t crc_static_7_cached
Definition: rohc_decomp_rfc3095.h:366
bool is_crc_static_7_cached_valid
Definition: rohc_decomp_rfc3095.h:364
uint16_t udp_lite_cc
Definition: rohc_decomp_rfc3095.h:166
uint32_t sn
Definition: rohc_decomp_rfc3095.h:116
rohc_mode_t
ROHC operation modes.
Definition: rohc.h:111
size_t rtp_pt_nr
Definition: rohc_decomp_rfc3095.h:205
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:4216
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:559
uint16_t udp_lite_cc
Definition: rohc_decomp_rfc3095.h:282
The generic decompression context for RFC3095-based profiles.
Definition: rohc_decomp_rfc3095.h:335
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:6156
rohc_tristate_t udp_check_present
Definition: rohc_decomp_rfc3095.h:152
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:240
size_t nbo_nr
Definition: rohc_decomp_rfc3095.h:80
uint8_t rtp_cc
Definition: rohc_decomp_rfc3095.h:191
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
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:233
size_t tos_nr
Definition: rohc_decomp_rfc3095.h:58
struct rohc_decomp_rfc3095_changes * inner_ip_changes
Information about the inner IP header.
Definition: rohc_decomp_rfc3095.h:340
unsigned int next_header_len
The length of the next header.
Definition: rohc_decomp_rfc3095.h:375
uint8_t sid
Definition: rohc_decomp_rfc3095.h:86
uint16_t udp_src
Definition: rohc_decomp_rfc3095.h:144
The bits extracted from ROHC UO* base headers.
Definition: rohc_decomp_rfc3095.h:111
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:338
uint8_t rtp_m
Definition: rohc_decomp_rfc3095.h:290
rohc_packet_cce_t cce_pkt
Definition: rohc_decomp_rfc3095.h:163
size_t rtp_x_nr
Definition: rohc_decomp_rfc3095.h:188
size_t rtp_p_nr
Definition: rohc_decomp_rfc3095.h:183
bool is_crc_static_3_cached_valid
Definition: rohc_decomp_rfc3095.h:360
uint32_t ts
Definition: rohc_decomp_rfc3095.h:208
bool static_chain_end
Definition: rohc_decomp_rfc3095.h:53
size_t rtp_m_nr
Definition: rohc_decomp_rfc3095.h:199
Internal structures for ROHC decompression.
rohc_lsb_ref_t lsb_ref_type
Definition: rohc_decomp_rfc3095.h:119
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:96
rohc_tristate_t cfi
Definition: rohc_decomp_rfc3095.h:165
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:343
size_t id_nr
Definition: rohc_decomp_rfc3095.h:63
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:121
uint8_t rtp_p
Definition: rohc_decomp_rfc3095.h:287
uint16_t id
Definition: rohc_decomp_rfc3095.h:235
Define the UDP-Lite protocol.
uint8_t rtp_version
Definition: rohc_decomp_rfc3095.h:286
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:6070
uint8_t df
Definition: rohc_decomp_rfc3095.h:236
uint16_t udp_check
Definition: rohc_decomp_rfc3095.h:154
rohc_tristate_t cfp
Definition: rohc_decomp_rfc3095.h:164
uint8_t crc_static_3_cached
Definition: rohc_decomp_rfc3095.h:362
void * next_header
The next header located after the IP header(s)
Definition: rohc_decomp_rfc3095.h:322
bool is_sn_enc
Definition: rohc_decomp_rfc3095.h:118
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:4886
size_t esp_spi_nr
Definition: rohc_decomp_rfc3095.h:226
size_t rnd_nr
Definition: rohc_decomp_rfc3095.h:84
uint8_t rtp_x
Definition: rohc_decomp_rfc3095.h:186
uint16_t udp_dst
Definition: rohc_decomp_rfc3095.h:272
void * specific
Profile-specific data.
Definition: rohc_decomp_rfc3095.h:451
uint8_t daddr[16]
Definition: rohc_decomp_rfc3095.h:98
uint8_t df
Definition: rohc_decomp_rfc3095.h:66
uint8_t ttl
Definition: rohc_decomp_rfc3095.h:237
uint8_t proto
Definition: rohc_decomp_rfc3095.h:238
uint16_t udp_src
Definition: rohc_decomp_rfc3095.h:271
size_t rtp_version_nr
Definition: rohc_decomp_rfc3095.h:178
uint8_t sid
Definition: rohc_decomp_rfc3095.h:241
uint32_t flowid
Definition: rohc_decomp_rfc3095.h:242
size_t daddr_nr
Definition: rohc_decomp_rfc3095.h:100
uint8_t rnd
Definition: rohc_decomp_rfc3095.h:82
size_t rtp_cc_nr
Definition: rohc_decomp_rfc3095.h:193
bool multiple_ip
Definition: rohc_decomp_rfc3095.h:125
uint16_t id
Definition: rohc_decomp_rfc3095.h:60
unsigned int next_header_len
The length of the next header.
Definition: rohc_decomp_rfc3095.h:324
uint32_t ts
Definition: rohc_decomp_rfc3095.h:292
Window-based Least Significant Bits (W-LSB) decoding.
size_t udp_check_nr
Definition: rohc_decomp_rfc3095.h:157
size_t udp_src_nr
Definition: rohc_decomp_rfc3095.h:146
size_t proto_nr
Definition: rohc_decomp_rfc3095.h:76
uint32_t rtp_ssrc
Definition: rohc_decomp_rfc3095.h:293
rohc_crc_type_t
Definition: crc.h:58
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:309
uint8_t rtp_cc
Definition: rohc_decomp_rfc3095.h:289
unsigned short next_header_proto
The IP protocol ID of the protocol the context is able to decompress.
Definition: rohc_decomp_rfc3095.h:372
A timestamp for the ROHC library.
Definition: rohc_time.h:51
uint16_t udp_check
Definition: rohc_decomp_rfc3095.h:273
rohc_tristate_t udp_check_present
Definition: rohc_decomp_rfc3095.h:274
uint8_t tos
Definition: rohc_decomp_rfc3095.h:234
uint8_t rtp_x
Definition: rohc_decomp_rfc3095.h:288
ROHC generic list decompression.
Definition: rohc_decomp_rfc3095.h:231
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:547
size_t mode_nr
Definition: rohc_decomp_rfc3095.h:138
size_t df_nr
Definition: rohc_decomp_rfc3095.h:68
size_t ttl_nr
Definition: rohc_decomp_rfc3095.h:72
rohc_status_t 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:5567
uint32_t rtp_ssrc
Definition: rohc_decomp_rfc3095.h:215
bool is_ts_scaled
Definition: rohc_decomp_rfc3095.h:212
int rnd
Whether the IP-ID is considered as random or not (IPv4 only)
Definition: rohc_decomp_rfc3095.h:315
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:239
uint8_t rtp_m
Definition: rohc_decomp_rfc3095.h:196
rohc_tristate_t cfp
Definition: rohc_decomp_rfc3095.h:280
uint16_t udp_dst
Definition: rohc_decomp_rfc3095.h:148
bool is_context_reused
Definition: rohc_decomp_rfc3095.h:113
Definition: rohc_decomp_internals.h:223
uint8_t rtp_p
Definition: rohc_decomp_rfc3095.h:181
int nbo
Whether the IP-ID is considered as coded in NBO or not (IPv4 only)
Definition: rohc_decomp_rfc3095.h:317
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:263
size_t flowid_nr
Definition: rohc_decomp_rfc3095.h:92
bool is_context_reused
Definition: rohc_decomp_rfc3095.h:256
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:169
uint8_t saddr[16]
Definition: rohc_decomp_rfc3095.h:94
uint8_t ext_flag
Definition: rohc_decomp_rfc3095.h:134
size_t sid_nr
Definition: rohc_decomp_rfc3095.h:88
rohc_mode_t mode
Definition: rohc_decomp_rfc3095.h:260
The values decoded from the bits extracted from ROHC header.
Definition: rohc_decomp_rfc3095.h:254
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:1309
uint32_t flowid
Definition: rohc_decomp_rfc3095.h:90
size_t sn_nr
Definition: rohc_decomp_rfc3095.h:117
uint8_t rtp_version
Definition: rohc_decomp_rfc3095.h:176
uint8_t nbo
Definition: rohc_decomp_rfc3095.h:78
uint8_t ttl
Definition: rohc_decomp_rfc3095.h:70
rohc_tristate_t
Definition: rohc_utils.h:33
rohc_packet_cce_t cce_pkt
Definition: rohc_decomp_rfc3095.h:279
uint8_t tos
Definition: rohc_decomp_rfc3095.h:56
ROHC decompression routines.
uint8_t rtp_pt
Definition: rohc_decomp_rfc3095.h:291
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:295
uint8_t mode
Definition: rohc_decomp_rfc3095.h:137
int sid
Whether the IP-ID is considered as static or not (IPv4 only)
Definition: rohc_decomp_rfc3095.h:319
uint32_t esp_spi
Definition: rohc_decomp_rfc3095.h:297
bool is_id_enc
Definition: rohc_decomp_rfc3095.h:64
int multiple_ip
Whether the decompressed packet contains a 2nd IP header.
Definition: rohc_decomp_rfc3095.h:357
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:5358
size_t ts_nr
Definition: rohc_decomp_rfc3095.h:211