30 #ifndef ROHC_DECOMP_RFC3095_H 31 #define ROHC_DECOMP_RFC3095_H 38 #include "schemes/ip_id_offset.h" 358 const uint8_t *packet,
365 const uint8_t *packet,
383 const uint8_t *
const rohc_data,
384 const size_t rohc_data_len,
387 __attribute__((warn_unused_result,
nonnull(1, 2, 5)));
391 const uint8_t *packet,
399 __attribute__((warn_unused_result,
nonnull(1, 2, 3)));
405 const unsigned int payload_len);
410 const uint8_t init_val)
411 __attribute__((warn_unused_result,
nonnull(1)));
416 const uint8_t init_val)
417 __attribute__((warn_unused_result,
nonnull(1)));
422 __attribute__((
nonnull(1, 2)));
437 void *
const trace_cb_priv,
438 const int profile_id)
439 __attribute__((warn_unused_result,
nonnull(1, 2, 3)));
443 __attribute__((
nonnull(1, 2)));
447 const size_t large_cid_len,
451 size_t *
const rohc_hdr_len)
452 __attribute__((warn_unused_result,
nonnull(1, 4, 5, 6, 7)));
455 const uint8_t *
const flags,
456 const uint8_t *fields,
458 bool *
const last_flag,
460 __attribute__((warn_unused_result,
nonnull(1, 2, 3, 5, 6)));
463 const uint8_t *
const flags,
464 const uint8_t *fields,
467 __attribute__((warn_unused_result,
nonnull(1, 2, 3, 5)));
474 const size_t payload_len,
476 size_t *
const uncomp_hdrs_len)
477 __attribute__((warn_unused_result,
nonnull(1, 2, 4, 5, 7, 8)));
481 const size_t payload_len,
483 __attribute__((warn_unused_result,
nonnull(1, 2, 4)));
487 const size_t payload_len,
488 bool *
const do_change_mode)
489 __attribute__((
nonnull(1, 2, 4)));
493 const struct rohc_ts pkt_arrival_time,
496 __attribute__((warn_unused_result,
nonnull(1, 2, 4, 5)));
499 __attribute__((warn_unused_result,
nonnull(1)));
509 __attribute__((warn_unused_result, pure, always_inline));
512 __attribute__((warn_unused_result, pure, always_inline));
515 __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:501
struct rohc_extr_ip_bits inner_ip
Definition: rohc_decomp_rfc3095.h:130
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:524
uint32_t sn
Definition: rohc_decomp_rfc3095.h:245
uint8_t proto
Definition: rohc_decomp_rfc3095.h:73
uint32_t esp_spi
Definition: rohc_decomp_rfc3095.h:211
The ROHC decompressor.
Definition: rohc_decomp_internals.h:138
size_t udp_dst_nr
Definition: rohc_decomp_rfc3095.h:149
size_t rtp_ssrc_nr
Definition: rohc_decomp_rfc3095.h:204
int rfc3095_parse_outer_hdr_flags_fields(const struct rohc_decomp_ctxt *const context, const uint8_t *const flags, const uint8_t *fields, const size_t length, struct rohc_extr_ip_bits *const bits)
Parse the outer IP header flags and fields.
Definition: rohc_decomp_rfc3095.c:5073
uint8_t rtp_pt
Definition: rohc_decomp_rfc3095.h:189
struct ip_id_offset_decode inner_ip_id_offset_ctxt
The IP-ID of the inner IP header.
Definition: rohc_decomp_rfc3095.h:327
uint8_t saddr[16]
Definition: rohc_decomp_rfc3095.h:230
uint8_t crc_static_7_cached
Definition: rohc_decomp_rfc3095.h:344
uint8_t(* compute_crc_static)(const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, const rohc_crc_type_t crc_type, const uint8_t init_val)
The handler used to compute the CRC-STATIC value.
Definition: rohc_decomp_rfc3095.h:408
bool is_crc_static_7_cached_valid
Definition: rohc_decomp_rfc3095.h:342
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:357
uint32_t sn
Definition: rohc_decomp_rfc3095.h:115
rohc_mode_t
ROHC operation modes.
Definition: rohc.h:112
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:382
size_t rtp_pt_nr
Definition: rohc_decomp_rfc3095.h:192
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:548
The generic decompression context for RFC3095-based profiles.
Definition: rohc_decomp_rfc3095.h:315
rohc_tristate_t udp_check_present
Definition: rohc_decomp_rfc3095.h:151
The volatile part of the ROHC decompression context.
Definition: rohc_decomp_internals.h:249
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:358
uint8_t rnd
Definition: rohc_decomp_rfc3095.h:227
size_t nbo_nr
Definition: rohc_decomp_rfc3095.h:79
uint8_t rtp_cc
Definition: rohc_decomp_rfc3095.h:178
rohc_status_t
The status code of several functions in the library API.
Definition: rohc.h:80
uint8_t version
Definition: rohc_decomp_rfc3095.h:220
size_t tos_nr
Definition: rohc_decomp_rfc3095.h:57
struct rohc_decomp_rfc3095_changes * inner_ip_changes
Information about the inner IP header.
Definition: rohc_decomp_rfc3095.h:320
unsigned int next_header_len
The length of the next header.
Definition: rohc_decomp_rfc3095.h:353
uint8_t sid
Definition: rohc_decomp_rfc3095.h:85
uint16_t udp_src
Definition: rohc_decomp_rfc3095.h:143
The bits extracted from ROHC UO* base headers.
Definition: rohc_decomp_rfc3095.h:110
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:318
uint8_t rtp_m
Definition: rohc_decomp_rfc3095.h:270
size_t rtp_x_nr
Definition: rohc_decomp_rfc3095.h:175
size_t rtp_p_nr
Definition: rohc_decomp_rfc3095.h:170
bool is_crc_static_3_cached_valid
Definition: rohc_decomp_rfc3095.h:338
uint32_t ts
Definition: rohc_decomp_rfc3095.h:195
bool static_chain_end
Definition: rohc_decomp_rfc3095.h:52
size_t rtp_m_nr
Definition: rohc_decomp_rfc3095.h:186
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:396
struct list_decomp list_decomp1
The list decompressor of the outer IP header.
Definition: rohc_decomp_rfc3095.h:330
rohc_lsb_ref_t lsb_ref_type
Definition: rohc_decomp_rfc3095.h:118
struct rohc_lsb_decode sn_lsb_ctxt
The LSB decoding context for the Sequence Number (SN)
Definition: rohc_decomp_rfc3095.h:323
The Least Significant Bits (LSB) decoding object.
Definition: decomp_wlsb.h:59
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:364
size_t saddr_nr
Definition: rohc_decomp_rfc3095.h:95
Miscellaneous utils for ROHC libraries.
size_t id_nr
Definition: rohc_decomp_rfc3095.h:62
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:120
uint8_t rtp_p
Definition: rohc_decomp_rfc3095.h:267
uint16_t id
Definition: rohc_decomp_rfc3095.h:222
uint8_t rtp_version
Definition: rohc_decomp_rfc3095.h:266
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:6460
uint8_t df
Definition: rohc_decomp_rfc3095.h:223
uint16_t udp_check
Definition: rohc_decomp_rfc3095.h:153
uint8_t crc_static_3_cached
Definition: rohc_decomp_rfc3095.h:340
void(* update_context)(struct rohc_decomp_ctxt *const context, const struct rohc_decoded_values *const decoded)
Definition: rohc_decomp_rfc3095.h:420
void * next_header
The next header located after the IP header(s)
Definition: rohc_decomp_rfc3095.h:302
bool is_sn_enc
Definition: rohc_decomp_rfc3095.h:117
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:5168
size_t esp_spi_nr
Definition: rohc_decomp_rfc3095.h:213
size_t rnd_nr
Definition: rohc_decomp_rfc3095.h:83
uint8_t rtp_x
Definition: rohc_decomp_rfc3095.h:173
uint16_t udp_dst
Definition: rohc_decomp_rfc3095.h:259
void * specific
Profile-specific data.
Definition: rohc_decomp_rfc3095.h:425
uint8_t daddr[16]
Definition: rohc_decomp_rfc3095.h:97
uint8_t df
Definition: rohc_decomp_rfc3095.h:65
uint8_t ttl
Definition: rohc_decomp_rfc3095.h:224
uint8_t proto
Definition: rohc_decomp_rfc3095.h:225
uint16_t udp_src
Definition: rohc_decomp_rfc3095.h:258
size_t rtp_version_nr
Definition: rohc_decomp_rfc3095.h:165
uint8_t sid
Definition: rohc_decomp_rfc3095.h:228
uint32_t flowid
Definition: rohc_decomp_rfc3095.h:229
size_t daddr_nr
Definition: rohc_decomp_rfc3095.h:99
uint8_t rnd
Definition: rohc_decomp_rfc3095.h:81
size_t rtp_cc_nr
Definition: rohc_decomp_rfc3095.h:180
bool multiple_ip
Definition: rohc_decomp_rfc3095.h:124
uint16_t id
Definition: rohc_decomp_rfc3095.h:59
struct rohc_extr_ip_bits outer_ip
Definition: rohc_decomp_rfc3095.h:127
unsigned int next_header_len
The length of the next header.
Definition: rohc_decomp_rfc3095.h:304
uint32_t ts
Definition: rohc_decomp_rfc3095.h:272
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:402
Window-based Least Significant Bits (W-LSB) decoding.
size_t udp_check_nr
Definition: rohc_decomp_rfc3095.h:156
size_t udp_src_nr
Definition: rohc_decomp_rfc3095.h:145
size_t proto_nr
Definition: rohc_decomp_rfc3095.h:75
uint32_t rtp_ssrc
Definition: rohc_decomp_rfc3095.h:273
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:289
uint8_t rtp_cc
Definition: rohc_decomp_rfc3095.h:269
uint8_t(* compute_crc_dynamic)(const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, const rohc_crc_type_t crc_type, const uint8_t init_val)
The handler used to compute the CRC-DYNAMIC value.
Definition: rohc_decomp_rfc3095.h:414
unsigned short next_header_proto
The IP protocol ID of the protocol the context is able to decompress.
Definition: rohc_decomp_rfc3095.h:350
A timestamp for the ROHC library.
Definition: rohc_time.h:51
uint16_t udp_check
Definition: rohc_decomp_rfc3095.h:260
rohc_tristate_t udp_check_present
Definition: rohc_decomp_rfc3095.h:261
uint8_t tos
Definition: rohc_decomp_rfc3095.h:221
The information collected about the packet headers.
Definition: uncomp_pkt_hdrs.h:102
struct ip_packet ip
The IP header.
Definition: rohc_decomp_rfc3095.h:292
uint8_t rtp_x
Definition: rohc_decomp_rfc3095.h:268
ROHC generic list decompression.
Definition: rohc_decomp_rfc3095.h:218
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:536
size_t mode_nr
Definition: rohc_decomp_rfc3095.h:137
size_t df_nr
Definition: rohc_decomp_rfc3095.h:67
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:390
size_t ttl_nr
Definition: rohc_decomp_rfc3095.h:71
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:5951
uint32_t rtp_ssrc
Definition: rohc_decomp_rfc3095.h:202
bool is_ts_scaled
Definition: rohc_decomp_rfc3095.h:199
int rnd
Whether the IP-ID is considered as random or not (IPv4 only)
Definition: rohc_decomp_rfc3095.h:295
Definition: rohc_decomp_internals.h:233
Definition of ROHC packets and extensions.
uint8_t version
Definition: rohc_decomp_rfc3095.h:50
struct rohc_decoded_ip_values outer_ip
Definition: rohc_decomp_rfc3095.h:252
The ROHC decompression context.
Definition: rohc_decomp_internals.h:267
uint8_t nbo
Definition: rohc_decomp_rfc3095.h:226
uint8_t rtp_m
Definition: rohc_decomp_rfc3095.h:183
struct ip_id_offset_decode outer_ip_id_offset_ctxt
The IP-ID of the outer IP header.
Definition: rohc_decomp_rfc3095.h:325
uint16_t udp_dst
Definition: rohc_decomp_rfc3095.h:147
bool is_context_reused
Definition: rohc_decomp_rfc3095.h:112
Definition: rohc_decomp_internals.h:207
uint8_t rtp_p
Definition: rohc_decomp_rfc3095.h:168
int nbo
Whether the IP-ID is considered as coded in NBO or not (IPv4 only)
Definition: rohc_decomp_rfc3095.h:297
rohc_lsb_ref_t
Definition: decomp_wlsb.h:45
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:456
int rfc3095_parse_hdr_flags_fields(const struct rohc_decomp_ctxt *const context, const uint8_t *const flags, const uint8_t *fields, const size_t length, bool *const last_flag, struct rohc_extr_ip_bits *const bits)
Parse the inner or outer IP header flags and fields.
Definition: rohc_decomp_rfc3095.c:4940
bool multiple_ip
Definition: rohc_decomp_rfc3095.h:250
size_t flowid_nr
Definition: rohc_decomp_rfc3095.h:91
bool is_context_reused
Definition: rohc_decomp_rfc3095.h:243
Defines an IP-agnostic packet that can handle an IPv4 or IPv6 packet.
Definition: ip.h:77
IP version 4.
Definition: ip.h:52
uint8_t saddr[16]
Definition: rohc_decomp_rfc3095.h:93
struct rohc_decoded_ip_values inner_ip
Definition: rohc_decomp_rfc3095.h:254
uint8_t ext_flag
Definition: rohc_decomp_rfc3095.h:133
size_t sid_nr
Definition: rohc_decomp_rfc3095.h:87
rohc_mode_t mode
Definition: rohc_decomp_rfc3095.h:247
The values decoded from the bits extracted from ROHC header.
Definition: rohc_decomp_rfc3095.h:241
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:1306
uint32_t flowid
Definition: rohc_decomp_rfc3095.h:89
size_t sn_nr
Definition: rohc_decomp_rfc3095.h:116
uint8_t rtp_version
Definition: rohc_decomp_rfc3095.h:163
uint8_t nbo
Definition: rohc_decomp_rfc3095.h:77
uint8_t ttl
Definition: rohc_decomp_rfc3095.h:69
rohc_tristate_t
Definition: rohc_utils.h:33
uint8_t tos
Definition: rohc_decomp_rfc3095.h:55
ROHC decompression routines.
struct list_decomp list_decomp2
The list decompressor of the inner IP header.
Definition: rohc_decomp_rfc3095.h:332
uint8_t rtp_pt
Definition: rohc_decomp_rfc3095.h:271
Definition: rohc_decomp_rfc3095.h:48
rohc_packet_t
The different types of ROHC packets.
Definition: rohc_packets.h:55
uint8_t daddr[16]
Definition: rohc_decomp_rfc3095.h:231
uint8_t mode
Definition: rohc_decomp_rfc3095.h:136
int sid
Whether the IP-ID is considered as static or not (IPv4 only)
Definition: rohc_decomp_rfc3095.h:299
uint32_t esp_spi
Definition: rohc_decomp_rfc3095.h:277
bool is_id_enc
Definition: rohc_decomp_rfc3095.h:63
int multiple_ip
Whether the decompressed packet contains a 2nd IP header.
Definition: rohc_decomp_rfc3095.h:335
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:5728
size_t ts_nr
Definition: rohc_decomp_rfc3095.h:198