#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/af.c,v 1.2 2006-02-27 07:25:27 hannes Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/af.c,v 1.3 2006-03-23 14:58:44 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
{ AFNUM_VPLS, "VPLS"},
{ 0, NULL},
};
+
+struct tok bsd_af_values[] = {
+ { BSD_AFNUM_INET, "IPv4" },
+ { BSD_AFNUM_NS, "NS" },
+ { BSD_AFNUM_ISO, "ISO" },
+ { BSD_AFNUM_APPLETALK, "Appletalk" },
+ { BSD_AFNUM_IPX, "IPX" },
+ { BSD_AFNUM_INET6_BSD, "IPv6" },
+ { BSD_AFNUM_INET6_FREEBSD, "IPv6" },
+ { BSD_AFNUM_INET6_DARWIN, "IPv6" },
+ { 0, NULL}
+};
-/* @(#) $Header: /tcpdump/master/tcpdump/af.h,v 1.2 2006-02-27 07:25:27 hannes Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/af.h,v 1.3 2006-03-23 14:58:44 hannes Exp $ (LBL) */
/*
* Copyright (c) 1998-2006 The TCPDUMP project
*/
extern struct tok af_values[];
+extern struct tok bsd_af_values[];
/* RFC1700 address family numbers */
#define AFNUM_INET 1
#define AFNUM_VPLS 25
/* draft-kompella-ppvpn-l2vpn */
#define AFNUM_L2VPN 196 /* still to be approved by IANA */
+
+/*
+ * 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_AFNUM_INET 2
+#define BSD_AFNUM_NS 6 /* XEROX NS protocols */
+#define BSD_AFNUM_ISO 7
+#define BSD_AFNUM_APPLETALK 16
+#define BSD_AFNUM_IPX 23
+#define BSD_AFNUM_INET6_BSD 24 /* OpenBSD (and probably NetBSD), BSD/OS */
+#define BSD_AFNUM_INET6_FREEBSD 28
+#define BSD_AFNUM_INET6_DARWIN 30
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.56 2005-07-07 01:22:19 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.57 2006-03-23 14:58:44 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#ifdef INET6
#include "ip6.h"
#endif
+#include "af.h"
/*
* The DLT_NULL packet header is 4 bytes long. It contains a host-byte-order
*/
#define NULL_HDRLEN 4
-/*
- * 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}
-};
-
-
/*
* Byte-swap a 32-bit number.
* ("htonl()" or "ntohl()" won't work - we want to byte-swap even on
switch (family) {
- case BSD_AF_INET:
+ case BSD_AFNUM_INET:
ip_print(gndo, p, length);
break;
#ifdef INET6
- case BSD_AF_INET6_BSD:
- case BSD_AF_INET6_FREEBSD:
- case BSD_AF_INET6_DARWIN:
+ case BSD_AFNUM_INET6_BSD:
+ case BSD_AFNUM_INET6_FREEBSD:
+ case BSD_AFNUM_INET6_DARWIN:
ip6_print(p, length);
break;
#endif
- case BSD_AF_ISO:
+ case BSD_AFNUM_ISO:
isoclns_print(p, length, caplen);
break;
- case BSD_AF_APPLETALK:
+ case BSD_AFNUM_APPLETALK:
atalk_print(p, length);
break;
- case BSD_AF_IPX:
+ case BSD_AFNUM_IPX:
ipx_print(p, length);
break;
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-rip.c,v 1.58 2006-02-21 10:27:40 hannes Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-rip.c,v 1.59 2006-03-23 14:58:44 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
/* RFC 1058 */
family = EXTRACT_16BITS(&ni->rip_family);
- if (family != AF_INET) {
- printf("\n\t AFI %s, ", tok2str(af_values, "Unknown (%u)", family));
+ if (family != BSD_AFNUM_INET) {
+ printf("\n\t AFI %s, ", tok2str(bsd_af_values, "Unknown (%u)", family));
print_unknown_data((u_int8_t *)&ni->rip_family,"\n\t ",RIP_ROUTELEN);
return;
}
/* MBZ fields not zero */
print_unknown_data((u_int8_t *)&ni->rip_family,"\n\t ",RIP_ROUTELEN);
return;
- } /* AF_INET */
+ } /* BSD_AFNUM_INET */
printf("\n\t %s, metric: %u",
ipaddr_string(&ni->rip_dest),
EXTRACT_32BITS(&ni->rip_metric));
EXTRACT_16BITS(&ni->rip_tag));
print_unknown_data((u_int8_t *)&ni->rip_dest,"\n\t ",RIP_AUTHLEN);
}
- } else if (family != AF_INET) {
- printf("\n\t AFI %s", tok2str(af_values, "Unknown (%u)", family));
+ } else if (family != BSD_AFNUM_INET) {
+ printf("\n\t AFI %s", tok2str(bsd_af_values, "Unknown (%u)", family));
print_unknown_data((u_int8_t *)&ni->rip_tag,"\n\t ",RIP_ROUTELEN-2);
return;
- } else { /* AF_INET */
+ } else { /* BSD_AFNUM_INET */
printf("\n\t AFI %s, %15s/%-2d, tag 0x%04x, metric: %u, next-hop: ",
- tok2str(af_values, "Unknown (%u)", family),
+ tok2str(bsd_af_values, "Unknown (%u)", family),
ipaddr_string(&ni->rip_dest),
mask2plen(EXTRACT_32BITS(&ni->rip_dest_mask)),
EXTRACT_16BITS(&ni->rip_tag),