ROHC decompression context for the UDP-Lite profile.
More...
#include "d_ip.h"
#include "d_udp.h"
#include "d_generic.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>
Data Structures |
struct | d_udp_lite_context |
| Define the UDP-Lite part of the decompression profile context. More...
|
Functions |
static void | d_udp_lite_destroy (void *const context) |
| 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 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 unsigned char *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 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 decoded, unsigned char *dest, const unsigned int payload_len) |
| Build an uncompressed UDP-Lite header.
|
void * | d_udp_lite_create (const struct rohc_decomp_ctxt *const context) |
| Create the UDP-Lite decompression context.
|
static rohc_status_t | d_udp_lite_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, IR-DYN or UO* packet for UDP-Lite profile.
|
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
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 decompression context |
- Returns:
- The newly-created UDP-Lite decompression context
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:
-
| decomp | The ROHC decompressor |
| context | The decompression context |
| rohc_packet | The ROHC packet to decode |
| add_cid_len | The length of the optional Add-CID field |
| large_cid_len | The length of the optional large CID field |
[out] | uncomp_packet | The uncompressed packet |
| packet_type | IN: 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
Destroy the context.
This function is one of the functions that must exist in one profile for the framework to work.
- Parameters:
-
context | The compression context |
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
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
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
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
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
Variable Documentation
Initial value:
Define the decompression part of the UDP-Lite profile as described in the RFC 4019.