From 364261f0adfdda976fedddc1578c32122ceed9b8 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 21 Nov 2003 21:58:55 +0000 Subject: 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 --- epan/packet.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'epan/packet.c') 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 @@ -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 -- cgit v1.2.3