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-bacapp.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-bacapp.c')
-rw-r--r-- | epan/dissectors/packet-bacapp.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/epan/dissectors/packet-bacapp.c b/epan/dissectors/packet-bacapp.c index da6a20776a..939875e6c5 100644 --- a/epan/dissectors/packet-bacapp.c +++ b/epan/dissectors/packet-bacapp.c @@ -6189,7 +6189,7 @@ bacapp_get_address_label(const char *tag, address *addr) return label_str; } -static int +static tap_packet_status bacapp_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t* edt _U_, const void* p) { int packets_for_this_dst; @@ -6230,7 +6230,7 @@ bacapp_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t* edt wmem_free(NULL, srcstr); wmem_free(NULL, dststr); - return 1; + return TAP_PACKET_REDRAW; } /* Stat: BACnet Packets sorted by Service */ @@ -6243,7 +6243,7 @@ bacapp_service_stats_tree_init(stats_tree* st) st_node_packets_by_service = stats_tree_create_pivot(st, st_str_packets_by_service, 0); } -static int +static tap_packet_status bacapp_stats_tree_service(stats_tree* st, packet_info* pinfo, epan_dissect_t* edt _U_, const void* p) { int servicetype; @@ -6272,7 +6272,7 @@ bacapp_stats_tree_service(stats_tree* st, packet_info* pinfo, epan_dissect_t* ed wmem_free(NULL, srcstr); wmem_free(NULL, dststr); - return 1; + return TAP_PACKET_REDRAW; } /* Stat: BACnet Packets sorted by Object Type */ @@ -6285,7 +6285,7 @@ bacapp_objectid_stats_tree_init(stats_tree* st) st_node_packets_by_objectid = stats_tree_create_pivot(st, st_str_packets_by_objectid, 0); } -static int +static tap_packet_status bacapp_stats_tree_objectid(stats_tree* st, packet_info* pinfo, epan_dissect_t* edt _U_, const void* p) { int servicetype; @@ -6313,7 +6313,7 @@ bacapp_stats_tree_objectid(stats_tree* st, packet_info* pinfo, epan_dissect_t* e wmem_free(NULL, srcstr); wmem_free(NULL, dststr); - return 1; + return TAP_PACKET_REDRAW; } /* Stat: BACnet Packets sorted by Instance No */ @@ -6326,7 +6326,7 @@ bacapp_instanceid_stats_tree_init(stats_tree* st) st_node_packets_by_instanceid = stats_tree_create_pivot(st, st_str_packets_by_instanceid, 0); } -static int +static tap_packet_status bacapp_stats_tree_instanceid(stats_tree* st, packet_info* pinfo, epan_dissect_t* edt _U_, const void* p) { int servicetype; @@ -6354,7 +6354,7 @@ bacapp_stats_tree_instanceid(stats_tree* st, packet_info* pinfo, epan_dissect_t* wmem_free(NULL, srcstr); wmem_free(NULL, dststr); - return 1; + return TAP_PACKET_REDRAW; } |