AAAAAArgh. The capture_input_new_XXX routines are called from

capture_sync.c, not from capture.c, so they should be declared in
capture_sync.h, so callers that use the capture_sync.c stuff but not the
capture.c stuff - such as TShark - get the declarations and get their
implementations compared with the signatures that they should have.

Doing so points out that some of them in TShark *don't*, so fix that.

svn path=/trunk/; revision=49517
This commit is contained in:
Guy Harris 2013-05-22 19:14:52 +00:00
parent 491b512399
commit 9ac21fd6cc
3 changed files with 50 additions and 43 deletions

View File

@ -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;

View File

@ -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 */

View File

@ -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.