ROHC compression/decompression library
Functions | Variables
c_ip.c File Reference

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

#include "c_ip.h"
#include "rohc_traces_internal.h"
#include "rohc_utils.h"
#include <string.h>
#include <assert.h>
Include dependency graph for c_ip.c:

Functions

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.

Variables

struct c_profile c_ip_profile
 Define the compression part of the IP-only profile as described in the RFC 3843.

Detailed Description

ROHC compression context for the IP-only profile.

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

Function Documentation

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_comp_debug, rohc_hton16(), sn, c_generic_context::sn, and c_context::specific.

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 ip_header_info::info, c_generic_context::ip2_flags, c_generic_context::ip_flags, IPV4, MAX_FO_COUNT, generic_tmp_vars::nr_of_ip_hdr, generic_tmp_vars::nr_sn_bits, PACKET_IR_DYN, PACKET_UOR_2, rohc_comp_debug, generic_tmp_vars::send_dynamic, generic_tmp_vars::send_static, ipv4_header_info::sid_count, c_context::specific, c_generic_context::tmp, ip_header_info::v4, and ip_header_info::version.

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, MAX_FO_COUNT, 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_comp_debug, ipv4_header_info::sid_count, c_context::specific, c_generic_context::tmp, ip_header_info::v4, and ip_header_info::version.

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.


Variable Documentation

Initial value:

Define the compression part of the IP-only profile as described in the RFC 3843.