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

Functions | |
| int | udp_code_dynamic_udp_part (struct c_context *context, const unsigned char *next_header, unsigned char *dest, int counter) |
| Build the dynamic part of the UDP header. | |
| int | udp_changed_udp_dynamic (struct c_context *context, const struct udphdr *udp) |
| Check if the dynamic part of the UDP header changed. | |
| int | c_udp_create (struct c_context *context, const struct ip_packet ip) |
| Create a new UDP context and initialize it thanks to the given IP/UDP packet. | |
| int | c_udp_check_context (struct c_context *context, struct ip_packet ip) |
| Check if the IP/UDP packet belongs to the context. | |
| int | c_udp_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 packet according to a pattern decided by several different factors. | |
| void | udp_decide_state (struct c_context *context) |
| Decide the state that should be used for the next packet compressed with the ROHC UDP profile. | |
| int | udp_code_UO_packet_tail (struct c_context *context, const unsigned char *next_header, unsigned char *dest, int counter) |
| Build UDP-related fields in the tail of the UO packets. | |
| int | udp_code_static_udp_part (struct c_context *context, const unsigned char *next_header, unsigned char *dest, int counter) |
| Build the static part of the UDP header. | |
Variables | |
| struct c_profile | c_udp_profile |
| Define the compression part of the UDP profile as described in the RFC 3095. | |
ROHC compression context for the UDP profile.
| int c_udp_check_context | ( | struct c_context * | context, |
| struct ip_packet | ip | ||
| ) |
Check if the IP/UDP 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 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(), 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_context::old_udp, rohc_debugf, c_context::specific, c_generic_context::specific, ip_header_info::v4, ip_header_info::v6, version, and ip_header_info::version.
Referenced by c_rtp_check_context().
| int c_udp_create | ( | struct c_context * | context, |
| const struct ip_packet | ip | ||
| ) |
Create a new UDP context and initialize it thanks to the given IP/UDP 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 packet given to initialize the new context |
References c_generic_create(), c_generic_destroy(), 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, c_generic_context::decide_state, c_generic_context::init_at_IR, ip_get_inner_packet(), ip_get_next_layer(), ip_get_protocol(), c_generic_context::next_header_len, c_generic_context::next_header_proto, sc_udp_context::old_udp, rohc_debugf, udp_tmp_variables::send_udp_dynamic, c_context::specific, c_generic_context::specific, sc_udp_context::tmp_variables, sc_udp_context::udp_checksum_change_count, udp_code_dynamic_udp_part(), udp_code_static_udp_part(), udp_code_UO_packet_tail(), udp_compute_crc_dynamic(), udp_compute_crc_static(), and udp_decide_state().
| int c_udp_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 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_inner_packet(), ip_get_next_layer(), ip_get_protocol(), sc_udp_context::old_udp, PACKET_IR, PACKET_IR_DYN, generic_tmp_variables::packet_type, rohc_debugf, udp_tmp_variables::send_udp_dynamic, c_context::specific, c_generic_context::specific, sc_udp_context::tmp_variables, c_generic_context::tmp_variables, and udp_changed_udp_dynamic().
| int udp_changed_udp_dynamic | ( | struct c_context * | context, |
| const struct udphdr * | udp | ||
| ) |
Check if the dynamic part of the UDP header changed.
| context | The compression context |
| udp | The UDP header |
References MAX_IR_COUNT, sc_udp_context::old_udp, c_context::specific, c_generic_context::specific, and sc_udp_context::udp_checksum_change_count.
Referenced by c_udp_encode().
| int udp_code_dynamic_udp_part | ( | struct c_context * | context, |
| const unsigned char * | next_header, | ||
| unsigned char * | dest, | ||
| int | counter | ||
| ) |
Build the dynamic part of the UDP header.
Dynamic part of UDP header (5.7.7.5):
+---+---+---+---+---+---+---+---+
1 / Checksum / 2 octets
+---+---+---+---+---+---+---+---+
| 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 |
References rohc_debugf, c_context::specific, c_generic_context::specific, and sc_udp_context::udp_checksum_change_count.
Referenced by c_udp_create().
| int udp_code_static_udp_part | ( | struct c_context * | context, |
| const unsigned char * | next_header, | ||
| unsigned char * | dest, | ||
| int | counter | ||
| ) |
Build the static part of the UDP header.
Static part of UDP header (5.7.7.5):
+---+---+---+---+---+---+---+---+
1 / Source Port / 2 octets
+---+---+---+---+---+---+---+---+
2 / Destination Port / 2 octets
+---+---+---+---+---+---+---+---+
| 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 |
References rohc_debugf.
Referenced by c_udp_create(), c_udp_lite_create(), and rtp_code_static_rtp_part().
| int udp_code_UO_packet_tail | ( | struct c_context * | context, |
| const unsigned char * | next_header, | ||
| unsigned char * | dest, | ||
| int | counter | ||
| ) |
Build UDP-related fields in the tail of the UO packets.
--- --- --- --- --- --- --- ---
: :
13 + UDP Checksum + 2 octets,
: : if context(UDP Checksum) != 0
--- --- --- --- --- --- --- ---
| 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 |
References rohc_debugf.
Referenced by c_rtp_create(), and c_udp_create().
| void udp_decide_state | ( | struct c_context * | context | ) |
Decide the state that should be used for the next packet compressed with the ROHC UDP profile.
The three states are:
| context | The compression context |
References change_state(), decide_state(), IR, rohc_debugf, udp_tmp_variables::send_udp_dynamic, c_context::specific, c_generic_context::specific, and sc_udp_context::tmp_variables.
Referenced by c_udp_create().
| struct c_profile c_udp_profile |
{
IPPROTO_UDP,
NULL,
ROHC_PROFILE_UDP,
"1.0b",
"UDP / Compressor",
c_udp_create,
c_generic_destroy,
c_udp_check_context,
c_udp_encode,
c_generic_feedback,
}
Define the compression part of the UDP profile as described in the RFC 3095.
1.7.6.1