From 2d41b15495e245d9292ba42dd3954bdebc9f3290 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 31 Dec 2018 19:36:12 -0800 Subject: Add a "failed" return for tap packet routines. This allows taps that can fail to report an error and fail; a failed tap's packet routine won't be called again, so they don't have to keep track of whether they've failed themselves. We make the return value from the packet routine an enum. Don't have a separate type for the per-packet routine for "follow" taps; they're expected to act like tap packet routines, so just use the type for tap packet routines. One tap packet routine returned -1; that's not a valid return value, and wasn't one before this change (the return value was a boolean), so presume the intent was "don't redraw". Another tap routine's early return, without doing any work, returned TRUE; this is presumably an error (no work done, no need to redraw), so presumably it should be "don't redraw". Clean up some white space while we're at it. Change-Id: Ia7d2b717b2cace4b13c2b886e699aa4d79cc82c8 Reviewed-on: https://code.wireshark.org/review/31283 Reviewed-by: Guy Harris --- epan/dissectors/packet-camel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'epan/dissectors/packet-camel.c') diff --git a/epan/dissectors/packet-camel.c b/epan/dissectors/packet-camel.c index c5b568835a..8390548341 100644 --- a/epan/dissectors/packet-camel.c +++ b/epan/dissectors/packet-camel.c @@ -1318,7 +1318,7 @@ camelstat_init(struct register_srt* srt _U_, GArray* srt_array) } } -static gboolean +static tap_packet_status camelstat_packet(void *pcamel, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi) { guint idx = 0; @@ -1337,7 +1337,7 @@ camelstat_packet(void *pcamel, packet_info *pinfo, epan_dissect_t *edt _U_, cons add_srt_table_data(camel_srt_table, i, &pi->msginfo[i].req_time, pinfo); } } /* category */ - return TRUE; + return TAP_PACKET_REDRAW; } @@ -8255,7 +8255,7 @@ static void camel_stat_init(stat_tap_table_ui* new_stat) } } -static gboolean +static tap_packet_status camel_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *csi_ptr) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -8266,12 +8266,12 @@ camel_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_ table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i); if (csi->opcode >= table->num_elements) - return FALSE; + return TAP_PACKET_DONT_REDRAW; msg_data = stat_tap_get_field_data(table, csi->opcode, COUNT_COLUMN); msg_data->value.uint_value++; stat_tap_set_field_data(table, csi->opcode, COUNT_COLUMN, msg_data); - return TRUE; + return TAP_PACKET_REDRAW; } static void -- cgit v1.2.3