aboutsummaryrefslogtreecommitdiffstats
path: root/epan/follow.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-12-31 19:36:12 -0800
committerGuy Harris <guy@alum.mit.edu>2019-01-01 05:03:42 +0000
commit2d41b15495e245d9292ba42dd3954bdebc9f3290 (patch)
tree40282b7aab9f1347489126dd98974a681dca888f /epan/follow.h
parentba589a4e445a8ad8054073eff846087fc61c9ef8 (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/follow.h')
-rw-r--r--epan/follow.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/follow.h b/epan/follow.h
index 81ce435a8b..a841273825 100644
--- a/epan/follow.h
+++ b/epan/follow.h
@@ -20,6 +20,7 @@ extern "C" {
#include <epan/epan.h>
#include <epan/packet.h>
#include <epan/ipv6.h>
+#include <epan/tap.h>
#include <epan/wmem/wmem.h>
#include "ws_symbol_export.h"
@@ -102,12 +103,11 @@ typedef gchar* (*follow_conv_filter_func)(packet_info* pinfo, int* stream);
typedef gchar* (*follow_index_filter_func)(int stream);
typedef gchar* (*follow_address_filter_func)(address* src_addr, address* dst_addr, int src_port, int dst_port);
typedef gchar* (*follow_port_to_display_func)(wmem_allocator_t *allocator, guint port);
-typedef gboolean (*follow_tap_func)(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data);
WS_DLL_PUBLIC
void register_follow_stream(const int proto_id, const char* tap_listener,
follow_conv_filter_func conv_filter, follow_index_filter_func index_filter, follow_address_filter_func address_filter,
- follow_port_to_display_func port_to_display, follow_tap_func tap_handler);
+ follow_port_to_display_func port_to_display, tap_packet_cb tap_handler);
/** Get protocol ID from registered follower
*
@@ -161,15 +161,15 @@ WS_DLL_PUBLIC follow_port_to_display_func get_follow_port_to_display(register_fo
/** Provide function that handles tap data (tap_packet_cb parameter of register_tap_listener)
*
* @param follower [in] Registered follower
- * @return A tap data handler
+ * @return A tap packet handler
*/
-WS_DLL_PUBLIC follow_tap_func get_follow_tap_handler(register_follow_t* follower);
+WS_DLL_PUBLIC tap_packet_cb get_follow_tap_handler(register_follow_t* follower);
/** Tap function handler when dissector's tap provides follow data as a tvb.
* Used by TCP, UDP and HTTP followers
*/
-WS_DLL_PUBLIC gboolean
+WS_DLL_PUBLIC tap_packet_status
follow_tvb_tap_listener(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data);
/** Interator to walk all registered followers and execute func