diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-09-29 00:57:36 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-09-29 00:57:36 +0000 |
commit | 096770328914d454c8a7267c4ec14b23c9a73977 (patch) | |
tree | 99b20c72cdc5b36b948537e8f1baab383f302ebd /packet-netbios.c | |
parent | 168a986072dcef20db2ded2f26662eec3ff9108a (diff) |
Have "dissect_netbios_payload()" take as an argument a tvbuff containing
only the NetBIOS payload, and have the NBSS dissector construct tvbuffs
of that sort (i.e., stop at the end of the NBSS session message, not at
the end of the data handed to the NBSS dissector).
svn path=/trunk/; revision=3972
Diffstat (limited to 'packet-netbios.c')
-rw-r--r-- | packet-netbios.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/packet-netbios.c b/packet-netbios.c index d21144ab86..c1671faee0 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.36 2001/09/28 22:43:56 guy Exp $ + * $Id: packet-netbios.c,v 1.37 2001/09/29 00:57:36 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -957,20 +957,17 @@ void (*dissect_netb[])(tvbuff_t *, int, proto_tree *) = { static heur_dissector_list_t netbios_heur_subdissector_list; void -dissect_netbios_payload(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, int max_data) +dissect_netbios_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - tvbuff_t *next_tvb; - const guint8 *next_pd; - int next_offset; - - next_tvb = tvb_new_subset(tvb, offset, -1, -1); + const guint8 *pd; + int offset; + int max_data; /* * Try the heuristic dissectors for NetBIOS. */ if (dissector_try_heuristic(netbios_heur_subdissector_list, - next_tvb, pinfo, tree)) + tvb, pinfo, tree)) return; /* @@ -978,15 +975,16 @@ dissect_netbios_payload(tvbuff_t *tvb, int offset, packet_info *pinfo, * (XXX - once the SMB dissector is tvbuffified, it should * become a regular heuristic dissector.) */ - tvb_compat(next_tvb, &next_pd, &next_offset); + tvb_compat(tvb, &pd, &offset); + max_data = tvb_length(tvb); - if (dissect_smb(next_pd, next_offset, pinfo->fd, tree, max_data)) + if (dissect_smb(pd, offset, pinfo->fd, tree, max_data)) return; /* * It's none of the above. Dissect it as data. */ - dissect_data(next_tvb, 0, pinfo, tree); + dissect_data(tvb, 0, pinfo, tree); } static void @@ -998,6 +996,7 @@ dissect_netbios(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint16 hdr_len, command; char name[(NETBIOS_NAME_LEN - 1)*4 + 1]; int name_type; + tvbuff_t *next_tvb; int offset = 0; @@ -1070,8 +1069,8 @@ dissect_netbios(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += hdr_len; /* move past header */ - dissect_netbios_payload(tvb, offset, pinfo, tree, - tvb_length_remaining(tvb, offset)); + next_tvb = tvb_new_subset(tvb, offset, -1, -1); + dissect_netbios_payload(next_tvb, pinfo, tree); } |