ROHC compression/decompression library
|
ROHC compression context for the IP-only profile. More...
#include "c_ip.h"
#include "rohc_traces_internal.h"
#include "rohc_utils.h"
#include <string.h>
#include <assert.h>
Functions | |
static bool | rohc_ip_ctxt_create (struct rohc_comp_ctxt *const context, const struct net_pkt *const packet) |
Create a new context and initialize it thanks to the given IP packet. | |
bool | c_ip_check_context (const struct rohc_comp_ctxt *const context, const struct net_pkt *const packet) |
Check if an IP packet belongs to the context. | |
rohc_packet_t | c_ip_decide_FO_packet (const struct rohc_comp_ctxt *context) |
Decide which packet to send when in First Order (FO) state. | |
rohc_packet_t | c_ip_decide_SO_packet (const struct rohc_comp_ctxt *context) |
Decide which packet to send when in Second Order (SO) state. | |
uint32_t | c_ip_get_next_sn (const struct rohc_comp_ctxt *const context, const struct net_pkt *const uncomp_pkt) |
Determine the SN value for the next packet. | |
int | c_ip_code_ir_remainder (const struct rohc_comp_ctxt *const context, unsigned char *const dest, const size_t dest_max_len, const size_t counter) |
Code the remainder header for the IR or IR-DYN packets. | |
Variables | |
struct rohc_comp_profile | c_ip_profile |
Define the compression part of the IP-only profile as described in the RFC 3843. |
ROHC compression context for the IP-only profile.
bool c_ip_check_context | ( | const struct rohc_comp_ctxt *const | context, |
const struct net_pkt *const | packet | ||
) |
Check if an IP packet belongs to the context.
Conditions are:
This function is one of the functions that must exist in one profile for the framework to work.
context | The compression context |
packet | The IP packet to check |
int c_ip_code_ir_remainder | ( | const struct rohc_comp_ctxt *const | context, |
unsigned char *const | dest, | ||
const size_t | dest_max_len, | ||
const size_t | counter | ||
) |
Code the remainder header for the IR or IR-DYN packets.
Remainder of IR/IR-DYN packet (5.7.7.1): 0 1 2 3 4 5 6 7 +---+---+---+---+---+---+---+---+ 1 | SN | 2 octets if not RTP +---+---+---+---+---+---+---+---+
context | The compression context |
dest | The ROHC packet being coded |
dest_max_len | The maximum length (in bytes) of the ROHC packet |
counter | The current position in the ROHC buffer |
rohc_packet_t c_ip_decide_FO_packet | ( | const struct rohc_comp_ctxt * | context | ) |
Decide which packet to send when in First Order (FO) state.
Packets that can be used are the IR-DYN and UO-2 packets.
context | The compression context |
rohc_packet_t c_ip_decide_SO_packet | ( | const struct rohc_comp_ctxt * | context | ) |
Decide which packet to send when in Second Order (SO) state.
Packets that can be used are the UO-0, UO-1 and UO-2 (with or without extensions) packets.
context | The compression context |
uint32_t c_ip_get_next_sn | ( | const struct rohc_comp_ctxt *const | context, |
const struct net_pkt *const | uncomp_pkt | ||
) |
Determine the SN value for the next packet.
Profile SN is an internal increasing 16-bit number.
context | The compression context |
uncomp_pkt | The uncompressed packet to encode |
static bool rohc_ip_ctxt_create | ( | struct rohc_comp_ctxt *const | context, |
const struct net_pkt *const | packet | ||
) | [static] |
Create a new context and initialize it thanks to the given IP packet.
This function is one of the functions that must exist in one profile for the framework to work.
context | The compression context |
packet | The IP packet given to initialize the new context |
struct rohc_comp_profile c_ip_profile |
{ .id = ROHC_PROFILE_IP, .protocol = 0, .create = rohc_ip_ctxt_create, .destroy = c_generic_destroy, .check_profile = c_generic_check_profile, .check_context = c_ip_check_context, .encode = c_generic_encode, .reinit_context = c_generic_reinit_context, .feedback = c_generic_feedback, .use_udp_port = c_generic_use_udp_port, }
Define the compression part of the IP-only profile as described in the RFC 3843.