diff options
author | Tim Potter <tpot@samba.org> | 2003-02-17 01:59:39 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2003-02-17 01:59:39 +0000 |
commit | 3031823bed12bd2156b1718181575718ebdfe0ec (patch) | |
tree | c4dba5f01f7eba1355c16af4360db3b90f2f94f4 /packet-smb-browse.c | |
parent | 33b251a58ff1e9d556f88ef5ff0de13927c9b551 (diff) |
Dissect the server type bitfield in NetServerGetInfo for SERVER_INFO_101
and SERVER_INFO_102.
Modify all callers to use the new interface.
svn path=/trunk/; revision=7158
Diffstat (limited to 'packet-smb-browse.c')
-rw-r--r-- | packet-smb-browse.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/packet-smb-browse.c b/packet-smb-browse.c index ad684714ef..409c629e56 100644 --- a/packet-smb-browse.c +++ b/packet-smb-browse.c @@ -2,7 +2,7 @@ * Routines for SMB Browser packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-smb-browse.c,v 1.25 2003/01/30 04:51:30 tpot Exp $ + * $Id: packet-smb-browse.c,v 1.26 2003/02/17 01:59:39 tpot Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -41,6 +41,7 @@ #include "alignment.h" #include "packet-smb-browse.h" +#include "packet-dcerpc.h" static int proto_smb_browse = -1; static int hf_command = -1; @@ -431,19 +432,18 @@ dissect_election_criterion(tvbuff_t *tvb, proto_tree *parent_tree, int offset) } -/* - * XXX - this causes non-browser packets to have browser fields. - */ -void -dissect_smb_server_type_flags(tvbuff_t *tvb, packet_info *pinfo, - proto_tree *parent_tree, int offset, gboolean infoflag) +int +dissect_smb_server_type_flags(tvbuff_t *tvb, int offset, packet_info *pinfo, + proto_tree *parent_tree, char *drep, + gboolean infoflag) { proto_tree *tree = NULL; proto_item *item = NULL; guint32 flags; int i; - flags = tvb_get_letohl(tvb, offset); + offset = dissect_ndr_uint32( + tvb, offset, pinfo, tree, drep, hf_server_type, &flags); if (parent_tree) { item = proto_tree_add_uint(parent_tree, hf_server_type, tvb, offset, 4, flags); @@ -512,6 +512,7 @@ dissect_smb_server_type_flags(tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_boolean(tree, hf_server_type_domainenum, tvb, offset, 4, flags); + return offset; } @@ -563,7 +564,9 @@ dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr switch (cmd) { case BROWSE_DOMAIN_ANNOUNCEMENT: case BROWSE_LOCAL_MASTER_ANNOUNCEMENT: - case BROWSE_HOST_ANNOUNCE: + case BROWSE_HOST_ANNOUNCE: { + char drep = 0x10; /* Assume little endian */ + /* update count */ proto_tree_add_item(tree, hf_update_count, tvb, offset, 1, TRUE); offset += 1; @@ -599,8 +602,8 @@ dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr offset += 1; /* server type flags */ - dissect_smb_server_type_flags(tvb, pinfo, tree, offset, TRUE); - offset += 4; + offset = dissect_smb_server_type_flags( + tvb, offset, pinfo, tree, &drep, TRUE); if (cmd == BROWSE_DOMAIN_ANNOUNCEMENT) { /* @@ -637,7 +640,7 @@ dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr tvb, offset, namelen, TRUE); offset += namelen; break; - + } case BROWSE_REQUEST_ANNOUNCE: { char *computer_name; @@ -768,6 +771,7 @@ dissect_mailslot_lanman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr guint32 periodicity; const char *host_name; guint namelen; + char drep = 0x10; /* Assume little-endian */ if (!proto_is_protocol_enabled(proto_smb_browse)) { return FALSE; @@ -804,14 +808,14 @@ dissect_mailslot_lanman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr case BROWSE_DOMAIN_ANNOUNCEMENT: case BROWSE_LOCAL_MASTER_ANNOUNCEMENT: case BROWSE_HOST_ANNOUNCE: + /* update count */ proto_tree_add_item(tree, hf_update_count, tvb, offset, 1, TRUE); offset += 1; /* server type flags */ - dissect_smb_server_type_flags(tvb, pinfo, tree, offset, - hf_server_type); - offset += 4; + offset = dissect_smb_server_type_flags( + tvb, offset, pinfo, tree, &drep, TRUE); /* OS major version */ proto_tree_add_item(tree, hf_os_major, tvb, offset, 1, TRUE); |