xref: /freebsd/contrib/tcpdump/ipproto.c (revision 0a7e5f1f02aad2ff5fff1c60f44c6975fd07e1d9)
11de50e9fSSam Leffler /*
21de50e9fSSam Leffler  * Redistribution and use in source and binary forms, with or without
31de50e9fSSam Leffler  * modification, are permitted provided that: (1) source code
41de50e9fSSam Leffler  * distributions retain the above copyright notice and this paragraph
51de50e9fSSam Leffler  * in its entirety, and (2) distributions including binary code include
61de50e9fSSam Leffler  * the above copyright notice and this paragraph in its entirety in
71de50e9fSSam Leffler  * the documentation or other materials provided with the distribution.
81de50e9fSSam Leffler  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
91de50e9fSSam Leffler  * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
101de50e9fSSam Leffler  * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
111de50e9fSSam Leffler  * FOR A PARTICULAR PURPOSE.
121de50e9fSSam Leffler  *
130bff6a5aSEd Maste  * Original code by Hannes Gredler (hannes@gredler.at)
141de50e9fSSam Leffler  */
151de50e9fSSam Leffler 
16*ee67461eSJoseph Mingrone #include <config.h>
171de50e9fSSam Leffler 
18*ee67461eSJoseph Mingrone #include "netdissect-stdinc.h"
191de50e9fSSam Leffler 
203340d773SGleb Smirnoff #include "netdissect.h"
21f4d0c64aSSam Leffler #include "ipproto.h"
221de50e9fSSam Leffler 
2327df3f5dSRui Paulo const struct tok ipproto_values[] = {
241de50e9fSSam Leffler     { IPPROTO_HOPOPTS, "Options" },
251de50e9fSSam Leffler     { IPPROTO_ICMP, "ICMP" },
261de50e9fSSam Leffler     { IPPROTO_IGMP, "IGMP" },
271de50e9fSSam Leffler     { IPPROTO_IPV4, "IPIP" },
281de50e9fSSam Leffler     { IPPROTO_TCP, "TCP" },
291de50e9fSSam Leffler     { IPPROTO_EGP, "EGP" },
301de50e9fSSam Leffler     { IPPROTO_PIGP, "IGRP" },
311de50e9fSSam Leffler     { IPPROTO_UDP, "UDP" },
322ebc47dbSSam Leffler     { IPPROTO_DCCP, "DCCP" },
331de50e9fSSam Leffler     { IPPROTO_IPV6, "IPv6" },
341de50e9fSSam Leffler     { IPPROTO_ROUTING, "Routing" },
351de50e9fSSam Leffler     { IPPROTO_FRAGMENT, "Fragment" },
361de50e9fSSam Leffler     { IPPROTO_RSVP, "RSVP" },
371de50e9fSSam Leffler     { IPPROTO_GRE, "GRE" },
381de50e9fSSam Leffler     { IPPROTO_ESP, "ESP" },
391de50e9fSSam Leffler     { IPPROTO_AH, "AH" },
401de50e9fSSam Leffler     { IPPROTO_MOBILE, "Mobile IP" },
411de50e9fSSam Leffler     { IPPROTO_ICMPV6, "ICMPv6" },
421de50e9fSSam Leffler     { IPPROTO_MOBILITY_OLD, "Mobile IP (old)" },
431de50e9fSSam Leffler     { IPPROTO_EIGRP, "EIGRP" },
441de50e9fSSam Leffler     { IPPROTO_OSPF, "OSPF" },
451de50e9fSSam Leffler     { IPPROTO_PIM, "PIM" },
461de50e9fSSam Leffler     { IPPROTO_IPCOMP, "Compressed IP" },
47*ee67461eSJoseph Mingrone     { IPPROTO_VRRP, "VRRP" }, /* See also CARP. */
48f4d0c64aSSam Leffler     { IPPROTO_PGM, "PGM" },
491de50e9fSSam Leffler     { IPPROTO_SCTP, "SCTP" },
501de50e9fSSam Leffler     { IPPROTO_MOBILITY, "Mobility" },
51ffe9c13eSGleb Smirnoff     { IPPROTO_PFSYNC, "pfsync" },
52*ee67461eSJoseph Mingrone     { IPPROTO_ETHERNET, "Ethernet" },
531de50e9fSSam Leffler     { 0, NULL }
541de50e9fSSam Leffler };
551de50e9fSSam Leffler 
560bff6a5aSEd Maste /*
570bff6a5aSEd Maste  * For completeness the number space in the array below comes from IANA:
580bff6a5aSEd Maste  * https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
590bff6a5aSEd Maste  * However, the spelling tries to match that of /etc/protocols to achieve as
600bff6a5aSEd Maste  * much consistency as possible with the previously implemented behaviour,
610bff6a5aSEd Maste  * which was based on getprotobynumber (3).
620bff6a5aSEd Maste  */
630bff6a5aSEd Maste static const char *netdb_protocol_names[256] = {
640bff6a5aSEd Maste 	"hopopt",            /* 0 (IPPROTO_HOPOPTS, IPv6 Hop-by-Hop Option) */
650bff6a5aSEd Maste 	"icmp",              /* 1 (IPPROTO_ICMP, Internet Control Message) */
660bff6a5aSEd Maste 	"igmp",              /* 2 (IPPROTO_IGMP, Internet Group Management) */
670bff6a5aSEd Maste 	"ggp",               /* 3 (Gateway-to-Gateway) */
680bff6a5aSEd Maste 	"ipencap",           /* 4 (IPPROTO_IPV4, IPv4 encapsulation) */
690bff6a5aSEd Maste 	"st",                /* 5 (Stream, ST datagram mode) */
700bff6a5aSEd Maste 	"tcp",               /* 6 (IPPROTO_TCP, Transmission Control) */
710bff6a5aSEd Maste 	"cbt",               /* 7 (CBT) */
720bff6a5aSEd Maste 	"egp",               /* 8 (IPPROTO_EGP, Exterior Gateway Protocol) */
730bff6a5aSEd Maste 	"igp",               /* 9 (IPPROTO_PIGP, "any private interior gateway
740bff6a5aSEd Maste 	                      *   (used by Cisco for their IGRP)")
750bff6a5aSEd Maste 	                      */
760bff6a5aSEd Maste 	"bbn-rcc-mon",       /* 10 (BBN RCC Monitoring) */
770bff6a5aSEd Maste 	"nvp-ii",            /* 11 (Network Voice Protocol) */
780bff6a5aSEd Maste 	"pup",               /* 12 (PARC universal packet protocol) */
790bff6a5aSEd Maste 	"argus",             /* 13 (ARGUS) */
800bff6a5aSEd Maste 	"emcon",             /* 14 (EMCON) */
810bff6a5aSEd Maste 	"xnet",              /* 15 (Cross Net Debugger) */
820bff6a5aSEd Maste 	"chaos",             /* 16 (Chaos) */
830bff6a5aSEd Maste 	"udp",               /* 17 (IPPROTO_UDP, User Datagram) */
840bff6a5aSEd Maste 	"mux",               /* 18 (Multiplexing) */
850bff6a5aSEd Maste 	"dcn-meas",          /* 19 (DCN Measurement Subsystems) */
860bff6a5aSEd Maste 	"hmp",               /* 20 (Host Monitoring) */
870bff6a5aSEd Maste 	"prm",               /* 21 (Packet Radio Measurement) */
880bff6a5aSEd Maste 	"xns-idp",           /* 22 (XEROX NS IDP) */
890bff6a5aSEd Maste 	"trunk-1",           /* 23 (Trunk-1) */
900bff6a5aSEd Maste 	"trunk-2",           /* 24 (Trunk-2) */
910bff6a5aSEd Maste 	"leaf-1",            /* 25 (Leaf-1) */
920bff6a5aSEd Maste 	"leaf-2",            /* 26 (Leaf-2) */
930bff6a5aSEd Maste 	"rdp",               /* 27 (Reliable Data Protocol) */
940bff6a5aSEd Maste 	"irtp",              /* 28 (Internet Reliable Transaction) */
950bff6a5aSEd Maste 	"iso-tp4",           /* 29 (ISO Transport Protocol Class 4) */
960bff6a5aSEd Maste 	"netblt",            /* 30 (Bulk Data Transfer Protocol) */
970bff6a5aSEd Maste 	"mfe-nsp",           /* 31 (MFE Network Services Protocol) */
980bff6a5aSEd Maste 	"merit-inp",         /* 32 (MERIT Internodal Protocol) */
990bff6a5aSEd Maste 	"dccp",              /* 33 (IPPROTO_DCCP, Datagram Congestion
1000bff6a5aSEd Maste 	                      *    Control Protocol)
1010bff6a5aSEd Maste 	                      */
1020bff6a5aSEd Maste 	"3pc",               /* 34 (Third Party Connect Protocol) */
1030bff6a5aSEd Maste 	"idpr",              /* 35 (Inter-Domain Policy Routing Protocol) */
1040bff6a5aSEd Maste 	"xtp",               /* 36 (Xpress Transfer Protocol) */
1050bff6a5aSEd Maste 	"ddp",               /* 37 (Datagram Delivery Protocol) */
1060bff6a5aSEd Maste 	"idpr-cmtp",         /* 38 (IDPR Control Message Transport Proto) */
1070bff6a5aSEd Maste 	"tp++",              /* 39 (TP++ Transport Protocol) */
1080bff6a5aSEd Maste 	"il",                /* 40 (IL Transport Protocol) */
1090bff6a5aSEd Maste 	"ipv6",              /* 41 (IPPROTO_IPV6, IPv6 encapsulation) */
1100bff6a5aSEd Maste 	"sdrp",              /* 42 (Source Demand Routing Protocol) */
1110bff6a5aSEd Maste 	"ipv6-route",        /* 43 (IPPROTO_ROUTING, Routing Header for IPv6) */
1120bff6a5aSEd Maste 	"ipv6-frag",         /* 44 (IPPROTO_FRAGMENT, Fragment Header for
1130bff6a5aSEd Maste 	                      *    IPv6)
1140bff6a5aSEd Maste 	                      */
1150bff6a5aSEd Maste 	"idrp",              /* 45 (Inter-Domain Routing Protocol) */
1160bff6a5aSEd Maste 	"rsvp",              /* 46 (IPPROTO_RSVP, Reservation Protocol) */
1170bff6a5aSEd Maste 	"gre",               /* 47 (IPPROTO_GRE, Generic Routing
1180bff6a5aSEd Maste 	                      *    Encapsulation)
1190bff6a5aSEd Maste 	                      */
1200bff6a5aSEd Maste 	"dsr",               /* 48 (Dynamic Source Routing Protocol) */
1210bff6a5aSEd Maste 	"bna",               /* 49 (BNA) */
1220bff6a5aSEd Maste 	"esp",               /* 50 (IPPROTO_ESP, Encap Security Payload) */
1230bff6a5aSEd Maste 	"ah",                /* 51 (IPPROTO_AH, Authentication Header) */
1240bff6a5aSEd Maste 	"i-nlsp",            /* 52 (Integrated Net Layer Security TUBA) */
1250bff6a5aSEd Maste 	"swipe",             /* 53 (IP with Encryption) */
1260bff6a5aSEd Maste 	"narp",              /* 54 (NBMA Address Resolution Protocol) */
1270bff6a5aSEd Maste 	"mobile",            /* 55 (IPPROTO_MOBILE, IP Mobility) */
1280bff6a5aSEd Maste 	"tlsp",              /* 56 (Transport Layer Security Protocol using
1290bff6a5aSEd Maste 	                      *    Kryptonet key management)
1300bff6a5aSEd Maste 	                      */
1310bff6a5aSEd Maste 	"skip",              /* 57 (SKIP) */
1320bff6a5aSEd Maste 	"ipv6-icmp",         /* 58 (IPPROTO_ICMPV6, ICMP for IPv6) */
1330bff6a5aSEd Maste 	"ipv6-nonxt",        /* 59 (IPPROTO_NONE, No Next Header for IPv6) */
1340bff6a5aSEd Maste 	"ipv6-opts",         /* 60 (IPPROTO_DSTOPTS, Destination Options for
1350bff6a5aSEd Maste 	                      *    IPv6)
1360bff6a5aSEd Maste 	                      */
1370bff6a5aSEd Maste 	NULL,                /* 61 (any host internal protocol) */
1380bff6a5aSEd Maste 	"cftp",              /* 62 (IPPROTO_MOBILITY_OLD, CFTP, see the note
1390bff6a5aSEd Maste 	                      *    in ipproto.h)
1400bff6a5aSEd Maste 	                      */
1410bff6a5aSEd Maste 	NULL,                /* 63 (any local network) */
1420bff6a5aSEd Maste 	"sat-expak",         /* 64 (SATNET and Backroom EXPAK) */
1430bff6a5aSEd Maste 	"kryptolan",         /* 65 (Kryptolan) */
1440bff6a5aSEd Maste 	"rvd",               /* 66 (MIT Remote Virtual Disk Protocol) */
1450bff6a5aSEd Maste 	"ippc",              /* 67 (Internet Pluribus Packet Core) */
1460bff6a5aSEd Maste 	NULL,                /* 68 (any distributed file system) */
1470bff6a5aSEd Maste 	"sat-mon",           /* 69 (SATNET Monitoring) */
1480bff6a5aSEd Maste 	"visa",              /* 70 (VISA Protocol) */
1490bff6a5aSEd Maste 	"ipcv",              /* 71 (Internet Packet Core Utility) */
1500bff6a5aSEd Maste 	"cpnx",              /* 72 (Computer Protocol Network Executive) */
1510bff6a5aSEd Maste 	"rspf",              /* 73 (Radio Shortest Path First, CPHB -- Computer
1520bff6a5aSEd Maste 	                      *    Protocol Heart Beat -- in IANA)
1530bff6a5aSEd Maste 	                      */
1540bff6a5aSEd Maste 	"wsn",               /* 74 (Wang Span Network) */
1550bff6a5aSEd Maste 	"pvp",               /* 75 (Packet Video Protocol) */
1560bff6a5aSEd Maste 	"br-sat-mon",        /* 76 (Backroom SATNET Monitoring) */
1570bff6a5aSEd Maste 	"sun-nd",            /* 77 (IPPROTO_ND, SUN ND PROTOCOL-Temporary) */
1580bff6a5aSEd Maste 	"wb-mon",            /* 78 (WIDEBAND Monitoring) */
1590bff6a5aSEd Maste 	"wb-expak",          /* 79 (WIDEBAND EXPAK) */
1600bff6a5aSEd Maste 	"iso-ip",            /* 80 (ISO Internet Protocol) */
1610bff6a5aSEd Maste 	"vmtp",              /* 81 (Versatile Message Transport) */
1620bff6a5aSEd Maste 	"secure-vmtp",       /* 82 (Secure VMTP) */
1630bff6a5aSEd Maste 	"vines",             /* 83 (VINES) */
1640bff6a5aSEd Maste 	"ttp",               /* 84 (Transaction Transport Protocol, also IPTM --
1650bff6a5aSEd Maste 	                      *    Internet Protocol Traffic Manager)
1660bff6a5aSEd Maste 	                      */
1670bff6a5aSEd Maste 	"nsfnet-igp",        /* 85 (NSFNET-IGP) */
1680bff6a5aSEd Maste 	"dgp",               /* 86 (Dissimilar Gateway Protocol) */
1690bff6a5aSEd Maste 	"tcf",               /* 87 (TCF) */
1700bff6a5aSEd Maste 	"eigrp",             /* 88 (IPPROTO_EIGRP, Cisco EIGRP) */
1710bff6a5aSEd Maste 	"ospf",              /* 89 (IPPROTO_OSPF, Open Shortest Path First
1720bff6a5aSEd Maste 	                      *    IGP)
1730bff6a5aSEd Maste 	                      */
1740bff6a5aSEd Maste 	"sprite-rpc",        /* 90 (Sprite RPC Protocol) */
1750bff6a5aSEd Maste 	"larp",              /* 91 (Locus Address Resolution Protocol) */
1760bff6a5aSEd Maste 	"mtp",               /* 92 (Multicast Transport Protocol) */
1770bff6a5aSEd Maste 	"ax.25",             /* 93 (AX.25 Frames) */
1780bff6a5aSEd Maste 	"ipip",              /* 94 (IP-within-IP Encapsulation Protocol) */
1790bff6a5aSEd Maste 	"micp",              /* 95 (Mobile Internetworking Control Pro.) */
1800bff6a5aSEd Maste 	"scc-sp",            /* 96 (Semaphore Communications Sec. Pro.) */
1810bff6a5aSEd Maste 	"etherip",           /* 97 (Ethernet-within-IP Encapsulation) */
1820bff6a5aSEd Maste 	"encap",             /* 98 (Encapsulation Header) */
1830bff6a5aSEd Maste 	NULL,                /* 99 (any private encryption scheme) */
1840bff6a5aSEd Maste 	"gmtp",              /* 100 (GMTP) */
1850bff6a5aSEd Maste 	"ifmp",              /* 101 (Ipsilon Flow Management Protocol) */
1860bff6a5aSEd Maste 	"pnni",              /* 102 (PNNI over IP) */
1870bff6a5aSEd Maste 	"pim",               /* 103 (IPPROTO_PIM, Protocol Independent
1880bff6a5aSEd Maste 	                      *     Multicast)
1890bff6a5aSEd Maste 	                      */
1900bff6a5aSEd Maste 	"aris",              /* 104 (ARIS) */
1910bff6a5aSEd Maste 	"scps",              /* 105 (SCPS) */
1920bff6a5aSEd Maste 	"qnx",               /* 106 (QNX) */
1930bff6a5aSEd Maste 	"a/n",               /* 107 (Active Networks) */
1940bff6a5aSEd Maste 	"ipcomp",            /* 108 (IPPROTO_IPCOMP, IP Payload Compression
1950bff6a5aSEd Maste 	                      *     Protocol)
1960bff6a5aSEd Maste 	                      */
1970bff6a5aSEd Maste 	"snp",               /* 109 (Sitara Networks Protocol) */
1980bff6a5aSEd Maste 	"compaq-peer",       /* 110 (Compaq Peer Protocol) */
1990bff6a5aSEd Maste 	"ipx-in-ip",         /* 111 (IPX in IP) */
2000bff6a5aSEd Maste 	"vrrp",              /* 112 (IPPROTO_VRRP, Virtual Router Redundancy
2010bff6a5aSEd Maste 	                      *     Protocol)
2020bff6a5aSEd Maste 	                      */
2030bff6a5aSEd Maste 	"pgm",               /* 113 (IPPROTO_PGM, PGM Reliable Transport
2040bff6a5aSEd Maste 	                      *     Protocol)
2050bff6a5aSEd Maste 	                      */
2060bff6a5aSEd Maste 	NULL,                /* 114 (any 0-hop protocol) */
2070bff6a5aSEd Maste 	"l2tp",              /* 115 (Layer Two Tunneling Protocol) */
2080bff6a5aSEd Maste 	"ddx",               /* 116 (D-II Data Exchange (DDX)) */
2090bff6a5aSEd Maste 	"iatp",              /* 117 (Interactive Agent Transfer Protocol) */
2100bff6a5aSEd Maste 	"stp",               /* 118 (Schedule Transfer Protocol) */
2110bff6a5aSEd Maste 	"srp",               /* 119 (SpectraLink Radio Protocol) */
2120bff6a5aSEd Maste 	"uti",               /* 120 (UTI) */
2130bff6a5aSEd Maste 	"smp",               /* 121 (Simple Message Protocol) */
2140bff6a5aSEd Maste 	"sm",                /* 122 (Simple Multicast Protocol) */
2150bff6a5aSEd Maste 	"ptp",               /* 123 (Performance Transparency Protocol) */
2160bff6a5aSEd Maste 	"isis",              /* 124 (ISIS over IPv4) */
2170bff6a5aSEd Maste 	"fire",              /* 125 (FIRE) */
2180bff6a5aSEd Maste 	"crtp",              /* 126 (Combat Radio Transport Protocol) */
2190bff6a5aSEd Maste 	"crudp",             /* 127 (Combat Radio User Datagram) */
2200bff6a5aSEd Maste 	"sscopmce",          /* 128 (SSCOPMCE) */
2210bff6a5aSEd Maste 	"iplt",              /* 129 (IPLT) */
2220bff6a5aSEd Maste 	"sps",               /* 130 (Secure Packet Shield) */
2230bff6a5aSEd Maste 	"pipe",              /* 131 (Private IP Encapsulation within IP) */
2240bff6a5aSEd Maste 	"sctp",              /* 132 (IPPROTO_SCTP, Stream Control Transmission
2250bff6a5aSEd Maste 	                      *     Protocol)
2260bff6a5aSEd Maste 	                      */
2270bff6a5aSEd Maste 	"fc",                /* 133 (Fibre Channel) */
2280bff6a5aSEd Maste 	"rsvp-e2e-ignore",   /* 134 (RSVP-E2E-IGNORE) */
2290bff6a5aSEd Maste 	"mobility-header",   /* 135 (IPPROTO_MOBILITY, Mobility Header) */
2300bff6a5aSEd Maste 	"udplite",           /* 136 (UDPLite) */
2310bff6a5aSEd Maste 	"mpls-in-ip",        /* 137 (MPLS-in-IP) */
2320bff6a5aSEd Maste 	"manet",             /* 138 (MANET Protocols) */
2330bff6a5aSEd Maste 	"hip",               /* 139 (Host Identity Protocol) */
2340bff6a5aSEd Maste 	"shim6",             /* 140 (Shim6 Protocol) */
2350bff6a5aSEd Maste 	"wesp",              /* 141 (Wrapped Encapsulating Security Payload) */
2360bff6a5aSEd Maste 	"rohc",              /* 142 (Robust Header Compression) */
2370bff6a5aSEd Maste 	NULL,                /* 143 (unassigned) */
2380bff6a5aSEd Maste 	NULL,                /* 144 (unassigned) */
2390bff6a5aSEd Maste 	NULL,                /* 145 (unassigned) */
2400bff6a5aSEd Maste 	NULL,                /* 146 (unassigned) */
2410bff6a5aSEd Maste 	NULL,                /* 147 (unassigned) */
2420bff6a5aSEd Maste 	NULL,                /* 148 (unassigned) */
2430bff6a5aSEd Maste 	NULL,                /* 149 (unassigned) */
2440bff6a5aSEd Maste 	NULL,                /* 150 (unassigned) */
2450bff6a5aSEd Maste 	NULL,                /* 151 (unassigned) */
2460bff6a5aSEd Maste 	NULL,                /* 152 (unassigned) */
2470bff6a5aSEd Maste 	NULL,                /* 153 (unassigned) */
2480bff6a5aSEd Maste 	NULL,                /* 154 (unassigned) */
2490bff6a5aSEd Maste 	NULL,                /* 155 (unassigned) */
2500bff6a5aSEd Maste 	NULL,                /* 156 (unassigned) */
2510bff6a5aSEd Maste 	NULL,                /* 157 (unassigned) */
2520bff6a5aSEd Maste 	NULL,                /* 158 (unassigned) */
2530bff6a5aSEd Maste 	NULL,                /* 159 (unassigned) */
2540bff6a5aSEd Maste 	NULL,                /* 160 (unassigned) */
2550bff6a5aSEd Maste 	NULL,                /* 161 (unassigned) */
2560bff6a5aSEd Maste 	NULL,                /* 162 (unassigned) */
2570bff6a5aSEd Maste 	NULL,                /* 163 (unassigned) */
2580bff6a5aSEd Maste 	NULL,                /* 164 (unassigned) */
2590bff6a5aSEd Maste 	NULL,                /* 165 (unassigned) */
2600bff6a5aSEd Maste 	NULL,                /* 166 (unassigned) */
2610bff6a5aSEd Maste 	NULL,                /* 167 (unassigned) */
2620bff6a5aSEd Maste 	NULL,                /* 168 (unassigned) */
2630bff6a5aSEd Maste 	NULL,                /* 169 (unassigned) */
2640bff6a5aSEd Maste 	NULL,                /* 170 (unassigned) */
2650bff6a5aSEd Maste 	NULL,                /* 171 (unassigned) */
2660bff6a5aSEd Maste 	NULL,                /* 172 (unassigned) */
2670bff6a5aSEd Maste 	NULL,                /* 173 (unassigned) */
2680bff6a5aSEd Maste 	NULL,                /* 174 (unassigned) */
2690bff6a5aSEd Maste 	NULL,                /* 175 (unassigned) */
2700bff6a5aSEd Maste 	NULL,                /* 176 (unassigned) */
2710bff6a5aSEd Maste 	NULL,                /* 177 (unassigned) */
2720bff6a5aSEd Maste 	NULL,                /* 178 (unassigned) */
2730bff6a5aSEd Maste 	NULL,                /* 179 (unassigned) */
2740bff6a5aSEd Maste 	NULL,                /* 180 (unassigned) */
2750bff6a5aSEd Maste 	NULL,                /* 181 (unassigned) */
2760bff6a5aSEd Maste 	NULL,                /* 182 (unassigned) */
2770bff6a5aSEd Maste 	NULL,                /* 183 (unassigned) */
2780bff6a5aSEd Maste 	NULL,                /* 184 (unassigned) */
2790bff6a5aSEd Maste 	NULL,                /* 185 (unassigned) */
2800bff6a5aSEd Maste 	NULL,                /* 186 (unassigned) */
2810bff6a5aSEd Maste 	NULL,                /* 187 (unassigned) */
2820bff6a5aSEd Maste 	NULL,                /* 188 (unassigned) */
2830bff6a5aSEd Maste 	NULL,                /* 189 (unassigned) */
2840bff6a5aSEd Maste 	NULL,                /* 190 (unassigned) */
2850bff6a5aSEd Maste 	NULL,                /* 191 (unassigned) */
2860bff6a5aSEd Maste 	NULL,                /* 192 (unassigned) */
2870bff6a5aSEd Maste 	NULL,                /* 193 (unassigned) */
2880bff6a5aSEd Maste 	NULL,                /* 194 (unassigned) */
2890bff6a5aSEd Maste 	NULL,                /* 195 (unassigned) */
2900bff6a5aSEd Maste 	NULL,                /* 196 (unassigned) */
2910bff6a5aSEd Maste 	NULL,                /* 197 (unassigned) */
2920bff6a5aSEd Maste 	NULL,                /* 198 (unassigned) */
2930bff6a5aSEd Maste 	NULL,                /* 199 (unassigned) */
2940bff6a5aSEd Maste 	NULL,                /* 200 (unassigned) */
2950bff6a5aSEd Maste 	NULL,                /* 201 (unassigned) */
2960bff6a5aSEd Maste 	NULL,                /* 202 (unassigned) */
2970bff6a5aSEd Maste 	NULL,                /* 203 (unassigned) */
2980bff6a5aSEd Maste 	NULL,                /* 204 (unassigned) */
2990bff6a5aSEd Maste 	NULL,                /* 205 (unassigned) */
3000bff6a5aSEd Maste 	NULL,                /* 206 (unassigned) */
3010bff6a5aSEd Maste 	NULL,                /* 207 (unassigned) */
3020bff6a5aSEd Maste 	NULL,                /* 208 (unassigned) */
3030bff6a5aSEd Maste 	NULL,                /* 209 (unassigned) */
3040bff6a5aSEd Maste 	NULL,                /* 210 (unassigned) */
3050bff6a5aSEd Maste 	NULL,                /* 211 (unassigned) */
3060bff6a5aSEd Maste 	NULL,                /* 212 (unassigned) */
3070bff6a5aSEd Maste 	NULL,                /* 213 (unassigned) */
3080bff6a5aSEd Maste 	NULL,                /* 214 (unassigned) */
3090bff6a5aSEd Maste 	NULL,                /* 215 (unassigned) */
3100bff6a5aSEd Maste 	NULL,                /* 216 (unassigned) */
3110bff6a5aSEd Maste 	NULL,                /* 217 (unassigned) */
3120bff6a5aSEd Maste 	NULL,                /* 218 (unassigned) */
3130bff6a5aSEd Maste 	NULL,                /* 219 (unassigned) */
3140bff6a5aSEd Maste 	NULL,                /* 220 (unassigned) */
3150bff6a5aSEd Maste 	NULL,                /* 221 (unassigned) */
3160bff6a5aSEd Maste 	NULL,                /* 222 (unassigned) */
3170bff6a5aSEd Maste 	NULL,                /* 223 (unassigned) */
3180bff6a5aSEd Maste 	NULL,                /* 224 (unassigned) */
3190bff6a5aSEd Maste 	NULL,                /* 225 (unassigned) */
3200bff6a5aSEd Maste 	NULL,                /* 226 (unassigned) */
3210bff6a5aSEd Maste 	NULL,                /* 227 (unassigned) */
3220bff6a5aSEd Maste 	NULL,                /* 228 (unassigned) */
3230bff6a5aSEd Maste 	NULL,                /* 229 (unassigned) */
3240bff6a5aSEd Maste 	NULL,                /* 230 (unassigned) */
3250bff6a5aSEd Maste 	NULL,                /* 231 (unassigned) */
3260bff6a5aSEd Maste 	NULL,                /* 232 (unassigned) */
3270bff6a5aSEd Maste 	NULL,                /* 233 (unassigned) */
3280bff6a5aSEd Maste 	NULL,                /* 234 (unassigned) */
3290bff6a5aSEd Maste 	NULL,                /* 235 (unassigned) */
3300bff6a5aSEd Maste 	NULL,                /* 236 (unassigned) */
3310bff6a5aSEd Maste 	NULL,                /* 237 (unassigned) */
3320bff6a5aSEd Maste 	NULL,                /* 238 (unassigned) */
3330bff6a5aSEd Maste 	NULL,                /* 239 (unassigned) */
3340bff6a5aSEd Maste 	NULL,                /* 240 (unassigned) */
3350bff6a5aSEd Maste 	NULL,                /* 241 (unassigned) */
3360bff6a5aSEd Maste 	NULL,                /* 242 (unassigned) */
3370bff6a5aSEd Maste 	NULL,                /* 243 (unassigned) */
3380bff6a5aSEd Maste 	NULL,                /* 244 (unassigned) */
3390bff6a5aSEd Maste 	NULL,                /* 245 (unassigned) */
3400bff6a5aSEd Maste 	NULL,                /* 246 (unassigned) */
3410bff6a5aSEd Maste 	NULL,                /* 247 (unassigned) */
3420bff6a5aSEd Maste 	NULL,                /* 248 (unassigned) */
3430bff6a5aSEd Maste 	NULL,                /* 249 (unassigned) */
3440bff6a5aSEd Maste 	NULL,                /* 250 (unassigned) */
3450bff6a5aSEd Maste 	NULL,                /* 251 (unassigned) */
3460bff6a5aSEd Maste 	NULL,                /* 252 (unassigned) */
3470bff6a5aSEd Maste 	"exptest-253",       /* 253 (Use for experimentation and testing,
3480bff6a5aSEd Maste 	                      *     RFC 3692)
3490bff6a5aSEd Maste 	                      */
3500bff6a5aSEd Maste 	"exptest-254",       /* 254 (Use for experimentation and testing,
3510bff6a5aSEd Maste 	                      *     RFC 3692)
3520bff6a5aSEd Maste 	                      */
3530bff6a5aSEd Maste 	"reserved",          /* 255 (reserved) */
3540bff6a5aSEd Maste };
3550bff6a5aSEd Maste 
3560bff6a5aSEd Maste /* The function enforces the array index to be 8-bit. */
3570bff6a5aSEd Maste const char *
netdb_protoname(const uint8_t protoid)358*ee67461eSJoseph Mingrone netdb_protoname (const uint8_t protoid)
3590bff6a5aSEd Maste {
3600bff6a5aSEd Maste 	return netdb_protocol_names[protoid];
3610bff6a5aSEd Maste }
362