|
ROHC compression/decompression library
|
#include "rohc_decomp.h"#include "rohc_decomp_internals.h"#include "rohc_packets.h"#include "rohc_utils.h"#include "schemes/decomp_wlsb.h"#include "schemes/ip_id_offset.h"#include "schemes/decomp_list.h"#include "ip.h"#include "crc.h"#include <stddef.h>#include <stdbool.h>

Go to the source code of this file.
Data Structures | |
| struct | rohc_extr_ip_bits |
| struct | rohc_extr_bits |
| The bits extracted from ROHC UO* base headers. More... | |
| struct | rohc_decoded_ip_values |
| struct | rohc_decoded_values |
| The values decoded from the bits extracted from ROHC header. More... | |
| struct | rohc_decomp_rfc3095_changes |
| Store information about an IP header between the different decompressions of IP packets. More... | |
| struct | rohc_decomp_rfc3095_ctxt |
| The generic decompression context for RFC3095-based profiles. More... | |
Functions | |
| bool | rohc_decomp_rfc3095_create (const struct rohc_decomp_ctxt *const context, struct rohc_decomp_rfc3095_ctxt **const persist_ctxt, struct rohc_decomp_volat_ctxt *const volat_ctxt, rohc_trace_callback2_t trace_cb, void *const trace_cb_priv, const int profile_id) |
| Create the RFC3095 volatile and persistent parts of the context. More... | |
| void | rohc_decomp_rfc3095_destroy (struct rohc_decomp_rfc3095_ctxt *const rfc3095_ctxt, const struct rohc_decomp_volat_ctxt *const volat_ctxt) |
| Destroy the context. More... | |
| bool | rfc3095_decomp_parse_pkt (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) |
| Parse one IR, IR-DYN, UO-0, UO-1*, or UOR-2* packet. More... | |
| int | rfc3095_parse_hdr_flags_fields (const struct rohc_decomp_ctxt *const context, const uint8_t *const flags, const uint8_t *fields, const size_t length, bool *const last_flag, struct rohc_extr_ip_bits *const bits) |
| Parse the inner or outer IP header flags and fields. More... | |
| int | rfc3095_parse_outer_hdr_flags_fields (const struct rohc_decomp_ctxt *const context, const uint8_t *const flags, const uint8_t *fields, const size_t length, struct rohc_extr_ip_bits *const bits) |
| Parse the outer IP header flags and fields. More... | |
| rohc_status_t | rfc3095_decomp_build_hdrs (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const rohc_packet_t packet_type, const struct rohc_decomp_crc *const extr_crc, const struct rohc_decoded_values *const decoded, const size_t payload_len, struct rohc_buf *const uncomp_hdrs, size_t *const uncomp_hdrs_len) |
| Build the uncompressed headers. More... | |
| rohc_status_t | rfc3095_decomp_decode_bits (const struct rohc_decomp_ctxt *const context, const struct rohc_extr_bits *const bits, const size_t payload_len, struct rohc_decoded_values *const decoded) |
| Decode values from extracted bits. More... | |
| void | rfc3095_decomp_update_ctxt (struct rohc_decomp_ctxt *const context, const struct rohc_decoded_values *const decoded, const size_t payload_len, bool *const do_change_mode) |
| Update context with decoded values. More... | |
| bool | rfc3095_decomp_attempt_repair (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const struct rohc_ts pkt_arrival_time, struct rohc_decomp_crc_corr_ctxt *const crc_corr, struct rohc_extr_bits *const extr_bits) |
| Attempt a packet/context repair upon CRC failure. More... | |
| uint32_t | rohc_decomp_rfc3095_get_sn (const struct rohc_decomp_ctxt *const context) |
| Get the reference SN value of the context. More... | |
| static bool | is_ipv4_pkt (const struct rohc_extr_ip_bits *const bits) |
| Is the given IP header IPV4 wrt packet? More... | |
| static bool | is_ipv4_rnd_pkt (const struct rohc_extr_ip_bits *const bits) |
| Is the given IP header IPv4 and its IP-ID random wrt packet? More... | |
| static bool | is_ipv4_non_rnd_pkt (const struct rohc_extr_ip_bits *const bits) |
| Is the given IP header IPv4 and its IP-ID non-random wrt packet? More... | |
|
inlinestatic |
Is the given IP header IPv4 and its IP-ID non-random wrt packet?
| bits | The bits extracted from packet |
|
inlinestatic |
Is the given IP header IPV4 wrt packet?
| bits | The bits extracted from packet |
|
inlinestatic |
Is the given IP header IPv4 and its IP-ID random wrt packet?
| bits | The bits extracted from packet |
| bool rfc3095_decomp_attempt_repair | ( | const struct rohc_decomp *const | decomp, |
| const struct rohc_decomp_ctxt *const | context, | ||
| const struct rohc_ts | pkt_arrival_time, | ||
| struct rohc_decomp_crc_corr_ctxt *const | crc_corr, | ||
| struct rohc_extr_bits *const | extr_bits | ||
| ) |
Attempt a packet/context repair upon CRC failure.
| decomp | The ROHC decompressor | |
| context | The decompression context | |
| pkt_arrival_time | The arrival time of the ROHC packet that caused the CRC failure | |
| [in,out] | crc_corr | The context for corrections upon CRC failures |
| [in,out] | extr_bits | The bits extracted from the ROHC header |
| rohc_status_t rfc3095_decomp_build_hdrs | ( | const struct rohc_decomp *const | decomp, |
| const struct rohc_decomp_ctxt *const | context, | ||
| const rohc_packet_t | packet_type, | ||
| const struct rohc_decomp_crc *const | extr_crc, | ||
| const struct rohc_decoded_values *const | decoded, | ||
| const size_t | payload_len, | ||
| struct rohc_buf *const | uncomp_hdrs, | ||
| size_t *const | uncomp_hdrs_len | ||
| ) |
Build the uncompressed headers.
| decomp | The ROHC decompressor | |
| context | The decompression context | |
| packet_type | The type of ROHC packet | |
| extr_crc | The CRC bits extracted from the ROHC header | |
| decoded | The values decoded from ROHC header | |
| payload_len | The length of the packet payload | |
| [out] | uncomp_hdrs | The buffer to store the uncompressed headers |
| [out] | uncomp_hdrs_len | The length of the uncompressed headers written into the buffer |
| rohc_status_t rfc3095_decomp_decode_bits | ( | const struct rohc_decomp_ctxt *const | context, |
| const struct rohc_extr_bits *const | bits, | ||
| const size_t | payload_len, | ||
| struct rohc_decoded_values *const | decoded | ||
| ) |
Decode values from extracted bits.
The following values are decoded:
Other fields may be decoded by the profile-specific callback named decode_values_from_bits.
This function is one of the functions that must exist in one profile for the framework to work.
| context | The decompression context | |
| bits | The bits extracted from the ROHC packet | |
| payload_len | The length of the packet payload (in bytes) | |
| [out] | decoded | The corresponding decoded values |
| bool rfc3095_decomp_parse_pkt | ( | 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 | ||
| ) |
Parse one IR, IR-DYN, UO-0, UO-1*, or UOR-2* packet.
| 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) |
| void rfc3095_decomp_update_ctxt | ( | struct rohc_decomp_ctxt *const | context, |
| const struct rohc_decoded_values *const | decoded, | ||
| const size_t | payload_len, | ||
| bool *const | do_change_mode | ||
| ) |
Update context with decoded values.
The following decoded values are updated in context:
This function is one of the functions that must exist in one profile for the framework to work.
| context | The decompression context | |
| decoded | The decoded values to update in the context | |
| payload_len | The length of the packet payload | |
| [out] | do_change_mode | Whether the profile context wants to change its operational mode or not |
| int rfc3095_parse_hdr_flags_fields | ( | const struct rohc_decomp_ctxt *const | context, |
| const uint8_t *const | flags, | ||
| const uint8_t * | fields, | ||
| const size_t | length, | ||
| bool *const | last_flag, | ||
| struct rohc_extr_ip_bits *const | bits | ||
| ) |
Parse the inner or outer IP header flags and fields.
Store the values in an IP header info structure.
Inner IP header flags for RTP profile (5.7.5):
0 1 2 3 4 5 6 7
..... ..... ..... ..... ..... ..... ..... .....
| TOS | TTL | DF | PR | IPX | NBO | RND | ip2 | if ip = 1
..... ..... ..... ..... ..... ..... ..... .....
Inner IP header flags for non-RTP profiles (5.11.4):
0 1 2 3 4 5 6 7
..... ..... ..... ..... ..... ..... ..... .....
| TOS | TTL | DF | PR | IPX | NBO | RND | 0 | if ip = 1
..... ..... ..... ..... ..... ..... ..... .....
Outer IP header flags for RTP profile (5.7.5):
0 1 2 3 4 5 6 7
..... ..... ..... ..... ..... ..... ..... .....
| TOS2| TTL2| DF2 | PR2 |IPX2 |NBO2 |RND2 | I2 | if ip2 = 1
..... ..... ..... ..... ..... ..... ..... .....
Inner IP header fields (5.7.5):
..... ..... ..... ..... ..... ..... ..... .....
| Type of Service/Traffic Class | if TOS = 1
..... ..... ..... ..... ..... ..... ..... .....
| Time to Live/Hop Limit | if TTL = 1
..... ..... ..... ..... ..... ..... ..... .....
| Protocol/Next Header | if PR = 1
..... ..... ..... ..... ..... ..... ..... .....
/ IP extension headers / variable,
..... ..... ..... ..... ..... ..... ..... ..... if IPX = 1
Outer IP header fields (5.7.5):
..... ..... ..... ..... ..... ..... ..... .....
| Type of Service/Traffic Class | if TOS2 = 1
..... ..... ..... ..... ..... ..... ..... .....
| Time to Live/Hop Limit | if TTL2 = 1
..... ..... ..... ..... ..... ..... ..... .....
| Protocol/Next Header | if PR2 = 1
..... ..... ..... ..... ..... ..... ..... .....
/ IP extension headers / variable,
..... ..... ..... ..... ..... ..... ..... ..... if IPX2 = 1
/ IP-ID / 2 octets,
..... ..... ..... ..... ..... ..... ..... ..... if I2 = 1| context | The decompression context | |
| flags | The ROHC flags that indicate which IP fields are present in the packet | |
| fields | The ROHC packet part that contains some IP header fields | |
| length | The length of the ROHC packet part that contains some IP header fields | |
| [out] | last_flag | Whether the parsing is performed for the RTP profile or not |
| [out] | bits | The bits extracted from extension 3 |
| int rfc3095_parse_outer_hdr_flags_fields | ( | const struct rohc_decomp_ctxt *const | context, |
| const uint8_t *const | flags, | ||
| const uint8_t * | fields, | ||
| const size_t | length, | ||
| struct rohc_extr_ip_bits *const | bits | ||
| ) |
Parse the outer IP header flags and fields.
| context | The decompression context |
| flags | The ROHC flags that indicate which IP fields are present in the packet |
| fields | The ROHC packet part that contain some IP header fields |
| length | The length of the ROHC packet part that contains some IP header fields |
| bits | OUT: The bits extracted from extension 3 |
| bool rohc_decomp_rfc3095_create | ( | const struct rohc_decomp_ctxt *const | context, |
| struct rohc_decomp_rfc3095_ctxt **const | persist_ctxt, | ||
| struct rohc_decomp_volat_ctxt *const | volat_ctxt, | ||
| rohc_trace_callback2_t | trace_cb, | ||
| void *const | trace_cb_priv, | ||
| const int | profile_id | ||
| ) |
Create the RFC3095 volatile and persistent parts of the context.
This function is one of the functions that must exist in one profile for the framework to work.
| context | The decompression context | |
| [out] | persist_ctxt | The persistent part of the decompression context |
| [out] | volat_ctxt | The volatile part of the decompression context |
| trace_cb | The function to call for printing traces | |
| trace_cb_priv | An optional private context, may be NULL | |
| profile_id | The ID of the associated decompression profile |
| void rohc_decomp_rfc3095_destroy | ( | struct rohc_decomp_rfc3095_ctxt *const | rfc3095_ctxt, |
| const struct rohc_decomp_volat_ctxt *const | volat_ctxt | ||
| ) |
Destroy the context.
This function is one of the functions that must exist in one profile for the framework to work.
| rfc3095_ctxt | The generic decompression context |
| volat_ctxt | The volatile part of the decompression context |
| uint32_t rohc_decomp_rfc3095_get_sn | ( | const struct rohc_decomp_ctxt *const | context | ) |
Get the reference SN value of the context.
This function is one of the functions that must exist in one profile for the framework to work.
| context | The decompression context |
1.8.14