d_udp_lite.c File Reference

ROHC decompression context for the UDP-Lite profile. More...

#include "d_ip.h"
#include "d_udp.h"
#include "rohc_decomp_rfc3095.h"
#include "rohc_bit_ops.h"
#include "rohc_traces_internal.h"
#include "rohc_debug.h"
#include "rohc_utils.h"
#include "rohc_packets.h"
#include "crc.h"
#include "protocols/udp_lite.h"
#include <string.h>
Include dependency graph for d_udp_lite.c:

Data Structures

struct  d_udp_lite_context
 Define the UDP-Lite part of the decompression profile context. More...

Functions

static bool d_udp_lite_create (const struct rohc_decomp_ctxt *const context, struct rohc_decomp_rfc3095_ctxt **const persist_ctxt, struct rohc_decomp_volat_ctxt *const volat_ctxt)
 Create the UDP-Lite decompression context.
static void d_udp_lite_destroy (struct rohc_decomp_rfc3095_ctxt *const rfc3095_ctxt, const struct rohc_decomp_volat_ctxt *const volat_ctxt)
 Destroy the context.
static rohc_packet_t udp_lite_detect_packet_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 UDP-Lite profile.
static bool d_udp_lite_parse (const struct rohc_decomp_ctxt *const context, const struct rohc_buf rohc_packet, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Decode one IR, IR-DYN or UO* packet for UDP-Lite profile.
static int udp_lite_parse_dynamic_udp (const struct rohc_decomp_ctxt *const context, const uint8_t *packet, const size_t length, struct rohc_extr_bits *const bits)
 Parse the UDP-Lite dynamic part of the ROHC packet.
static int udp_lite_parse_uo_remainder (const struct rohc_decomp_ctxt *const context, const uint8_t *packet, unsigned int length, struct rohc_extr_bits *const bits)
 Parse the UDP-Lite remainder of the UO* ROHC packets.
static bool udp_lite_decode_values_from_bits (const struct rohc_decomp_ctxt *context, const struct rohc_extr_bits *const bits, struct rohc_decoded_values *const decoded)
 Decode UDP-Lite values from extracted bits.
static int udp_lite_build_uncomp_udp (const struct rohc_decomp_ctxt *const context, const struct rohc_decoded_values *const decoded, uint8_t *const dest, const unsigned int payload_len)
 Build an uncompressed UDP-Lite header.
static void udp_lite_update_context (struct rohc_decomp_ctxt *const context, const struct rohc_decoded_values *const decoded)
 Update context with decoded UDP-Lite values.

Variables

struct rohc_decomp_profile d_udplite_profile
 Define the decompression part of the UDP-Lite profile as described in the RFC 4019.

Detailed Description

ROHC decompression context for the UDP-Lite profile.

Author:
Didier Barvaux <didier.barvaux@toulouse.viveris.com>
Didier Barvaux <didier@barvaux.org>

Function Documentation

static bool d_udp_lite_create ( const struct rohc_decomp_ctxt *const   context,
struct rohc_decomp_rfc3095_ctxt **const   persist_ctxt,
struct rohc_decomp_volat_ctxt *const   volat_ctxt 
) [static]

Create the UDP-Lite decompression context.

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

Parameters:
context The main decompression context
[out] persist_ctxt The persistent part of the decompression context
[out] volat_ctxt The volatile part of the decompression context
Returns:
true if the UDP-Lite context was successfully created, false if a problem occurred
static void d_udp_lite_destroy ( struct rohc_decomp_rfc3095_ctxt *const   rfc3095_ctxt,
const struct rohc_decomp_volat_ctxt *const   volat_ctxt 
) [static]

Destroy the context.

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

Parameters:
rfc3095_ctxt The persistent decompression context for the RFC3095 profiles
volat_ctxt The volatile decompression context
static bool d_udp_lite_parse ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_buf  rohc_packet,
const size_t  large_cid_len,
rohc_packet_t *const   packet_type,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_extr_bits *const   bits,
size_t *const   rohc_hdr_len 
) [static]

Decode one IR, IR-DYN or UO* packet for UDP-Lite profile.

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

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
large_cid_len The length of the optional large CID field
[in,out] packet_type IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the ROHC header
[out] rohc_hdr_len The length of the ROHC header (in bytes)
Returns:
true if packet is successfully parsed, false otherwise
static int udp_lite_build_uncomp_udp ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_decoded_values *const   decoded,
uint8_t *const   dest,
const unsigned int  payload_len 
) [static]

Build an uncompressed UDP-Lite header.

Todo:
check for dest size before writing into it
Parameters:
context The decompression context
decoded The values decoded from the ROHC header
dest The buffer to store the UDP-Lite header
payload_len The length of the UDP-Lite payload
Returns:
The length of the next header (ie. the UDP-Lite header), -1 in case of error
static bool udp_lite_decode_values_from_bits ( const struct rohc_decomp_ctxt context,
const struct rohc_extr_bits *const   bits,
struct rohc_decoded_values *const   decoded 
) [static]

Decode UDP-Lite values from extracted bits.

The following values are decoded:

  • UDP-Lite source port
  • UDP-Lite destination port
  • UDP-Lite checksum
  • UDP-Lite Checksum Coverage (CC)
Parameters:
context The decompression context
bits The extracted bits
decoded OUT: The corresponding decoded values
Returns:
true if decoding is successful, false otherwise
static rohc_packet_t udp_lite_detect_packet_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 UDP-Lite profile.

Parse optional CCE packet type, then normal packet type.

Parameters:
context The decompression context
rohc_packet The ROHC packet
rohc_length The length of the ROHC packet
large_cid_len The length of the optional large CID field
Returns:
The packet type
static int udp_lite_parse_dynamic_udp ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *  packet,
const size_t  length,
struct rohc_extr_bits *const   bits 
) [static]

Parse the UDP-Lite dynamic part of the ROHC packet.

Parameters:
context The decompression context
packet The ROHC packet to parse
length The length of the ROHC packet
bits OUT: The bits extracted from the ROHC header
Returns:
The number of bytes read in the ROHC packet, -1 in case of failure
static int udp_lite_parse_uo_remainder ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *  packet,
unsigned int  length,
struct rohc_extr_bits *const   bits 
) [static]

Parse the UDP-Lite remainder of the UO* ROHC packets.

Parameters:
context The decompression context
packet The ROHC packet to parse
length The length of the ROHC packet
bits OUT: The bits extracted from the ROHC header
Returns:
The number of bytes read in the ROHC packet, -1 in case of failure
static void udp_lite_update_context ( struct rohc_decomp_ctxt *const   context,
const struct rohc_decoded_values *const   decoded 
) [static]

Update context with decoded UDP-Lite values.

The following decoded values are updated in context:

  • UDP-Lite source port
  • UDP-Lite destination port
Parameters:
context The decompression context
decoded The decoded values to update in the context

Variable Documentation

Initial value:

Define the decompression part of the UDP-Lite profile as described in the RFC 4019.


Generated on 4 Jul 2018 for ROHC compression/decompression library by  doxygen 1.6.1