ROHC compression/decompression library
Functions
c_ip.h File Reference

ROHC compression context for the IP-only profile. More...

#include "c_generic.h"
Include dependency graph for c_ip.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int c_ip_check_context (const struct c_context *context, const const struct ip_packet *ip)
rohc_packet_t c_ip_decide_FO_packet (const struct c_context *context)
 Decide which packet to send when in First Order (FO) state.
rohc_packet_t c_ip_decide_SO_packet (const struct c_context *context)
 Decide which packet to send when in Second Order (SO) state.
uint32_t c_ip_get_next_sn (const struct c_context *context, const struct ip_packet *outer_ip, const struct ip_packet *inner_ip)
 Determine the SN value for the next packet.
int c_ip_code_ir_remainder (const struct c_context *context, unsigned char *const dest, int counter)
 Code the remainder header for the IR or IR-DYN packets.

Detailed Description

ROHC compression context for the IP-only profile.

Author:
Didier Barvaux <didier.barvaux@toulouse.viveris.com>
The hackers from ROHC for Linux

Function Documentation

int c_ip_check_context ( const struct c_context context,
const const struct ip_packet ip 
)
int c_ip_code_ir_remainder ( const struct c_context context,
unsigned char *const  dest,
int  counter 
)

Code the remainder header for the IR or IR-DYN packets.


 Remainder of IR/IR-DYN packet (5.7.7.1):

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
 1  |             SN                |  2 octets if not RTP
    +---+---+---+---+---+---+---+---+

Parameters:
contextThe compression context
destThe rohc-packet-under-build buffer
counterThe current position in the rohc-packet-under-build buffer
Returns:
The new position in the rohc-packet-under-build buffer

References rohc_debugf, sn, c_generic_context::sn, and c_context::specific.

Referenced by c_udp_create(), and c_udp_lite_create().

rohc_packet_t c_ip_decide_FO_packet ( const struct c_context context)

Decide which packet to send when in First Order (FO) state.

Packets that can be used are the IR-DYN and UO-2 packets.

See also:
decide_packet
Parameters:
contextThe compression context
Returns:
The packet type among PACKET_IR_DYN and PACKET_UOR_2

References generic_tmp_vars::nr_of_ip_hdr, generic_tmp_vars::nr_sn_bits, PACKET_IR_DYN, PACKET_UOR_2, rohc_debugf, generic_tmp_vars::send_dynamic, generic_tmp_vars::send_static, c_context::specific, and c_generic_context::tmp.

Referenced by c_udp_create(), and c_udp_lite_create().

rohc_packet_t c_ip_decide_SO_packet ( const struct c_context context)

Decide which packet to send when in Second Order (SO) state.

Packets that can be used are the UO-0, UO-1 and UO-2 (with or without extensions) packets.

See also:
decide_packet
Parameters:
contextThe compression context
Returns:
The packet type among PACKET_UO_0, PACKET_UO_1 and PACKET_UOR_2

References ip_header_info::info, c_generic_context::ip2_flags, c_generic_context::ip_flags, IPV4, generic_tmp_vars::nr_ip_id_bits, generic_tmp_vars::nr_ip_id_bits2, generic_tmp_vars::nr_of_ip_hdr, generic_tmp_vars::nr_sn_bits, PACKET_IR_DYN, PACKET_UO_0, PACKET_UO_1, PACKET_UOR_2, ipv4_header_info::rnd, rohc_debugf, c_context::specific, c_generic_context::tmp, ip_header_info::v4, and ip_header_info::version.

Referenced by c_udp_create(), and c_udp_lite_create().

uint32_t c_ip_get_next_sn ( const struct c_context context,
const struct ip_packet outer_ip,
const struct ip_packet inner_ip 
)

Determine the SN value for the next packet.

Profile SN is an internal increasing 16-bit number.

Parameters:
contextThe compression context
outer_ipThe outer IP header
inner_ipThe inner IP header if it exists, NULL otherwise
Returns:
The SN

References c_generic_context::sn, and c_context::specific.

Referenced by c_udp_create(), and c_udp_lite_create().