]> The Tcpdump Group git mirrors - tcpdump/blobdiff - tcpdump.c
Merge pull request #467 from wessels/master
[tcpdump] / tcpdump.c
index d2df06a69c53b51c0f7afa3b6a0644f216b432bd..13becf7ee69a9b31a5614c65b47da91f02a31011 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -58,7 +58,6 @@ The Regents of the University of California.  All rights reserved.\n";
 
 #ifdef WIN32
 #include "w32_fzs.h"
-extern int strcasecmp (const char *__s1, const char *__s2);
 extern int SIZE_BUF;
 #define off_t long
 #define uint UINT
@@ -121,6 +120,7 @@ extern int SIZE_BUF;
 #include "setsignal.h"
 #include "gmt2local.h"
 #include "pcap-missing.h"
+#include "ascii_strcasecmp.h"
 
 #include "print.h"
 
@@ -996,11 +996,11 @@ main(int argc, char **argv)
 
 #ifdef HAVE_PCAP_SETDIRECTION
                case 'Q':
-                       if (strcasecmp(optarg, "in") == 0)
+                       if (ascii_strcasecmp(optarg, "in") == 0)
                                Qflag = PCAP_D_IN;
-                       else if (strcasecmp(optarg, "out") == 0)
+                       else if (ascii_strcasecmp(optarg, "out") == 0)
                                Qflag = PCAP_D_OUT;
-                       else if (strcasecmp(optarg, "inout") == 0)
+                       else if (ascii_strcasecmp(optarg, "inout") == 0)
                                Qflag = PCAP_D_INOUT;
                        else
                                error("unknown capture direction `%s'", optarg);
@@ -1033,37 +1033,37 @@ main(int argc, char **argv)
                        break;
 
                case 'T':
-                       if (strcasecmp(optarg, "vat") == 0)
+                       if (ascii_strcasecmp(optarg, "vat") == 0)
                                ndo->ndo_packettype = PT_VAT;
-                       else if (strcasecmp(optarg, "wb") == 0)
+                       else if (ascii_strcasecmp(optarg, "wb") == 0)
                                ndo->ndo_packettype = PT_WB;
-                       else if (strcasecmp(optarg, "rpc") == 0)
+                       else if (ascii_strcasecmp(optarg, "rpc") == 0)
                                ndo->ndo_packettype = PT_RPC;
-                       else if (strcasecmp(optarg, "rtp") == 0)
+                       else if (ascii_strcasecmp(optarg, "rtp") == 0)
                                ndo->ndo_packettype = PT_RTP;
-                       else if (strcasecmp(optarg, "rtcp") == 0)
+                       else if (ascii_strcasecmp(optarg, "rtcp") == 0)
                                ndo->ndo_packettype = PT_RTCP;
-                       else if (strcasecmp(optarg, "snmp") == 0)
+                       else if (ascii_strcasecmp(optarg, "snmp") == 0)
                                ndo->ndo_packettype = PT_SNMP;
-                       else if (strcasecmp(optarg, "cnfp") == 0)
+                       else if (ascii_strcasecmp(optarg, "cnfp") == 0)
                                ndo->ndo_packettype = PT_CNFP;
-                       else if (strcasecmp(optarg, "tftp") == 0)
+                       else if (ascii_strcasecmp(optarg, "tftp") == 0)
                                ndo->ndo_packettype = PT_TFTP;
-                       else if (strcasecmp(optarg, "aodv") == 0)
+                       else if (ascii_strcasecmp(optarg, "aodv") == 0)
                                ndo->ndo_packettype = PT_AODV;
-                       else if (strcasecmp(optarg, "carp") == 0)
+                       else if (ascii_strcasecmp(optarg, "carp") == 0)
                                ndo->ndo_packettype = PT_CARP;
-                       else if (strcasecmp(optarg, "radius") == 0)
+                       else if (ascii_strcasecmp(optarg, "radius") == 0)
                                ndo->ndo_packettype = PT_RADIUS;
-                       else if (strcasecmp(optarg, "zmtp1") == 0)
+                       else if (ascii_strcasecmp(optarg, "zmtp1") == 0)
                                ndo->ndo_packettype = PT_ZMTP1;
-                       else if (strcasecmp(optarg, "vxlan") == 0)
+                       else if (ascii_strcasecmp(optarg, "vxlan") == 0)
                                ndo->ndo_packettype = PT_VXLAN;
-                       else if (strcasecmp(optarg, "pgm") == 0)
+                       else if (ascii_strcasecmp(optarg, "pgm") == 0)
                                ndo->ndo_packettype = PT_PGM;
-                       else if (strcasecmp(optarg, "pgm_zmtp1") == 0)
+                       else if (ascii_strcasecmp(optarg, "pgm_zmtp1") == 0)
                                ndo->ndo_packettype = PT_PGM_ZMTP1;
-                       else if (strcasecmp(optarg, "lmp") == 0)
+                       else if (ascii_strcasecmp(optarg, "lmp") == 0)
                                ndo->ndo_packettype = PT_LMP;
                        else
                                error("unknown packet type `%s'", optarg);
@@ -1697,8 +1697,6 @@ main(int argc, char **argv)
        cansandbox = (ndo->ndo_nflag && VFileName == NULL && zflag == NULL);
        if (cansandbox && cap_enter() < 0 && errno != ENOSYS)
                error("unable to enter the capability mode");
-       if (cap_sandboxed())
-               fprintf(stderr, "capability mode sandbox enabled\n");
 #endif /* HAVE_CAPSICUM */
 
        do {