diff options
author | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-04-01 21:55:01 +0000 |
---|---|---|
committer | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-04-01 21:55:01 +0000 |
commit | 734b51599ef4981aa341330a5c60a5e52e8807c7 (patch) | |
tree | ff46a91b7d856f44d11317046d270906f9b538ef /capture.c | |
parent | 302cfefe80cf784a353238fbbb1692ce461fcb20 (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32357 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture.c')
-rw-r--r-- | capture.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -133,7 +133,7 @@ gboolean capture_start(capture_options *capture_opts) { gboolean ret; - + GString *source = g_string_new(""); /* close the currently loaded capture file */ cf_close(capture_opts->cf); @@ -143,6 +143,13 @@ 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); + } + cf_set_tempfile_source(capture_opts->cf, source->str); + g_string_free(source, TRUE); + /* try to start the capture child process */ ret = sync_pipe_start(capture_opts); if(!ret) { @@ -209,13 +216,12 @@ guint32 drops) { int err; - /* Capture succeeded; attempt to open the capture file. */ if (cf_open(capture_opts->cf, capture_opts->save_file, is_tempfile, &err) != CF_OK) { /* We're not doing a capture any more, so we don't have a save file. */ return FALSE; } - + /* Set the read filter to NULL. */ /* XXX - this is odd here; try to put it somewhere where it fits better */ cf_set_rfcode(capture_opts->cf, NULL); @@ -301,7 +307,6 @@ capture_input_new_file(capture_options *capture_opts, gchar *new_file) gboolean is_tempfile; int err; - if(capture_opts->state == CAPTURE_PREPARING) { g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture started!"); } |