Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 532 lines (513 sloc) 25.412 kb
013e89b1 » jeagle
2012-02-15 Update flag types, update documentation.
1 /*
2 * Copyright (c) 2012, Yahoo! Inc All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer. Redistributions
9 * in binary form must reproduce the above copyright notice, this list
10 * of conditions and the following disclaimer in the documentation and/or
11 * other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
18 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * Author: John Eaglesham
26 */
27
28 #include <stdlib.h>
29 #include <string.h>
30
31 /*
32 * The following functions require the user to call free() on the returned
33 * pointer.
34 */
35
36 /* Room for all of the flags as strings plus * one for the NULL. */
37 #define TCP_FLAG_STRING_MAX_LENGTH ( ( 8 * 5 ) + 1 )
38 char *tcp_flags_to_names( unsigned char flags )
39 {
40 char *str;
41 str = (char *) malloc( TCP_FLAG_STRING_MAX_LENGTH );
42 if ( str == NULL ) return NULL;
43
44 if ( flags == 0 ) {
45 strcpy( str, "None" );
46 return str;
47 }
48 str[0] = '\0';
49 if ( flags & ( 1 << 0 ) ) strcat( str, "FIN, " );
50 if ( flags & ( 1 << 1 ) ) strcat( str, "SYN, " );
51 if ( flags & ( 1 << 2 ) ) strcat( str, "RST, " );
52 if ( flags & ( 1 << 3 ) ) strcat( str, "PSH, " );
53 if ( flags & ( 1 << 4 ) ) strcat( str, "ACK, " );
54 if ( flags & ( 1 << 5 ) ) strcat( str, "URG, " );
55 if ( flags & ( 1 << 6 ) ) strcat( str, "ECN, " );
56 if ( flags & ( 1 << 7 ) ) strcat( str, "CWR, " );
57 str[ strlen(str) - 2 ] = '\0';
58
59 return str;
60 }
61
62 /* Room for all of the flags as strings plus * one for the NULL. */
63 #define IP_FLAG_STRING_MAX_LENGTH ( ( 3 * 4 ) + 1 )
64 char *ip_flags_to_names( unsigned char flags )
65 {
66 char *str;
67 str = (char *) malloc( IP_FLAG_STRING_MAX_LENGTH );
68 if ( str == NULL ) return NULL;
69
70 if ( flags == 0 ) {
71 strcpy( str, "None" );
72 return str;
73 }
74 str[0] = '\0';
75 if ( flags & ( 1 << 0 ) ) strcat( str, "MF, " );
76 if ( flags & ( 1 << 1 ) ) strcat( str, "DF, " );
77 if ( flags & ( 1 << 2 ) ) strcat( str, "RE, " );
78 str[ strlen(str) - 2 ] = '\0';
79
80 return str;
81 }
82
83 /*
84 * The following functions return static strings, the user should not call
85 * free() on the returned pointer.
86 */
87 char *icmp6_type_to_name( unsigned char type )
88 {
89 if ( type == 1 ) return "Destination unreachable";
90 if ( type == 2 ) return "Packet too big";
91 if ( type == 3 ) return "Time exceeded";
92 if ( type == 4 ) return "Invalid IPv6 header";
93 if ( type == 128 ) return "Echo service request";
94 if ( type == 129 ) return "Echo service reply";
95 if ( type == 130 ) return "Group membership query";
96 if ( type == 130 ) return "Multicast listener query";
97 if ( type == 131 ) return "Group membership report";
98 if ( type == 131 ) return "Multicast listener report";
99 if ( type == 132 ) return "Group membership termination";
100 if ( type == 132 ) return "Multicast listerner done";
101 if ( type == 133 ) return "Router solicitation";
102 if ( type == 134 ) return "Router advertisement";
103 if ( type == 135 ) return "Neighbor solicitation";
104 if ( type == 136 ) return "Neighbor advertisement";
105 if ( type == 137 ) return "Shorter route exists";
106 if ( type == 138 ) return "Route renumbering";
107 if ( type == 139 ) return "FQDN query";
108 if ( type == 139 ) return "Node information query";
109 if ( type == 139 ) return "Who-are-you request";
110 if ( type == 140 ) return "FQDN reply";
111 if ( type == 140 ) return "Node information reply";
112 if ( type == 140 ) return "Who-are-you reply";
113 if ( type == 200 ) return "mtrace response";
114 if ( type == 201 ) return "mtrace messages";
115 return "Unassigned";
116 }
117
118
119 char *icmp6_code_to_name( unsigned char type, unsigned char code )
120 {
121 if ( type == 1 ) {
122 if ( code == 0 ) return "No route to destination";
123 if ( code == 1 ) return "Administratively prohibited";
124 if ( code == 2 ) return "Beyond scope of source address";
125 if ( code == 2 ) return "Not a neighbor (obselete)";
126 if ( code == 3 ) return "Address unreachable";
127 if ( code == 4 ) return "Port unreachable";
128 }
129
130 if ( type == 3 ) {
131 if ( code == 0 ) return "Time exceeded in transit";
132 if ( code == 1 ) return "Time exceeded in reassembly";
133 }
134
135 if ( type == 4 ) {
136 if ( code == 0 ) return "Erroneous header field";
137 if ( code == 1 ) return "Unrecognized next header";
138 }
139
140 if ( type == 137 ) {
141 if ( code == 0 ) return "Redirection to on-link node";
142 if ( code == 1 ) return "Redirection to better router";
143 if ( code == 2 ) return "Unrecognized option";
144 }
145
146 return "Unassigned";
147 }
148
149 char *icmp_type_to_name( unsigned char type )
150 {
151 if ( type == 0 ) return "Echo Reply";
152 if ( type == 3 ) return "Destination Unreachable";
153 if ( type == 4 ) return "Source Quench";
154 if ( type == 5 ) return "Redirect";
155 if ( type == 6 ) return "Alternate Host Address";
156 if ( type == 8 ) return "Echo";
157 if ( type == 9 ) return "Router Advertisement";
158 if ( type == 10 ) return "Router Solicitation";
159 if ( type == 11 ) return "Time Exceeded";
160 if ( type == 12 ) return "Parameter Problem";
161 if ( type == 13 ) return "Timestamp";
162 if ( type == 14 ) return "Timestamp Reply";
163 if ( type == 15 ) return "Information Request";
164 if ( type == 16 ) return "Information Reply";
165 if ( type == 17 ) return "Address Mask Request";
166 if ( type == 18 ) return "Address Mask Reply";
167 if ( type == 19 ) return "Reserved (for Security)";
168 if ( type == 30 ) return "Traceroute";
169 if ( type == 31 ) return "Datagram Conversion Error";
170 if ( type == 32 ) return "Mobile Host Redirect";
171 if ( type == 33 ) return "IPv6 Where-Are-You";
172 if ( type == 34 ) return "IPv6 I-Am-Here";
173 if ( type == 35 ) return "Mobile Registration Request";
174 if ( type == 36 ) return "Mobile Registration Reply";
175 if ( type == 37 ) return "Domain Name Request";
176 if ( type == 38 ) return "Domain Name Reply";
177 if ( type == 39 ) return "SKIP";
178 if ( type == 40 ) return "Photuris";
179 if ( type == 41 ) return "ICMP messages utilized by experimental mobility protocols such as Seamoby";
180 return "Unassigned";
181 }
182
183 char *icmp_code_to_name( unsigned char type, unsigned char code )
184 {
185 if ( type == 3 ) {
186 if ( code == 0 ) return "Net Unreachable";
187 if ( code == 1 ) return "Host Unreachable";
188 if ( code == 2 ) return "Protocol Unreachable";
189 if ( code == 3 ) return "Port Unreachable";
190 if ( code == 4 ) return "Fragmentation Needed and Don't Fragment was Set";
191 if ( code == 5 ) return "Source Route Failed";
192 if ( code == 6 ) return "Destination Network Unknown";
193 if ( code == 7 ) return "Destination Host Unknown";
194 if ( code == 8 ) return "Source Host Isolated";
195 if ( code == 9 ) return "Communication with Destination Network is Administratively Prohibited";
196 if ( code == 10 ) return "Communication with Destination Host is Administratively Prohibited";
197 if ( code == 11 ) return "Destination Network Unreachable for Type of Service";
198 if ( code == 12 ) return "Destination Host Unreachable for Type of Service";
199 if ( code == 13 ) return "Communication Administratively Prohibited";
200 if ( code == 14 ) return "Host Precedence Violation";
201 if ( code == 15 ) return "Precedence cutoff in effect";
202 }
203 if ( type == 5 ) {
204 if ( code == 0 ) return "Redirect Datagram for the Network (or subnet)";
205 if ( code == 1 ) return "Redirect Datagram for the Host";
206 if ( code == 2 ) return "Redirect Datagram for the Type of Service and Network";
207 if ( code == 3 ) return "Redirect Datagram for the Type of Service and Host";
208 }
209 if ( type == 6 ) {
210 if ( code == 0 ) return "Alternate Address for Host";
211 }
212 if ( type == 9 ) {
213 if ( code == 0 ) return "Normal router advertisement";
214 if ( code == 16 ) return "Does not route common traffic";
215 }
216 if ( type == 11 ) {
217 if ( code == 0 ) return "Time to Live exceeded in Transit";
218 if ( code == 1 ) return "Fragment Reassembly Time Exceeded";
219 }
220 if ( type == 12 ) {
221 if ( code == 0 ) return "Pointer indicates the error";
222 if ( code == 1 ) return "Missing a Required Option";
223 if ( code == 2 ) return "Bad Length";
224 }
225 if ( type == 40 ) {
226 if ( code == 0 ) return "Bad SPI";
227 if ( code == 1 ) return "Authentication Failed";
228 if ( code == 2 ) return "Decompression Failed";
229 if ( code == 3 ) return "Decryption Failed";
230 if ( code == 4 ) return "Need Authentication";
231 if ( code == 5 ) return "Need Authorization";
232 }
233 return "Unassigned";
234 }
235
236 char *ip_protocol_to_name( unsigned char protocol )
237 {
238 if ( protocol == 0 ) return "IPPROTO_IP";
239 if ( protocol == 1 ) return "IPPROTO_ICMP";
240 if ( protocol == 6 ) return "IPPROTO_TCP";
241 if ( protocol == 17 ) return "IPPROTO_UDP";
242 if ( protocol == 255 ) return "IPPROTO_RAW";
243 if ( protocol == 0 ) return "IPPROTO_HOPOPTS";
244 if ( protocol == 2 ) return "IPPROTO_IGMP";
245 if ( protocol == 3 ) return "IPPROTO_GGP";
246 if ( protocol == 4 ) return "IPPROTO_IPV4";
247 if ( protocol == 7 ) return "IPPROTO_ST";
248 if ( protocol == 8 ) return "IPPROTO_EGP";
249 if ( protocol == 9 ) return "IPPROTO_PIGP";
250 if ( protocol == 10 ) return "IPPROTO_RCCMON";
251 if ( protocol == 11 ) return "IPPROTO_NVPII";
252 if ( protocol == 12 ) return "IPPROTO_PUP";
253 if ( protocol == 13 ) return "IPPROTO_ARGUS";
254 if ( protocol == 14 ) return "IPPROTO_EMCON";
255 if ( protocol == 15 ) return "IPPROTO_XNET";
256 if ( protocol == 16 ) return "IPPROTO_CHAOS";
257 if ( protocol == 18 ) return "IPPROTO_MUX";
258 if ( protocol == 19 ) return "IPPROTO_MEAS";
259 if ( protocol == 20 ) return "IPPROTO_HMP";
260 if ( protocol == 21 ) return "IPPROTO_PRM";
261 if ( protocol == 22 ) return "IPPROTO_IDP";
262 if ( protocol == 23 ) return "IPPROTO_TRUNK1";
263 if ( protocol == 24 ) return "IPPROTO_TRUNK2";
264 if ( protocol == 25 ) return "IPPROTO_LEAF1";
265 if ( protocol == 26 ) return "IPPROTO_LEAF2";
266 if ( protocol == 27 ) return "IPPROTO_RDP";
267 if ( protocol == 28 ) return "IPPROTO_IRTP";
268 if ( protocol == 29 ) return "IPPROTO_TP";
269 if ( protocol == 30 ) return "IPPROTO_BLT";
270 if ( protocol == 31 ) return "IPPROTO_NSP";
271 if ( protocol == 32 ) return "IPPROTO_INP";
272 if ( protocol == 33 ) return "IPPROTO_SEP";
273 if ( protocol == 34 ) return "IPPROTO_3PC";
274 if ( protocol == 35 ) return "IPPROTO_IDPR";
275 if ( protocol == 36 ) return "IPPROTO_XTP";
276 if ( protocol == 37 ) return "IPPROTO_DDP";
277 if ( protocol == 38 ) return "IPPROTO_CMTP";
278 if ( protocol == 39 ) return "IPPROTO_TPXX";
279 if ( protocol == 40 ) return "IPPROTO_IL";
280 if ( protocol == 41 ) return "IPPROTO_IPV6";
281 if ( protocol == 42 ) return "IPPROTO_SDRP";
282 if ( protocol == 43 ) return "IPPROTO_ROUTING";
283 if ( protocol == 44 ) return "IPPROTO_FRAGMENT";
284 if ( protocol == 45 ) return "IPPROTO_IDRP";
285 if ( protocol == 46 ) return "IPPROTO_RSVP";
286 if ( protocol == 47 ) return "IPPROTO_GRE";
287 if ( protocol == 48 ) return "IPPROTO_MHRP";
288 if ( protocol == 49 ) return "IPPROTO_BHA";
289 if ( protocol == 50 ) return "IPPROTO_ESP";
290 if ( protocol == 51 ) return "IPPROTO_AH";
291 if ( protocol == 52 ) return "IPPROTO_INLSP";
292 if ( protocol == 53 ) return "IPPROTO_SWIPE";
293 if ( protocol == 54 ) return "IPPROTO_NHRP";
294 if ( protocol == 55 ) return "IPPROTO_MOBILE";
295 if ( protocol == 56 ) return "IPPROTO_TLSP";
296 if ( protocol == 57 ) return "IPPROTO_SKIP";
297 if ( protocol == 58 ) return "IPPROTO_ICMPV6";
298 if ( protocol == 59 ) return "IPPROTO_NONE";
299 if ( protocol == 60 ) return "IPPROTO_DSTOPTS";
300 if ( protocol == 61 ) return "IPPROTO_AHIP";
301 if ( protocol == 62 ) return "IPPROTO_CFTP";
302 if ( protocol == 63 ) return "IPPROTO_HELLO";
303 if ( protocol == 64 ) return "IPPROTO_SATEXPAK";
304 if ( protocol == 65 ) return "IPPROTO_KRYPTOLAN";
305 if ( protocol == 66 ) return "IPPROTO_RVD";
306 if ( protocol == 67 ) return "IPPROTO_IPPC";
307 if ( protocol == 68 ) return "IPPROTO_ADFS";
308 if ( protocol == 69 ) return "IPPROTO_SATMON";
309 if ( protocol == 70 ) return "IPPROTO_VISA";
310 if ( protocol == 71 ) return "IPPROTO_IPCV";
311 if ( protocol == 72 ) return "IPPROTO_CPNX";
312 if ( protocol == 73 ) return "IPPROTO_CPHB";
313 if ( protocol == 74 ) return "IPPROTO_WSN";
314 if ( protocol == 75 ) return "IPPROTO_PVP";
315 if ( protocol == 76 ) return "IPPROTO_BRSATMON";
316 if ( protocol == 77 ) return "IPPROTO_ND";
317 if ( protocol == 78 ) return "IPPROTO_WBMON";
318 if ( protocol == 79 ) return "IPPROTO_WBEXPAK";
319 if ( protocol == 80 ) return "IPPROTO_EON";
320 if ( protocol == 81 ) return "IPPROTO_VMTP";
321 if ( protocol == 82 ) return "IPPROTO_SVMTP";
322 if ( protocol == 83 ) return "IPPROTO_VINES";
323 if ( protocol == 84 ) return "IPPROTO_TTP";
324 if ( protocol == 85 ) return "IPPROTO_IGP";
325 if ( protocol == 86 ) return "IPPROTO_DGP";
326 if ( protocol == 87 ) return "IPPROTO_TCF";
327 if ( protocol == 88 ) return "IPPROTO_IGRP";
328 if ( protocol == 89 ) return "IPPROTO_OSPFIGP";
329 if ( protocol == 90 ) return "IPPROTO_SRPC";
330 if ( protocol == 91 ) return "IPPROTO_LARP";
331 if ( protocol == 92 ) return "IPPROTO_MTP";
332 if ( protocol == 93 ) return "IPPROTO_AX25";
333 if ( protocol == 94 ) return "IPPROTO_IPEIP";
334 if ( protocol == 95 ) return "IPPROTO_MICP";
335 if ( protocol == 96 ) return "IPPROTO_SCCSP";
336 if ( protocol == 97 ) return "IPPROTO_ETHERIP";
337 if ( protocol == 98 ) return "IPPROTO_ENCAP";
338 if ( protocol == 99 ) return "IPPROTO_APES";
339 if ( protocol == 100 ) return "IPPROTO_GMTP";
340 if ( protocol == 108 ) return "IPPROTO_IPCOMP";
341 if ( protocol == 132 ) return "IPPROTO_SCTP";
342 if ( protocol == 103 ) return "IPPROTO_PIM";
343 if ( protocol == 112 ) return "IPPROTO_CARP";
344 if ( protocol == 113 ) return "IPPROTO_PGM";
345 if ( protocol == 240 ) return "IPPROTO_PFSYNC";
346 if ( protocol == 254 ) return "IPPROTO_OLD_DIVERT";
347 return "Unassigned";
348 }
349
350 char *ether_protocol_to_name( unsigned short protocol )
351 {
352 if ( protocol == 0x0004 ) return "ETHERTYPE_8023";
353 if ( protocol == 0x0200 ) return "ETHERTYPE_PUP";
354 if ( protocol == 0x0200 ) return "ETHERTYPE_PUPAT";
355 if ( protocol == 0x0500 ) return "ETHERTYPE_SPRITE";
356 if ( protocol == 0x0600 ) return "ETHERTYPE_NS";
357 if ( protocol == 0x0601 ) return "ETHERTYPE_NSAT";
358 if ( protocol == 0x0660 ) return "ETHERTYPE_DLOG1";
359 if ( protocol == 0x0661 ) return "ETHERTYPE_DLOG2";
360 if ( protocol == 0x0800 ) return "ETHERTYPE_IP";
361 if ( protocol == 0x0801 ) return "ETHERTYPE_X75";
362 if ( protocol == 0x0802 ) return "ETHERTYPE_NBS";
363 if ( protocol == 0x0803 ) return "ETHERTYPE_ECMA";
364 if ( protocol == 0x0804 ) return "ETHERTYPE_CHAOS";
365 if ( protocol == 0x0805 ) return "ETHERTYPE_X25";
366 if ( protocol == 0x0806 ) return "ETHERTYPE_ARP";
367 if ( protocol == 0x0807 ) return "ETHERTYPE_NSCOMPAT";
368 if ( protocol == 0x0808 ) return "ETHERTYPE_FRARP";
369 if ( protocol == 0x0900 ) return "ETHERTYPE_UBDEBUG";
370 if ( protocol == 0x0A00 ) return "ETHERTYPE_IEEEPUP";
371 if ( protocol == 0x0A01 ) return "ETHERTYPE_IEEEPUPAT";
372 if ( protocol == 0x0BAD ) return "ETHERTYPE_VINES";
373 if ( protocol == 0x0BAE ) return "ETHERTYPE_VINESLOOP";
374 if ( protocol == 0x0BAF ) return "ETHERTYPE_VINESECHO";
375 if ( protocol == 0x1000 ) return "ETHERTYPE_TRAIL";
376 if ( protocol == 0x1234 ) return "ETHERTYPE_DCA";
377 if ( protocol == 0x1600 ) return "ETHERTYPE_VALID";
378 if ( protocol == 0x1989 ) return "ETHERTYPE_DOGFIGHT";
379 if ( protocol == 0x1995 ) return "ETHERTYPE_RCL";
380 if ( protocol == 0x3C00 ) return "ETHERTYPE_NBPVCD";
381 if ( protocol == 0x3C01 ) return "ETHERTYPE_NBPSCD";
382 if ( protocol == 0x3C02 ) return "ETHERTYPE_NBPCREQ";
383 if ( protocol == 0x3C03 ) return "ETHERTYPE_NBPCRSP";
384 if ( protocol == 0x3C04 ) return "ETHERTYPE_NBPCC";
385 if ( protocol == 0x3C05 ) return "ETHERTYPE_NBPCLREQ";
386 if ( protocol == 0x3C06 ) return "ETHERTYPE_NBPCLRSP";
387 if ( protocol == 0x3C07 ) return "ETHERTYPE_NBPDG";
388 if ( protocol == 0x3C08 ) return "ETHERTYPE_NBPDGB";
389 if ( protocol == 0x3C09 ) return "ETHERTYPE_NBPCLAIM";
390 if ( protocol == 0x3C0A ) return "ETHERTYPE_NBPDLTE";
391 if ( protocol == 0x3C0B ) return "ETHERTYPE_NBPRAS";
392 if ( protocol == 0x3C0C ) return "ETHERTYPE_NBPRAR";
393 if ( protocol == 0x3C0D ) return "ETHERTYPE_NBPRST";
394 if ( protocol == 0x4242 ) return "ETHERTYPE_PCS";
395 if ( protocol == 0x424C ) return "ETHERTYPE_IMLBLDIAG";
396 if ( protocol == 0x4321 ) return "ETHERTYPE_DIDDLE";
397 if ( protocol == 0x4C42 ) return "ETHERTYPE_IMLBL";
398 if ( protocol == 0x5208 ) return "ETHERTYPE_SIMNET";
399 if ( protocol == 0x6000 ) return "ETHERTYPE_DECEXPER";
400 if ( protocol == 0x6001 ) return "ETHERTYPE_MOPDL";
401 if ( protocol == 0x6002 ) return "ETHERTYPE_MOPRC";
402 if ( protocol == 0x6003 ) return "ETHERTYPE_DECnet";
403 if ( protocol == 0x6004 ) return "ETHERTYPE_LAT";
404 if ( protocol == 0x6005 ) return "ETHERTYPE_DECDIAG";
405 if ( protocol == 0x6006 ) return "ETHERTYPE_DECCUST";
406 if ( protocol == 0x6007 ) return "ETHERTYPE_SCA";
407 if ( protocol == 0x6008 ) return "ETHERTYPE_AMBER";
408 if ( protocol == 0x6009 ) return "ETHERTYPE_DECMUMPS";
409 if ( protocol == 0x6558 ) return "ETHERTYPE_TRANSETHER";
410 if ( protocol == 0x6559 ) return "ETHERTYPE_RAWFR";
411 if ( protocol == 0x7000 ) return "ETHERTYPE_UBDL";
412 if ( protocol == 0x7001 ) return "ETHERTYPE_UBNIU";
413 if ( protocol == 0x7002 ) return "ETHERTYPE_UBDIAGLOOP";
414 if ( protocol == 0x7003 ) return "ETHERTYPE_UBNMC";
415 if ( protocol == 0x7005 ) return "ETHERTYPE_UBBST";
416 if ( protocol == 0x7007 ) return "ETHERTYPE_OS9";
417 if ( protocol == 0x7009 ) return "ETHERTYPE_OS9NET";
418 if ( protocol == 0x7030 ) return "ETHERTYPE_RACAL";
419 if ( protocol == 0x7031 ) return "ETHERTYPE_PRIMENTS";
420 if ( protocol == 0x7034 ) return "ETHERTYPE_CABLETRON";
421 if ( protocol == 0x8003 ) return "ETHERTYPE_CRONUSVLN";
422 if ( protocol == 0x8004 ) return "ETHERTYPE_CRONUS";
423 if ( protocol == 0x8005 ) return "ETHERTYPE_HP";
424 if ( protocol == 0x8006 ) return "ETHERTYPE_NESTAR";
425 if ( protocol == 0x8008 ) return "ETHERTYPE_ATTSTANFORD";
426 if ( protocol == 0x8010 ) return "ETHERTYPE_EXCELAN";
427 if ( protocol == 0x8013 ) return "ETHERTYPE_SG_DIAG";
428 if ( protocol == 0x8014 ) return "ETHERTYPE_SG_NETGAMES";
429 if ( protocol == 0x8015 ) return "ETHERTYPE_SG_RESV";
430 if ( protocol == 0x8016 ) return "ETHERTYPE_SG_BOUNCE";
431 if ( protocol == 0x8019 ) return "ETHERTYPE_APOLLODOMAIN";
432 if ( protocol == 0x802E ) return "ETHERTYPE_TYMSHARE";
433 if ( protocol == 0x802F ) return "ETHERTYPE_TIGAN";
434 if ( protocol == 0x8035 ) return "ETHERTYPE_REVARP";
435 if ( protocol == 0x8036 ) return "ETHERTYPE_AEONIC";
436 if ( protocol == 0x8037 ) return "ETHERTYPE_IPXNEW";
437 if ( protocol == 0x8038 ) return "ETHERTYPE_LANBRIDGE";
438 if ( protocol == 0x8039 ) return "ETHERTYPE_DSMD";
439 if ( protocol == 0x803A ) return "ETHERTYPE_ARGONAUT";
440 if ( protocol == 0x803B ) return "ETHERTYPE_VAXELN";
441 if ( protocol == 0x803C ) return "ETHERTYPE_DECDNS";
442 if ( protocol == 0x803D ) return "ETHERTYPE_ENCRYPT";
443 if ( protocol == 0x803E ) return "ETHERTYPE_DECDTS";
444 if ( protocol == 0x803F ) return "ETHERTYPE_DECLTM";
445 if ( protocol == 0x8040 ) return "ETHERTYPE_DECNETBIOS";
446 if ( protocol == 0x8041 ) return "ETHERTYPE_DECLAST";
447 if ( protocol == 0x8044 ) return "ETHERTYPE_PLANNING";
448 if ( protocol == 0x8048 ) return "ETHERTYPE_DECAM";
449 if ( protocol == 0x8049 ) return "ETHERTYPE_EXPERDATA";
450 if ( protocol == 0x805B ) return "ETHERTYPE_VEXP";
451 if ( protocol == 0x805C ) return "ETHERTYPE_VPROD";
452 if ( protocol == 0x805D ) return "ETHERTYPE_ES";
453 if ( protocol == 0x8060 ) return "ETHERTYPE_LITTLE";
454 if ( protocol == 0x8062 ) return "ETHERTYPE_COUNTERPOINT";
455 if ( protocol == 0x8067 ) return "ETHERTYPE_VEECO";
456 if ( protocol == 0x8068 ) return "ETHERTYPE_GENDYN";
457 if ( protocol == 0x8069 ) return "ETHERTYPE_ATT";
458 if ( protocol == 0x806A ) return "ETHERTYPE_AUTOPHON";
459 if ( protocol == 0x806C ) return "ETHERTYPE_COMDESIGN";
460 if ( protocol == 0x806D ) return "ETHERTYPE_COMPUGRAPHIC";
461 if ( protocol == 0x807A ) return "ETHERTYPE_MATRA";
462 if ( protocol == 0x807B ) return "ETHERTYPE_DDE";
463 if ( protocol == 0x807C ) return "ETHERTYPE_MERIT";
464 if ( protocol == 0x8080 ) return "ETHERTYPE_VLTLMAN";
465 if ( protocol == 0x809B ) return "ETHERTYPE_ATALK";
466 if ( protocol == 0x809F ) return "ETHERTYPE_SPIDER";
467 if ( protocol == 0x80C6 ) return "ETHERTYPE_PACER";
468 if ( protocol == 0x80C7 ) return "ETHERTYPE_APPLITEK";
469 if ( protocol == 0x80D5 ) return "ETHERTYPE_SNA";
470 if ( protocol == 0x80DD ) return "ETHERTYPE_VARIAN";
471 if ( protocol == 0x80F2 ) return "ETHERTYPE_RETIX";
472 if ( protocol == 0x80F3 ) return "ETHERTYPE_AARP";
473 if ( protocol == 0x80F7 ) return "ETHERTYPE_APOLLO";
474 if ( protocol == 0x8100 ) return "ETHERTYPE_VLAN";
475 if ( protocol == 0x8102 ) return "ETHERTYPE_BOFL";
476 if ( protocol == 0x8103 ) return "ETHERTYPE_WELLFLEET";
477 if ( protocol == 0x812B ) return "ETHERTYPE_TALARIS";
478 if ( protocol == 0x8130 ) return "ETHERTYPE_WATERLOO";
479 if ( protocol == 0x8130 ) return "ETHERTYPE_HAYES";
480 if ( protocol == 0x8131 ) return "ETHERTYPE_VGLAB";
481 if ( protocol == 0x8137 ) return "ETHERTYPE_IPX";
482 if ( protocol == 0x8138 ) return "ETHERTYPE_NOVELL";
483 if ( protocol == 0x813F ) return "ETHERTYPE_MUMPS";
484 if ( protocol == 0x8145 ) return "ETHERTYPE_AMOEBA";
485 if ( protocol == 0x8146 ) return "ETHERTYPE_FLIP";
486 if ( protocol == 0x8147 ) return "ETHERTYPE_VURESERVED";
487 if ( protocol == 0x8148 ) return "ETHERTYPE_LOGICRAFT";
488 if ( protocol == 0x8149 ) return "ETHERTYPE_NCD";
489 if ( protocol == 0x814A ) return "ETHERTYPE_ALPHA";
490 if ( protocol == 0x814C ) return "ETHERTYPE_SNMP";
491 if ( protocol == 0x814F ) return "ETHERTYPE_TEC";
492 if ( protocol == 0x8150 ) return "ETHERTYPE_RATIONAL";
493 if ( protocol == 0x817D ) return "ETHERTYPE_XTP";
494 if ( protocol == 0x817E ) return "ETHERTYPE_SGITW";
495 if ( protocol == 0x8180 ) return "ETHERTYPE_HIPPI_FP";
496 if ( protocol == 0x8181 ) return "ETHERTYPE_STP";
497 if ( protocol == 0x818D ) return "ETHERTYPE_MOTOROLA";
498 if ( protocol == 0x8191 ) return "ETHERTYPE_NETBEUI";
499 if ( protocol == 0x8390 ) return "ETHERTYPE_ACCTON";
500 if ( protocol == 0x852B ) return "ETHERTYPE_TALARISMC";
501 if ( protocol == 0x8582 ) return "ETHERTYPE_KALPANA";
502 if ( protocol == 0x86DB ) return "ETHERTYPE_SECTRA";
503 if ( protocol == 0x86DD ) return "ETHERTYPE_IPV6";
504 if ( protocol == 0x86DE ) return "ETHERTYPE_DELTACON";
505 if ( protocol == 0x86DF ) return "ETHERTYPE_ATOMIC";
506 if ( protocol == 0x8739 ) return "ETHERTYPE_RDP";
507 if ( protocol == 0x873A ) return "ETHERTYPE_MICP";
508 if ( protocol == 0x876B ) return "ETHERTYPE_TCPCOMP";
509 if ( protocol == 0x876C ) return "ETHERTYPE_IPAS";
510 if ( protocol == 0x876D ) return "ETHERTYPE_SECUREDATA";
511 if ( protocol == 0x8808 ) return "ETHERTYPE_FLOWCONTROL";
512 if ( protocol == 0x8809 ) return "ETHERTYPE_SLOW";
513 if ( protocol == 0x880B ) return "ETHERTYPE_PPP";
514 if ( protocol == 0x8820 ) return "ETHERTYPE_HITACHI";
515 if ( protocol == 0x8847 ) return "ETHERTYPE_MPLS";
516 if ( protocol == 0x8848 ) return "ETHERTYPE_MPLS_MCAST";
517 if ( protocol == 0x8856 ) return "ETHERTYPE_AXIS";
518 if ( protocol == 0x8863 ) return "ETHERTYPE_PPPOEDISC";
519 if ( protocol == 0x8864 ) return "ETHERTYPE_PPPOE";
520 if ( protocol == 0x8888 ) return "ETHERTYPE_LANPROBE";
521 if ( protocol == 0x888e ) return "ETHERTYPE_PAE";
522 if ( protocol == 0x9000 ) return "ETHERTYPE_LOOPBACK";
523 if ( protocol == 0x9001 ) return "ETHERTYPE_XNSSM";
524 if ( protocol == 0x9002 ) return "ETHERTYPE_TCPSM";
525 if ( protocol == 0x9003 ) return "ETHERTYPE_BCLOOP";
526 if ( protocol == 0xAAAA ) return "ETHERTYPE_DEBNI";
527 if ( protocol == 0xFAF5 ) return "ETHERTYPE_SONIX";
528 if ( protocol == 0xFF00 ) return "ETHERTYPE_VITAL";
529 if ( protocol == 0xFFFF ) return "ETHERTYPE_MAX";
530 if ( protocol == 0x1000 ) return "ETHERTYPE_TRAIL";
531 return "Unassigned";
532 }
Something went wrong with that request. Please try again.