aboutsummaryrefslogtreecommitdiffstats
path: root/rawshark.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 /rawshark.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 'rawshark.c')
-rw-r--r--rawshark.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rawshark.c b/rawshark.c
index 738b521e89..c23d8020ac 100644
--- a/rawshark.c
+++ b/rawshark.c
@@ -1247,7 +1247,7 @@ static gboolean print_field_value(field_info *finfo, int cmd_line_index)
return TRUE;
}
-static int
+static tap_packet_status
protocolinfo_packet(void *prs, packet_info *pinfo _U_, epan_dissect_t *edt, const void *dummy _U_)
{
pci_t *rs=(pci_t *)prs;
@@ -1257,7 +1257,7 @@ protocolinfo_packet(void *prs, packet_info *pinfo _U_, epan_dissect_t *edt, cons
gp=proto_get_finfo_ptr_array(edt->tree, rs->hf_index);
if(!gp){
printf(" n.a.");
- return 0;
+ return TAP_PACKET_DONT_REDRAW;
}
/*
@@ -1267,7 +1267,7 @@ protocolinfo_packet(void *prs, packet_info *pinfo _U_, epan_dissect_t *edt, cons
print_field_value((field_info *)gp->pdata[i], rs->cmd_line_index);
}
- return 0;
+ return TAP_PACKET_DONT_REDRAW;
}
int g_cmd_line_index = 0;