]> The Tcpdump Group git mirrors - tcpdump/blobdiff - tcpdump.c
Fix a minor bug in the ack packet printing.
[tcpdump] / tcpdump.c
index 71e7c7eab18375657473de92928acb78179ade17..69c7dbaafd99b16eef5277e7ce7bc90476de4e80 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -24,7 +24,7 @@ static const char copyright[] =
     "@(#) 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.138 1999-12-22 15:44:11 itojun Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.143 2000-01-29 21:00:59 fenner Exp $ (LBL)";
 #endif
 
 /*
@@ -78,7 +78,6 @@ int vflag;                    /* verbose */
 int xflag;                     /* print packet in hex */
 int Xflag;                     /* print packet in ascii as well as hex */
 
-char *ahsecret = NULL;         /* AH secret key */
 char *espsecret = NULL;                /* ESP secret key */
 
 int packettype;
@@ -167,7 +166,7 @@ main(int argc, char **argv)
        else
                program_name = argv[0];
 
-       if (abort_on_misalignment(ebuf) < 0)
+       if (abort_on_misalignment(ebuf, sizeof(ebuf)) < 0)
                error("%s", ebuf);
 
 #ifdef LIBSMI
@@ -176,22 +175,13 @@ main(int argc, char **argv)
        
        opterr = 0;
        while (
-           (op = getopt(argc, argv, "ac:deE:fF:i:lnNm:Opqr:Rs:StT:vw:xXY")) != EOF)
+           (op = getopt(argc, argv, "ac:deE:fF:i:lm:nNOpqr:Rs:StT:vw:xXY")) != EOF)
                switch (op) {
 
                case 'a':
                        ++aflag;
                        break;
 
-#if 0
-               case 'A':
-#ifndef CRYPTO
-                       warning("crypto code not compiled in");
-#endif
-                       ahsecret = optarg;
-                       break;
-#endif
-
                case 'c':
                        cnt = atoi(optarg);
                        if (cnt <= 0)
@@ -207,7 +197,7 @@ main(int argc, char **argv)
                        break;
 
                case 'E':
-#ifndef CRYPTO
+#ifndef HAVE_LIBCRYPTO
                        warning("crypto code not compiled in");
 #endif
                        espsecret = optarg;
@@ -317,6 +307,7 @@ main(int argc, char **argv)
                        break;
 
                case 'X':
+                       ++xflag;
                        ++Xflag;
                        break;
 
@@ -475,13 +466,11 @@ default_print_unaligned(register const u_char *cp, register u_int length)
 
 /*
  * By default, print the packet out in hex.
- *
- * (BTW, please don't send us patches to print the packet out in ascii)
  */
 void
 default_print(register const u_char *bp, register u_int length)
 {
-       default_print_unaligned(bp, length);
+  default_print_unaligned(bp, length);
 }
 
 __dead void