]> The Tcpdump Group git mirrors - tcpdump/blobdiff - tcpdump.c
TESTrun: Use more 'newdir' and 'diffdir' variables
[tcpdump] / tcpdump.c
index 7159d1c76fd8677ea395f6e4321c58768f27721e..5e23219718619344c94543b8102e34e3ad54fbdf 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -157,7 +157,6 @@ The Regents of the University of California.  All rights reserved.\n";
 #include "netdissect.h"
 #include "interface.h"
 #include "addrtoname.h"
 #include "netdissect.h"
 #include "interface.h"
 #include "addrtoname.h"
-#include "machdep.h"
 #include "pcap-missing.h"
 #include "ascii_strcasecmp.h"
 
 #include "pcap-missing.h"
 #include "ascii_strcasecmp.h"
 
@@ -705,6 +704,7 @@ show_remote_devices_and_exit(void)
 #define OPTION_FP_TYPE                 135
 #define OPTION_COUNT                   136
 #define OPTION_PRINT_SAMPLING          137
 #define OPTION_FP_TYPE                 135
 #define OPTION_COUNT                   136
 #define OPTION_PRINT_SAMPLING          137
+#define OPTION_LENGTHS                 138
 
 static const struct option longopts[] = {
 #if defined(HAVE_PCAP_CREATE) || defined(_WIN32)
 
 static const struct option longopts[] = {
 #if defined(HAVE_PCAP_CREATE) || defined(_WIN32)
@@ -753,12 +753,13 @@ static const struct option longopts[] = {
        { "number", no_argument, NULL, '#' },
        { "print", no_argument, NULL, OPTION_PRINT },
        { "print-sampling", required_argument, NULL, OPTION_PRINT_SAMPLING },
        { "number", no_argument, NULL, '#' },
        { "print", no_argument, NULL, OPTION_PRINT },
        { "print-sampling", required_argument, NULL, OPTION_PRINT_SAMPLING },
+       { "lengths", no_argument, NULL, OPTION_LENGTHS },
        { "version", no_argument, NULL, OPTION_VERSION },
        { NULL, 0, NULL, 0 }
 };
 
 #ifdef HAVE_PCAP_FINDALLDEVS_EX
        { "version", no_argument, NULL, OPTION_VERSION },
        { NULL, 0, NULL, 0 }
 };
 
 #ifdef HAVE_PCAP_FINDALLDEVS_EX
-#define LIST_REMOTE_INTERFACES_USAGE "[ --list-remote-interfaces remote-source ]"
+#define LIST_REMOTE_INTERFACES_USAGE " [ --list-remote-interfaces remote-source ]"
 #else
 #define LIST_REMOTE_INTERFACES_USAGE
 #endif
 #else
 #define LIST_REMOTE_INTERFACES_USAGE
 #endif
@@ -1565,16 +1566,6 @@ main(int argc, char **argv)
                error("Attempting to initialize Winsock failed");
 #endif
 
                error("Attempting to initialize Winsock failed");
 #endif
 
-       /*
-        * On platforms where the CPU doesn't support unaligned loads,
-        * force unaligned accesses to abort with SIGBUS, rather than
-        * being fixed up (slowly) by the OS kernel; on those platforms,
-        * misaligned accesses are bugs, and we want tcpdump to crash so
-        * that the bugs are reported.
-        */
-       if (abort_on_misalignment(ebuf, sizeof(ebuf)) < 0)
-               error("%s", ebuf);
-
        /*
         * An explicit tzset() call is usually not needed as it happens
         * implicitly the first time we call localtime() or mktime(),
        /*
         * An explicit tzset() call is usually not needed as it happens
         * implicitly the first time we call localtime() or mktime(),
@@ -1990,6 +1981,10 @@ main(int argc, char **argv)
                        ndo->ndo_packet_number = 1;
                        break;
 
                        ndo->ndo_packet_number = 1;
                        break;
 
+               case OPTION_LENGTHS:
+                       ndo->ndo_lengths = 1;
+                       break;
+
                case OPTION_VERSION:
                        print_version(stdout);
                        exit_tcpdump(S_SUCCESS);
                case OPTION_VERSION:
                        print_version(stdout);
                        exit_tcpdump(S_SUCCESS);
@@ -3340,7 +3335,7 @@ print_usage(FILE *f)
 "\t\t[ -i interface ]" IMMEDIATE_MODE_USAGE j_FLAG_USAGE "\n");
 #ifdef HAVE_PCAP_FINDALLDEVS_EX
        (void)fprintf(f,
 "\t\t[ -i interface ]" IMMEDIATE_MODE_USAGE j_FLAG_USAGE "\n");
 #ifdef HAVE_PCAP_FINDALLDEVS_EX
        (void)fprintf(f,
-"\t\t" LIST_REMOTE_INTERFACES_USAGE "\n");
+"\t\t[ --lengths ]" LIST_REMOTE_INTERFACES_USAGE "\n");
 #endif
 #ifdef USE_LIBSMI
        (void)fprintf(f,
 #endif
 #ifdef USE_LIBSMI
        (void)fprintf(f,