* 2002, some share information levels implemented based on samba
* sources.
*
- * $Id: packet-dcerpc-srvsvc.c,v 1.52 2003/02/07 22:44:53 guy Exp $
+ * $Id: packet-dcerpc-srvsvc.c,v 1.53 2003/02/17 01:59:39 tpot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include "packet-dcerpc-lsa.h"
#include "packet-dcerpc-nt.h"
#include "packet-smb-common.h"
+#include "packet-smb-browse.h"
#include "smb.h"
static int proto_dcerpc_srvsvc = -1;
static int hf_srvsvc_platform_id = -1;
static int hf_srvsvc_ver_major = -1;
static int hf_srvsvc_ver_minor = -1;
-static int hf_srvsvc_server_type = -1;
static int hf_srvsvc_client_type = -1;
static int hf_srvsvc_comment = -1;
static int hf_srvsvc_users = -1;
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
hf_srvsvc_ver_minor, NULL);
- offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
- hf_srvsvc_server_type, NULL);
+ offset = dissect_smb_server_type_flags(
+ tvb, offset, pinfo, tree, drep, TRUE);
offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
NDR_POINTER_UNIQUE, "Comment", hf_srvsvc_comment, 0);
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
hf_srvsvc_ver_minor, NULL);
- offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
- hf_srvsvc_server_type, NULL);
+ offset = dissect_smb_server_type_flags(
+ tvb, offset, pinfo, tree, drep, TRUE);
offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
NDR_POINTER_UNIQUE, "Comment", hf_srvsvc_comment, 0);
{ &hf_srvsvc_ver_minor,
{ "Minor Version", "srvsvc.version.minor", FT_UINT32,
BASE_DEC, NULL, 0x0, "Minor Version", HFILL}},
- /* XXX - Should break this out. We know it from browsing.
- See "dissect_smb_server_type_flags()"
- in "packet-smb-browse.c" */
- { &hf_srvsvc_server_type,
- { "Server Type", "srvsvc.server.type", FT_UINT32,
- BASE_HEX, NULL, 0x0, "Server Type", HFILL}},
{ &hf_srvsvc_client_type,
{ "Client Type", "srvsvc.client.type", FT_STRING,
BASE_NONE, NULL, 0x0, "Client Type", HFILL}},
* 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>
#include "alignment.h"
#include "packet-smb-browse.h"
+#include "packet-dcerpc.h"
static int proto_smb_browse = -1;
static int hf_command = -1;
}
-/*
- * 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);
proto_tree_add_boolean(tree, hf_server_type_domainenum,
tvb, offset, 4, flags);
+ return offset;
}
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;
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) {
/*
tvb, offset, namelen, TRUE);
offset += namelen;
break;
-
+ }
case BROWSE_REQUEST_ANNOUNCE: {
char *computer_name;
guint32 periodicity;
const char *host_name;
guint namelen;
+ char drep = 0x10; /* Assume little-endian */
if (!proto_is_protocol_enabled(proto_smb_browse)) {
return FALSE;
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);
* Declaration of routines for SMB Browser packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-smb-browse.h,v 1.5 2002/08/28 21:00:31 jmayer Exp $
+ * $Id: packet-smb-browse.h,v 1.6 2003/02/17 01:59:39 tpot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
gboolean
dissect_mailslot_lanman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree);
-void
-dissect_smb_server_type_flags(tvbuff_t *tvb, packet_info *pinfo, proto_tree *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);
#endif
* significant rewrite to tvbuffify the dissector, Ronnie Sahlberg and
* Guy Harris 2001
*
- * $Id: packet-smb-pipe.c,v 1.85 2002/12/19 11:22:35 sahlberg Exp $
+ * $Id: packet-smb-pipe.c,v 1.86 2003/02/17 01:59:39 tpot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
add_server_type(tvbuff_t *tvb, int offset, int count _U_,
packet_info *pinfo, proto_tree *tree, int convert _U_, int hf_index _U_)
{
- dissect_smb_server_type_flags(tvb, pinfo, tree, offset, FALSE);
- offset += 4;
+ char drep = 0x10; /* Assume little-endian */
+ offset = dissect_smb_server_type_flags(
+ tvb, offset, pinfo, tree, &drep, FALSE);
return offset;
}
add_server_type_info(tvbuff_t *tvb, int offset, int count _U_,
packet_info *pinfo, proto_tree *tree, int convert _U_, int hf_index _U_)
{
- dissect_smb_server_type_flags(tvb, pinfo, tree, offset, TRUE);
- offset += 4;
+ char drep = 0x10; /* Assume little-endian */
+ offset = dissect_smb_server_type_flags(
+ tvb, offset, pinfo, tree, &drep, TRUE);
return offset;
}