aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-11-21 21:58:55 +0000
committerGuy Harris <guy@alum.mit.edu>2003-11-21 21:58:55 +0000
commit364261f0adfdda976fedddc1578c32122ceed9b8 (patch)
treef6b62290ead092c654c8a464305f3ad3ebde39bf /epan/packet.c
parent8796847f6440164094a73abe2f3ccaec6150f003 (diff)
downloadwireshark-364261f0adfdda976fedddc1578c32122ceed9b8.tar.gz
wireshark-364261f0adfdda976fedddc1578c32122ceed9b8.tar.bz2
wireshark-364261f0adfdda976fedddc1578c32122ceed9b8.zip
From Olivier Biot:
* Add a "match_string" field to the "packet_info" structure, saving the string value that matched in a string dissector lookup, by analogy to "match_port" - this was required for dissection with token rendering of WBXML content when no public ID was given (e.g. Nokia/Ericsson OTA provisioning data). * Add support for textual content type based WBXML token mapping. * Add extra WBXML public identifiers. * Add the Nokia/Ericsson OTA provisioning (version 7) token definitions. * Inform the user when a content-type based token match is found. svn path=/trunk/; revision=9061
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/epan/packet.c b/epan/packet.c
index b99cbd5c5e..c98c13a463 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.98 2003/11/16 23:17:24 guy Exp $
+ * $Id: packet.c,v 1.99 2003/11/21 21:58:54 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -286,6 +286,7 @@ dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header,
edt->pi.srcport = 0;
edt->pi.destport = 0;
edt->pi.match_port = 0;
+ edt->pi.match_string = NULL;
edt->pi.can_desegment = 0;
edt->pi.want_pdu_tracking = 0;
edt->pi.p2p_dir = P2P_DIR_UNKNOWN;
@@ -987,6 +988,7 @@ dissector_try_string(dissector_table_t sub_dissectors, const gchar *string,
dtbl_entry_t *dtbl_entry;
struct dissector_handle *handle;
int ret;
+ const gchar *saved_match_string;
dtbl_entry = find_string_dtbl_entry(sub_dissectors, string);
if (dtbl_entry != NULL) {
@@ -1003,7 +1005,15 @@ dissector_try_string(dissector_table_t sub_dissectors, const gchar *string,
return FALSE;
}
+ /*
+ * Save the current value of "pinfo->match_string",
+ * set it to the string that matched, call the
+ * dissector, and restore "pinfo->match_string".
+ */
+ saved_match_string = pinfo->match_string;
+ pinfo->match_string = string;
ret = call_dissector_work(handle, tvb, pinfo, tree);
+ pinfo->match_string = saved_match_string;
/*
* If a new-style dissector returned 0, it means that