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

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

#include "rohc_decomp.h"
#include "rohc_decomp_internals.h"
#include "rohc_bit_ops.h"
#include "rohc_traces_internal.h"
#include "crc.h"
#include "rohc_decomp_detect_packet.h"
#include <string.h>
Include dependency graph for d_uncompressed.c:

Functions

static rohc_packet_t uncomp_detect_pkt_type (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len)
 Detect the type of ROHC packet for the Uncompressed profile.
static rohc_status_t uncomp_decode (struct rohc_decomp *const decomp, struct rohc_decomp_ctxt *const context, const struct rohc_buf rohc_packet, const size_t add_cid_len, const size_t large_cid_len, struct rohc_buf *const uncomp_packet, rohc_packet_t *const packet_type)
 Decode one IR or Normal packet for the Uncompressed profile.
static rohc_status_t uncomp_decode_ir (struct rohc_decomp *const decomp, struct rohc_decomp_ctxt *context, const struct rohc_buf rohc_packet, const size_t add_cid_len, const size_t large_cid_len, struct rohc_buf *const uncomp_packet)
 Decode one IR packet for the Uncompressed profile.
static rohc_status_t uncomp_decode_normal (struct rohc_decomp_ctxt *context, const struct rohc_buf rohc_packet, const size_t large_cid_len, struct rohc_buf *const uncomp_packet)
 Decode one Normal packet for the Uncompressed profile.
static uint32_t uncomp_get_sn (const struct rohc_decomp_ctxt *const context)
 Get the reference SN value of the context. Always return 0 for the uncompressed profile.
static void * uncomp_new_context (const struct rohc_decomp_ctxt *const context)
 Allocate profile-specific data, nothing to allocate for the uncompressed profile.
static void uncomp_free_context (void *context)
 Destroy profile-specific data, nothing to destroy for the uncompressed profile.

Variables

struct rohc_decomp_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>
Didier Barvaux <didier@barvaux.org>

Function Documentation

static rohc_status_t uncomp_decode ( struct rohc_decomp *const  decomp,
struct rohc_decomp_ctxt *const  context,
const struct rohc_buf  rohc_packet,
const size_t  add_cid_len,
const size_t  large_cid_len,
struct rohc_buf *const  uncomp_packet,
rohc_packet_t *const  packet_type 
) [static]

Decode one IR or Normal packet for the Uncompressed profile.

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
add_cid_lenThe length of the optional Add-CID field
large_cid_lenThe length of the large CID field
[out]uncomp_packetThe uncompressed packet
packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
Returns:
ROHC_STATUS_OK if packet is successfully decoded, ROHC_STATUS_MALFORMED if packet is malformed, ROHC_STATUS_BAD_CRC if a CRC error occurs ROHC_STATUS_ERROR if an error occurs
static rohc_status_t uncomp_decode_ir ( struct rohc_decomp *const  decomp,
struct rohc_decomp_ctxt context,
const struct rohc_buf  rohc_packet,
const size_t  add_cid_len,
const size_t  large_cid_len,
struct rohc_buf *const  uncomp_packet 
) [static]

Decode one IR packet for the Uncompressed profile.

Parameters:
decompThe ROHC decompressor
contextThe decompression context
rohc_packetThe ROHC packet to decode
add_cid_lenThe length of the optional Add-CID field
large_cid_lenThe length of the large CID field
[out]uncomp_packetThe uncompressed packet
Returns:
ROHC_STATUS_OK if packet is successfully decoded, ROHC_STATUS_MALFORMED if packet is malformed, ROHC_STATUS_BAD_CRC if CRC in IR header is wrong
static rohc_status_t uncomp_decode_normal ( struct rohc_decomp_ctxt context,
const struct rohc_buf  rohc_packet,
const size_t  large_cid_len,
struct rohc_buf *const  uncomp_packet 
) [static]

Decode one Normal packet for the Uncompressed profile.

Parameters:
contextThe decompression context
rohc_packetThe ROHC packet to decode
large_cid_lenThe length of the optional large CID field
[out]uncomp_packetThe uncompressed packet
Returns:
ROHC_STATUS_OK if packet is successfully decoded, ROHC_STATUS_MALFORMED if packet is malformed, ROHC_STATUS_ERROR if another error occurs
static rohc_packet_t uncomp_detect_pkt_type ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len 
) [static]

Detect the type of ROHC packet for the Uncompressed profile.

Parameters:
contextThe decompression context
rohc_packetThe ROHC packet
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
Returns:
The packet type
static void uncomp_free_context ( void *  context) [static]

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
static uint32_t uncomp_get_sn ( const struct rohc_decomp_ctxt *const  context) [static]

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
static void* uncomp_new_context ( const struct rohc_decomp_ctxt *const  context) [static]

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

Variable Documentation

Initial value:
{
        .id              = ROHC_PROFILE_UNCOMPRESSED, 
        .new_context     = uncomp_new_context,
        .free_context    = uncomp_free_context,
        .decode          = uncomp_decode,
        .detect_pkt_type = uncomp_detect_pkt_type,
        .get_sn          = uncomp_get_sn,
}

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