ROHC compression/decompression library
|
ROHC compression context for the IP-only profile. More...
Functions | |
int | c_ip_check_context (const struct c_context *context, const struct ip_packet *ip) |
Check if an IP packet belongs to the context. | |
rohc_packet_t | c_ip_decide_FO_packet (const struct c_context *context) |
Decide which packet to send when in First Order (FO) state. | |
rohc_packet_t | c_ip_decide_SO_packet (const struct c_context *context) |
Decide which packet to send when in Second Order (SO) state. | |
uint32_t | c_ip_get_next_sn (const struct c_context *context, const struct ip_packet *outer_ip, const struct ip_packet *inner_ip) |
Determine the SN value for the next packet. | |
int | c_ip_code_ir_remainder (const struct c_context *context, unsigned char *const dest, int counter) |
Code the remainder header for the IR or IR-DYN packets. | |
Variables | |
struct c_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.
int c_ip_check_context | ( | const struct c_context * | context, |
const struct ip_packet * | ip | ||
) |
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 |
ip | The IP packet to check |
References ipv4_hdr::daddr, ip_header_info::info, c_generic_context::ip2_flags, ipv6_hdr::ip6_dst, ipv6_hdr::ip6_src, c_generic_context::ip_flags, ip_get_inner_packet(), ip_get_protocol(), ip_get_version(), IPV4, ipv4_get_daddr(), ipv4_get_saddr(), IPV6, IPV6_ADDR_CMP, ipv6_get_daddr(), IPV6_GET_FLOW_LABEL, ipv6_get_flow_label(), ipv6_get_saddr(), c_generic_context::is_ip2_initialized, c_generic_context::next_header_proto, ipv4_header_info::old_ip, ipv6_header_info::old_ip, rohc_debugf, ROHC_IPPROTO_IPIP, ROHC_IPPROTO_IPV6, ipv4_hdr::saddr, c_context::specific, ip_header_info::v4, ip_header_info::v6, version, and ip_header_info::version.
int c_ip_code_ir_remainder | ( | const struct c_context * | context, |
unsigned char *const | dest, | ||
int | 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-under-build buffer |
counter | The current position in the rohc-packet-under-build buffer |
References rohc_debugf, sn, c_generic_context::sn, and c_context::specific.
Referenced by c_udp_create(), and c_udp_lite_create().
rohc_packet_t c_ip_decide_FO_packet | ( | const struct c_context * | 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 |
References generic_tmp_vars::nr_of_ip_hdr, generic_tmp_vars::nr_sn_bits, PACKET_IR_DYN, PACKET_UOR_2, rohc_debugf, generic_tmp_vars::send_dynamic, generic_tmp_vars::send_static, c_context::specific, and c_generic_context::tmp.
Referenced by c_udp_create(), and c_udp_lite_create().
rohc_packet_t c_ip_decide_SO_packet | ( | const struct c_context * | 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 |
References ip_header_info::info, c_generic_context::ip2_flags, c_generic_context::ip_flags, IPV4, generic_tmp_vars::nr_ip_id_bits, generic_tmp_vars::nr_ip_id_bits2, generic_tmp_vars::nr_of_ip_hdr, generic_tmp_vars::nr_sn_bits, PACKET_IR_DYN, PACKET_UO_0, PACKET_UO_1, PACKET_UOR_2, ipv4_header_info::rnd, rohc_debugf, c_context::specific, c_generic_context::tmp, ip_header_info::v4, and ip_header_info::version.
Referenced by c_udp_create(), and c_udp_lite_create().
uint32_t c_ip_get_next_sn | ( | const struct c_context * | context, |
const struct ip_packet * | outer_ip, | ||
const struct ip_packet * | inner_ip | ||
) |
Determine the SN value for the next packet.
Profile SN is an internal increasing 16-bit number.
context | The compression context |
outer_ip | The outer IP header |
inner_ip | The inner IP header if it exists, NULL otherwise |
References c_generic_context::sn, and c_context::specific.
Referenced by c_udp_create(), and c_udp_lite_create().
struct c_profile c_ip_profile |
{ 0, NULL, ROHC_PROFILE_IP, "IP / Compressor", rohc_ip_ctxt_create, c_generic_destroy, c_ip_check_context, c_generic_encode, c_generic_feedback, }
Define the compression part of the IP-only profile as described in the RFC 3843.