From e829856c0c03666c5b9b917fba4716b88fd580e6 Mon Sep 17 00:00:00 2001 From: Ulf Lamping Date: Sun, 4 Dec 2005 02:04:18 +0000 Subject: move the complete functionality of the capture info dialog from capture_loop.c to capture_info.c and call it from capture.c (instead of capture_loop.c). This way, the capture child don't need to now any of the packet_counter things (no epan/packet.h and all alike). Currently the capture_info code will always open another wiretap file instance to build it's own counter values. This isn't optimized for now (next step: use data from cf_continue_tail() somehow). svn path=/trunk/; revision=16669 --- capture.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'capture.c') diff --git a/capture.c b/capture.c index 074acc3fe7..f1cb5501aa 100644 --- a/capture.c +++ b/capture.c @@ -52,6 +52,7 @@ #include "file.h" #include "capture.h" #include "capture_sync.h" +#include "capture_info.h" #include "capture_ui_utils.h" #include "util.h" #include "pcap-util.h" @@ -105,6 +106,9 @@ capture_start(capture_options *capture_opts) /* to prevent problems, bring the main GUI into "capture mode" right after successfully */ /* spawn/exec the capture child, without waiting for any response from it */ cf_callback_invoke(cf_cb_live_capture_prepared, capture_opts); + + if(capture_opts->show_info) + capture_info_open(capture_opts->iface); } return ret; @@ -293,6 +297,9 @@ capture_input_new_file(capture_options *capture_opts, gchar *new_file) cf_callback_invoke(cf_cb_live_capture_fixed_started, capture_opts); } + if(capture_opts->show_info) + capture_info_new_file(new_file); + capture_opts->state = CAPTURE_RUNNING; return TRUE; @@ -320,7 +327,8 @@ capture_input_new_packets(capture_options *capture_opts, int to_read) XXX - abort on a read error? */ cf_callback_invoke(cf_cb_live_capture_update_continue, capture_opts->cf); - /* update the main window, so we get events (e.g. from the stop toolbar button) */ + + /* update the main window, so we get events (e.g. from the stop toolbar button) */ main_window_update(); break; @@ -331,6 +339,9 @@ capture_input_new_packets(capture_options *capture_opts, int to_read) break; } } + + if(capture_opts->show_info) + capture_info_new_packets(to_read); } @@ -441,6 +452,9 @@ capture_input_closed(capture_options *capture_opts) } } + if(capture_opts->show_info) + capture_info_close(); + capture_opts->state = CAPTURE_STOPPED; /* if we couldn't open a capture file, there's nothing more for us to do */ -- cgit v1.2.3