"@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997\n\
The Regents of the University of California. All rights reserved.\n";
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.132 1999-10-30 05:11:23 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.136 1999-12-13 18:06:15 mcr Exp $ (LBL)";
#endif
/*
* combined efforts of Van, Steve McCanne and Craig Leres of LBL.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <sys/types.h>
#include <sys/time.h>
int pflag; /* don't go promiscuous */
int qflag; /* quick (shorter) output */
int Rflag = 1; /* print sequence # field in AH/ESP*/
+int sflag = 0; /* use the libsmi to translate OIDs */
int Sflag; /* print raw TCP sequence numbers */
int tflag = 1; /* print packet arrival time */
int vflag; /* verbose */
static struct printer printers[] = {
{ ether_if_print, DLT_EN10MB },
{ ether_if_print, DLT_IEEE802 },
+#ifdef DLT_LANE8023
+ { lane_if_print, DLT_LANE8023 },
+#endif
+#ifdef DLT_CIP
+ { cip_if_print, DLT_CIP },
+#endif
{ sl_if_print, DLT_SLIP },
{ sl_bsdos_if_print, DLT_SLIP_BSDOS },
{ ppp_if_print, DLT_PPP },
if (abort_on_misalignment(ebuf) < 0)
error("%s", ebuf);
+#ifdef LIBSMI
+ smiInit("tcpdump");
+#endif
+
opterr = 0;
while (
- (op = getopt(argc, argv, "ac:deE:fF:i:lnNOpqr:Rs:StT:vw:xY")) != EOF)
+ (op = getopt(argc, argv, "ac:deE:fF:i:lnNm:Opqr:Rs:StT:vw:xY")) != EOF)
switch (op) {
case 'a':
++Nflag;
break;
+ case 'm':
+#ifdef LIBSMI
+ if (smiLoadModule(optarg) == 0) {
+ error("could not load MIB module %s", optarg);
+ }
+ sflag = 1;
+#else
+ (void)fprintf(stderr, "%s: ignoring option `-m %s' ",
+ program_name, optarg);
+ (void)fprintf(stderr, "(no libsmi support)\n");
+#endif
+
case 'O':
Oflag = 0;
break;
putchar('\n');
while (nshorts >= 0) {
- snprintf(line+20+i*5, 7, "%02x%02x ", cp[0], cp[1]);
+ sprintf(line+20+i*5, "%02x%02x ", cp[0], cp[1]);
if(isprint(cp[0])) {
line[62+i*2]=cp[0];