aboutsummaryrefslogtreecommitdiffstats
path: root/capture_ui_utils.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2010-04-01 21:55:01 +0000
committerGerald Combs <gerald@wireshark.org>2010-04-01 21:55:01 +0000
commitcc5d7670bde3072fdc4aa738c7643e50133c2cb2 (patch)
treeff46a91b7d856f44d11317046d270906f9b538ef /capture_ui_utils.c
parentdc5e066caedd01323d815c60a8c988263bdd9619 (diff)
Keep a copy of the interface description and capture filter around so that
we can use it in the main window title during and after capture. Add a "-X" option for providing a description for stdin. svn path=/trunk/; revision=32357
Diffstat (limited to 'capture_ui_utils.c')
-rw-r--r--capture_ui_utils.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/capture_ui_utils.c b/capture_ui_utils.c
index f64e638993..f6ff8c3fb8 100644
--- a/capture_ui_utils.c
+++ b/capture_ui_utils.c
@@ -34,7 +34,8 @@
#include <ctype.h>
#include <glib.h>
-#include <epan/prefs.h>
+#include "epan/prefs.h"
+#include "epan/ex-opt.h"
#include "capture_ifinfo.h"
#include "capture_ui_utils.h"
@@ -155,6 +156,11 @@ get_interface_descriptive_name(const char *if_name)
if (descr != NULL) {
/* Yes - make a copy of that. */
descr = g_strdup(descr);
+ } else if (strcmp(if_name, "-") == 0) {
+ descr = g_strdup(ex_opt_get_nth("stdin_descr", 0));
+ if (!descr) {
+ descr = g_strdup("Standard input");
+ }
} else {
/* No, we don't have a user-supplied description; did we get
one from the OS or libpcap? */