diff options
-rw-r--r-- | capture.c | 4 | ||||
-rw-r--r-- | capture.h | 2 | ||||
-rw-r--r-- | capture_sync.c | 2 | ||||
-rw-r--r-- | dumpcap.c | 10 | ||||
-rw-r--r-- | tshark.c | 24 |
5 files changed, 21 insertions, 21 deletions
@@ -446,9 +446,9 @@ capture_input_new_packets(capture_options *capture_opts, int to_read) /* Capture child told us how many dropped packets it counted. */ void -capture_input_drops(capture_options *capture_opts, int dropped) +capture_input_drops(capture_options *capture_opts, guint32 dropped) { - g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_INFO, "%d packet%s dropped", dropped, plurality(dropped, "", "s")); + g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_INFO, "%u packet%s dropped", dropped, plurality(dropped, "", "s")); g_assert(capture_opts->state == CAPTURE_RUNNING); @@ -83,7 +83,7 @@ extern void capture_input_new_packets(capture_options *capture_opts, int to_read /** * Capture child told us how many dropped packets it counted. */ -extern void capture_input_drops(capture_options *capture_opts, int dropped); +extern void capture_input_drops(capture_options *capture_opts, guint32 dropped); /** * Capture child told us that an error has occurred while starting the capture. diff --git a/capture_sync.c b/capture_sync.c index 489c4f7762..ba819677c1 100644 --- a/capture_sync.c +++ b/capture_sync.c @@ -1227,7 +1227,7 @@ sync_pipe_input_cb(gint source, gpointer user_data) /* the capture child will close the sync_pipe, nothing to do for now */ break; case SP_DROPS: - capture_input_drops(capture_opts, atoi(buffer)); + capture_input_drops(capture_opts, (guint32)strtoul(buffer, NULL, 10)); break; default: g_assert_not_reached(); @@ -259,7 +259,7 @@ static void exit_main(int err); static void report_new_capture_file(const char *filename); static void report_packet_count(int packet_count); -static void report_packet_drops(int drops); +static void report_packet_drops(guint32 drops); static void report_capture_error(const char *error_msg, const char *secondary_error_msg); static void report_cfilter_error(const char *cfilter, const char *errmsg); @@ -460,10 +460,10 @@ print_statistics_loop(gboolean machine_readable) pcap_stats(if_stat->pch, &ps); if (!machine_readable) { - printf("%-15s %10d %10d\n", if_stat->name, + printf("%-15s %10u %10u\n", if_stat->name, ps.ps_recv, ps.ps_drop); } else { - printf("%s\t%d\t%d\n", if_stat->name, + printf("%s\t%u\t%u\n", if_stat->name, ps.ps_recv, ps.ps_drop); fflush(stdout); } @@ -2869,11 +2869,11 @@ report_capture_error(const char *error_msg, const char *secondary_error_msg) } void -report_packet_drops(int drops) +report_packet_drops(guint32 drops) { char tmp[SP_DECISIZE+1+1]; - g_snprintf(tmp, sizeof(tmp), "%d", drops); + g_snprintf(tmp, sizeof(tmp), "%u", drops); if(capture_child) { g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG, "Packets dropped: %s", tmp); @@ -2075,19 +2075,19 @@ report_counts_siginfo(int signum _U_) /* capture child detected any packet drops? */ void -capture_input_drops(capture_options *capture_opts _U_, int dropped) +capture_input_drops(capture_options *capture_opts _U_, guint32 dropped) { - if (print_packet_counts) { - /* We're printing packet counts to stderr. - Send a newline so that we move to the line after the packet count. */ - fprintf(stderr, "\n"); - } - - if(dropped != 0) { - /* We're printing packet counts to stderr. - Send a newline so that we move to the line after the packet count. */ - fprintf(stderr, "%u packet%s dropped\n", dropped, plurality(dropped, "", "s")); - } + if (print_packet_counts) { + /* We're printing packet counts to stderr. + Send a newline so that we move to the line after the packet count. */ + fprintf(stderr, "\n"); + } + + if (dropped != 0) { + /* We're printing packet counts to stderr. + Send a newline so that we move to the line after the packet count. */ + fprintf(stderr, "%u packet%s dropped\n", dropped, plurality(dropped, "", "s")); + } } |