aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gtp.c
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/dissectors/packet-gtp.c
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/dissectors/packet-gtp.c')
-rw-r--r--epan/dissectors/packet-gtp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c
index bfe432e6e9..5a5c8cb8f3 100644
--- a/epan/dissectors/packet-gtp.c
+++ b/epan/dissectors/packet-gtp.c
@@ -2088,7 +2088,7 @@ gtpstat_init(struct register_srt* srt _U_, GArray* srt_array)
init_srt_table_row(gtp_srt_table, 3, "Delete PDP context");
}
-static int
+static tap_packet_status
gtpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv)
{
guint i = 0;
@@ -2099,11 +2099,11 @@ gtpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
/* we are only interested in reply packets */
if(gtp->is_request){
- return 0;
+ return TAP_PACKET_DONT_REDRAW;
}
/* if we have not seen the request, just ignore it */
if(!gtp->req_frame){
- return 0;
+ return TAP_PACKET_DONT_REDRAW;
}
/* Only use the commands we know how to handle, this is not a comprehensive list */
@@ -2122,13 +2122,13 @@ gtpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
case GTP_MSG_DELETE_PDP_REQ: idx=3;
break;
default:
- return 0;
+ return TAP_PACKET_DONT_REDRAW;
}
gtp_srt_table = g_array_index(data->srt_array, srt_stat_table*, i);
add_srt_table_data(gtp_srt_table, idx, &gtp->req_time, pinfo);
- return 1;
+ return TAP_PACKET_REDRAW;
}