ROHC compression/decompression library
Functions
c_ip.h File Reference

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

#include <netinet/ip.h>
#include "c_generic.h"
Include dependency graph for c_ip.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int c_ip_check_context (struct c_context *context, const struct ip_packet ip)
 Check if an IP packet belongs to the context.

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 ( struct c_context context,
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(), 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, rohc_debugf, c_context::specific, ip_header_info::v4, ip_header_info::v6, version, and ip_header_info::version.