Add -A as command line option to wireshark and tshark.
authorIrene Rüngeler <I.Ruengeler@fh-muenster.de>
Wed, 8 Aug 2012 14:30:55 +0000 (14:30 -0000)
committerIrene Rüngeler <I.Ruengeler@fh-muenster.de>
Wed, 8 Aug 2012 14:30:55 +0000 (14:30 -0000)
svn path=/trunk/; revision=44339

tshark.c
ui/gtk/main.c

index 10d55a5143aa486c17388ae46df3b6e25b27ba33..c7bf0095c955ba2992b0758665d9c7e3ec713736 100644 (file)
--- a/tshark.c
+++ b/tshark.c
@@ -270,7 +270,10 @@ print_usage(gboolean print_ver)
   fprintf(output, "                           filesize:NUM - switch to next file after NUM KB\n");
   fprintf(output, "                              files:NUM - ringbuffer: replace after NUM files\n");
 #endif  /* HAVE_LIBPCAP */
-
+#ifdef HAVE_PCAP_REMOTE
+  fprintf(output, "RPCAP options:\n");
+  fprintf(output, "  -A <user>:<password>     use RPCAP password authentication\n");
+#endif
   /*fprintf(output, "\n");*/
   fprintf(output, "Input file:\n");
   fprintf(output, "  -r <infile>              set the filename to read from (no pipes or stdin!)\n");
@@ -840,6 +843,11 @@ main(int argc, char *argv[])
   int                  optind_initial;
   gchar               *output_only = NULL;
 
+#ifdef HAVE_PCAP_REMOTE
+#define OPTSTRING_A "A:"
+#else
+#define OPTSTRING_A ""
+#endif
 #ifdef HAVE_LIBPCAP
 #if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
 #define OPTSTRING_B "B:"
@@ -856,7 +864,7 @@ main(int argc, char *argv[])
 #define OPTSTRING_I ""
 #endif
 
-#define OPTSTRING "2a:A:b:" OPTSTRING_B "c:C:d:De:E:f:F:G:hH:i:" OPTSTRING_I "K:lLnN:o:O:pPqr:R:s:S:t:T:u:vVw:W:xX:y:z:"
+#define OPTSTRING "2a:" OPTSTRING_A "b:" OPTSTRING_B "c:C:d:De:E:f:F:G:hH:i:" OPTSTRING_I "K:lLnN:o:O:pPqr:R:s:S:t:T:u:vVw:W:xX:y:z:"
 
   static const char    optstring[] = OPTSTRING;
 
@@ -1094,6 +1102,9 @@ main(int argc, char *argv[])
     case 'f':        /* capture filter */
     case 'i':        /* Use interface x */
     case 'p':        /* Don't capture in promiscuous mode */
+#ifdef HAVE_PCAP_REMOTE
+    case 'A':        /* Authentication */
+#endif
 #ifdef HAVE_PCAP_CREATE
     case 'I':        /* Capture in monitor mode, if available */
 #endif
index 6c90932a91ef0c3957427b992bd0b98f52f6cb57..9563b2259887459a0befa55242cd2f2127395326 100644 (file)
@@ -1184,7 +1184,10 @@ print_usage(gboolean print_ver) {
   fprintf(output, "                           filesize:NUM - switch to next file after NUM KB\n");
   fprintf(output, "                              files:NUM - ringbuffer: replace after NUM files\n");
 #endif  /* HAVE_LIBPCAP */
-
+#ifdef HAVE_PCAP_REMOTE
+  fprintf(output, "RPCAP options:\n");
+  fprintf(output, "  -A <user>:<password>     use RPCAP password authentication\n");
+#endif
   /*fprintf(output, "\n");*/
   fprintf(output, "Input file:\n");
   fprintf(output, "  -r <infile>              set the filename to read from (no pipes or stdin!)\n");
@@ -2217,14 +2220,18 @@ main(int argc, char *argv[])
 #else /* HAVE_LIBPCAP */
 #define OPTSTRING_B ""
 #endif  /* HAVE_LIBPCAP */
-
+#ifdef HAVE_PCAP_REMOTE
+#define OPTSTRING_A "A:"
+#else
+#define OPTSTRING_A ""
+#endif
 #ifdef HAVE_PCAP_CREATE
 #define OPTSTRING_I "I"
 #else
 #define OPTSTRING_I ""
 #endif
 
-#define OPTSTRING "a:b:" OPTSTRING_B "c:C:d:Df:g:Hhi:" OPTSTRING_I "jJ:kK:lLm:nN:o:P:pr:R:Ss:t:u:vw:X:y:z:"
+#define OPTSTRING "a:" OPTSTRING_A "b:" OPTSTRING_B "c:C:d:Df:g:Hhi:" OPTSTRING_I "jJ:kK:lLm:nN:o:P:pr:R:Ss:t:u:vw:X:y:z:"
 
   static const char optstring[] = OPTSTRING;
 
@@ -2604,6 +2611,9 @@ main(int argc, char *argv[])
       case 'i':        /* Use interface x */
 #ifdef HAVE_PCAP_CREATE
       case 'I':        /* Capture in monitor mode, if available */
+#endif
+#ifdef HAVE_PCAP_REMOTE
+      case 'A':        /* Authentication */
 #endif
       case 's':        /* Set the snapshot (capture) length */
       case 'S':        /* "Sync" mode: used for following file ala tail -f */