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 #include <stdbool.h>
40 #include <stdint.h>
41 
42 
43 /**
44  * @brief The IP numbers defined by IANA
45  *
46  * Full list at:
47  * http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml
48  */
49 enum
50 {
51  /** The IP protocol number for Hop-by-Hop option */
53  /** The IP protocol number for IPv4-in-IPv4 tunnels */
55  /** The IP protocol number for Transmission Control Protocol (TCP) */
57  /** The IP protocol number for the User Datagram Protocol (UDP) */
59  /** The IP protocol number for IPv6 */
61  /** The IP protocol number for IPv6 routing header */
63  /** The IP protocol number for IPv6 fragment header */
65  /** The IP protocol number for Generic Routing Encapsulation (GRE) */
67  /** The IP protocol number for the Encapsulating Security Payload (ESP) */
69  /** The IP protocol number for Authentication Header */
71  /** The IP protocol number for Minimal Encapsulation within IP (RFC 2004) */
73  /** The IP protocol number for IPv6 destination option */
75  /** The IP protocol number for Mobility Header */
77  /** The IP protocol number for UDP-Lite */
79  /** The IP protocol number for the Host Identity Protocol (HIP) */
81  /** The IP protocol number for the Shim6 Protocol */
83  /** The IP protocol number reserved for experimentation and testing */
85  /** The IP protocol number reserved for experimentation and testing */
87  /** The maximum IP protocol number */
89 };
90 
91 
92 bool rohc_is_tunneling(const uint8_t protocol)
93  __attribute__((warn_unused_result, const));
94 
95 bool rohc_is_ipv6_opt(const uint8_t protocol)
96  __attribute__((warn_unused_result, const));
97 
98 const char * rohc_get_ip_proto_descr(const uint8_t protocol)
99  __attribute__((warn_unused_result, const));
100 
101 #endif
102 
Definition: ip_numbers.h:62
Definition: ip_numbers.h:70
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:64
Definition: ip_numbers.h:66
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:68
Definition: ip_numbers.h:58
Definition: ip_numbers.h:60
Definition: ip_numbers.h:56
bool rohc_is_tunneling(const uint8_t protocol)
Whether the given protocol is IP tunneling.
Definition: ip_numbers.c:35
Definition: ip_numbers.h:74
Definition: ip_numbers.h:84
Definition: ip_numbers.h:76
Definition: ip_numbers.h:52
Definition: ip_numbers.h:54
Definition: ip_numbers.h:78
Definition: ip_numbers.h:80
Definition: ip_numbers.h:82
Definition: ip_numbers.h:72
Definition: ip_numbers.h:88
Definition: ip_numbers.h:86