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

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

#include "rohc_comp_internals.h"
#include "rohc_traces.h"
#include "rohc_traces_internal.h"
#include "rohc_debug.h"
#include "rohc_bit_ops.h"
#include "protocols/ip_numbers.h"
#include "protocols/ip.h"
#include "protocols/rfc5225.h"
#include "schemes/cid.h"
#include "schemes/ipv6_exts.h"
#include "schemes/ip_ctxt.h"
#include "schemes/comp_wlsb.h"
#include "schemes/ip_id_offset.h"
#include "schemes/rfc4996.h"
#include "crc.h"
#include <assert.h>
Include dependency graph for comp_rfc5225_ip_udp_rtp.c:

Data Structures

struct  comp_rfc5225_tmp_variables
 Define the RFC5225-specific temporary variables in the profile compression context. More...
 
struct  rohc_comp_rfc5225_ip_udp_rtp_ctxt
 

Functions

static bool rohc_comp_rfc5225_ip_udp_rtp_create (struct rohc_comp_ctxt *const context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs)
 Create a new ROHCv2 IP/UDP/RTP context and initialize it thanks to the given uncompressed packet. More...
 
static void rohc_comp_rfc5225_ip_udp_rtp_destroy (struct rohc_comp_ctxt *const context)
 Destroy the ROHCv2 IP/UDP/RTP context. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_encode (struct rohc_comp_ctxt *const context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len, rohc_packet_t *const packet_type)
 Encode an uncompressed packet according to a pattern decided by several different factors. More...
 
static void rohc_comp_rfc5225_ip_udp_rtp_detect_changes (struct rohc_comp_ctxt *const context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs)
 Detect changes between packet and context. More...
 
static void rohc_comp_rfc5225_ip_udp_rtp_detect_changes_ipv4 (struct rohc_comp_ctxt *const ctxt, ip_context_t *const ip_ctxt, const struct ipv4_hdr *const ipv4, const bool is_innermost)
 Detect changes for the given IPv4 header between packet and context. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_code_IR_pkt (const struct rohc_comp_ctxt *context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len)
 Encode an IP packet as IR packet. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_code_co_repair_pkt (const struct rohc_comp_ctxt *context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len)
 Encode an IP packet as co_repair packet. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_code_CO_pkt (const struct rohc_comp_ctxt *const context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len, const rohc_packet_t packet_type)
 Encode an IP packet as CO packet. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_static_chain (const struct rohc_comp_ctxt *const ctxt, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len)
 Code the static chain of an ROHCv2 IP/UDP/RTP IR packet. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_static_ipv4_part (const struct rohc_comp_ctxt *const ctxt, const struct ipv4_hdr *const ipv4, const bool is_innermost, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the static part of the IPv4 header. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_static_ipv6_part (const struct rohc_comp_ctxt *const ctxt, const struct ipv6_hdr *const ipv6, const bool is_innermost, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the static part of the IPv6 header. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_static_udp_part (const struct rohc_comp_ctxt *const ctxt, const struct udphdr *const udp, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the static part of the UDP header. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_static_rtp_part (const struct rohc_comp_ctxt *const ctxt, const struct rtphdr *const rtp, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the static part of the RTP header. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_dyn_chain (const struct rohc_comp_ctxt *const ctxt, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len)
 Code the dynamic chain of a ROHCv2 IP/UDP/RTP IR packet. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_dyn_ipv4_part (const struct rohc_comp_ctxt *const ctxt, const ip_context_t *const ip_ctxt, const struct ipv4_hdr *const ipv4, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the dynamic part of the IPv4 header. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_dyn_ipv6_part (const struct rohc_comp_ctxt *const ctxt, const ip_context_t *const ip_ctxt, const struct ipv6_hdr *const ipv6, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the dynamic part of the IPv6 header. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_dyn_udp_part (const struct rohc_comp_ctxt *const ctxt, const struct udphdr *const udp, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the dynamic part of the UDP header. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_dyn_rtp_part (const struct rohc_comp_ctxt *const ctxt, const struct rtphdr *const rtp, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the dynamic part of the RTP header. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_irreg_chain (const struct rohc_comp_ctxt *const ctxt, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len)
 Code the irregular chain of a ROHCv2 IP/UDP/RTP IR packet. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_irreg_ipv4_part (const struct rohc_comp_ctxt *const ctxt, const ip_context_t *const ip_ctxt, const struct ipv4_hdr *const ipv4, const bool is_innermost, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the irregular part of the IPv4 header. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_irreg_ipv6_part (const struct rohc_comp_ctxt *const ctxt, const ip_context_t *const ip_ctxt, const struct ipv6_hdr *const ipv6, const bool is_innermost, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the irregular part of the IPv6 header. More...
 
static int rohc_comp_rfc5225_ip_udp_rtp_irreg_udp_part (const struct rohc_comp_ctxt *const ctxt, const struct udphdr *const udp, uint8_t *const rohc_data, const size_t rohc_max_len)
 Build the irregular part of the UDP header. More...
 
static bool rohc_comp_rfc5225_ip_udp_rtp_feedback (struct rohc_comp_ctxt *const ctxt, const enum rohc_feedback_type feedback_type, const uint8_t *const packet, const size_t packet_len, const uint8_t *const feedback_data, const size_t feedback_data_len)
 Update the profile when feedback is received. More...
 
static bool rohc_comp_rfc5225_ip_udp_rtp_feedback_2 (struct rohc_comp_ctxt *const ctxt, const uint8_t *const packet, const size_t packet_len, const uint8_t *const feedback_data, const size_t feedback_data_len)
 Update the profile when FEEDBACK-2 is received. More...
 
static void rohc_comp_rfc5225_ip_udp_rtp_feedback_ack (struct rohc_comp_ctxt *const ctxt, const uint32_t sn_bits, const size_t sn_bits_nr, const bool sn_not_valid)
 Perform the required actions after the reception of a positive ACK. More...
 
static rohc_packet_t rohc_comp_rfc5225_ip_udp_rtp_decide_pkt (struct rohc_comp_ctxt *const context)
 Decide which packet to send when in the different states. More...
 
static rohc_packet_t rohc_comp_rfc5225_ip_udp_rtp_decide_FO_pkt (const struct rohc_comp_ctxt *const ctxt)
 Decide which packet to send when in FO state. More...
 
static rohc_packet_t rohc_comp_rfc5225_ip_udp_rtp_decide_SO_pkt (const struct rohc_comp_ctxt *const ctxt)
 Decide which packet to send when in SO state. More...
 
static rohc_packet_t rohc_comp_rfc5225_ip_udp_rtp_decide_FO_SO_pkt (const struct rohc_comp_ctxt *const ctxt, const bool crc7_at_least)
 Decide which packet to send when in FO or SO state. More...
 
static bool rohc_comp_rfc5225_is_msn_lsb_possible (const struct c_wlsb *const wlsb, const uint16_t value, const rohc_reordering_offset_t reorder_ratio, const size_t k)
 Define according to computed shift parameter if msn_lsb() is possible. More...
 
static bool rohc_comp_rfc5225_is_ipid_sequential (const rohc_ip_id_behavior_t behavior)
 Whether the given IP-ID is sequential (swapped or not) More...
 
static bool rohc_comp_rfc5225_is_seq_ipid_inferred (const ip_context_t *const ip_ctxt, const uint8_t ip_id_offset_trans_nr, const uint8_t oa_repetitions_nr, const uint16_t new_ip_id, const int16_t msn_offset)
 Whether the given IP-ID is inferred from SN. More...
 

Variables

const struct rohc_comp_profile rohc_comp_rfc5225_ip_udp_rtp_profile
 Define the compression part of the ROHCv2 IP/UDP/RTP profile as described in the RFC 5225. More...
 

Detailed Description

ROHC compression 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

◆ rohc_comp_rfc5225_ip_udp_rtp_code_CO_pkt()

static int rohc_comp_rfc5225_ip_udp_rtp_code_CO_pkt ( const struct rohc_comp_ctxt *const  context,
const struct rohc_pkt_hdrs *const  uncomp_pkt_hdrs,
uint8_t *const  rohc_pkt,
const size_t  rohc_pkt_max_len,
const rohc_packet_t  packet_type 
)
static

Encode an IP packet as CO packet.

Parameters
contextThe compression context
uncomp_pkt_hdrsThe uncompressed headers to encode
rohc_pktOUT: The ROHC packet
rohc_pkt_max_lenThe maximum length of the ROHC packet
packet_typeThe type of ROHC packet to create
Returns
The length of the ROHC packet if successful, -1 otherwise

◆ rohc_comp_rfc5225_ip_udp_rtp_code_co_repair_pkt()

static int rohc_comp_rfc5225_ip_udp_rtp_code_co_repair_pkt ( const struct rohc_comp_ctxt context,
const struct rohc_pkt_hdrs *const  uncomp_pkt_hdrs,
uint8_t *const  rohc_pkt,
const size_t  rohc_pkt_max_len 
)
static

Encode an IP packet as co_repair packet.

        0   1   2   3   4   5   6   7
       --- --- --- --- --- --- --- ---
      :         Add-CID octet         : if for small CIDs and CID 1-15
      +---+---+---+---+---+---+---+---+
      | 1   1   1   1   1   0   1   1 | discriminator
      +---+---+---+---+---+---+---+---+
      :                               :
      /   0, 1, or 2 octets of CID    / 1-2 octets if large CIDs
      :                               :
      +---+---+---+---+---+---+---+---+
      |r1 |         CRC-7             |
      +---+---+---+---+---+---+---+---+
      |        r2         |   CRC-3   |
      +---+---+---+---+---+---+---+---+
      |                               |
      /         Dynamic chain         / variable length
      |                               |
       - - - - - - - - - - - - - - - -
Parameters
contextThe compression context
uncomp_pkt_hdrsThe uncompressed headers to encode
rohc_pktOUT: The ROHC packet
rohc_pkt_max_lenThe maximum length of the ROHC packet
Returns
The length of the ROHC packet if successful, -1 otherwise

◆ rohc_comp_rfc5225_ip_udp_rtp_code_IR_pkt()

static int rohc_comp_rfc5225_ip_udp_rtp_code_IR_pkt ( const struct rohc_comp_ctxt context,
const struct rohc_pkt_hdrs *const  uncomp_pkt_hdrs,
uint8_t *const  rohc_pkt,
const size_t  rohc_pkt_max_len 
)
static

Encode an IP packet as IR packet.

Parameters
contextThe compression context
uncomp_pkt_hdrsThe uncompressed headers to encode
rohc_pktOUT: The ROHC packet
rohc_pkt_max_lenThe maximum length of the ROHC packet
Returns
The length of the ROHC packet if successful, -1 otherwise

◆ rohc_comp_rfc5225_ip_udp_rtp_create()

static bool rohc_comp_rfc5225_ip_udp_rtp_create ( struct rohc_comp_ctxt *const  context,
const struct rohc_pkt_hdrs *const  uncomp_pkt_hdrs 
)
static

Create a new ROHCv2 IP/UDP/RTP context and initialize it thanks to the given uncompressed packet.

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

Parameters
contextThe compression context
uncomp_pkt_hdrsThe uncompressed headers to initialize the new context
Returns
true if successful, false otherwise

◆ rohc_comp_rfc5225_ip_udp_rtp_decide_FO_pkt()

static rohc_packet_t rohc_comp_rfc5225_ip_udp_rtp_decide_FO_pkt ( const struct rohc_comp_ctxt *const  ctxt)
static

Decide which packet to send when in FO state.

Parameters
ctxtThe compression context
Returns
  • The packet type among ROHC_PACKET_IR, ROHC_PACKET_CO_REPAIR, ROHC_PACKET_CO_COMMON, ROHC_PACKET_NORTP_PT_0_CRC7, or ROHC_PACKET_NORTP_PT_2_SEQ_ID in case of success
  • ROHC_PACKET_UNKNOWN in case of failure

◆ rohc_comp_rfc5225_ip_udp_rtp_decide_FO_SO_pkt()

static rohc_packet_t rohc_comp_rfc5225_ip_udp_rtp_decide_FO_SO_pkt ( const struct rohc_comp_ctxt *const  ctxt,
const bool  crc7_at_least 
)
static

Decide which packet to send when in FO or SO state.

Parameters
ctxtThe compression context
crc7_at_leastWhether packet types with CRC strictly smaller than 7 bits are allowed or not
Returns
  • The packet type among ROHC_PACKET_IR, ROHC_PACKET_CO_REPAIR, ROHC_PACKET_CO_COMMON, ROHC_PACKET_PT_0_CRC3, ROHC_PACKET_NORTP_PT_0_CRC7, ROHC_PACKET_NORTP_PT_1_SEQ_ID, or ROHC_PACKET_NORTP_PT_2_SEQ_ID in case of success
  • ROHC_PACKET_UNKNOWN in case of failure

◆ rohc_comp_rfc5225_ip_udp_rtp_decide_pkt()

static rohc_packet_t rohc_comp_rfc5225_ip_udp_rtp_decide_pkt ( struct rohc_comp_ctxt *const  context)
static

Decide which packet to send when in the different states.

Parameters
contextThe compression context
Returns
  • The packet type among ROHC_PACKET_IR, ROHC_PACKET_PT_0_CRC3, ROHC_PACKET_NORTP_PT_0_CRC7, ROHC_PACKET_NORTP_PT_1_SEQ_ID, or ROHC_PACKET_NORTP_PT_2_SEQ_ID in case of success
  • ROHC_PACKET_UNKNOWN in case of failure

◆ rohc_comp_rfc5225_ip_udp_rtp_decide_SO_pkt()

static rohc_packet_t rohc_comp_rfc5225_ip_udp_rtp_decide_SO_pkt ( const struct rohc_comp_ctxt *const  ctxt)
static

Decide which packet to send when in SO state.

Parameters
ctxtThe compression context
Returns
  • The packet type among ROHC_PACKET_IR, ROHC_PACKET_CO_REPAIR, ROHC_PACKET_CO_COMMON, ROHC_PACKET_PT_0_CRC3, ROHC_PACKET_NORTP_PT_0_CRC7, ROHC_PACKET_NORTP_PT_1_SEQ_ID, or ROHC_PACKET_NORTP_PT_2_SEQ_ID in case of success
  • ROHC_PACKET_UNKNOWN in case of failure

◆ rohc_comp_rfc5225_ip_udp_rtp_destroy()

static void rohc_comp_rfc5225_ip_udp_rtp_destroy ( struct rohc_comp_ctxt *const  context)
static

Destroy the ROHCv2 IP/UDP/RTP context.

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

Parameters
contextThe ROHCv2 IP/UDP/RTP compression context to destroy

◆ rohc_comp_rfc5225_ip_udp_rtp_detect_changes()

static void rohc_comp_rfc5225_ip_udp_rtp_detect_changes ( struct rohc_comp_ctxt *const  context,
const struct rohc_pkt_hdrs *const  uncomp_pkt_hdrs 
)
static

Detect changes between packet and context.

Parameters
contextThe compression context to compare
uncomp_pkt_hdrsThe uncompressed headers to compare

◆ rohc_comp_rfc5225_ip_udp_rtp_detect_changes_ipv4()

static void rohc_comp_rfc5225_ip_udp_rtp_detect_changes_ipv4 ( struct rohc_comp_ctxt *const  ctxt,
ip_context_t *const  ip_ctxt,
const struct ipv4_hdr *const  ipv4,
const bool  is_innermost 
)
static

Detect changes for the given IPv4 header between packet and context.

Parameters
ctxtThe compression context
ip_ctxtThe IPv4 context to compare
ipv4The IPv4 header to compare
is_innermostWhether the IPv4 header is the innermost of all IP headers

◆ rohc_comp_rfc5225_ip_udp_rtp_dyn_chain()

static int rohc_comp_rfc5225_ip_udp_rtp_dyn_chain ( const struct rohc_comp_ctxt *const  ctxt,
const struct rohc_pkt_hdrs *const  uncomp_pkt_hdrs,
uint8_t *const  rohc_pkt,
const size_t  rohc_pkt_max_len 
)
static

Code the dynamic chain of a ROHCv2 IP/UDP/RTP IR packet.

Parameters
ctxtThe compression context
uncomp_pkt_hdrsThe uncompressed headers to encode
rohc_pktOUT: The ROHC packet
rohc_pkt_max_lenThe maximum length of the ROHC packet
Returns
The length of the ROHC packet if successful, -1 otherwise

◆ rohc_comp_rfc5225_ip_udp_rtp_dyn_ipv4_part()

static int rohc_comp_rfc5225_ip_udp_rtp_dyn_ipv4_part ( const struct rohc_comp_ctxt *const  ctxt,
const ip_context_t *const  ip_ctxt,
const struct ipv4_hdr *const  ipv4,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the dynamic part of the IPv4 header.

Parameters
ctxtThe compression context
ip_ctxtThe specific IP compression context
ipv4The IPv4 header
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error

◆ rohc_comp_rfc5225_ip_udp_rtp_dyn_ipv6_part()

static int rohc_comp_rfc5225_ip_udp_rtp_dyn_ipv6_part ( const struct rohc_comp_ctxt *const  ctxt,
const ip_context_t *const  ip_ctxt,
const struct ipv6_hdr *const  ipv6,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the dynamic part of the IPv6 header.

Parameters
ctxtThe compression context
ip_ctxtThe specific IP compression context
ipv6The IPv6 header
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error

◆ rohc_comp_rfc5225_ip_udp_rtp_dyn_rtp_part()

static int rohc_comp_rfc5225_ip_udp_rtp_dyn_rtp_part ( const struct rohc_comp_ctxt *const  ctxt,
const struct rtphdr *const  rtp,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the dynamic part of the RTP header.

Parameters
ctxtThe compression context
rtpThe RTP header
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error

◆ rohc_comp_rfc5225_ip_udp_rtp_dyn_udp_part()

static int rohc_comp_rfc5225_ip_udp_rtp_dyn_udp_part ( const struct rohc_comp_ctxt *const  ctxt,
const struct udphdr *const  udp,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the dynamic part of the UDP header.

Parameters
ctxtThe compression context
udpThe UDP header
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error

◆ rohc_comp_rfc5225_ip_udp_rtp_encode()

static int rohc_comp_rfc5225_ip_udp_rtp_encode ( struct rohc_comp_ctxt *const  context,
const struct rohc_pkt_hdrs *const  uncomp_pkt_hdrs,
uint8_t *const  rohc_pkt,
const size_t  rohc_pkt_max_len,
rohc_packet_t *const  packet_type 
)
static

Encode an uncompressed packet according to a pattern decided by several different factors.

  1. Decide state
  2. Decide which packet type to send.
  3. Code packet
  4. Update context

    This function is one of the functions that must exist in one profile for the framework to work.
Parameters
contextThe compression context
uncomp_pkt_hdrsThe uncompressed headers to encode
rohc_pktOUT: The ROHC packet
rohc_pkt_max_lenThe maximum length of the ROHC packet
packet_typeOUT: The type of ROHC packet that is created
Returns
The length of the ROHC packet if successful, -1 otherwise

◆ rohc_comp_rfc5225_ip_udp_rtp_feedback()

static bool rohc_comp_rfc5225_ip_udp_rtp_feedback ( struct rohc_comp_ctxt *const  ctxt,
const enum rohc_feedback_type  feedback_type,
const uint8_t *const  packet,
const size_t  packet_len,
const uint8_t *const  feedback_data,
const size_t  feedback_data_len 
)
static

Update the profile when feedback is received.

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

Parameters
ctxtThe compression context
feedback_typeThe feedback type among ROHC_FEEDBACK_1 and ROHC_FEEDBACK_2
packetThe whole feedback packet with CID bits
packet_lenThe length of the whole feedback packet with CID bits
feedback_dataThe feedback data without the CID bits
feedback_data_lenThe length of the feedback data without the CID bits
Returns
true if the feedback was successfully handled, false if the feedback could not be taken into account

◆ rohc_comp_rfc5225_ip_udp_rtp_feedback_2()

static bool rohc_comp_rfc5225_ip_udp_rtp_feedback_2 ( struct rohc_comp_ctxt *const  ctxt,
const uint8_t *const  packet,
const size_t  packet_len,
const uint8_t *const  feedback_data,
const size_t  feedback_data_len 
)
static

Update the profile when FEEDBACK-2 is received.

Parameters
ctxtThe compression context
packetThe whole feedback packet with CID bits
packet_lenThe length of the whole feedback packet with CID bits
feedback_dataThe feedback data without the CID bits
feedback_data_lenThe length of the feedback data without the CID bits
Returns
true if the feedback was successfully handled, false if the feedback could not be taken into account

◆ rohc_comp_rfc5225_ip_udp_rtp_feedback_ack()

static void rohc_comp_rfc5225_ip_udp_rtp_feedback_ack ( struct rohc_comp_ctxt *const  ctxt,
const uint32_t  sn_bits,
const size_t  sn_bits_nr,
const bool  sn_not_valid 
)
static

Perform the required actions after the reception of a positive ACK.

Parameters
ctxtThe compression context that received a positive ACK
sn_bitsThe LSB bits of the acknowledged SN
sn_bits_nrThe number of LSB bits of the acknowledged SN
sn_not_validWhether the received SN may be considered as valid or not

◆ rohc_comp_rfc5225_ip_udp_rtp_irreg_chain()

static int rohc_comp_rfc5225_ip_udp_rtp_irreg_chain ( const struct rohc_comp_ctxt *const  ctxt,
const struct rohc_pkt_hdrs *const  uncomp_pkt_hdrs,
uint8_t *const  rohc_pkt,
const size_t  rohc_pkt_max_len 
)
static

Code the irregular chain of a ROHCv2 IP/UDP/RTP IR packet.

Parameters
ctxtThe compression context
uncomp_pkt_hdrsThe uncompressed headers to encode
rohc_pktOUT: The ROHC packet
rohc_pkt_max_lenThe maximum length of the ROHC packet
Returns
The length of the ROHC packet if successful, -1 otherwise

◆ rohc_comp_rfc5225_ip_udp_rtp_irreg_ipv4_part()

static int rohc_comp_rfc5225_ip_udp_rtp_irreg_ipv4_part ( const struct rohc_comp_ctxt *const  ctxt,
const ip_context_t *const  ip_ctxt,
const struct ipv4_hdr *const  ipv4,
const bool  is_innermost,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the irregular part of the IPv4 header.

Parameters
ctxtThe compression context
ip_ctxtThe specific IP compression context
ipv4The IPv4 header
is_innermosttrue if the IP header is the innermost of the packet, false otherwise
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error

◆ rohc_comp_rfc5225_ip_udp_rtp_irreg_ipv6_part()

static int rohc_comp_rfc5225_ip_udp_rtp_irreg_ipv6_part ( const struct rohc_comp_ctxt *const  ctxt,
const ip_context_t *const  ip_ctxt,
const struct ipv6_hdr *const  ipv6,
const bool  is_innermost,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the irregular part of the IPv6 header.

Parameters
ctxtThe compression context
ip_ctxtThe specific IP compression context
ipv6The IPv6 header
is_innermosttrue if the IP header is the innermost of the packet, false otherwise
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error

◆ rohc_comp_rfc5225_ip_udp_rtp_irreg_udp_part()

static int rohc_comp_rfc5225_ip_udp_rtp_irreg_udp_part ( const struct rohc_comp_ctxt *const  ctxt,
const struct udphdr *const  udp,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the irregular part of the UDP header.

Parameters
ctxtThe compression context
udpThe UDP header
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error

◆ rohc_comp_rfc5225_ip_udp_rtp_static_chain()

static int rohc_comp_rfc5225_ip_udp_rtp_static_chain ( const struct rohc_comp_ctxt *const  ctxt,
const struct rohc_pkt_hdrs *const  uncomp_pkt_hdrs,
uint8_t *const  rohc_pkt,
const size_t  rohc_pkt_max_len 
)
static

Code the static chain of an ROHCv2 IP/UDP/RTP IR packet.

Parameters
ctxtThe compression context
uncomp_pkt_hdrsThe uncompressed headers to encode
rohc_pktOUT: The ROHC packet
rohc_pkt_max_lenThe maximum length of the ROHC packet
Returns
The length of the ROHC packet if successful, -1 otherwise

◆ rohc_comp_rfc5225_ip_udp_rtp_static_ipv4_part()

static int rohc_comp_rfc5225_ip_udp_rtp_static_ipv4_part ( const struct rohc_comp_ctxt *const  ctxt,
const struct ipv4_hdr *const  ipv4,
const bool  is_innermost,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the static part of the IPv4 header.

Parameters
ctxtThe compression context
ipv4The IPv4 header
is_innermostWhether the IPv4 header is the innermost IP header
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error

◆ rohc_comp_rfc5225_ip_udp_rtp_static_ipv6_part()

static int rohc_comp_rfc5225_ip_udp_rtp_static_ipv6_part ( const struct rohc_comp_ctxt *const  ctxt,
const struct ipv6_hdr *const  ipv6,
const bool  is_innermost,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the static part of the IPv6 header.

Parameters
ctxtThe compression context
ipv6The IPv6 header
is_innermostWhether the IPv6 header is the innermost IP header
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error

◆ rohc_comp_rfc5225_ip_udp_rtp_static_rtp_part()

static int rohc_comp_rfc5225_ip_udp_rtp_static_rtp_part ( const struct rohc_comp_ctxt *const  ctxt,
const struct rtphdr *const  rtp,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the static part of the RTP header.

Parameters
ctxtThe compression context
rtpThe RTP header
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error

◆ rohc_comp_rfc5225_ip_udp_rtp_static_udp_part()

static int rohc_comp_rfc5225_ip_udp_rtp_static_udp_part ( const struct rohc_comp_ctxt *const  ctxt,
const struct udphdr *const  udp,
uint8_t *const  rohc_data,
const size_t  rohc_max_len 
)
static

Build the static part of the UDP header.

Parameters
ctxtThe compression context
udpThe UDP header
[out]rohc_dataThe ROHC packet being built
rohc_max_lenThe max remaining length in the ROHC buffer
Returns
The length appended in the ROHC buffer if positive, -1 in case of error

◆ rohc_comp_rfc5225_is_ipid_sequential()

static bool rohc_comp_rfc5225_is_ipid_sequential ( const rohc_ip_id_behavior_t  behavior)
static

Whether the given IP-ID is sequential (swapped or not)

Parameters
behaviorThe IP-ID behavior
Returns
true if the given IP-ID behavior is sequential or sequential swapped, false otherwise

◆ rohc_comp_rfc5225_is_msn_lsb_possible()

static bool rohc_comp_rfc5225_is_msn_lsb_possible ( const struct c_wlsb *const  wlsb,
const uint16_t  value,
const rohc_reordering_offset_t  reorder_ratio,
const size_t  k 
)
static

Define according to computed shift parameter if msn_lsb() is possible.

Parameters
wlsbThe W-LSB object
valueThe value to encode using the LSB algorithm
reorder_ratioThe reordering ratio
kThe number of bits for encoding
Returns
true if msn_lsb is possible or not

◆ rohc_comp_rfc5225_is_seq_ipid_inferred()

static bool rohc_comp_rfc5225_is_seq_ipid_inferred ( const ip_context_t *const  ip_ctxt,
const uint8_t  ip_id_offset_trans_nr,
const uint8_t  oa_repetitions_nr,
const uint16_t  new_ip_id,
const int16_t  msn_offset 
)
static

Whether the given IP-ID is inferred from SN.

The given IP-ID is inferred from SN if:

  • the IP header is IPv4,
  • the IP-ID / SN offset was transmitted enough times to gain confidence that the decompressor received the value,
  • the IP-ID behavior is sequential or sequential swapped,
  • the new IP-ID value increases from the last IP-ID by the same delta as the MSN.
Parameters
ip_ctxtThe context for the given IP header
ip_id_offset_trans_nrThe number of IP-ID offset transmissions
oa_repetitions_nrThe number of repetitions for Optimistic Approach
new_ip_idThe new value of the IP-ID
msn_offsetThe offset between the previous and current MSN
Returns
true if the given IP-ID is sequential and inferred from MSN, false otherwise

Variable Documentation

◆ rohc_comp_rfc5225_ip_udp_rtp_profile

const struct rohc_comp_profile rohc_comp_rfc5225_ip_udp_rtp_profile
Initial value:
=
{
.clone = NULL,
}
Definition: rohc_profiles.h:117
static bool rohc_comp_rfc5225_ip_udp_rtp_feedback(struct rohc_comp_ctxt *const ctxt, const enum rohc_feedback_type feedback_type, const uint8_t *const packet, const size_t packet_len, const uint8_t *const feedback_data, const size_t feedback_data_len)
Update the profile when feedback is received.
Definition: comp_rfc5225_ip_udp_rtp.c:1120
static void rohc_comp_rfc5225_ip_udp_rtp_destroy(struct rohc_comp_ctxt *const context)
Destroy the ROHCv2 IP/UDP/RTP context.
Definition: comp_rfc5225_ip_udp_rtp.c:469
static bool rohc_comp_rfc5225_ip_udp_rtp_create(struct rohc_comp_ctxt *const context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs)
Create a new ROHCv2 IP/UDP/RTP context and initialize it thanks to the given uncompressed packet...
Definition: comp_rfc5225_ip_udp_rtp.c:357
static int rohc_comp_rfc5225_ip_udp_rtp_encode(struct rohc_comp_ctxt *const context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len, rohc_packet_t *const packet_type)
Encode an uncompressed packet according to a pattern decided by several different factors...
Definition: comp_rfc5225_ip_udp_rtp.c:499

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