diff options
-rw-r--r-- | capture.h | 40 | ||||
-rw-r--r-- | capture_sync.h | 46 | ||||
-rw-r--r-- | tshark.c | 7 |
3 files changed, 50 insertions, 43 deletions
@@ -80,46 +80,6 @@ capture_restart(capture_session *cap_session); extern void capture_kill_child(capture_session *cap_session); -/** - * Capture child told us we have a new (or the first) capture file. - */ -extern gboolean -capture_input_new_file(capture_session *cap_session, gchar *new_file); - -/** - * Capture child told us we have new packets to read. - */ -extern void -capture_input_new_packets(capture_session *cap_session, int to_read); - -/** - * Capture child told us how many dropped packets it counted. - */ -extern void -capture_input_drops(capture_session *cap_session, guint32 dropped); - -/** - * Capture child told us that an error has occurred while starting the capture. - */ -extern void -capture_input_error_message(capture_session *cap_session, char *error_message, - char *secondary_error_msg); - -/** - * Capture child told us that an error has occurred while parsing a - * capture filter when starting/running the capture. - */ -extern void -capture_input_cfilter_error_message(capture_session *cap_session, guint i, - char *error_message); - -/** - * Capture child closed its side of the pipe, report any error and - * do the required cleanup. - */ -extern void -capture_input_closed(capture_session *cap_session, gchar *msg); - struct if_stat_cache_s; typedef struct if_stat_cache_s if_stat_cache_t; diff --git a/capture_sync.h b/capture_sync.h index f8e6f63e6d..337abc5819 100644 --- a/capture_sync.h +++ b/capture_sync.h @@ -86,5 +86,51 @@ sync_interface_stats_close(int *read_fd, int *fork_child, gchar **msg); extern int sync_pipe_gets_nonblock(int pipe_fd, char *bytes, int max); +/* + * Routines supplied by our caller; we call them back to notify them + * of various events. + * + * XXX - this is *really* ugly. We should do this better. + */ + +/** + * Capture child told us we have a new (or the first) capture file. + */ +extern gboolean +capture_input_new_file(capture_session *cap_session, gchar *new_file); + +/** + * Capture child told us we have new packets to read. + */ +extern void +capture_input_new_packets(capture_session *cap_session, int to_read); + +/** + * Capture child told us how many dropped packets it counted. + */ +extern void +capture_input_drops(capture_session *cap_session, guint32 dropped); + +/** + * Capture child told us that an error has occurred while starting the capture. + */ +extern void +capture_input_error_message(capture_session *cap_session, char *error_message, + char *secondary_error_msg); + +/** + * Capture child told us that an error has occurred while parsing a + * capture filter when starting/running the capture. + */ +extern void +capture_input_cfilter_error_message(capture_session *cap_session, guint i, + char *error_message); + +/** + * Capture child closed its side of the pipe, report any error and + * do the required cleanup. + */ +extern void +capture_input_closed(capture_session *cap_session, gchar *msg); #endif /* capture_sync.h */ @@ -2350,7 +2350,7 @@ void main_window_update(void) /* capture child detected an error */ void -capture_input_error_message(capture_options *capture_opts _U_, char *error_msg, char *secondary_error_msg) +capture_input_error_message(capture_session *cap_session _U_, char *error_msg, char *secondary_error_msg) { cmdarg_err("%s", error_msg); cmdarg_err_cont("%s", secondary_error_msg); @@ -2359,8 +2359,9 @@ capture_input_error_message(capture_options *capture_opts _U_, char *error_msg, /* capture child detected an capture filter related error */ void -capture_input_cfilter_error_message(capture_options *capture_opts, guint i, char *error_message) +capture_input_cfilter_error_message(capture_session *cap_session, guint i, char *error_message) { + capture_options *capture_opts = cap_session->capture_opts; dfilter_t *rfcode = NULL; interface_options interface_opts; @@ -2558,7 +2559,7 @@ report_counts_siginfo(int signum _U_) /* capture child detected any packet drops? */ void -capture_input_drops(capture_options *capture_opts _U_, guint32 dropped) +capture_input_drops(capture_session *cap_session _U_, guint32 dropped) { if (print_packet_counts) { /* We're printing packet counts to stderr. |