diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-12-31 19:36:12 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-01-01 05:03:42 +0000 |
commit | 2d41b15495e245d9292ba42dd3954bdebc9f3290 (patch) | |
tree | 40282b7aab9f1347489126dd98974a681dca888f /epan/dissectors/packet-ansi_a.c | |
parent | ba589a4e445a8ad8054073eff846087fc61c9ef8 (diff) |
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 <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-ansi_a.c')
-rw-r--r-- | epan/dissectors/packet-ansi_a.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c index 4d791d351c..955e1c8a3a 100644 --- a/epan/dissectors/packet-ansi_a.c +++ b/epan/dissectors/packet-ansi_a.c @@ -10597,7 +10597,7 @@ static void ansi_a_dtap_stat_init(stat_tap_table_ui* new_stat) } } -static gboolean +static tap_packet_status ansi_a_dtap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -10609,7 +10609,7 @@ ansi_a_dtap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *e if (data_p->pdu_type == BSSAP_PDU_TYPE_DTAP) { if (my_try_val_to_str_idx(data_p->message_type, ansi_a_dtap_strings, &idx) == NULL) - return FALSE; + return TAP_PACKET_DONT_REDRAW; table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i); @@ -10617,10 +10617,10 @@ ansi_a_dtap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *e dtap_data->value.uint_value++; stat_tap_set_field_data(table, data_p->message_type, COUNT_COLUMN, dtap_data); - return TRUE; + return TAP_PACKET_REDRAW; } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } static void @@ -10665,7 +10665,7 @@ static void ansi_a_bsmap_stat_init(stat_tap_table_ui* new_stat) } } -static gboolean +static tap_packet_status ansi_a_bsmap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -10677,7 +10677,7 @@ ansi_a_bsmap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t * if (data_p->pdu_type == BSSAP_PDU_TYPE_BSMAP) { if (my_try_val_to_str_idx(data_p->message_type, ansi_a_bsmap_strings, &idx) == NULL) - return FALSE; + return TAP_PACKET_DONT_REDRAW; table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i); @@ -10685,10 +10685,10 @@ ansi_a_bsmap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t * dtap_data->value.uint_value++; stat_tap_set_field_data(table, data_p->message_type, COUNT_COLUMN, dtap_data); - return TRUE; + return TAP_PACKET_REDRAW; } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /* Register the protocol with Wireshark */ |