ROHC compression/decompression library
Enumerations | Functions
ip_numbers.h File Reference

Defines the IPv4 protocol numbers. More...

#include <stdbool.h>
#include <stdint.h>
Include dependency graph for ip_numbers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  {
  ROHC_IPPROTO_HOPOPTS = 0, ROHC_IPPROTO_IPIP = 4, ROHC_IPPROTO_TCP = 6, ROHC_IPPROTO_UDP = 17,
  ROHC_IPPROTO_IPV6 = 41, ROHC_IPPROTO_ROUTING = 43, ROHC_IPPROTO_FRAGMENT = 44, ROHC_IPPROTO_GRE = 47,
  ROHC_IPPROTO_ESP = 50, ROHC_IPPROTO_AH = 51, ROHC_IPPROTO_MINE = 55, ROHC_IPPROTO_DSTOPTS = 60,
  ROHC_IPPROTO_MOBILITY = 135, ROHC_IPPROTO_UDPLITE = 136, ROHC_IPPROTO_HIP = 139, ROHC_IPPROTO_SHIM = 140,
  ROHC_IPPROTO_RESERVED1 = 253, ROHC_IPPROTO_RESERVED2 = 254, ROHC_IPPROTO_MAX = 255
}
 The IP numbers defined by IANA. More...
 

Functions

bool rohc_is_tunneling (const uint8_t protocol)
 Whether the given protocol is IP tunneling. More...
 
bool rohc_is_ipv6_opt (const uint8_t protocol)
 Whether the given protocol is an IPv6 option. More...
 
const char * rohc_get_ip_proto_descr (const uint8_t protocol)
 Give a description for the given IP protocol. More...
 

Detailed Description

Defines the IPv4 protocol numbers.

Author
Free Software Foundation, Inc
Didier Barvaux didie.nosp@m.r@ba.nosp@m.rvaux.nosp@m..org

This file contains some parts from the GNU C library. It is copied here to be portable on all platforms, even the platforms that miss the declarations or got different declarations, such as Microsoft Windows or FreeBSD.

The copyright statement of the GNU C library is: Copyright (C) 1991-2001, 2003, 2004, 2006, 2007, 2008, 2011, 2012 Free Software Foundation, Inc.

Enumeration Type Documentation

anonymous enum

The IP numbers defined by IANA.

Full list at: http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml

Enumerator
ROHC_IPPROTO_HOPOPTS 

The IP protocol number for Hop-by-Hop option

ROHC_IPPROTO_IPIP 

The IP protocol number for IPv4-in-IPv4 tunnels

ROHC_IPPROTO_TCP 

The IP protocol number for Transmission Control Protocol (TCP)

ROHC_IPPROTO_UDP 

The IP protocol number for the User Datagram Protocol (UDP)

ROHC_IPPROTO_IPV6 

The IP protocol number for IPv6

ROHC_IPPROTO_ROUTING 

The IP protocol number for IPv6 routing header

ROHC_IPPROTO_FRAGMENT 

The IP protocol number for IPv6 fragment header

ROHC_IPPROTO_GRE 

The IP protocol number for Generic Routing Encapsulation (GRE)

ROHC_IPPROTO_ESP 

The IP protocol number for the Encapsulating Security Payload (ESP)

ROHC_IPPROTO_AH 

The IP protocol number for Authentication Header

ROHC_IPPROTO_MINE 

The IP protocol number for Minimal Encapsulation within IP (RFC 2004)

ROHC_IPPROTO_DSTOPTS 

The IP protocol number for IPv6 destination option

ROHC_IPPROTO_MOBILITY 

The IP protocol number for Mobility Header

ROHC_IPPROTO_UDPLITE 

The IP protocol number for UDP-Lite

ROHC_IPPROTO_HIP 

The IP protocol number for the Host Identity Protocol (HIP)

ROHC_IPPROTO_SHIM 

The IP protocol number for the Shim6 Protocol

ROHC_IPPROTO_RESERVED1 

The IP protocol number reserved for experimentation and testing

ROHC_IPPROTO_RESERVED2 

The IP protocol number reserved for experimentation and testing

ROHC_IPPROTO_MAX 

The maximum IP protocol number

Function Documentation

const char* rohc_get_ip_proto_descr ( const uint8_t  protocol)

Give a description for the given IP protocol.

Parameters
protocolThe IP protocol to get a description for
Returns
A string that describes the given IP protocol
bool rohc_is_ipv6_opt ( const uint8_t  protocol)

Whether the given protocol is an IPv6 option.

Handle GRE, Authentication (AH), MINE, and all IPv6 extension headers.

The list of IPv6 extension headers was retrieved from the registry maintained by IANA at: http://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml Remember to update get_index_ipv6_table if you update the list.

Parameters
protocolThe protocol number to check for
Returns
true if the protocol is an IPv6 option, false otherwise
bool rohc_is_tunneling ( const uint8_t  protocol)

Whether the given protocol is IP tunneling.

Parameters
protocolThe protocol number to check for
Returns
true if the protocol is IP/IP or IPv6, false otherwise