A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
iana-link-type-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 * Centralized definitions for packet capture (pcap) data link layer types.
11 * This file contains the data link numbers as used by many packet analyzers.
12 * (e.g., tcpdump, wireshark)
13 * Only a small subset of data link types supported in ns-3 are included.
14 * References:
15 * - https://www.tcpdump.org/linktypes.html
16 * - https://datatracker.ietf.org/doc/draft-ietf-opsawg-pcaplinktype/05/
17 * - https://www.iana.org/assignments/pcap/pcap.xhtml
18 *
19 */
20
21#ifndef IANA_LINK_TYPE_NUMBERS_H
22#define IANA_LINK_TYPE_NUMBERS_H
23
24#include <cstdint>
25
26namespace ns3
27{
28namespace iana
29{
30namespace linktype // Helper namespace to avoid using scoped enums
31{
32constexpr uint16_t NULL_LINK = 0; //!< BSD loopback encapsulation.
33constexpr uint16_t ETHERNET = 1; //!< IEEE 802.3 Ethernet (10Mb, 100Mb, 1000Mb, and up).
34constexpr uint16_t PPP = 9; //!< Point to point protococol [RFC1661]/[RFC1662].
35constexpr uint16_t RAW = 101; //!< Raw IP; begins with an IPv4 or IPv6 header.
36constexpr uint16_t IEEE802_11 = 105; //!< IEEE 802.11 wireless LAN.
37constexpr uint16_t LINUX_SLL = 113; //!< Linux "cooked" capture encapsulation.
38constexpr uint16_t IEEE802_11_PRISM = 119; //!< Prism monitor mode.
39constexpr uint16_t IEEE802_11_RADIOTAP = 127; //!< Radiotap header, followed by an 802.11 header.
40constexpr uint16_t IEEE802_15_4_WITHFCS = 195; //!< IEEE 802.15.4 packets with FCS.
41constexpr uint16_t IEEE802_15_4_NOFCS = 230; //!< IEEE 802.15.4 packets without FCS.
42constexpr uint16_t NETLINK = 253; //!< Linux Netlink capture encapsulation [RFC3549].
43constexpr uint16_t LORATAP = 270; //!< LoRaTap pseudo-header.
44} // namespace linktype
45} // namespace iana
46} // namespace ns3
47
48#endif // IANA_LINK_TYPE_NUMBERS_H
constexpr uint16_t IEEE802_11_PRISM
Prism monitor mode.
constexpr uint16_t RAW
Raw IP; begins with an IPv4 or IPv6 header.
constexpr uint16_t LORATAP
LoRaTap pseudo-header.
constexpr uint16_t IEEE802_15_4_WITHFCS
IEEE 802.15.4 packets with FCS.
constexpr uint16_t ETHERNET
IEEE 802.3 Ethernet (10Mb, 100Mb, 1000Mb, and up).
constexpr uint16_t PPP
Point to point protococol [RFC1661]/[RFC1662].
constexpr uint16_t NULL_LINK
BSD loopback encapsulation.
constexpr uint16_t IEEE802_11
IEEE 802.11 wireless LAN.
constexpr uint16_t NETLINK
Linux Netlink capture encapsulation [RFC3549].
constexpr uint16_t IEEE802_15_4_NOFCS
IEEE 802.15.4 packets without FCS.
constexpr uint16_t LINUX_SLL
Linux "cooked" capture encapsulation.
constexpr uint16_t IEEE802_11_RADIOTAP
Radiotap header, followed by an 802.11 header.
Every class exported by the ns3 library is enclosed in the ns3 namespace.