A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
iana-internet-protocol-numbers.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 Tokushima University, Japan
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Alberto Gallegos Ramonet <alramonet@is.tokushima-u.ac.jp>
7 *
8 */
9
10/*
11 * Centralized definitions for internet protocol numbers.
12 * This enumeration contains the IEEE 802 protocol numbers as defined by IANA.
13 * This represents only a portion of the complete list, protocols should
14 * be added as needed.
15 *
16 * In the Internet Protocol version 4 (IPv4) [RFC791] there is a field
17 * called "Protocol" to identify the next level protocol. This is an 8
18 * bit field. In Internet Protocol version 6 (IPv6) [RFC8200], this field
19 * is called the "Next Header" field.
20 * References:
21 * - https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
22
23 */
24
25#ifndef IANA_INTERNET_PROTOCOL_NUMBERS_H
26#define IANA_INTERNET_PROTOCOL_NUMBERS_H
27
28#include <cstdint>
29
30namespace ns3
31{
32namespace iana
33{
35{
36constexpr uint8_t HOPOPT = 0; //!< IPv6 Hop-by-Hop Option [RFC8200]
37constexpr uint8_t ICMP = 1; //!< Internet Control Message for IPV4 [RFC792]
38constexpr uint8_t IGMP = 2; //!< Internet Group Management [RFC1112]
39constexpr uint8_t TCP = 6; //!< Transmission Control [RFC9293]
40constexpr uint8_t UDP = 17; //!< User Datagram [RFC768]
41constexpr uint8_t IPV6_FRAG = 44; //!< IPV6 Fragment Header
42constexpr uint8_t DSR = 48; //!< Dynamic Source Routing Protocol [RFC4728]
43constexpr uint8_t ICMPV6 = 58; //!< ICMP for IPv6 [RFC8200]
44constexpr uint8_t NO_NEXT_HEADER = 59; //!< No Next Header for IPV4 and IPv6 [RFC8200]
45constexpr uint8_t MANET = 138; //!< MANET Protocols [RFC5498]
46} // namespace internetprotocolnumbers
47} // namespace iana
48} // namespace ns3
49
50#endif // IANA_INTERNET_PROTOCOL_NUMBERS_H
constexpr uint8_t NO_NEXT_HEADER
No Next Header for IPV4 and IPv6 [RFC8200].
constexpr uint8_t ICMP
Internet Control Message for IPV4 [RFC792].
constexpr uint8_t IPV6_FRAG
IPV6 Fragment Header.
constexpr uint8_t DSR
Dynamic Source Routing Protocol [RFC4728].
constexpr uint8_t ICMPV6
ICMP for IPv6 [RFC8200].
constexpr uint8_t MANET
MANET Protocols [RFC5498].
constexpr uint8_t UDP
User Datagram [RFC768].
constexpr uint8_t HOPOPT
IPv6 Hop-by-Hop Option [RFC8200].
constexpr uint8_t IGMP
Internet Group Management [RFC1112].
constexpr uint8_t TCP
Transmission Control [RFC9293].
Every class exported by the ns3 library is enclosed in the ns3 namespace.