ROHC compression/decompression library
Functions | Variables
c_ip.c File Reference

ROHC compression context for the IP-only profile. More...

#include "c_ip.h"
#include "rohc_traces.h"
Include dependency graph for c_ip.c:

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.

Variables

struct c_profile c_ip_profile
 Define the compression part of the IP-only profile as described in the RFC 3843.

Detailed Description

ROHC compression context for the IP-only profile.

Author:
Didier Barvaux <didier.barvaux@toulouse.viveris.com>
The hackers from ROHC for Linux

Function Documentation

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:

  • the number of IP headers must be the same as in context
  • IP version of the two IP headers must be the same as in context
  • IP packets must not be fragmented
  • the source and destination addresses of the two IP headers must match the ones in the context
  • IPv6 only: the Flow Label of the two IP headers must match the ones the context

This function is one of the functions that must exist in one profile for the framework to work.

Parameters:
contextThe compression context
ipThe IP packet to check
Returns:
1 if the IP packet belongs to the context, 0 if it does not belong to the context and -1 if the profile cannot compress it or an error occurs

References ip_header_info::info, c_generic_context::ip2_flags, 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, ipv4_header_info::old_ip, ipv6_header_info::old_ip, rohc_debugf, c_context::specific, ip_header_info::v4, ip_header_info::v6, version, and ip_header_info::version.


Variable Documentation

Initial value:

Define the compression part of the IP-only profile as described in the RFC 3843.