Rename capture_opts_trim_iface() to
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 22 May 2013 04:49:31 +0000 (04:49 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 22 May 2013 04:49:31 +0000 (04:49 +0000)
capture_opts_default_iface_if_necessary(), to reflect what it actually
does.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@49491 f5534014-38df-0310-8fa8-9805f1628bb7

capture_opts.c
capture_opts.h
dumpcap.c
tshark.c
ui/gtk/main.c
ui/qt/main.cpp

index 3c88d282ffa72c005a447573af23c08c494835ee..785a22a5c1236688271580f3926f508bd9b5d9bd 100644 (file)
@@ -928,9 +928,12 @@ capture_opts_trim_ring_num_files(capture_options *capture_opts)
 #endif
 }
 
-
+/*
+ * If no interface was specified explicitly, pick a default.
+ */
 int
-capture_opts_trim_iface(capture_options *capture_opts, const char *capture_device)
+capture_opts_default_iface_if_necessary(capture_options *capture_opts,
+                                        const char *capture_device)
 {
     int status;
 
index b6dfa80ece59486ecc7471a8f52bebfe33b4edc5..c380b9d145ec6ac7024dbb5ee7484504320d4433 100644 (file)
@@ -252,9 +252,10 @@ capture_opts_trim_snaplen(capture_options *capture_opts, int snaplen_min);
 extern void
 capture_opts_trim_ring_num_files(capture_options *capture_opts);
 
-/* trim the interface entry */
+/* pick default interface if none was specified */
 extern int
-capture_opts_trim_iface(capture_options *capture_opts, const char *capture_device);
+capture_opts_default_iface_if_necessary(capture_options *capture_opts,
+                                        const char *capture_device);
 
 extern void
 collect_ifaces(capture_options *capture_opts);
index bea453717684184b207b45af8556f6ff25528cfd..509398c843af15a4a8aa0942946164c05ea11ccd 100644 (file)
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -4716,7 +4716,7 @@ main(int argc, char *argv[])
      * "-L", "-d", and capturing act on a particular interface, so we have to
      * have an interface; if none was specified, pick a default.
      */
-    status = capture_opts_trim_iface(&global_capture_opts, NULL);
+    status = capture_opts_default_iface_if_necessary(&global_capture_opts, NULL);
     if (status != 0) {
         /* cmdarg_err() already called .... */
         exit_main(status);
index 2481db9817c0177fcaf52d5a8090b0e240ea2ab8..a0c1991799c3e715b45ada7c0cb75686c1d836b0 100644 (file)
--- a/tshark.c
+++ b/tshark.c
@@ -1937,11 +1937,11 @@ main(int argc, char *argv[])
     }
   } else {
     /* No capture file specified, so we're supposed to do a live capture
-       (or get a list of link-layer types for a live capture device);
+       or get a list of link-layer types for a live capture device;
        do we have support for live captures? */
 #ifdef HAVE_LIBPCAP
-    /* trim the interface name and exit if that failed */
-    exit_status = capture_opts_trim_iface(&global_capture_opts,
+    /* if no interface was specified, pick a default */
+    exit_status = capture_opts_default_iface_if_necessary(&global_capture_opts,
         ((prefs_p->capture_device) && (*prefs_p->capture_device != '\0')) ? get_if_name(prefs_p->capture_device) : NULL);
     if (exit_status != 0)
         return exit_status;
index f88f5fd6b6c3065b5cfeb19b69a11792738c19a9..580642478d7f2faa9ba6cae7b2e833264310ddf3 100644 (file)
@@ -2848,8 +2848,10 @@ main(int argc, char *argv[])
   }
 
   if (start_capture || list_link_layer_types) {
-    /* Did the user specify an interface to use? */
-    status = capture_opts_trim_iface(&global_capture_opts,
+    /* We're supposed to do a live capture or get a list of link-layer
+       types for a live capture device; if the user didn't specify an
+       interface to use, pick a default. */
+    status = capture_opts_default_iface_if_necessary(&global_capture_opts,
         ((prefs_p->capture_device) && (*prefs_p->capture_device != '\0')) ? get_if_name(prefs_p->capture_device) : NULL);
     if (status != 0) {
       exit(status);
index 97bbef5db8d377c0241d66511278d066dba08c21..19679a9bb64b2de454ba0663762391193724def1 100644 (file)
@@ -905,8 +905,10 @@ int main(int argc, char *argv[])
 //  }
 
 //  if (start_capture || list_link_layer_types) {
-//    /* Did the user specify an interface to use? */
-//    status = capture_opts_trim_iface(&global_capture_opts,
+//    /* We're supposed to do a live capture or get a list of link-layer
+//       types for a live capture device; if the user didn't specify an
+//       interface to use, pick a default. */
+//    status = capture_opts_default_iface_if_necessary(&global_capture_opts,
 //        (prefs_p->capture_device) ? get_if_name(prefs_p->capture_device) : NULL);
 //    if (status != 0) {
 //      exit(status);