Handle the irregular chain of the TCP decompression profile.
More...
#include "d_tcp_irregular.h"
#include "d_tcp_defines.h"
#include "d_tcp_opts_list.h"
#include "rohc_utils.h"
#include <string.h>
|
static int | tcp_parse_irregular_ip (const struct rohc_decomp_ctxt *const context, const ip_context_t *const ip_context, const uint8_t *rohc_data, const size_t rohc_data_len, const bool is_innermost, const tcp_ip_id_behavior_t ip_id_behavior, struct rohc_tcp_extr_bits *const bits, struct rohc_tcp_extr_ip_bits *const ip_bits) |
| Decode the irregular IP header of the rohc packet. More...
|
|
static int | tcp_parse_irregular_ipv4 (const struct rohc_decomp_ctxt *const context, const uint8_t *rohc_data, const size_t rohc_data_len, const bool is_innermost, const tcp_ip_id_behavior_t ip_id_behavior, struct rohc_tcp_extr_bits *const bits, struct rohc_tcp_extr_ip_bits *const ip_bits) |
| Decode the irregular IPv4 header of the rohc packet. More...
|
|
static int | tcp_parse_irregular_ipv6 (const struct rohc_decomp_ctxt *const context, const uint8_t *rohc_data, const size_t rohc_data_len, const bool is_innermost, struct rohc_tcp_extr_bits *const bits, struct rohc_tcp_extr_ip_bits *const ip_bits) |
| Decode the irregular IPv6 header of the rohc packet. More...
|
|
static int | tcp_parse_irregular_tcp (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_data, const size_t rohc_data_len, struct rohc_tcp_extr_bits *const bits, struct rohc_tcp_extr_ip_bits *const ip_inner_bits) |
| Decode the irregular TCP header of the rohc packet. More...
|
|
static bool | d_tcp_is_ecn_used (const struct d_tcp_context *const tcp_ctxt, const struct rohc_tcp_extr_bits *const bits) |
| Determine whether the TCP ECN flags are used or not. More...
|
|
bool | tcp_parse_irreg_chain (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const tcp_ip_id_behavior_t innermost_ip_id_behavior, struct rohc_tcp_extr_bits *const bits, size_t *const parsed_len) |
| Parse the irregular chain of the ROHC packet. More...
|
|
◆ d_tcp_is_ecn_used()
Determine whether the TCP ECN flags are used or not.
The bits extracted from the current ROHC packet are used if present. The value recorded in the decompression context is used as fallback otherwise.
- Parameters
-
tcp_ctxt | The TCP decompression context |
bits | The bits extracted from the ROHC packet |
- Returns
- true if the TCP ECN flags are used by the compressed TCP packet or not, false if they are not
◆ tcp_parse_irreg_chain()
Parse the irregular chain of the ROHC packet.
- Parameters
-
| context | The decompression context |
| rohc_packet | The remaining part of the ROHC packet |
| rohc_length | The remaining length (in bytes) of ROHC packet |
| innermost_ip_id_behavior | The behavior of the innermost IP-ID |
[out] | bits | The bits extracted from the irregular chain in case of success |
[out] | parsed_len | The length (in bytes) of irregular chain in case of success |
- Returns
- true in the irregular chain was successfully parsed, false if the ROHC packet was malformed
◆ tcp_parse_irregular_ip()
Decode the irregular IP header of the rohc packet.
- Parameters
-
| context | The decompression context |
| ip_context | The specific IP decompression context |
| rohc_data | The remaining part of the ROHC packet |
| rohc_data_len | The length of remaining part of the ROHC packet |
| is_innermost | True if the IP header is the innermost of the packet |
| ip_id_behavior | The IP-ID behavior of the IP header (may be different from the context) |
[out] | bits | The bits extracted from the irregular chain in case of success |
[out] | ip_bits | The bits extracted from the irregular chain for the current IPv6 header in case of success |
- Returns
- The number of ROHC bytes parsed, -1 if packet is malformed
◆ tcp_parse_irregular_ipv4()
Decode the irregular IPv4 header of the rohc packet.
- Parameters
-
| context | The decompression context |
| rohc_data | The remaining part of the ROHC packet |
| rohc_data_len | The length of remaining part of the ROHC packet |
| is_innermost | True if the IP header is the innermost of the packet |
| ip_id_behavior | The IP-ID behavior of the IP header (may be different from the context) |
[out] | bits | The bits extracted from the irregular chain in case of success |
[out] | ip_bits | The bits extracted from the irregular chain for the current IPv6 header in case of success |
- Returns
- The number of ROHC bytes parsed, -1 if packet is malformed
◆ tcp_parse_irregular_ipv6()
Decode the irregular IPv6 header of the rohc packet.
- Parameters
-
| context | The decompression context |
| rohc_data | The remaining part of the ROHC packet |
| rohc_data_len | The length of remaining part of the ROHC packet |
| is_innermost | True if the IP header is the innermost of the packet |
[out] | bits | The bits extracted from the irregular chain in case of success |
[out] | ip_bits | The bits extracted from the irregular chain for the current IPv6 header in case of success |
- Returns
- The number of ROHC bytes parsed, -1 if packet is malformed
◆ tcp_parse_irregular_tcp()
Decode the irregular TCP header of the rohc packet.
See RFC4996 page 75
- Parameters
-
| context | The decompression context |
| rohc_data | The remain data of the rohc packet |
| rohc_data_len | The length of the remain data of the rohc packet |
[out] | bits | The bits extracted from the TCP part of the irregular chain |
[out] | ip_inner_bits | The bits extracted from the innermost IP part of the irregular chain |
- Returns
- The number of ROHC bytes parsed, -1 if packet is malformed