diff options
author | Michael Tüxen <tuexen@fh-muenster.de> | 2011-05-19 12:19:03 +0000 |
---|---|---|
committer | Michael Tüxen <tuexen@fh-muenster.de> | 2011-05-19 12:19:03 +0000 |
commit | 307d7e8c3cb6836c51ee0e65eb9feca34b3e4967 (patch) | |
tree | 0a8a64e81d15dbd43d0377ca42d0114ff7db620c /capture.c | |
parent | 1d19739c9ff61eb75faf719515706597220f0558 (diff) | |
download | wireshark-307d7e8c3cb6836c51ee0e65eb9feca34b3e4967.tar.gz |
When capturing from multiple interfaces, indicate this in the window
title of the wireshark main window.
svn path=/trunk/; revision=37289
Diffstat (limited to 'capture.c')
-rw-r--r-- | capture.c | 30 |
1 files changed, 27 insertions, 3 deletions
@@ -133,6 +133,7 @@ gboolean capture_start(capture_options *capture_opts) { gboolean ret; + guint i; GString *source = g_string_new(""); if (capture_opts->state != CAPTURE_STOPPED) @@ -144,9 +145,32 @@ capture_start(capture_options *capture_opts) g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Start ..."); - g_string_printf(source, "%s", get_iface_description(capture_opts)); - if(capture_opts->cfilter && capture_opts->cfilter[0]) { - g_string_append_printf(source, " (%s)", capture_opts->cfilter); +#ifdef _WIN32 + if (capture_opts->ifaces->len < 2) { +#else + if (capture_opts->ifaces->len < 4) { +#endif + for (i = 0; i < capture_opts->ifaces->len; i++) { + interface_options interface_opts; + + interface_opts = g_array_index(capture_opts->ifaces, interface_options, i); + if (i > 0) { + if (capture_opts->ifaces->len > 2) { + g_string_append_printf(source, ","); + } + g_string_append_printf(source, " "); + if (i == capture_opts->ifaces->len - 1) { + g_string_append_printf(source, "and "); + } + } + g_string_append_printf(source, "%s", get_iface_description_for_interface(capture_opts, i)); + if ((interface_opts.cfilter != NULL) && + (strlen(interface_opts.cfilter) > 0)) { + g_string_append_printf(source, " (%s)", interface_opts.cfilter); + } + } + } else { + g_string_append_printf(source, "%u interfaces", capture_opts->ifaces->len); } cf_set_tempfile_source(capture_opts->cf, source->str); g_string_free(source, TRUE); |