xref: /minix/external/bsd/tcpdump/dist/af.c (revision fb9c64b2)
1 /*
2  * Copyright (c) 1998-2006 The TCPDUMP project
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that: (1) source code
6  * distributions retain the above copyright notice and this paragraph
7  * in its entirety, and (2) distributions including binary code include
8  * the above copyright notice and this paragraph in its entirety in
9  * the documentation or other materials provided with the distribution.
10  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
11  * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
12  * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13  * FOR A PARTICULAR PURPOSE.
14  *
15  * Original code by Hannes Gredler (hannes@juniper.net)
16  */
17 
18 #include <sys/cdefs.h>
19 #ifndef lint
20 __RCSID("$NetBSD: af.c,v 1.4 2014/11/20 03:05:03 christos Exp $");
21 #endif
22 
23 #define NETDISSECT_REWORKED
24 #ifdef HAVE_CONFIG_H
25 #include "config.h"
26 #endif
27 
28 #include <tcpdump-stdinc.h>
29 #include "interface.h"
30 #include "af.h"
31 
32 const struct tok af_values[] = {
33     { 0,                      "Reserved"},
34     { AFNUM_INET,             "IPv4"},
35     { AFNUM_INET6,            "IPv6"},
36     { AFNUM_NSAP,             "NSAP"},
37     { AFNUM_HDLC,             "HDLC"},
38     { AFNUM_BBN1822,          "BBN 1822"},
39     { AFNUM_802,              "802"},
40     { AFNUM_E163,             "E.163"},
41     { AFNUM_E164,             "E.164"},
42     { AFNUM_F69,              "F.69"},
43     { AFNUM_X121,             "X.121"},
44     { AFNUM_IPX,              "Novell IPX"},
45     { AFNUM_ATALK,            "Appletalk"},
46     { AFNUM_DECNET,           "Decnet IV"},
47     { AFNUM_BANYAN,           "Banyan Vines"},
48     { AFNUM_E164NSAP,         "E.164 with NSAP subaddress"},
49     { AFNUM_L2VPN,            "Layer-2 VPN"},
50     { AFNUM_VPLS,             "VPLS"},
51     { 0, NULL},
52 };
53 
54 const struct tok bsd_af_values[] = {
55     { BSD_AFNUM_INET, "IPv4" },
56     { BSD_AFNUM_NS, "NS" },
57     { BSD_AFNUM_ISO, "ISO" },
58     { BSD_AFNUM_APPLETALK, "Appletalk" },
59     { BSD_AFNUM_IPX, "IPX" },
60     { BSD_AFNUM_INET6_BSD, "IPv6" },
61     { BSD_AFNUM_INET6_FREEBSD, "IPv6" },
62     { BSD_AFNUM_INET6_DARWIN, "IPv6" },
63     { 0, NULL}
64 };
65