9 my (%default_test, %protos, %test);
11 %default_test = map { $_ => 1 } sort keys %protos;
14 %test = %default_test;
15 } elsif ($^O eq 'MSWin32') {
16 %test = map { $_ => 1 } (0,1,3,6,8,12,17,20,22,27,66);
18 } elsif ($^O eq 'NetWare') {
19 %test = %default_test;
20 } elsif ($^O eq 'VMS') {
21 %test = %default_test;
23 %test = %default_test;
26 plan tests => scalar (keys %test) * 2;
28 for my $number (sort {$a <=> $b} keys %protos) {
29 next unless exists $test{$number};
30 my ($name, $alias) = getprotobynumber($number);
31 is($name, $protos{$number}[0], "getprotobynumber($number) returned name ($name)");
32 is($alias, $protos{$number}[1], "getprotobynumber($number) returned alias ($alias)");
37 0 => ['ip', 'IP HOPOPT'],
41 4 => [qw(ipencap IP-ENCAP)],
44 7 => ['ucl', 'UCL CBT'],
47 10 => [qw(bbn-rcc-mon BBN-RCC-MON)],
48 11 => [qw(nvp-ii NVP-II)],
50 13 => [qw(argus ARGUS)],
51 14 => [qw(emcon EMCON)],
52 15 => [qw(xnet XNET)],
53 16 => [qw(chaos CHAOS)],
56 19 => [qw(dcn-meas DCN-MEAS)],
59 22 => [qw(xns-idp XNS-IDP)],
60 23 => [qw(trunk-1 TRUNK-1)],
61 24 => [qw(trunk-2 TRUNK-2)],
62 25 => [qw(leaf-1 LEAF-1)],
63 26 => [qw(leaf-2 LEAF-2)],
65 28 => [qw(irtp IRTP)],
66 29 => [qw(iso-tp4 ISO-TP4)],
67 30 => [qw(netblt NETBLT)],
68 31 => [qw(mfe-nsp MFE-NSP)],
69 32 => [qw(merit-inp MERIT-INP)],
72 35 => [qw(idpr IDPR)],
75 38 => [qw(idpr-cmtp IDPR-CMTP)],
76 39 => [qw(tp++ TP++)],
78 41 => [qw(ipv6 IPv6)],
79 42 => [qw(sdrp SDRP)],
80 43 => [qw(sip-sr SIP-SR)],
81 44 => [qw(sip-frag SIP-FRAG)],
82 45 => [qw(idrp IDRP)],
83 46 => [qw(rsvp RSVP)],
85 48 => [qw(mhrp MHRP)],
87 50 => ['esp', 'IPSEC-ESP ESP'],
88 51 => ['ah', 'IPSEC-AH AH'],
89 52 => [qw(i-nlsp I-NLSP)],
90 53 => [qw(swipe SWIPE)],
91 54 => ['nhrp', 'NHRP NARP'],
92 55 => ['mobileip', 'MOBILEIP MOBILE'],
93 57 => [qw(skip SKIP)],
94 58 => ['ipv6-icmp', 'IPv6-ICMP icmp6'],
95 59 => [qw(ipv6-nonxt IPv6-NoNxt)],
96 60 => [qw(ipv6-opts IPv6-Opts)],
98 62 => [qw(cftp CFTP)],
100 64 => [qw(sat-expak SAT-EXPAK)],
101 65 => [qw(kryptolan KRYPTOLAN)],
103 67 => [qw(ippc IPPC)],
105 69 => [qw(sat-mon SAT-MON)],
106 70 => [qw(visa VISA)],
107 71 => [qw(ipcv IPCV)],
108 72 => [qw(cpnx CPNX)],
109 73 => [qw(cphb CPHB)],
112 76 => [qw(br-sat-mon BR-SAT-MON)],
113 77 => [qw(sun-nd SUN-ND)],
114 78 => [qw(wb-mon WB-MON)],
115 79 => [qw(wb-expak WB-EXPAK)],
116 80 => [qw(iso-ip ISO-IP)],
117 81 => [qw(vmtp VMTP)],
118 82 => [qw(secure-vmtp SECURE-VMTP)],
119 83 => [qw(vines VINES)],
121 85 => [qw(nsfnet-igp NSFNET-IGP)],
124 88 => ['igrp', 'IGRP EIGRP'],
125 89 => [qw(ospf OSPFIGP)],
126 90 => [qw(sprite-rpc Sprite-RPC)],
127 91 => [qw(larp LARP)],
129 93 => [qw(ax.25 AX.25)],
130 94 => [qw(ipip IPIP)],
131 95 => [qw(micp MICP)],
132 96 => [qw(scc-sp SCC-SP)],
133 97 => [qw(etherip ETHERIP)],
134 98 => [qw(encap ENCAP)],
136 100 => [qw(gmtp GMTP)],
137 101 => [qw(ifmp IFMP)],
138 102 => [qw(pnni PNNI)],
139 103 => [qw(pim PIM)],
140 104 => [qw(aris ARIS)],
141 105 => [qw(scps SCPS)],
142 106 => [qw(qnx QNX)],
143 107 => [qw(a/n A/N)],
144 108 => [qw(ipcomp IPComp)],
145 109 => [qw(snp SNP)],
146 110 => [qw(compaq-peer Compaq-Peer)],
147 111 => [qw(ipx-in-ip IPX-in-IP)],
148 112 => ['carp', 'CARP vrrp'],
149 113 => [qw(pgm PGM)],
150 115 => [qw(l2tp L2TP)],
151 116 => [qw(ddx DDX)],
152 117 => [qw(iatp IATP)],
153 118 => [qw(stp STP)],
154 119 => [qw(srp SRP)],
155 120 => [qw(uti UTI)],
156 121 => [qw(smp SMP)],
158 123 => [qw(ptp PTP)],
159 124 => [qw(isis ISIS)],
160 125 => [qw(fire FIRE)],
161 126 => [qw(crtp CRTP)],
162 127 => [qw(crudp CRUDP)],
163 128 => [qw(sscopmce SSCOPMCE)],
164 129 => [qw(iplt IPLT)],
165 130 => [qw(sps SPS)],
166 131 => [qw(pipe PIPE)],
167 132 => [qw(sctp SCTP)],
169 134 => [qw(rsvp-e2e-ignore RSVP-E2E-IGNORE)],
170 240 => [qw(pfsync PFSYNC)],
171 255 => [qw(reserved Reserved)]);