Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
iana-info.h
1/* iana-info.h
2 *
3 * Constants and lookups for IANA-assigned values.
4 * This file was partially generated by running ./tools/make-iana-constants.py.
5 *
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <[email protected]>
8 * Copyright 1998 Gerald Combs
9 *
10 * SPDX-License-Identifier: GPL-2.0-or-later
11 */
12#pragma once
13#include <wireshark.h>
14#include "ws_symbol_export.h"
15#include <wsutil/value_string.h>
16#include <wsutil/inet_cidr.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif /* __cplusplus */
21
22/* <BEGIN GENERATED SOURCE> */
23/*
24 * Address family numbers, from
25 *
26 * http://www.iana.org/assignments/address-family-numbers
27 */
28#define AFNUM_RESERVED_0 0 /* Reserved */
29#define AFNUM_IP 1 /* IP (IP version 4) */
30#define AFNUM_IP6 2 /* IP6 (IP version 6) */
31#define AFNUM_NSAP 3 /* NSAP */
32#define AFNUM_HDLC 4 /* HDLC (8-bit multidrop) */
33#define AFNUM_BBN_1822 5 /* BBN 1822 */
34#define AFNUM_802 6 /* 802 (includes all 802 media plus Ethernet 'canonical format') */
35#define AFNUM_E163 7 /* E.163 */
36#define AFNUM_E164 8 /* E.164 (SMDS, Frame Relay, ATM) */
37#define AFNUM_F69 9 /* F.69 (Telex) */
38#define AFNUM_X121 10 /* X.121 (X.25, Frame Relay) */
39#define AFNUM_IPX 11 /* IPX */
40#define AFNUM_APPLETALK 12 /* Appletalk */
41#define AFNUM_DECNET_IV 13 /* Decnet IV */
42#define AFNUM_BANYAN_VINES 14 /* Banyan Vines */
43#define AFNUM_E164_WITH_NSAP_FORMAT_SUBADDRESS 15 /* E.164 with NSAP format subaddress */
44#define AFNUM_DNS 16 /* DNS (Domain Name System) */
45#define AFNUM_DISTINGUISHED_NAME 17 /* Distinguished Name */
46#define AFNUM_AS_NUMBER 18 /* AS Number */
47#define AFNUM_XTP_OVER_IP_VERSION_4 19 /* XTP over IP version 4 */
48#define AFNUM_XTP_OVER_IP_VERSION_6 20 /* XTP over IP version 6 */
49#define AFNUM_XTP_NATIVE_MODE_XTP 21 /* XTP native mode XTP */
50#define AFNUM_FIBRE_CHANNEL_WORLD_WIDE_PORT_NAME 22 /* Fibre Channel World-Wide Port Name */
51#define AFNUM_FIBRE_CHANNEL_WORLD_WIDE_NODE_NAME 23 /* Fibre Channel World-Wide Node Name */
52#define AFNUM_GWID 24 /* GWID */
53#define AFNUM_AFI_FOR_L2VPN_INFORMATION 25 /* AFI for L2VPN information */
54#define AFNUM_MPLS_TP_SECTION_ENDPOINT_IDENTIFIER 26 /* MPLS-TP Section Endpoint Identifier */
55#define AFNUM_MPLS_TP_LSP_ENDPOINT_IDENTIFIER 27 /* MPLS-TP LSP Endpoint Identifier */
56#define AFNUM_MPLS_TP_PSEUDOWIRE_ENDPOINT_IDENTIFIER 28 /* MPLS-TP Pseudowire Endpoint Identifier */
57#define AFNUM_MT_IP_MULTI_TOPOLOGY_IP_VERSION_4 29 /* MT IP: Multi-Topology IP version 4 */
58#define AFNUM_MT_IPV6_MULTI_TOPOLOGY_IP_VERSION_6 30 /* MT IPv6: Multi-Topology IP version 6 */
59#define AFNUM_BGP_SFC 31 /* BGP SFC */
60#define AFNUM_EIGRP_COMMON_SERVICE_FAMILY 16384 /* EIGRP Common Service Family */
61#define AFNUM_EIGRP_IPV4_SERVICE_FAMILY 16385 /* EIGRP IPv4 Service Family */
62#define AFNUM_EIGRP_IPV6_SERVICE_FAMILY 16386 /* EIGRP IPv6 Service Family */
63#define AFNUM_LISP_CANONICAL_ADDRESS_FORMAT 16387 /* LISP Canonical Address Format (LCAF) */
64#define AFNUM_BGP_LS 16388 /* BGP-LS */
65#define AFNUM_48_BIT_MAC 16389 /* 48-bit MAC */
66#define AFNUM_64_BIT_MAC 16390 /* 64-bit MAC */
67#define AFNUM_OUI 16391 /* OUI */
68#define AFNUM_MAC_24 16392 /* MAC/24 */
69#define AFNUM_MAC_40 16393 /* MAC/40 */
70#define AFNUM_IPV6_64 16394 /* IPv6/64 */
71#define AFNUM_RBRIDGE_PORT_ID 16395 /* RBridge Port ID */
72#define AFNUM_TRILL_NICKNAME 16396 /* TRILL Nickname */
73#define AFNUM_UNIVERSALLY_UNIQUE_IDENTIFIER 16397 /* Universally Unique Identifier (UUID) */
74#define AFNUM_ROUTING_POLICY_AFI 16398 /* Routing Policy AFI */
75#define AFNUM_MPLS_NAMESPACES 16399 /* MPLS Namespaces */
76#define AFNUM_RESERVED_65535 65535 /* Reserved */
77
78WS_DLL_PUBLIC const value_string afn_vals[];
79
80/*
81 * IP protocol numbers.
82 * http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml
83 */
84#define IP_PROTO_HOPOPT 0 /* IPv6 Hop-by-Hop Option */
85#define IP_PROTO_ICMP 1 /* Internet Control Message */
86#define IP_PROTO_IGMP 2 /* Internet Group Management */
87#define IP_PROTO_GGP 3 /* Gateway-to-Gateway */
88#define IP_PROTO_IPV4 4 /* IPv4 encapsulation */
89#define IP_PROTO_ST 5 /* Stream */
90#define IP_PROTO_TCP 6 /* Transmission Control */
91#define IP_PROTO_CBT 7 /* CBT */
92#define IP_PROTO_EGP 8 /* Exterior Gateway Protocol */
93#define IP_PROTO_IGP 9 /* any private interior gateway (used by Cisco for their IGRP) */
94#define IP_PROTO_BBN_RCC_MON 10 /* BBN RCC Monitoring */
95#define IP_PROTO_NVP_II 11 /* Network Voice Protocol */
96#define IP_PROTO_PUP 12 /* PUP */
97#define IP_PROTO_ARGUS_DEPRECATED 13 /* ARGUS */
98#define IP_PROTO_EMCON 14 /* EMCON */
99#define IP_PROTO_XNET 15 /* Cross Net Debugger */
100#define IP_PROTO_CHAOS 16 /* Chaos */
101#define IP_PROTO_UDP 17 /* User Datagram */
102#define IP_PROTO_MUX 18 /* Multiplexing */
103#define IP_PROTO_DCN_MEAS 19 /* DCN Measurement Subsystems */
104#define IP_PROTO_HMP 20 /* Host Monitoring */
105#define IP_PROTO_PRM 21 /* Packet Radio Measurement */
106#define IP_PROTO_XNS_IDP 22 /* XEROX NS IDP */
107#define IP_PROTO_TRUNK_1 23 /* Trunk-1 */
108#define IP_PROTO_TRUNK_2 24 /* Trunk-2 */
109#define IP_PROTO_LEAF_1 25 /* Leaf-1 */
110#define IP_PROTO_LEAF_2 26 /* Leaf-2 */
111#define IP_PROTO_RDP 27 /* Reliable Data Protocol */
112#define IP_PROTO_IRTP 28 /* Internet Reliable Transaction */
113#define IP_PROTO_ISO_TP4 29 /* ISO Transport Protocol Class 4 */
114#define IP_PROTO_NETBLT 30 /* Bulk Data Transfer Protocol */
115#define IP_PROTO_MFE_NSP 31 /* MFE Network Services Protocol */
116#define IP_PROTO_MERIT_INP 32 /* MERIT Internodal Protocol */
117#define IP_PROTO_DCCP 33 /* Datagram Congestion Control Protocol */
118#define IP_PROTO_3PC 34 /* Third Party Connect Protocol */
119#define IP_PROTO_IDPR 35 /* Inter-Domain Policy Routing Protocol */
120#define IP_PROTO_XTP 36 /* XTP */
121#define IP_PROTO_DDP 37 /* Datagram Delivery Protocol */
122#define IP_PROTO_IDPR_CMTP 38 /* IDPR Control Message Transport Proto */
123#define IP_PROTO_TP 39 /* TP++ Transport Protocol */
124#define IP_PROTO_IL 40 /* IL Transport Protocol */
125#define IP_PROTO_IPV6 41 /* IPv6 encapsulation */
126#define IP_PROTO_SDRP 42 /* Source Demand Routing Protocol */
127#define IP_PROTO_IPV6_ROUTE 43 /* Routing Header for IPv6 */
128#define IP_PROTO_IPV6_FRAG 44 /* Fragment Header for IPv6 */
129#define IP_PROTO_IDRP 45 /* Inter-Domain Routing Protocol */
130#define IP_PROTO_RSVP 46 /* Reservation Protocol */
131#define IP_PROTO_GRE 47 /* Generic Routing Encapsulation */
132#define IP_PROTO_DSR 48 /* Dynamic Source Routing Protocol */
133#define IP_PROTO_BNA 49 /* BNA */
134#define IP_PROTO_ESP 50 /* Encap Security Payload */
135#define IP_PROTO_AH 51 /* Authentication Header */
136#define IP_PROTO_I_NLSP 52 /* Integrated Net Layer Security TUBA */
137#define IP_PROTO_SWIPE_DEPRECATED 53 /* IP with Encryption */
138#define IP_PROTO_NARP 54 /* NBMA Address Resolution Protocol */
139#define IP_PROTO_MIN_IPV4 55 /* Minimal IPv4 Encapsulation */
140#define IP_PROTO_TLSP 56 /* Transport Layer Security Protocol using Kryptonet key management */
141#define IP_PROTO_SKIP 57 /* SKIP */
142#define IP_PROTO_IPV6_ICMP 58 /* ICMP for IPv6 */
143#define IP_PROTO_IPV6_NONXT 59 /* No Next Header for IPv6 */
144#define IP_PROTO_IPV6_OPTS 60 /* Destination Options for IPv6 */
145#define IP_PROTO_CFTP 62 /* CFTP */
146#define IP_PROTO_SAT_EXPAK 64 /* SATNET and Backroom EXPAK */
147#define IP_PROTO_KRYPTOLAN 65 /* Kryptolan */
148#define IP_PROTO_RVD 66 /* MIT Remote Virtual Disk Protocol */
149#define IP_PROTO_IPPC 67 /* Internet Pluribus Packet Core */
150#define IP_PROTO_SAT_MON 69 /* SATNET Monitoring */
151#define IP_PROTO_VISA 70 /* VISA Protocol */
152#define IP_PROTO_IPCV 71 /* Internet Packet Core Utility */
153#define IP_PROTO_CPNX 72 /* Computer Protocol Network Executive */
154#define IP_PROTO_CPHB 73 /* Computer Protocol Heart Beat */
155#define IP_PROTO_WSN 74 /* Wang Span Network */
156#define IP_PROTO_PVP 75 /* Packet Video Protocol */
157#define IP_PROTO_BR_SAT_MON 76 /* Backroom SATNET Monitoring */
158#define IP_PROTO_SUN_ND 77 /* SUN ND PROTOCOL-Temporary */
159#define IP_PROTO_WB_MON 78 /* WIDEBAND Monitoring */
160#define IP_PROTO_WB_EXPAK 79 /* WIDEBAND EXPAK */
161#define IP_PROTO_ISO_IP 80 /* ISO Internet Protocol */
162#define IP_PROTO_VMTP 81 /* VMTP */
163#define IP_PROTO_SECURE_VMTP 82 /* SECURE-VMTP */
164#define IP_PROTO_VINES 83 /* VINES */
165#define IP_PROTO_IPTM 84 /* Internet Protocol Traffic Manager */
166#define IP_PROTO_NSFNET_IGP 85 /* NSFNET-IGP */
167#define IP_PROTO_DGP 86 /* Dissimilar Gateway Protocol */
168#define IP_PROTO_TCF 87 /* TCF */
169#define IP_PROTO_EIGRP 88 /* EIGRP */
170#define IP_PROTO_OSPFIGP 89 /* OSPFIGP */
171#define IP_PROTO_SPRITE_RPC 90 /* Sprite RPC Protocol */
172#define IP_PROTO_LARP 91 /* Locus Address Resolution Protocol */
173#define IP_PROTO_MTP 92 /* Multicast Transport Protocol */
174#define IP_PROTO_AX25 93 /* AX.25 Frames */
175#define IP_PROTO_IPIP 94 /* IP-within-IP Encapsulation Protocol */
176#define IP_PROTO_MICP_DEPRECATED 95 /* Mobile Internetworking Control Pro. */
177#define IP_PROTO_SCC_SP 96 /* Semaphore Communications Sec. Pro. */
178#define IP_PROTO_ETHERIP 97 /* Ethernet-within-IP Encapsulation */
179#define IP_PROTO_ENCAP 98 /* Encapsulation Header */
180#define IP_PROTO_GMTP 100 /* GMTP */
181#define IP_PROTO_IFMP 101 /* Ipsilon Flow Management Protocol */
182#define IP_PROTO_PNNI 102 /* PNNI over IP */
183#define IP_PROTO_PIM 103 /* Protocol Independent Multicast */
184#define IP_PROTO_ARIS 104 /* ARIS */
185#define IP_PROTO_SCPS 105 /* SCPS */
186#define IP_PROTO_QNX 106 /* QNX */
187#define IP_PROTO_A_N 107 /* Active Networks */
188#define IP_PROTO_IPCOMP 108 /* IP Payload Compression Protocol */
189#define IP_PROTO_SNP 109 /* Sitara Networks Protocol */
190#define IP_PROTO_COMPAQ_PEER 110 /* Compaq Peer Protocol */
191#define IP_PROTO_IPX_IN_IP 111 /* IPX in IP */
192#define IP_PROTO_VRRP 112 /* Virtual Router Redundancy Protocol */
193#define IP_PROTO_PGM 113 /* PGM Reliable Transport Protocol */
194#define IP_PROTO_L2TP 115 /* Layer Two Tunneling Protocol */
195#define IP_PROTO_DDX 116 /* D-II Data Exchange (DDX) */
196#define IP_PROTO_IATP 117 /* Interactive Agent Transfer Protocol */
197#define IP_PROTO_STP 118 /* Schedule Transfer Protocol */
198#define IP_PROTO_SRP 119 /* SpectraLink Radio Protocol */
199#define IP_PROTO_UTI 120 /* UTI */
200#define IP_PROTO_SMP 121 /* Simple Message Protocol */
201#define IP_PROTO_SM_DEPRECATED 122 /* Simple Multicast Protocol */
202#define IP_PROTO_PTP 123 /* Performance Transparency Protocol */
203#define IP_PROTO_ISIS_OVER_IPV4 124
204#define IP_PROTO_FIRE 125
205#define IP_PROTO_CRTP 126 /* Combat Radio Transport Protocol */
206#define IP_PROTO_CRUDP 127 /* Combat Radio User Datagram */
207#define IP_PROTO_SSCOPMCE 128
208#define IP_PROTO_IPLT 129
209#define IP_PROTO_SPS 130 /* Secure Packet Shield */
210#define IP_PROTO_PIPE 131 /* Private IP Encapsulation within IP */
211#define IP_PROTO_SCTP 132 /* Stream Control Transmission Protocol */
212#define IP_PROTO_FC 133 /* Fibre Channel */
213#define IP_PROTO_RSVP_E2E_IGNORE 134
214#define IP_PROTO_MOBILITY_HEADER 135
215#define IP_PROTO_UDPLITE 136
216#define IP_PROTO_MPLS_IN_IP 137
217#define IP_PROTO_MANET 138 /* MANET Protocols */
218#define IP_PROTO_HIP 139 /* Host Identity Protocol */
219#define IP_PROTO_SHIM6 140 /* Shim6 Protocol */
220#define IP_PROTO_WESP 141 /* Wrapped Encapsulating Security Payload */
221#define IP_PROTO_ROHC 142 /* Robust Header Compression */
222#define IP_PROTO_ETHERNET 143 /* Ethernet */
223#define IP_PROTO_AGGFRAG 144 /* AGGFRAG encapsulation payload for ESP */
224#define IP_PROTO_NSH 145 /* Network Service Header */
225#define IP_PROTO_HOMA 146 /* Homa */
226#define IP_PROTO_BIT_EMU 147 /* Bit-stream Emulation */
227#define IP_PROTO_RESERVED 255
228
229WS_DLL_PUBLIC value_string_ext ipproto_val_ext;
230
231
232/*
233 * Enterprise numbers, from
234 * https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers
235 */
236WS_DLL_PUBLIC value_string_ext enterprise_val_ext;
237/* <END GENERATED SOURCE> */
238
239
240typedef enum {
241 ws_tcp,
242 ws_udp,
243 ws_sctp,
244 ws_dccp,
245} ws_services_proto_t;
246
247typedef struct {
248 uint16_t port;
249 const char* name;
250 const char* description;
252
260global_services_lookup(uint16_t value, ws_services_proto_t proto);
261
267WS_DLL_PUBLIC
268void global_services_dump(FILE* fp);
269
275WS_DLL_PUBLIC
276void global_enterprises_dump(FILE* fp);
277
278enum iana_ip {
279 WS_IANA_IPv4 = 4,
280 WS_IANA_IPv6 = 6,
281};
282
284 enum iana_ip type;
285 union {
288 } u_ip;
289 const char* name;
290 /* true = 1; false = 0; n/a = -1 */
291 int source, destination, forwardable, global, reserved;
292};
293
300WS_DLL_PUBLIC
301const struct ws_iana_ip_special_block*
302ws_iana_ipv4_special_block_lookup(uint32_t ipnum);
303
310WS_DLL_PUBLIC
311const struct ws_iana_ip_special_block*
312ws_iana_ipv6_special_block_lookup(const ws_in6_addr* addr);
313
314#ifdef __cplusplus
315}
316#endif /* __cplusplus */
Extended metadata for a value_string array.
Definition value_string.h:325
Mapping between a 32-bit integer value and its string representation.
Definition value_string.h:33
Represents a 128-bit IPv6 address.
Definition inet_addr.h:27
Definition inet_cidr.h:22
Definition inet_cidr.h:27
Definition iana-info.h:283
Definition iana-info.h:247