|
ROHC compression/decompression library
|
ROHC compression context for the UDP-Lite profile. More...

Functions | |
| int | udp_lite_code_dynamic_udp_lite_part (struct c_context *context, const unsigned char *next_header, unsigned char *dest, int counter) |
| Build the dynamic part of the UDP-Lite header. | |
| int | udp_lite_build_cce_packet (struct c_context *context, const unsigned char *next_header, unsigned char *dest, int counter, int *first_position) |
| Build the Checksum Coverage Extension (CCE) packet. | |
| boolean | udp_lite_send_cce_packet (struct c_context *context, const struct udphdr *udp_lite) |
| Check whether a Checksum Coverage Extension (CCE) packet must be sent or not in order to compress the given UDP-Lite header. | |
| int | udp_lite_code_UO_packet_tail (struct c_context *context, const unsigned char *next_header, unsigned char *dest, int counter) |
| Build UDP-Lite-related fields in the tail of the UO packets. | |
| void | udp_lite_init_cc (struct c_context *context, const unsigned char *next_header) |
| Initialize checksum coverage in the compression context with the given UDP-Lite header. | |
| int | c_udp_lite_create (struct c_context *context, const struct ip_packet ip) |
| Create a new UDP-Lite context and initialize it thanks to the given IP/UDP-Lite packet. | |
| int | c_udp_lite_check_context (struct c_context *context, struct ip_packet ip) |
| Check if the IP/UDP-Lite packet belongs to the context. | |
| int | c_udp_lite_encode (struct c_context *context, const struct ip_packet ip, int packet_size, unsigned char *dest, int dest_size, int *payload_offset) |
| Encode an IP/UDP-lite packet according to a pattern decided by several different factors. | |
Variables | |
| struct c_profile | c_udp_lite_profile |
| Define the compression part of the UDP-Lite profile as described in the RFC 4019. | |
ROHC compression context for the UDP-Lite profile.
| int c_udp_lite_check_context | ( | struct c_context * | context, |
| struct ip_packet | ip | ||
| ) |
Check if the IP/UDP-Lite 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/UDP-Lite packet to check |
References ip_header_info::info, c_generic_context::ip2_flags, c_generic_context::ip_flags, ip_get_inner_packet(), ip_get_next_layer(), ip_get_protocol(), ip_get_version(), ip_is_fragment(), IPPROTO_UDPLITE, 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, ipv4_header_info::old_ip, ipv6_header_info::old_ip, sc_udp_lite_context::old_udp_lite, rohc_debugf, c_context::specific, c_generic_context::specific, ip_header_info::v4, ip_header_info::v6, version, and ip_header_info::version.
| int c_udp_lite_create | ( | struct c_context * | context, |
| const struct ip_packet | ip | ||
| ) |
Create a new UDP-Lite context and initialize it thanks to the given IP/UDP-Lite packet.
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/UDP-Lite packet given to initialize the new context |
References c_generic_create(), c_generic_destroy(), sc_udp_lite_context::cfi, sc_udp_lite_context::cfp, c_generic_context::code_dynamic_part, c_generic_context::code_static_part, c_generic_context::code_UO_packet_head, c_generic_context::code_UO_packet_tail, c_generic_context::compute_crc_dynamic, c_generic_context::compute_crc_static, sc_udp_lite_context::coverage_equal_count, sc_udp_lite_context::coverage_inferred_count, decide_state(), c_generic_context::decide_state, sc_udp_lite_context::FK, c_generic_context::init_at_IR, ip_get_inner_packet(), ip_get_next_layer(), ip_get_protocol(), IPPROTO_UDPLITE, MAX_IR_COUNT, c_generic_context::next_header_len, c_generic_context::next_header_proto, sc_udp_lite_context::old_udp_lite, rohc_debugf, sc_udp_lite_context::sent_cce_off_count, sc_udp_lite_context::sent_cce_on_count, sc_udp_lite_context::sent_cce_only_count, c_context::specific, c_generic_context::specific, sc_udp_lite_context::tmp_variables, udp_code_static_udp_part(), udp_compute_crc_dynamic(), udp_compute_crc_static(), udp_lite_build_cce_packet(), udp_lite_code_dynamic_udp_lite_part(), udp_lite_code_UO_packet_tail(), udp_lite_init_cc(), and udp_lite_tmp_variables::udp_size.
| int c_udp_lite_encode | ( | struct c_context * | context, |
| const struct ip_packet | ip, | ||
| int | packet_size, | ||
| unsigned char * | dest, | ||
| int | dest_size, | ||
| int * | payload_offset | ||
| ) |
Encode an IP/UDP-lite packet according to a pattern decided by several different factors.
| context | The compression context |
| ip | The IP packet to encode |
| packet_size | The length of the IP packet to encode |
| dest | The rohc-packet-under-build buffer |
| dest_size | The length of the rohc-packet-under-build buffer |
| payload_offset | The offset for the payload in the IP packet |
References c_generic_encode(), ip_get_hdrlen(), ip_get_inner_packet(), ip_get_next_layer(), ip_get_protocol(), IPPROTO_UDPLITE, sc_udp_lite_context::old_udp_lite, PACKET_IR, PACKET_IR_DYN, generic_tmp_variables::packet_type, rohc_debugf, c_context::specific, c_generic_context::specific, sc_udp_lite_context::tmp_variables, c_generic_context::tmp_variables, and udp_lite_tmp_variables::udp_size.
| int udp_lite_build_cce_packet | ( | struct c_context * | context, |
| const unsigned char * | next_header, | ||
| unsigned char * | dest, | ||
| int | counter, | ||
| int * | first_position | ||
| ) |
Build the Checksum Coverage Extension (CCE) packet.
The Checksum Coverage Extension is located at the very start of the UO packet (part 2 in the following figure).
0 1 2 3 4 5 6 7
--- --- --- --- --- --- --- ---
1 : Add-CID octet : If for small CIDs and CID 1 - 15
+---+---+---+---+---+---+---+---+
2 | 1 1 1 1 1 0 F | K | Outer packet type identifier
+---+---+---+---+---+---+---+---+
: :
3 / 0, 1, or 2 octets of CID / 1 - 2 octets if large CIDs
: :
+---+---+---+---+---+---+---+---+
: :
4 / UO-0, UO-1 or UO-2 packet /
: :
+---+---+---+---+---+---+---+---+
Parts 1, 3 and 4 are coded by the generic code_UO0_packet, code_UO1_packet and code_UO2_packet functions. These functions call the code_UO_packet_head function which in case of UDP-Lite profile is the udp_lite_build_cce_packet function.
When the udp_lite_build_cce_packet is called, the parameter first_position points on the part 2 and the parameter counter points on the beginning of the part 4.
| context | The compression context |
| next_header | The UDP header |
| dest | The rohc-packet-under-build buffer |
| counter | The current position in the rohc-packet-under-build buffer |
| first_position | The position to place the first byte of packet |
References sc_udp_lite_context::FK, rohc_debugf, c_context::specific, c_generic_context::specific, and udp_lite_send_cce_packet().
Referenced by c_udp_lite_create().
| int udp_lite_code_dynamic_udp_lite_part | ( | struct c_context * | context, |
| const unsigned char * | next_header, | ||
| unsigned char * | dest, | ||
| int | counter | ||
| ) |
Build the dynamic part of the UDP-Lite header.
Dynamic part of UDP-Lite header (5.2.1 of RFC 4019):
+---+---+---+---+---+---+---+---+
1 / Checksum Coverage / 2 octets
+---+---+---+---+---+---+---+---+
2 / Checksum / 2 octets
+---+---+---+---+---+---+---+---+
| context | The compression context |
| next_header | The UDP-Lite header |
| dest | The rohc-packet-under-build buffer |
| counter | The current position in the rohc-packet-under-build buffer |
References rohc_debugf.
Referenced by c_udp_lite_create().
| int udp_lite_code_UO_packet_tail | ( | struct c_context * | context, |
| const unsigned char * | next_header, | ||
| unsigned char * | dest, | ||
| int | counter | ||
| ) |
Build UDP-Lite-related fields in the tail of the UO packets.
--- --- --- --- --- --- --- ---
: : 2 octets,
1 + UDP-Lite Checksum Coverage + if context(CFP) = 1 or
: : if packet type = CCE
--- --- --- --- --- --- --- ---
: :
2 + UDP-Lite Checksum + 2 octets
: :
--- --- --- --- --- --- --- ---
| context | The compression context |
| next_header | The UDP-Lite header |
| dest | The rohc-packet-under-build buffer |
| counter | The current position in the rohc-packet-under-build buffer |
References sc_udp_lite_context::cfp, rohc_debugf, c_context::specific, c_generic_context::specific, and udp_lite_send_cce_packet().
Referenced by c_udp_lite_create().
| void udp_lite_init_cc | ( | struct c_context * | context, |
| const unsigned char * | next_header | ||
| ) |
Initialize checksum coverage in the compression context with the given UDP-Lite header.
| context | The compression context |
| next_header | The UDP-Lite header |
References sc_udp_lite_context::cfi, sc_udp_lite_context::cfp, c_generic_context::ir_count, sc_udp_lite_context::old_udp_lite, rohc_debugf, c_context::specific, c_generic_context::specific, sc_udp_lite_context::tmp_coverage, sc_udp_lite_context::tmp_variables, and udp_lite_tmp_variables::udp_size.
Referenced by c_udp_lite_create().
| boolean udp_lite_send_cce_packet | ( | struct c_context * | context, |
| const struct udphdr * | udp_lite | ||
| ) |
Check whether a Checksum Coverage Extension (CCE) packet must be sent or not in order to compress the given UDP-Lite header.
The function also updates the FK variable stored in the UDP-Lite context.
| context | The compression context |
| udp_lite | The UDP-Lite header |
References sc_udp_lite_context::cfi, sc_udp_lite_context::cfp, sc_udp_lite_context::coverage_equal_count, sc_udp_lite_context::coverage_inferred_count, sc_udp_lite_context::FK, MAX_IR_COUNT, MAX_LITE_COUNT, sc_udp_lite_context::old_udp_lite, rohc_debugf, sc_udp_lite_context::sent_cce_off_count, sc_udp_lite_context::sent_cce_on_count, sc_udp_lite_context::sent_cce_only_count, c_context::specific, c_generic_context::specific, sc_udp_lite_context::tmp_coverage, sc_udp_lite_context::tmp_variables, and udp_lite_tmp_variables::udp_size.
Referenced by udp_lite_build_cce_packet(), and udp_lite_code_UO_packet_tail().
| struct c_profile c_udp_lite_profile |
{
IPPROTO_UDPLITE,
NULL,
ROHC_PROFILE_UDPLITE,
"1.0b",
"UDP-Lite / Compressor",
c_udp_lite_create,
c_generic_destroy,
c_udp_lite_check_context,
c_udp_lite_encode,
c_generic_feedback,
}
Define the compression part of the UDP-Lite profile as described in the RFC 4019.
1.7.6.1