diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-09-29 01:19:01 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-09-29 01:19:01 +0000 |
commit | 0102e0c783324875d19d6290c63121edc827f0a5 (patch) | |
tree | 7b803b1e3738baaf01cab288a68e3f087627367d /packet-netbios.c | |
parent | 096770328914d454c8a7267c4ec14b23c9a73977 (diff) |
Start the process of tvbuffifying the SMB dissector - give it a
tvbuffified heuristic-dissector interface, but have it immediately turn
its arguments into an old-style buffer pointer and offset.
Register the SMB dissector as a heuristic NetBIOS dissector, and have
"dissect_netbios_payload()" just try the heuristics, as it no longer has
to call the SMB dissector explicitly.
svn path=/trunk/; revision=3973
Diffstat (limited to 'packet-netbios.c')
-rw-r--r-- | packet-netbios.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/packet-netbios.c b/packet-netbios.c index c1671faee0..8236aad4e1 100644 --- a/packet-netbios.c +++ b/packet-netbios.c @@ -5,7 +5,7 @@ * * derived from the packet-nbns.c * - * $Id: packet-netbios.c,v 1.37 2001/09/29 00:57:36 guy Exp $ + * $Id: packet-netbios.c,v 1.38 2001/09/29 01:19:00 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -41,7 +41,6 @@ #include "packet.h" #include "llcsaps.h" #include "packet-netbios.h" -#include "packet-smb.h" /* Netbios command numbers */ #define NB_ADD_GROUP 0x00 @@ -959,32 +958,13 @@ static heur_dissector_list_t netbios_heur_subdissector_list; void dissect_netbios_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - const guint8 *pd; - int offset; - int max_data; - /* - * Try the heuristic dissectors for NetBIOS. + * Try the heuristic dissectors for NetBIOS; if none of them + * accept the packet, dissect it as data. */ - if (dissector_try_heuristic(netbios_heur_subdissector_list, + if (!dissector_try_heuristic(netbios_heur_subdissector_list, tvb, pinfo, tree)) - return; - - /* - * OK, none of them matched. Try the SMB dissector. - * (XXX - once the SMB dissector is tvbuffified, it should - * become a regular heuristic dissector.) - */ - tvb_compat(tvb, &pd, &offset); - max_data = tvb_length(tvb); - - if (dissect_smb(pd, offset, pinfo->fd, tree, max_data)) - return; - - /* - * It's none of the above. Dissect it as data. - */ - dissect_data(tvb, 0, pinfo, tree); + dissect_data(tvb, 0, pinfo, tree); } static void |