-static void
-null_print(const u_char *p, const struct ip *ip, u_int length)
-{
- u_int family;
-
- memcpy((char *)&family, (char *)p, sizeof(family));
-
- if (nflag) {
- /* XXX just dump the header */
- return;
- }
- switch (family) {
+/*
+ * BSD AF_ values.
+ *
+ * Unfortunately, the BSDs don't all use the same value for AF_INET6,
+ * so, because we want to be able to read captures from all of the BSDs,
+ * we check for all of them.
+ */
+#define BSD_AF_INET 2
+#define BSD_AF_NS 6 /* XEROX NS protocols */
+#define BSD_AF_ISO 7
+#define BSD_AF_APPLETALK 16
+#define BSD_AF_IPX 23
+#define BSD_AF_INET6_BSD 24 /* OpenBSD (and probably NetBSD), BSD/OS */
+#define BSD_AF_INET6_FREEBSD 28
+#define BSD_AF_INET6_DARWIN 30
+
+const struct tok bsd_af_values[] = {
+ { BSD_AF_INET, "IPv4" },
+ { BSD_AF_NS, "NS" },
+ { BSD_AF_ISO, "ISO" },
+ { BSD_AF_APPLETALK, "Appletalk" },
+ { BSD_AF_IPX, "IPX" },
+ { BSD_AF_INET6_BSD, "IPv6" },
+ { BSD_AF_INET6_FREEBSD, "IPv6" },
+ { BSD_AF_INET6_DARWIN, "IPv6" },
+ { 0, NULL}
+};