aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-12-04 02:04:18 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-12-04 02:04:18 +0000
commite829856c0c03666c5b9b917fba4716b88fd580e6 (patch)
treee287961aad0a7a10a11809797eec33b4c5fadd30 /capture.c
parentf856dbafa830a562da34b1aaf636fb941aa5a7c9 (diff)
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
Diffstat (limited to 'capture.c')
-rw-r--r--capture.c16
1 files changed, 15 insertions, 1 deletions
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 */