ROHC compression/decompression library
Functions
decode.c File Reference

ROHC packet related routines. More...

#include "decode.h"
#include "rohc_bit_ops.h"
#include "config.h"
Include dependency graph for decode.c:

Functions

int d_is_segment (const unsigned char *data)
 Find out whether the field is a segment field or not.
int d_is_padding (const unsigned char *data)
 Find out whether the field is a padding field or not.
int d_is_feedback (const unsigned char *data)
 Find out whether a ROHC packet is a Feedback packet or not.
int d_feedback_size (const unsigned char *data)
 Find out the size of the feedback.
int d_feedback_headersize (const unsigned char *data)
 Find out the size of the feedback header.
bool d_is_ir (const unsigned char *data, const size_t len)
 Find out whether a ROHC packet is an IR packet or not.
bool d_is_irdyn (const unsigned char *data, const size_t len)
 Find out whether a ROHC packet is an IR-DYN packet or not.
bool d_is_uo0 (const unsigned char *data, const size_t len)
 Find out whether a ROHC packet is an UO-0 packet or not.
bool d_is_uo1 (const unsigned char *data, const size_t len)
 Find out whether a ROHC packet is an UO-1* packet or not.
bool d_is_uor2 (const unsigned char *data, const size_t len)
 Find out whether a ROHC packet is an UOR-2* packet or not.
bool d_is_uor2_ts (const unsigned char *const data, const size_t data_len, const size_t large_cid_len)
 Find out whether a ROHC packet is an UOR-2-TS packet or not.
bool d_is_uor2_rtp (const unsigned char *const data, const size_t data_len, const size_t large_cid_len)
 Find out whether a ROHC packet is an UOR-2-RTP packet or not.
int d_is_add_cid (const unsigned char *data)
 Check whether a ROHC packet starts with an add-CID byte or not.
int d_decode_add_cid (const unsigned char *data)
 Decode the add-CID byte of a ROHC packet (if the add-CID byte is present)

Detailed Description

ROHC packet related routines.

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

Function Documentation

int d_decode_add_cid ( const unsigned char *  data)

Decode the add-CID byte of a ROHC packet (if the add-CID byte is present)

Parameters:
dataThe ROHC packet with a possible add-CID byte
Returns:
0 if no add-CID byte is present, the CID value otherwise

References d_is_add_cid(), and GET_BIT_0_3.

Referenced by c_deliver_feedback().

int d_feedback_headersize ( const unsigned char *  data)

Find out the size of the feedback header.

See 5.2.2 in the RFC 3095 for details.

Parameters:
dataThe feedback header
Returns:
The size of the feedback header (1 or 2 bytes)

References GET_BIT_0_2.

int d_feedback_size ( const unsigned char *  data)

Find out the size of the feedback.

See 5.2.2 in the RFC 3095 for details.

Parameters:
dataThe feedback header
Returns:
The size of the feedback

References GET_BIT_0_2, and GET_BIT_0_7.

int d_is_add_cid ( const unsigned char *  data)

Check whether a ROHC packet starts with an add-CID byte or not.

Parameters:
dataThe ROHC packet with a possible add-CID byte
Returns:
Whether the ROHC packet starts with an add-CID byte or not

References D_ADD_CID, and GET_BIT_4_7.

Referenced by c_deliver_feedback(), and d_decode_add_cid().

int d_is_feedback ( const unsigned char *  data)

Find out whether a ROHC packet is a Feedback packet or not.

Parameters:
dataThe ROHC packet to analyze
Returns:
Whether the ROHC packet is a Feedback packet or not

References D_FEEDBACK, and GET_BIT_3_7.

bool d_is_ir ( const unsigned char *  data,
const size_t  len 
)

Find out whether a ROHC packet is an IR packet or not.

Parameters:
dataThe ROHC packet to analyze
lenThe length of the ROHC packet
Returns:
Whether the ROHC packet is an IR packet or not

References D_IR_PACKET, and GET_BIT_1_7.

Referenced by d_decode_header(), and ip_detect_packet_type().

bool d_is_irdyn ( const unsigned char *  data,
const size_t  len 
)

Find out whether a ROHC packet is an IR-DYN packet or not.

Parameters:
dataThe ROHC packet to analyze
lenThe length of the ROHC packet
Returns:
Whether the ROHC packet is an IR-DYN packet or not

References D_IR_DYN_PACKET, and GET_BIT_0_7.

Referenced by d_decode_header(), and ip_detect_packet_type().

int d_is_padding ( const unsigned char *  data)

Find out whether the field is a padding field or not.

Parameters:
dataThe field to analyze
Returns:
Whether the field is a padding field or not

References D_PADDING, and GET_BIT_0_7.

int d_is_segment ( const unsigned char *  data)

Find out whether the field is a segment field or not.

Parameters:
dataThe field to analyze
Returns:
Whether the field is a segment field or not

References D_SEGMENT, and GET_BIT_1_7.

bool d_is_uo0 ( const unsigned char *  data,
const size_t  len 
)

Find out whether a ROHC packet is an UO-0 packet or not.

Parameters:
dataThe ROHC packet to analyze
lenThe length of the ROHC packet
Returns:
Whether the ROHC packet is an UO-0 packet or not

References GET_BIT_7.

Referenced by ip_detect_packet_type().

bool d_is_uo1 ( const unsigned char *  data,
const size_t  len 
)

Find out whether a ROHC packet is an UO-1* packet or not.

Parameters:
dataThe ROHC packet to analyze
lenThe length of the ROHC packet
Returns:
Whether the ROHC packet is an UO-1* packet or not

References GET_BIT_6_7.

Referenced by ip_detect_packet_type().

bool d_is_uor2 ( const unsigned char *  data,
const size_t  len 
)

Find out whether a ROHC packet is an UOR-2* packet or not.

Parameters:
dataThe ROHC packet to analyze
lenThe length of the ROHC packet
Returns:
Whether the ROHC packet is an UOR-2* packet or not

References GET_BIT_5_7.

Referenced by ip_detect_packet_type().

bool d_is_uor2_rtp ( const unsigned char *const  data,
const size_t  data_len,
const size_t  large_cid_len 
)

Find out whether a ROHC packet is an UOR-2-RTP packet or not.

If RTP disambiguation bit is enabled, check it. Otherwise, always return true.

The RTP disambiguation bit type is a proprietary extension to the ROHC standard. It was introduced to avoid reparsing the UOR-2* headers in cases where RND changes in extension 3.

Parameters:
dataThe ROHC packet to analyze
data_lenThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
Returns:
Whether the ROHC packet is an UOR-2-RTP packet or not

References GET_BIT_6.

bool d_is_uor2_ts ( const unsigned char *const  data,
const size_t  data_len,
const size_t  large_cid_len 
)

Find out whether a ROHC packet is an UOR-2-TS packet or not.

Check the T field that discriminates between UOR-2-TS and UOR-2-ID.

Parameters:
dataThe ROHC packet to analyze
data_lenThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
Returns:
Whether the ROHC packet is an UOR-2-TS packet or not

References GET_BIT_7.