ROHC compression/decompression library
Data Structures | Functions | Variables
decomp_rfc5225_ip_udp_rtp.c File Reference

ROHC decompression context for the ROHCv2 IP/UDP/RTP profile. More...

#include "rohc_decomp.h"
#include "rohc_decomp_internals.h"
#include "rohc_traces_internal.h"
#include "rohc_decomp_detect_packet.h"
#include "protocols/ip_numbers.h"
#include "protocols/ip.h"
#include "protocols/rfc5225.h"
#include "schemes/ip_ctxt.h"
#include "schemes/decomp_wlsb.h"
#include "schemes/decomp_crc.h"
#include "schemes/rfc4996.h"
#include "rohc_bit_ops.h"
#include "crc.h"
#include "rohc_debug.h"
#include "interval.h"
#include <string.h>
Include dependency graph for decomp_rfc5225_ip_udp_rtp.c:

Data Structures

struct  rohc_decomp_rfc5225_ip_udp_rtp_ctxt
 
struct  rohc_rfc5225_ip_bits
 
struct  rohc_rfc5225_bits
 
struct  rohc_rfc5225_decoded_ip
 
struct  rohc_rfc5225_decoded
 

Functions

static bool decomp_rfc5225_ip_udp_rtp_new_context (const struct rohc_decomp_ctxt *const context, void **const persist_ctxt, struct rohc_decomp_volat_ctxt *const volat_ctxt)
 Create the ROHCv2 IP/UDP/RTP volatile and persistent parts of the context. More...
 
static void decomp_rfc5225_ip_udp_rtp_free_context (struct rohc_decomp_rfc5225_ip_udp_rtp_ctxt *const rfc5225_ctxt, const struct rohc_decomp_volat_ctxt *const volat_ctxt)
 Destroy profile-specific data, nothing to destroy for the ROHCv2 IP/UDP/RTP profile. More...
 
static rohc_packet_t decomp_rfc5225_ip_udp_rtp_detect_pkt_type (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len)
 Detect the type of ROHC packet for the ROHCv2 IP/UDP/RTP profile. More...
 
static bool decomp_rfc5225_ip_udp_rtp_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_rfc5225_bits *const bits, size_t *const rohc_hdr_len)
 Parse one ROHC packet for the ROHCv2 IP/UDP/RTP profile. More...
 
static void decomp_rfc5225_ip_udp_rtp_reset_extr_bits (const struct rohc_decomp_ctxt *const ctxt, struct rohc_rfc5225_bits *const bits)
 Reset the extracted bits for next parsing. More...
 
static bool decomp_rfc5225_ip_udp_rtp_parse_ir (const struct rohc_decomp_ctxt *const ctxt, const struct rohc_buf rohc_pkt, const size_t large_cid_len, struct rohc_decomp_crc *const extr_crc, struct rohc_rfc5225_bits *const bits, size_t *const rohc_hdr_len)
 Parse one IR packet for the ROHCv2 IP/UDP/RTP profile. More...
 
static bool decomp_rfc5225_ip_udp_rtp_parse_co_repair (const struct rohc_decomp_ctxt *const ctxt, const struct rohc_buf rohc_pkt, const size_t large_cid_len, struct rohc_decomp_crc *const hdr_crc, struct rohc_rfc5225_bits *const bits, size_t *const rohc_hdr_len)
 Parse one co_repair packet for the ROHCv2 IP/UDP/RTP profile. More...
 
static bool decomp_rfc5225_ip_udp_rtp_parse_static_chain (const struct rohc_decomp_ctxt *const ctxt, const uint8_t *const rohc_pkt, const size_t rohc_len, struct rohc_rfc5225_bits *const bits, size_t *const parsed_len)
 Parse the static chain of the IR packet. More...
 
static int decomp_rfc5225_ip_udp_rtp_parse_static_ip (const struct rohc_decomp_ctxt *const ctxt, const uint8_t *const rohc_pkt, const size_t rohc_len, struct rohc_rfc5225_ip_bits *const ip_bits, bool *const is_innermost)
 Decode the static IP header of the ROHC packet. More...
 
static int decomp_rfc5225_ip_udp_rtp_parse_static_udp (const struct rohc_decomp_ctxt *const ctxt, const uint8_t *rohc_pkt, const size_t rohc_len, struct rohc_rfc5225_bits *const bits)
 Parse the UDP static part of the ROHC packet. More...
 
static int decomp_rfc5225_ip_udp_rtp_parse_static_rtp (const struct rohc_decomp_ctxt *const ctxt, const uint8_t *rohc_pkt, const size_t rohc_len, struct rohc_rfc5225_bits *const bits)
 Parse the RTP static part of the ROHC packet. More...
 
static bool decomp_rfc5225_ip_udp_rtp_parse_dyn_chain (const struct rohc_decomp_ctxt *const ctxt, const uint8_t *const rohc_pkt, const size_t rohc_len, struct rohc_rfc5225_bits *const bits, size_t *const parsed_len)
 Parse the dynamic chain of the IR packet. More...
 
static int decomp_rfc5225_ip_udp_rtp_parse_dyn_ip (const struct rohc_decomp_ctxt *const ctxt, const uint8_t *const rohc_pkt, const size_t rohc_len, struct rohc_rfc5225_ip_bits *const ip_bits)
 Decode the dynamic IP header of the ROHC packet. More...
 
static int decomp_rfc5225_ip_udp_rtp_parse_dyn_udp (const struct rohc_decomp_ctxt *const ctxt, const uint8_t *rohc_pkt, const size_t rohc_len, struct rohc_rfc5225_bits *const bits)
 Parse the UDP dynamic part of the ROHC packet. More...
 
static int decomp_rfc5225_ip_udp_rtp_parse_dyn_rtp (const struct rohc_decomp_ctxt *const ctxt, const uint8_t *rohc_pkt, const size_t rohc_len, struct rohc_rfc5225_bits *const bits)
 Parse the RTP dynamic part of the ROHC packet. More...
 
static rohc_status_t decomp_rfc5225_ip_udp_rtp_decode_bits (const struct rohc_decomp_ctxt *const ctxt, const struct rohc_rfc5225_bits *const bits, const size_t payload_len, struct rohc_rfc5225_decoded *const decoded)
 Decode values from extracted bits for the ROHCv2 IP/UDP/RTP profile. More...
 
static bool decomp_rfc5225_ip_udp_rtp_decode_bits_ip_hdrs (const struct rohc_decomp_ctxt *const ctxt, const struct rohc_rfc5225_bits *const bits, struct rohc_rfc5225_decoded *const decoded)
 Decode values for all IP headers from extracted bits. More...
 
static bool decomp_rfc5225_ip_udp_rtp_decode_bits_ip_hdr (const struct rohc_decomp_ctxt *const ctxt, const struct rohc_rfc5225_ip_bits *const ip_bits, const ip_context_t *const ip_ctxt, const bool is_innermost, const uint16_t decoded_msn, struct rohc_rfc5225_decoded_ip *const ip_decoded)
 Decode values for one IP header from extracted bits. More...
 
static rohc_status_t decomp_rfc5225_ip_udp_rtp_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_rfc5225_decoded *const decoded, const size_t payload_len, struct rohc_buf *const uncomp_hdrs, size_t *const uncomp_hdrs_len)
 Build the uncompressed headers for the ROHCv2 IP/UDP/RTP profile. More...
 
static bool decomp_rfc5225_ip_udp_rtp_build_ip_hdrs (const struct rohc_decomp_ctxt *const ctxt, const struct rohc_rfc5225_decoded *const decoded, struct rohc_buf *const uncomp_pkt, size_t *const ip_hdrs_len)
 Build all of the uncompressed IP headers. More...
 
static bool decomp_rfc5225_ip_udp_rtp_build_ip_hdr (const struct rohc_decomp_ctxt *const ctxt, const struct rohc_rfc5225_decoded_ip *const decoded, struct rohc_buf *const uncomp_pkt, size_t *const ip_hdr_len)
 Build one single uncompressed IP header. More...
 
static bool decomp_rfc5225_ip_udp_rtp_build_ipv4_hdr (const struct rohc_decomp_ctxt *const ctxt, const struct rohc_rfc5225_decoded_ip *const decoded, struct rohc_buf *const uncomp_pkt, size_t *const ip_hdr_len)
 Build one single uncompressed IPv4 header. More...
 
static bool decomp_rfc5225_ip_udp_rtp_build_ipv6_hdr (const struct rohc_decomp_ctxt *const ctxt, const struct rohc_rfc5225_decoded_ip *const decoded, struct rohc_buf *const uncomp_pkt, size_t *const ip_hdr_len)
 Build one single uncompressed IPv6 header. More...
 
static bool decomp_rfc5225_ip_udp_rtp_build_udp_hdr (const struct rohc_decomp_ctxt *const ctxt, const struct rohc_rfc5225_decoded *const decoded, const size_t payload_len, struct rohc_buf *const uncomp_pkt, size_t *const udp_hdr_len)
 Build the uncompressed UDP header. More...
 
static bool decomp_rfc5225_ip_udp_rtp_build_rtp_hdr (const struct rohc_decomp_ctxt *const ctxt, const struct rohc_rfc5225_decoded *const decoded, struct rohc_buf *const uncomp_pkt, size_t *const rtp_hdr_len)
 Build the uncompressed RTP header. More...
 
static void decomp_rfc5225_ip_udp_rtp_update_ctxt (struct rohc_decomp_ctxt *const context, const struct rohc_rfc5225_decoded *const decoded, const size_t payload_len, bool *const do_change_mode)
 Update the decompression context with the infos of current packet. More...
 
static bool decomp_rfc5225_ip_udp_rtp_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, void *const extr_bits)
 Attempt a packet/context repair upon CRC failure. More...
 
static uint32_t decomp_rfc5225_ip_udp_rtp_get_sn (const struct rohc_decomp_ctxt *const context)
 Get the reference SN value of the context. More...
 

Variables

const struct rohc_decomp_profile rohc_decomp_rfc5225_ip_udp_rtp_profile
 Define the decompression part of the ROHCv2 IP/UDP/RTP profile as described in the RFC 5225. More...
 

Detailed Description

ROHC decompression context for the ROHCv2 IP/UDP/RTP profile.

Author
Didier Barvaux didie.nosp@m.r.ba.nosp@m.rvaux.nosp@m.@tou.nosp@m.louse.nosp@m..viv.nosp@m.eris..nosp@m.com
Didier Barvaux didie.nosp@m.r@ba.nosp@m.rvaux.nosp@m..org
Valentin Boutonné vbout.nosp@m.onne.nosp@m.@toul.nosp@m.ouse.nosp@m..vive.nosp@m.ris..nosp@m.com

Function Documentation

◆ decomp_rfc5225_ip_udp_rtp_attempt_repair()

static bool decomp_rfc5225_ip_udp_rtp_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,
void *const  extr_bits 
)
static

Attempt a packet/context repair upon CRC failure.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters
decompThe ROHC decompressor
contextThe decompression context
pkt_arrival_timeThe arrival time of the ROHC packet that caused the CRC failure
[in,out]crc_corrThe context for corrections upon CRC failures
[in,out]extr_bitsThe bits extracted from the ROHC header
Returns
true if repair is possible, false if not

◆ decomp_rfc5225_ip_udp_rtp_build_hdrs()

static rohc_status_t decomp_rfc5225_ip_udp_rtp_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_rfc5225_decoded *const  decoded,
const size_t  payload_len,
struct rohc_buf *const  uncomp_hdrs,
size_t *const  uncomp_hdrs_len 
)
static

Build the uncompressed headers for the ROHCv2 IP/UDP/RTP profile.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters
decompThe ROHC decompressor
contextThe decompression context
packet_typeThe type of ROHC packet
extr_crcThe CRC bits extracted from the ROHC header
decodedThe values decoded from ROHC header
payload_lenThe length of the packet payload (in bytes)
[out]uncomp_hdrsThe uncompressed headers being built
[out]uncomp_hdrs_lenThe length of the uncompressed headers written into the buffer
Returns
Possible values:
  • ROHC_STATUS_OK if headers are built successfully,
  • ROHC_STATUS_OUTPUT_TOO_SMALL if uncomp_packet is too small

◆ decomp_rfc5225_ip_udp_rtp_build_ip_hdr()

static bool decomp_rfc5225_ip_udp_rtp_build_ip_hdr ( const struct rohc_decomp_ctxt *const  ctxt,
const struct rohc_rfc5225_decoded_ip *const  decoded,
struct rohc_buf *const  uncomp_pkt,
size_t *const  ip_hdr_len 
)
static

Build one single uncompressed IP header.

Build one single uncompressed IP header - IPv4 or IPv6 - from the context and packet information.

Parameters
ctxtThe decompression context
decodedThe values decoded from the ROHC packet
[out]uncomp_pktThe uncompressed packet being built
[out]ip_hdr_lenThe length of the IP header (in bytes)
Returns
true if IP header was successfully built, false if the output uncomp_packet was not large enough

◆ decomp_rfc5225_ip_udp_rtp_build_ip_hdrs()

static bool decomp_rfc5225_ip_udp_rtp_build_ip_hdrs ( const struct rohc_decomp_ctxt *const  ctxt,
const struct rohc_rfc5225_decoded *const  decoded,
struct rohc_buf *const  uncomp_pkt,
size_t *const  ip_hdrs_len 
)
static

Build all of the uncompressed IP headers.

Build all of the uncompressed IP headers - IPv4 or IPv6 - from the context and packet information.

Parameters
ctxtThe decompression context
decodedThe values decoded from the ROHC packet
[out]uncomp_pktThe uncompressed packet being built
[out]ip_hdrs_lenThe length of all the IP headers (in bytes)
Returns
true if IP headers were successfully built, false if the output uncomp_packet was not large enough

◆ decomp_rfc5225_ip_udp_rtp_build_ipv4_hdr()

static bool decomp_rfc5225_ip_udp_rtp_build_ipv4_hdr ( const struct rohc_decomp_ctxt *const  ctxt,
const struct rohc_rfc5225_decoded_ip *const  decoded,
struct rohc_buf *const  uncomp_pkt,
size_t *const  ip_hdr_len 
)
static

Build one single uncompressed IPv4 header.

Build one single uncompressed IPv4 header from the context and packet information.

Parameters
ctxtThe decompression context
decodedThe values decoded from the ROHC packet
[out]uncomp_pktThe uncompressed packet being built
[out]ip_hdr_lenThe length of the IPv4 header (in bytes)
Returns
true if IPv4 header was successfully built, false if the output uncomp_packet was not large enough

◆ decomp_rfc5225_ip_udp_rtp_build_ipv6_hdr()

static bool decomp_rfc5225_ip_udp_rtp_build_ipv6_hdr ( const struct rohc_decomp_ctxt *const  ctxt,
const struct rohc_rfc5225_decoded_ip *const  decoded,
struct rohc_buf *const  uncomp_pkt,
size_t *const  ip_hdr_len 
)
static

Build one single uncompressed IPv6 header.

Build one single uncompressed IPv6 header - including IPv6 extension headers - from the context and packet information.

Parameters
ctxtThe decompression context
decodedThe values decoded from the ROHC packet
[out]uncomp_pktThe uncompressed packet being built
[out]ip_hdr_lenThe length of the IPv6 header (in bytes)
Returns
true if IPv6 header was successfully built, false if the output uncomp_packet was not large enough

◆ decomp_rfc5225_ip_udp_rtp_build_rtp_hdr()

static bool decomp_rfc5225_ip_udp_rtp_build_rtp_hdr ( const struct rohc_decomp_ctxt *const  ctxt,
const struct rohc_rfc5225_decoded *const  decoded,
struct rohc_buf *const  uncomp_pkt,
size_t *const  rtp_hdr_len 
)
static

Build the uncompressed RTP header.

Build the uncompressed RTP header from the context and packet information.

Parameters
ctxtThe decompression context
decodedThe values decoded from the ROHC packet
[out]uncomp_pktThe uncompressed packet being built
[out]rtp_hdr_lenThe length of the RTP header (in bytes)
Returns
true if RTP header was successfully built, false if the output uncomp_packet was not large enough

◆ decomp_rfc5225_ip_udp_rtp_build_udp_hdr()

static bool decomp_rfc5225_ip_udp_rtp_build_udp_hdr ( const struct rohc_decomp_ctxt *const  ctxt,
const struct rohc_rfc5225_decoded *const  decoded,
const size_t  payload_len,
struct rohc_buf *const  uncomp_pkt,
size_t *const  udp_hdr_len 
)
static

Build the uncompressed UDP header.

Build the uncompressed UDP header from the context and packet information.

Parameters
ctxtThe decompression context
decodedThe values decoded from the ROHC packet
payload_lenThe length (in bytes) of the payload
[out]uncomp_pktThe uncompressed packet being built
[out]udp_hdr_lenThe length of the UDP header (in bytes)
Returns
true if UDP header was successfully built, false if the output uncomp_packet was not large enough

◆ decomp_rfc5225_ip_udp_rtp_decode_bits()

static rohc_status_t decomp_rfc5225_ip_udp_rtp_decode_bits ( const struct rohc_decomp_ctxt *const  ctxt,
const struct rohc_rfc5225_bits *const  bits,
const size_t  payload_len,
struct rohc_rfc5225_decoded *const  decoded 
)
static

Decode values from extracted bits for the ROHCv2 IP/UDP/RTP profile.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters
ctxtThe decompression context
bitsThe bits extracted from the ROHC packet
payload_lenThe length of the packet payload (in bytes)
[out]decodedThe corresponding decoded values
Returns
ROHC_STATUS_OK if decoding is successful, ROHC_STATUS_BAD_CRC if control CRC is wrong, ROHC_STATUS_ERROR otherwise

◆ decomp_rfc5225_ip_udp_rtp_decode_bits_ip_hdr()

static bool decomp_rfc5225_ip_udp_rtp_decode_bits_ip_hdr ( const struct rohc_decomp_ctxt *const  ctxt,
const struct rohc_rfc5225_ip_bits *const  ip_bits,
const ip_context_t *const  ip_ctxt,
const bool  is_innermost,
const uint16_t  decoded_msn,
struct rohc_rfc5225_decoded_ip *const  ip_decoded 
)
static

Decode values for one IP header from extracted bits.

Parameters
ctxtThe decompression context
ip_bitsThe IP bits extracted from the ROHC packet
ip_ctxtThe IP values recorded in context
is_innermostWhether the IP header is the innermost IP header
decoded_msnThe decoded Master Sequence Number (MSN)
[out]ip_decodedThe corresponding decoded IP values
Returns
true if decoding is successful, false otherwise

TODO: factorize with TCP profile

◆ decomp_rfc5225_ip_udp_rtp_decode_bits_ip_hdrs()

static bool decomp_rfc5225_ip_udp_rtp_decode_bits_ip_hdrs ( const struct rohc_decomp_ctxt *const  ctxt,
const struct rohc_rfc5225_bits *const  bits,
struct rohc_rfc5225_decoded *const  decoded 
)
static

Decode values for all IP headers from extracted bits.

Parameters
ctxtThe decompression context
bitsThe bits extracted from the ROHC packet
[out]decodedThe corresponding decoded values
Returns
true if decoding is successful, false otherwise

◆ decomp_rfc5225_ip_udp_rtp_detect_pkt_type()

static rohc_packet_t decomp_rfc5225_ip_udp_rtp_detect_pkt_type ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len 
)
static

Detect the type of ROHC packet for the ROHCv2 IP/UDP/RTP profile.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters
contextThe decompression context
rohc_packetThe ROHC packet
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
Returns
The packet type

◆ decomp_rfc5225_ip_udp_rtp_free_context()

static void decomp_rfc5225_ip_udp_rtp_free_context ( struct rohc_decomp_rfc5225_ip_udp_rtp_ctxt *const  rfc5225_ctxt,
const struct rohc_decomp_volat_ctxt *const  volat_ctxt 
)
static

Destroy profile-specific data, nothing to destroy for the ROHCv2 IP/UDP/RTP profile.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters
rfc5225_ctxtThe persistent decompression context for the IP/UDP/RTP profile
volat_ctxtThe volatile part of the decompression context

◆ decomp_rfc5225_ip_udp_rtp_get_sn()

static uint32_t decomp_rfc5225_ip_udp_rtp_get_sn ( const struct rohc_decomp_ctxt *const  context)
static

Get the reference SN value of the context.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters
contextThe decompression context
Returns
The reference SN value

◆ decomp_rfc5225_ip_udp_rtp_new_context()

static bool decomp_rfc5225_ip_udp_rtp_new_context ( const struct rohc_decomp_ctxt *const  context,
void **const  persist_ctxt,
struct rohc_decomp_volat_ctxt *const  volat_ctxt 
)
static

Create the ROHCv2 IP/UDP/RTP volatile and persistent parts of the context.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters
contextThe decompression context
[out]persist_ctxtThe persistent part of the decompression context
[out]volat_ctxtThe volatile part of the decompression context
Returns
true if the ROHCv2 IP/UDP/RTP context was successfully created, false if a problem occurred

◆ decomp_rfc5225_ip_udp_rtp_parse_co_repair()

static bool decomp_rfc5225_ip_udp_rtp_parse_co_repair ( const struct rohc_decomp_ctxt *const  ctxt,
const struct rohc_buf  rohc_pkt,
const size_t  large_cid_len,
struct rohc_decomp_crc *const  hdr_crc,
struct rohc_rfc5225_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse one co_repair packet for the ROHCv2 IP/UDP/RTP profile.

Parameters
ctxtThe decompression context
rohc_pktThe ROHC packet to decode
large_cid_lenThe length of the optional large CID field
[out]hdr_crcThe CRC over uncomp headers extracted from ROHC packet
[out]bitsThe bits extracted from the ROHC packet
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
Returns
true if parsing was successful, false if packet was malformed

◆ decomp_rfc5225_ip_udp_rtp_parse_dyn_chain()

static bool decomp_rfc5225_ip_udp_rtp_parse_dyn_chain ( const struct rohc_decomp_ctxt *const  ctxt,
const uint8_t *const  rohc_pkt,
const size_t  rohc_len,
struct rohc_rfc5225_bits *const  bits,
size_t *const  parsed_len 
)
static

Parse the dynamic chain of the IR packet.

Parameters
ctxtThe decompression context
rohc_pktThe remaining part of the ROHC packet
rohc_lenThe remaining length (in bytes) of the ROHC packet
[out]parsed_lenThe length (in bytes) of static chain in case of success
[out]bitsThe bits extracted from the dynamic chain
Returns
true in the dynamic chain was successfully parsed, false if the ROHC packet was malformed

◆ decomp_rfc5225_ip_udp_rtp_parse_dyn_ip()

static int decomp_rfc5225_ip_udp_rtp_parse_dyn_ip ( const struct rohc_decomp_ctxt *const  ctxt,
const uint8_t *const  rohc_pkt,
const size_t  rohc_len,
struct rohc_rfc5225_ip_bits *const  ip_bits 
)
static

Decode the dynamic IP header of the ROHC packet.

Parameters
ctxtThe decompression context
rohc_pktThe remaining part of the ROHC packet
rohc_lenThe remaining length (in bytes) of the ROHC packet
[out]ip_bitsThe bits extracted from the IP part of the dynamic chain
Returns
The length of dynamic IP header in case of success, -1 if an error occurs

◆ decomp_rfc5225_ip_udp_rtp_parse_dyn_rtp()

static int decomp_rfc5225_ip_udp_rtp_parse_dyn_rtp ( const struct rohc_decomp_ctxt *const  ctxt,
const uint8_t *  rohc_pkt,
const size_t  rohc_len,
struct rohc_rfc5225_bits *const  bits 
)
static

Parse the RTP dynamic part of the ROHC packet.

Parameters
ctxtThe decompression context
rohc_pktThe ROHC packet to decode
rohc_lenThe length of the ROHC packet
bitsOUT: The bits extracted from the ROHC header
Returns
The number of bytes read in the ROHC packet, -1 in case of failure

◆ decomp_rfc5225_ip_udp_rtp_parse_dyn_udp()

static int decomp_rfc5225_ip_udp_rtp_parse_dyn_udp ( const struct rohc_decomp_ctxt *const  ctxt,
const uint8_t *  rohc_pkt,
const size_t  rohc_len,
struct rohc_rfc5225_bits *const  bits 
)
static

Parse the UDP dynamic part of the ROHC packet.

Parameters
ctxtThe decompression context
rohc_pktThe ROHC packet to decode
rohc_lenThe length of the ROHC packet
bitsOUT: The bits extracted from the ROHC header
Returns
The number of bytes read in the ROHC packet, -1 in case of failure

◆ decomp_rfc5225_ip_udp_rtp_parse_ir()

static bool decomp_rfc5225_ip_udp_rtp_parse_ir ( const struct rohc_decomp_ctxt *const  ctxt,
const struct rohc_buf  rohc_pkt,
const size_t  large_cid_len,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_rfc5225_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse one IR packet for the ROHCv2 IP/UDP/RTP profile.

Parameters
ctxtThe decompression context
rohc_pktThe ROHC packet to decode
large_cid_lenThe length of the optional large CID field
[out]extr_crcThe CRC extracted from the ROHC packet
[out]bitsThe bits extracted from the ROHC packet
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
Returns
true if parsing was successful, false if packet was malformed

◆ decomp_rfc5225_ip_udp_rtp_parse_pkt()

static bool decomp_rfc5225_ip_udp_rtp_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_rfc5225_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse one ROHC packet for the ROHCv2 IP/UDP/RTP profile.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to parse
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out]extr_crcThe CRC bits extracted from the ROHC packet
[out]bitsThe bits extracted from the ROHC packet
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
Returns
true if parsing was successful, false if packet was malformed

◆ decomp_rfc5225_ip_udp_rtp_parse_static_chain()

static bool decomp_rfc5225_ip_udp_rtp_parse_static_chain ( const struct rohc_decomp_ctxt *const  ctxt,
const uint8_t *const  rohc_pkt,
const size_t  rohc_len,
struct rohc_rfc5225_bits *const  bits,
size_t *const  parsed_len 
)
static

Parse the static chain of the IR packet.

Parameters
ctxtThe decompression context
rohc_pktThe remaining part of the ROHC packet
rohc_lenThe remaining length (in bytes) of the ROHC packet
[out]bitsThe bits extracted from the static chain
[out]parsed_lenThe length (in bytes) of static chain in case of success
Returns
true in the static chain was successfully parsed, false if the ROHC packet was malformed

◆ decomp_rfc5225_ip_udp_rtp_parse_static_ip()

static int decomp_rfc5225_ip_udp_rtp_parse_static_ip ( const struct rohc_decomp_ctxt *const  ctxt,
const uint8_t *const  rohc_pkt,
const size_t  rohc_len,
struct rohc_rfc5225_ip_bits *const  ip_bits,
bool *const  is_innermost 
)
static

Decode the static IP header of the ROHC packet.

Parameters
ctxtThe decompression context
rohc_pktThe remaining part of the ROHC packet
rohc_lenThe remaining length (in bytes) of the ROHC packet
[out]ip_bitsThe bits extracted from the IP part of the static chain
[out]is_innermostWhether the IP header is the innermost IP header
Returns
The length of static IP header in case of success, -1 if an error occurs

◆ decomp_rfc5225_ip_udp_rtp_parse_static_rtp()

static int decomp_rfc5225_ip_udp_rtp_parse_static_rtp ( const struct rohc_decomp_ctxt *const  ctxt,
const uint8_t *  rohc_pkt,
const size_t  rohc_len,
struct rohc_rfc5225_bits *const  bits 
)
static

Parse the RTP static part of the ROHC packet.

Parameters
ctxtThe decompression context
rohc_pktThe ROHC packet to decode
rohc_lenThe length of the ROHC packet
bitsOUT: The bits extracted from the ROHC header
Returns
The number of bytes read in the ROHC packet, -1 in case of failure

◆ decomp_rfc5225_ip_udp_rtp_parse_static_udp()

static int decomp_rfc5225_ip_udp_rtp_parse_static_udp ( const struct rohc_decomp_ctxt *const  ctxt,
const uint8_t *  rohc_pkt,
const size_t  rohc_len,
struct rohc_rfc5225_bits *const  bits 
)
static

Parse the UDP static part of the ROHC packet.

Parameters
ctxtThe decompression context
rohc_pktThe ROHC packet to decode
rohc_lenThe length of the ROHC packet
bitsOUT: The bits extracted from the ROHC header
Returns
The number of bytes read in the ROHC packet, -1 in case of failure

◆ decomp_rfc5225_ip_udp_rtp_reset_extr_bits()

static void decomp_rfc5225_ip_udp_rtp_reset_extr_bits ( const struct rohc_decomp_ctxt *const  ctxt,
struct rohc_rfc5225_bits *const  bits 
)
static

Reset the extracted bits for next parsing.

Parameters
ctxtThe decompression context
[out]bitsThe extracted bits to reset

◆ decomp_rfc5225_ip_udp_rtp_update_ctxt()

static void decomp_rfc5225_ip_udp_rtp_update_ctxt ( struct rohc_decomp_ctxt *const  context,
const struct rohc_rfc5225_decoded *const  decoded,
const size_t  payload_len,
bool *const  do_change_mode 
)
static

Update the decompression context with the infos of current packet.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters
contextThe decompression context
decodedThe decoded values to update in the context
payload_lenThe length of the packet payload (in bytes)
[out]do_change_modeWhether the profile context wants to change its operational mode or not

Variable Documentation

◆ rohc_decomp_rfc5225_ip_udp_rtp_profile

const struct rohc_decomp_profile rohc_decomp_rfc5225_ip_udp_rtp_profile
Initial value:
=
{
.msn_max_bits = 16,
}
static uint32_t decomp_rfc5225_ip_udp_rtp_get_sn(const struct rohc_decomp_ctxt *const context)
Get the reference SN value of the context.
Definition: decomp_rfc5225_ip_udp_rtp.c:2708
static rohc_status_t decomp_rfc5225_ip_udp_rtp_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_rfc5225_decoded *const decoded, const size_t payload_len, struct rohc_buf *const uncomp_hdrs, size_t *const uncomp_hdrs_len)
Build the uncompressed headers for the ROHCv2 IP/UDP/RTP profile.
Definition: decomp_rfc5225_ip_udp_rtp.c:2110
Definition: rohc_profiles.h:117
static void decomp_rfc5225_ip_udp_rtp_free_context(struct rohc_decomp_rfc5225_ip_udp_rtp_ctxt *const rfc5225_ctxt, const struct rohc_decomp_volat_ctxt *const volat_ctxt)
Destroy profile-specific data, nothing to destroy for the ROHCv2 IP/UDP/RTP profile.
Definition: decomp_rfc5225_ip_udp_rtp.c:471
bool(* rohc_decomp_attempt_repair_t)(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, void *const extr_bits)
Definition: rohc_decomp_internals.h:383
static rohc_status_t decomp_rfc5225_ip_udp_rtp_decode_bits(const struct rohc_decomp_ctxt *const ctxt, const struct rohc_rfc5225_bits *const bits, const size_t payload_len, struct rohc_rfc5225_decoded *const decoded)
Decode values from extracted bits for the ROHCv2 IP/UDP/RTP profile.
Definition: decomp_rfc5225_ip_udp_rtp.c:1519
static rohc_packet_t decomp_rfc5225_ip_udp_rtp_detect_pkt_type(const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len)
Detect the type of ROHC packet for the ROHCv2 IP/UDP/RTP profile.
Definition: decomp_rfc5225_ip_udp_rtp.c:495
static bool decomp_rfc5225_ip_udp_rtp_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_rfc5225_bits *const bits, size_t *const rohc_hdr_len)
Parse one ROHC packet for the ROHCv2 IP/UDP/RTP profile.
Definition: decomp_rfc5225_ip_udp_rtp.c:563
static void decomp_rfc5225_ip_udp_rtp_update_ctxt(struct rohc_decomp_ctxt *const context, const struct rohc_rfc5225_decoded *const decoded, const size_t payload_len, bool *const do_change_mode)
Update the decompression context with the infos of current packet.
Definition: decomp_rfc5225_ip_udp_rtp.c:2598
static bool decomp_rfc5225_ip_udp_rtp_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, void *const extr_bits)
Attempt a packet/context repair upon CRC failure.
Definition: decomp_rfc5225_ip_udp_rtp.c:2687
void(* rohc_decomp_free_context_t)(void *const persist_ctxt, const struct rohc_decomp_volat_ctxt *const volat_ctxt)
Definition: rohc_decomp_internals.h:342
bool(* rohc_decomp_parse_pkt_t)(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, void *const extr_bits, size_t *const rohc_hdr_len)
Definition: rohc_decomp_internals.h:352
static bool decomp_rfc5225_ip_udp_rtp_new_context(const struct rohc_decomp_ctxt *const context, void **const persist_ctxt, struct rohc_decomp_volat_ctxt *const volat_ctxt)
Create the ROHCv2 IP/UDP/RTP volatile and persistent parts of the context.
Definition: decomp_rfc5225_ip_udp_rtp.c:408
void(* rohc_decomp_update_ctxt_t)(struct rohc_decomp_ctxt *const context, const void *const decoded_values, const size_t payload_len, bool *const do_change_mode)
Definition: rohc_decomp_internals.h:377
rohc_status_t(* rohc_decomp_decode_bits_t)(const struct rohc_decomp_ctxt *const context, const void *const extr_bits, const size_t payload_len, void *const decoded_values)
Definition: rohc_decomp_internals.h:361
rohc_status_t(* rohc_decomp_build_hdrs_t)(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 void *const decoded_values, const size_t payload_len, struct rohc_buf *const uncomp_hdrs, size_t *const uncomp_hdrs_len)
Definition: rohc_decomp_internals.h:367

Define the decompression part of the ROHCv2 IP/UDP/RTP profile as described in the RFC 5225.