ROHC compression/decompression library
ip_numbers.h
Go to the documentation of this file.
1 /*
2  * Copyright 2012,2013,2014 Didier Barvaux
3  * Copyright 2013 Viveris Technologies
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 /**
21  * @file ip_numbers.h
22  * @brief Defines the IPv4 protocol numbers
23  * @author Free Software Foundation, Inc
24  * @author Didier Barvaux <didier@barvaux.org>
25  *
26  * This file contains some parts from the GNU C library. It is copied here to
27  * be portable on all platforms, even the platforms that miss the
28  * declarations or got different declarations, such as Microsoft Windows or
29  * FreeBSD.
30  *
31  * The copyright statement of the GNU C library is:
32  * Copyright (C) 1991-2001, 2003, 2004, 2006, 2007, 2008, 2011, 2012
33  * Free Software Foundation, Inc.
34  */
35 
36 #ifndef ROHC_PROTOCOLS_NUMBERS_H
37 #define ROHC_PROTOCOLS_NUMBERS_H
38 
39 #ifdef __KERNEL__
40 # include <linux/types.h>
41 #else
42 # include <stdbool.h>
43 # include <stdint.h>
44 #endif
45 
46 
47 /**
48  * @brief The IP numbers defined by IANA
49  *
50  * Full list at:
51  * http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml
52  */
53 enum
54 {
55  /** The IP protocol number for Hop-by-Hop option */
57  /** The IP protocol number for IPv4-in-IPv4 tunnels */
59  /** The IP protocol number for Transmission Control Protocol (TCP) */
61  /** The IP protocol number for the User Datagram Protocol (UDP) */
63  /** The IP protocol number for IPv6 */
65  /** The IP protocol number for IPv6 routing header */
67  /** The IP protocol number for IPv6 fragment header */
69  /** The IP protocol number for Generic Routing Encapsulation (GRE) */
71  /** The IP protocol number for the Encapsulating Security Payload (ESP) */
73  /** The IP protocol number for Authentication Header */
75  /** The IP protocol number for Minimal Encapsulation within IP (RFC 2004) */
77  /** The IP protocol number for IPv6 destination option */
79  /** The IP protocol number for Mobility Header */
81  /** The IP protocol number for UDP-Lite */
83  /** The IP protocol number for the Host Identity Protocol (HIP) */
85  /** The IP protocol number for the Shim6 Protocol */
87  /** The IP protocol number reserved for experimentation and testing */
89  /** The IP protocol number reserved for experimentation and testing */
91  /** The maximum IP protocol number */
93 };
94 
95 
96 bool rohc_is_tunneling(const uint8_t protocol)
97  __attribute__((warn_unused_result, const));
98 
99 bool rohc_is_ipv6_opt(const uint8_t protocol)
100  __attribute__((warn_unused_result, const));
101 
102 const char * rohc_get_ip_proto_descr(const uint8_t protocol)
103  __attribute__((warn_unused_result, const));
104 
105 #endif
106 
Definition: ip_numbers.h:66
Definition: ip_numbers.h:74
const char * rohc_get_ip_proto_descr(const uint8_t protocol)
Give a description for the given IP protocol.
Definition: ip_numbers.c:88
Definition: ip_numbers.h:68
Definition: ip_numbers.h:70
bool rohc_is_ipv6_opt(const uint8_t protocol)
Whether the given protocol is an IPv6 option.
Definition: ip_numbers.c:56
Definition: ip_numbers.h:72
Definition: ip_numbers.h:62
Definition: ip_numbers.h:64
Definition: ip_numbers.h:60
bool rohc_is_tunneling(const uint8_t protocol)
Whether the given protocol is IP tunneling.
Definition: ip_numbers.c:35
Definition: ip_numbers.h:78
Definition: ip_numbers.h:88
Definition: ip_numbers.h:80
Definition: ip_numbers.h:56
Definition: ip_numbers.h:58
Definition: ip_numbers.h:82
Definition: ip_numbers.h:84
Definition: ip_numbers.h:86
Definition: ip_numbers.h:76
Definition: ip_numbers.h:92
Definition: ip_numbers.h:90