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

ROHC decompression context for the uncompressed profile. More...

#include "d_uncompressed.h"
#include "rohc_bit_ops.h"
#include "rohc_traces.h"
Include dependency graph for d_uncompressed.c:

Functions

void * uncompressed_allocate_decode_data (void)
 Allocate profile-specific data, nothing to allocate for the uncompressed profile.
void uncompressed_free_decode_data (void *context)
 Destroy profile-specific data, nothing to destroy for the uncompressed profile.
int uncompressed_decode_ir (struct rohc_decomp *decomp, struct d_context *context, const unsigned char *const rohc_packet, const unsigned int rohc_length, int large_cid_len, int is_addcid_used, unsigned char *dest)
 Decode one IR packet.
unsigned int uncompressed_detect_ir_size (struct d_context *context, unsigned char *packet, unsigned int plen, unsigned int large_cid_len)
 Find the length of data in an IR packet.
unsigned int uncompressed_detect_ir_dyn_size (struct d_context *context, unsigned char *packet, unsigned int plen, unsigned int large_cid_len)
 Find the length of data in an IR-DYN packet.
int uncompressed_decode (struct rohc_decomp *decomp, struct d_context *context, const unsigned char *const rohc_packet, const unsigned int rohc_length, int second_byte, unsigned char *dest)
 Decode one IR-DYN, UO-0, UO-1 or UOR-2 packet, but not IR packet.
int uncompressed_get_sn (struct d_context *context)
 Get the reference SN value of the context. Always return 0 for the uncompressed profile.

Variables

struct d_profile d_uncomp_profile
 Define the decompression part of the Uncompressed profile as described in the RFC 3095.

Detailed Description

ROHC decompression context for the uncompressed profile.

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

Function Documentation

Allocate profile-specific data, nothing to allocate for the uncompressed profile.

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

Returns:
The newly-created generic decompression context
int uncompressed_decode ( struct rohc_decomp decomp,
struct d_context context,
const unsigned char *const  rohc_packet,
const unsigned int  rohc_length,
int  second_byte,
unsigned char *  dest 
)

Decode one IR-DYN, UO-0, UO-1 or UOR-2 packet, but not IR packet.

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
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
second_byteThe offset for the second byte of the ROHC packet (depends on the CID encoding and the packet type)
destThe decoded IP packet
Returns:
The length of the uncompressed IP packet or ROHC_ERROR if an error occurs

References GET_BIT_0_7, NO_CONTEXT, rohc_debugf, ROHC_ERROR, and d_context::state.

int uncompressed_decode_ir ( struct rohc_decomp decomp,
struct d_context context,
const unsigned char *const  rohc_packet,
const unsigned int  rohc_length,
int  large_cid_len,
int  is_addcid_used,
unsigned char *  dest 
)

Decode one IR packet.

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
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet to decode
large_cid_lenThe length of the large CID field
is_addcid_usedWhether the add-CID field is present or not
destThe decoded IP packet
Returns:
The length of the uncompressed IP packet or ROHC_OK_NO_DATA if no data is returned or ROHC_ERROR if an error occurs

References FULL_CONTEXT, rohc_debugf, ROHC_ERROR, and d_context::state.

unsigned int uncompressed_detect_ir_dyn_size ( struct d_context context,
unsigned char *  packet,
unsigned int  plen,
unsigned int  large_cid_len 
)

Find the length of data in an IR-DYN packet.

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

Parameters:
contextThe decompression context
packetThe IR-DYN packet after the Add-CID byte if present
plenThe length of the IR-DYN packet minus the Add-CID byte
large_cid_lenThe size of the large CID field
Returns:
The length of data in the IR-DYN packet, 0 if an error occurs

References rohc_debugf.

unsigned int uncompressed_detect_ir_size ( struct d_context context,
unsigned char *  packet,
unsigned int  plen,
unsigned int  large_cid_len 
)

Find the length of data in an IR packet.

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

Parameters:
contextThe decompression context
packetThe IR packet after the Add-CID byte if present
plenThe length of the IR-DYN packet minus the Add-CID byte
large_cid_lenThe size of the large CID field
Returns:
The length of data in the IR packet, 0 if an error occurs
void uncompressed_free_decode_data ( void *  context)

Destroy profile-specific data, nothing to destroy for the uncompressed profile.

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

Parameters:
contextThe compression context
int uncompressed_get_sn ( struct d_context context)

Get the reference SN value of the context. Always return 0 for the uncompressed profile.

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

Variable Documentation

Initial value:

Define the decompression part of the Uncompressed profile as described in the RFC 3095.