diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-05-03 00:48:37 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-05-03 00:48:37 +0000 |
commit | ca318813a4d4c28af90b14abdb60f7ecbcb46ea9 (patch) | |
tree | e9aa16cb6d0df21a992929c5fc2cb8f53a13bd04 /tap-protocolinfo.c | |
parent | a8f171f2ffb7ebba2f270a7baa2df94d35b0fed8 (diff) |
Rename "proto_alloc_dfilter_string()" to
"proto_construct_dfilter_string()", to more accurately reflect what it
does.
Give it, and "proto_can_match_selected()", an "epan_dissect_t *"
argument, which replaces the raw data pointer argument to
"proto_construct_dfilter_string()".
For fields that don't have a type we can directly filter on, we don't
support filtering on the field as raw data if:
the "epan_dissect_t *" argument is null;
the data source tvbuff for the field isn't the tvbuff for the
"epan_dissect_t" in question (i.e., it's in the result of a
reassembly, and "frame[N:M]" can't get at it).
Trim the length the raw data in the case of such a field to the length
of the tvbuff for the "epan_dissect_t" in question, so we don't go past
it. Fetch the raw data bytes to match from that tvbuff.
Have "proto_construct_dfilter_string()" return a null pointer if it
can't construct the filter string, and have "protocolinfo_packet()" in
the tap-protocolinfo tap ignore a field if
"proto_construct_dfilter_string()" can't construct a filter string for
it - and have it pass NULL as the "epan_dissect_t *", for now. If
somebody decides it makes sense to dump out a "frame[N:M] =" value for
non-registered fields, it can be changed to pass "edt".
svn path=/trunk/; revision=7635
Diffstat (limited to 'tap-protocolinfo.c')
-rw-r--r-- | tap-protocolinfo.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tap-protocolinfo.c b/tap-protocolinfo.c index c2025a3ae8..eade2065be 100644 --- a/tap-protocolinfo.c +++ b/tap-protocolinfo.c @@ -1,7 +1,7 @@ /* tap-protocolinfo.c * protohierstat 2002 Ronnie Sahlberg * - * $Id: tap-protocolinfo.c,v 1.3 2003/04/23 08:20:01 guy Exp $ + * $Id: tap-protocolinfo.c,v 1.4 2003/05/03 00:48:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -61,9 +61,11 @@ protocolinfo_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, void *du } for(i=0;i<gp->len;i++){ - str=proto_alloc_dfilter_string(gp->pdata[i], NULL); - col_append_fstr(pinfo->cinfo, COL_INFO, " %s",str); - g_free(str); + str=proto_construct_dfilter_string(gp->pdata[i], NULL); + if(str){ + col_append_fstr(pinfo->cinfo, COL_INFO, " %s",str); + g_free(str); + } } return 0; } |