2000-02-14 04:02:21 +00:00
|
|
|
/* packet-smb-browse.c
|
2001-03-18 03:34:22 +00:00
|
|
|
* Routines for SMB Browser packet dissection
|
2000-02-14 04:02:21 +00:00
|
|
|
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2000-02-14 04:02:21 +00:00
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
2001-07-12 23:37:48 +00:00
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
2000-02-14 04:02:21 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* Copied from packet-pop.c
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-02-14 04:02:21 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-02-14 04:02:21 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-02-14 04:02:21 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <glib.h>
|
|
|
|
#include <ctype.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2000-02-14 04:02:21 +00:00
|
|
|
#include "smb.h"
|
|
|
|
|
2001-03-18 03:34:22 +00:00
|
|
|
#include "packet-smb-browse.h"
|
2003-02-17 01:59:39 +00:00
|
|
|
#include "packet-dcerpc.h"
|
2001-03-18 03:34:22 +00:00
|
|
|
|
2000-02-14 04:02:21 +00:00
|
|
|
static int proto_smb_browse = -1;
|
2001-07-12 23:37:48 +00:00
|
|
|
static int hf_command = -1;
|
|
|
|
static int hf_update_count = -1;
|
|
|
|
static int hf_periodicity = -1;
|
|
|
|
static int hf_server_name = -1;
|
|
|
|
static int hf_mb_server_name = -1;
|
2003-03-21 05:28:04 +00:00
|
|
|
static int hf_mb_reset_command = -1;
|
2003-03-24 16:49:10 +00:00
|
|
|
static int hf_mb_reset_demote = -1;
|
|
|
|
static int hf_mb_reset_flush = -1;
|
|
|
|
static int hf_mb_reset_stop = -1;
|
2001-07-12 23:37:48 +00:00
|
|
|
static int hf_os_major = -1;
|
|
|
|
static int hf_os_minor = -1;
|
|
|
|
static int hf_server_type = -1;
|
|
|
|
static int hf_server_type_workstation = -1;
|
|
|
|
static int hf_server_type_server = -1;
|
|
|
|
static int hf_server_type_sql = -1;
|
|
|
|
static int hf_server_type_domain = -1;
|
|
|
|
static int hf_server_type_backup = -1;
|
|
|
|
static int hf_server_type_time = -1;
|
|
|
|
static int hf_server_type_apple = -1;
|
|
|
|
static int hf_server_type_novell = -1;
|
|
|
|
static int hf_server_type_member = -1;
|
|
|
|
static int hf_server_type_print = -1;
|
|
|
|
static int hf_server_type_dialin = -1;
|
|
|
|
static int hf_server_type_xenix = -1;
|
|
|
|
static int hf_server_type_ntw = -1;
|
|
|
|
static int hf_server_type_wfw = -1;
|
|
|
|
static int hf_server_type_nts = -1;
|
|
|
|
static int hf_server_type_potentialb = -1;
|
|
|
|
static int hf_server_type_backupb = -1;
|
|
|
|
static int hf_server_type_masterb = -1;
|
|
|
|
static int hf_server_type_domainmasterb = -1;
|
|
|
|
static int hf_server_type_osf = -1;
|
|
|
|
static int hf_server_type_vms = -1;
|
|
|
|
static int hf_server_type_w95 = -1;
|
|
|
|
static int hf_server_type_local = -1;
|
|
|
|
static int hf_server_type_domainenum = -1;
|
|
|
|
static int hf_election_version = -1;
|
|
|
|
static int hf_proto_major = -1;
|
|
|
|
static int hf_proto_minor = -1;
|
|
|
|
static int hf_sig_const = -1;
|
|
|
|
static int hf_server_comment = -1;
|
|
|
|
static int hf_unused_flags = -1;
|
2001-07-13 07:04:23 +00:00
|
|
|
static int hf_response_computer_name = -1;
|
2001-07-12 23:37:48 +00:00
|
|
|
static int hf_election_criteria = -1;
|
|
|
|
static int hf_election_desire = -1;
|
|
|
|
static int hf_election_desire_flags_backup = -1;
|
|
|
|
static int hf_election_desire_flags_standby = -1;
|
|
|
|
static int hf_election_desire_flags_master = -1;
|
|
|
|
static int hf_election_desire_flags_domain_master = -1;
|
|
|
|
static int hf_election_desire_flags_wins = -1;
|
|
|
|
static int hf_election_desire_flags_nt = -1;
|
|
|
|
static int hf_election_revision = -1;
|
|
|
|
static int hf_election_os = -1;
|
|
|
|
static int hf_election_os_wfw = -1;
|
|
|
|
static int hf_election_os_ntw = -1;
|
|
|
|
static int hf_election_os_nts = -1;
|
|
|
|
static int hf_server_uptime = -1;
|
|
|
|
static int hf_backup_count = -1;
|
|
|
|
static int hf_backup_token = -1;
|
|
|
|
static int hf_backup_server = -1;
|
2001-07-13 07:04:23 +00:00
|
|
|
static int hf_browser_to_promote = -1;
|
2000-02-14 04:02:21 +00:00
|
|
|
|
|
|
|
static gint ett_browse = -1;
|
|
|
|
static gint ett_browse_flags = -1;
|
|
|
|
static gint ett_browse_election_criteria = -1;
|
|
|
|
static gint ett_browse_election_os = -1;
|
|
|
|
static gint ett_browse_election_desire = -1;
|
2003-03-24 16:49:10 +00:00
|
|
|
static gint ett_browse_reset_cmd_flags = -1;
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
#define SERVER_WORKSTATION 0
|
|
|
|
#define SERVER_SERVER 1
|
|
|
|
#define SERVER_SQL_SERVER 2
|
|
|
|
#define SERVER_DOMAIN_CONTROLLER 3
|
|
|
|
#define SERVER_BACKUP_CONTROLLER 4
|
|
|
|
#define SERVER_TIME_SOURCE 5
|
|
|
|
#define SERVER_APPLE_SERVER 6
|
|
|
|
#define SERVER_NOVELL_SERVER 7
|
|
|
|
#define SERVER_DOMAIN_MEMBER_SERVER 8
|
|
|
|
#define SERVER_PRINT_QUEUE_SERVER 9
|
|
|
|
#define SERVER_DIALIN_SERVER 10
|
|
|
|
#define SERVER_XENIX_SERVER 11
|
|
|
|
#define SERVER_NT_WORKSTATION 12
|
|
|
|
#define SERVER_WINDOWS_FOR_WORKGROUPS 13
|
|
|
|
#define SERVER_NT_SERVER 15
|
|
|
|
#define SERVER_POTENTIAL_BROWSER 16
|
|
|
|
#define SERVER_BACKUP_BROWSER 17
|
|
|
|
#define SERVER_MASTER_BROWSER 18
|
|
|
|
#define SERVER_DOMAIN_MASTER_BROWSER 19
|
|
|
|
#define SERVER_OSF 20
|
|
|
|
#define SERVER_VMS 21
|
|
|
|
#define SERVER_WINDOWS_95 22
|
|
|
|
#define SERVER_LOCAL_LIST_ONLY 30
|
|
|
|
#define SERVER_DOMAIN_ENUM 31
|
|
|
|
|
|
|
|
static const value_string server_types[] = {
|
|
|
|
{SERVER_WORKSTATION, "Workstation"},
|
|
|
|
{SERVER_SERVER, "Server"},
|
|
|
|
{SERVER_SQL_SERVER, "SQL Server"},
|
|
|
|
{SERVER_DOMAIN_CONTROLLER, "Domain Controller"},
|
|
|
|
{SERVER_BACKUP_CONTROLLER, "Backup Controller"},
|
|
|
|
{SERVER_TIME_SOURCE, "Time Source"},
|
|
|
|
{SERVER_APPLE_SERVER, "Apple Server"},
|
|
|
|
{SERVER_NOVELL_SERVER, "Novell Server"},
|
|
|
|
{SERVER_DOMAIN_MEMBER_SERVER, "Domain Member Server"},
|
|
|
|
{SERVER_PRINT_QUEUE_SERVER, "Print Queue Server"},
|
|
|
|
{SERVER_DIALIN_SERVER, "Dialin Server"},
|
|
|
|
{SERVER_XENIX_SERVER, "Xenix Server"},
|
|
|
|
{SERVER_NT_WORKSTATION, "NT Workstation"},
|
|
|
|
{SERVER_WINDOWS_FOR_WORKGROUPS, "Windows for Workgroups"},
|
|
|
|
{SERVER_NT_SERVER, "NT Server"},
|
|
|
|
{SERVER_POTENTIAL_BROWSER, "Potential Browser"},
|
|
|
|
{SERVER_BACKUP_BROWSER, "Backup Browser"},
|
|
|
|
{SERVER_MASTER_BROWSER, "Master Browser"},
|
|
|
|
{SERVER_DOMAIN_MASTER_BROWSER, "Domain Master Browser"},
|
|
|
|
{SERVER_OSF, "OSF"},
|
|
|
|
{SERVER_VMS, "VMS"},
|
|
|
|
{SERVER_WINDOWS_95, "Windows 95 or above"},
|
|
|
|
{SERVER_LOCAL_LIST_ONLY, "Local List Only"},
|
|
|
|
{SERVER_DOMAIN_ENUM, "Domain Enum"},
|
|
|
|
{0, NULL}
|
2000-02-14 04:02:21 +00:00
|
|
|
};
|
|
|
|
|
2003-03-21 05:28:04 +00:00
|
|
|
static const value_string resetbrowserstate_command_names[] = {
|
|
|
|
{ 0x01, "Stop being a master browser and become a backup browser"},
|
|
|
|
{ 0x02, "Discard browse lists, stop being a master browser, and try again"},
|
|
|
|
{ 0x04, "Stop being a master browser for ever"},
|
|
|
|
{ 0, NULL}
|
|
|
|
};
|
|
|
|
|
2003-03-24 16:49:10 +00:00
|
|
|
static true_false_string tfs_demote_to_backup = {
|
|
|
|
"Demote an LMB to a Backup Browser",
|
|
|
|
"Do not demote an LMB to a Backup Browser"
|
|
|
|
};
|
|
|
|
|
|
|
|
static true_false_string tfs_flush_browse_list = {
|
|
|
|
"Flush the Browse List",
|
|
|
|
"Do not Flush the Browse List"
|
|
|
|
};
|
|
|
|
|
|
|
|
static true_false_string tfs_stop_being_lmb = {
|
|
|
|
"Stop Being a Local Master Browser",
|
|
|
|
"Do not Stop Being a Local Master Browser"
|
|
|
|
};
|
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
static const true_false_string tfs_workstation = {
|
|
|
|
"This is a Workstation",
|
|
|
|
"This is NOT a Workstation"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_server = {
|
|
|
|
"This is a Server",
|
|
|
|
"This is NOT a Server"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_sql = {
|
2001-08-01 03:47:00 +00:00
|
|
|
"This is an SQL server",
|
|
|
|
"This is NOT an SQL server"
|
2001-07-12 23:37:48 +00:00
|
|
|
};
|
|
|
|
static const true_false_string tfs_domain = {
|
|
|
|
"This is a Domain Controller",
|
|
|
|
"This is NOT a Domain Controller"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_backup = {
|
|
|
|
"This is a Backup Controller",
|
|
|
|
"This is NOT a Backup Controller"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_time = {
|
|
|
|
"This is a Time Source",
|
|
|
|
"This is NOT a Time Source"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_apple = {
|
|
|
|
"This is an Apple host",
|
|
|
|
"This is NOT an Apple host"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_novell = {
|
|
|
|
"This is a Novell server",
|
|
|
|
"This is NOT a Novell server"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_member = {
|
|
|
|
"This is a Domain Member server",
|
|
|
|
"This is NOT a Domain Member server"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_print = {
|
|
|
|
"This is a Print Queue server",
|
|
|
|
"This is NOT a Print Queue server"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_dialin = {
|
|
|
|
"This is a Dialin server",
|
|
|
|
"This is NOT a Dialin server"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_xenix = {
|
|
|
|
"This is a Xenix server",
|
|
|
|
"This is NOT a Xenix server"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_ntw = {
|
2001-08-01 03:47:00 +00:00
|
|
|
"This is an NT Workstation",
|
|
|
|
"This is NOT an NT Workstation"
|
2001-07-12 23:37:48 +00:00
|
|
|
};
|
|
|
|
static const true_false_string tfs_wfw = {
|
|
|
|
"This is a WfW host",
|
|
|
|
"This is NOT a WfW host"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_nts = {
|
|
|
|
"This is an NT Server",
|
|
|
|
"This is NOT an NT Server"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_potentialb = {
|
|
|
|
"This is a Potential Browser",
|
|
|
|
"This is NOT a Potential Browser"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_backupb = {
|
|
|
|
"This is a Backup Browser",
|
|
|
|
"This is NOT a Backup Browser"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_masterb = {
|
|
|
|
"This is a Master Browser",
|
|
|
|
"This is NOT a Master Browser"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_domainmasterb = {
|
|
|
|
"This is a Domain Master Browser",
|
|
|
|
"This is NOT a Domain Master Browser"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_osf = {
|
|
|
|
"This is an OSF host",
|
|
|
|
"This is NOT an OSF host"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_vms = {
|
|
|
|
"This is a VMS host",
|
|
|
|
"This is NOT a VMS host"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_w95 = {
|
|
|
|
"This is a Windows 95 or above host",
|
|
|
|
"This is NOT a Windows 95 or above host"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_local = {
|
|
|
|
"This is a local list only request",
|
|
|
|
"This is NOT a local list only request"
|
|
|
|
};
|
|
|
|
static const true_false_string tfs_domainenum = {
|
|
|
|
"This is a Domain Enum request",
|
|
|
|
"This is NOT a Domain Enum request"
|
|
|
|
};
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
#define DESIRE_BACKUP 0
|
|
|
|
#define DESIRE_STANDBY 1
|
|
|
|
#define DESIRE_MASTER 2
|
|
|
|
#define DESIRE_DOMAIN_MASTER 3
|
|
|
|
#define DESIRE_WINS 5
|
|
|
|
#define DESIRE_NT 7
|
|
|
|
|
|
|
|
static const value_string desire_flags[] = {
|
|
|
|
{DESIRE_BACKUP, "Backup Browse Server"},
|
|
|
|
{DESIRE_STANDBY, "Standby Browse Server"},
|
|
|
|
{DESIRE_MASTER, "Master Browser"},
|
|
|
|
{DESIRE_DOMAIN_MASTER, "Domain Master Browse Server"},
|
|
|
|
{DESIRE_WINS, "WINS Client"},
|
|
|
|
{DESIRE_NT, "Windows NT Advanced Server"},
|
2001-08-01 03:47:00 +00:00
|
|
|
{0, NULL}
|
2001-07-12 23:37:48 +00:00
|
|
|
};
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
static const true_false_string tfs_desire_backup = {
|
2002-08-28 21:04:11 +00:00
|
|
|
"Backup Browse Server",
|
2001-08-01 03:47:00 +00:00
|
|
|
"NOT Backup Browse Server"
|
2001-07-12 23:37:48 +00:00
|
|
|
};
|
|
|
|
static const true_false_string tfs_desire_standby = {
|
2001-08-01 03:47:00 +00:00
|
|
|
"Standby Browse Server",
|
|
|
|
"NOT Standby Browse Server"
|
2001-07-12 23:37:48 +00:00
|
|
|
};
|
|
|
|
static const true_false_string tfs_desire_master = {
|
2001-08-01 03:47:00 +00:00
|
|
|
"Master Browser",
|
|
|
|
"NOT Master Browser"
|
2001-07-12 23:37:48 +00:00
|
|
|
};
|
|
|
|
static const true_false_string tfs_desire_domain_master = {
|
2001-08-01 03:47:00 +00:00
|
|
|
"Domain Master Browse Server",
|
|
|
|
"NOT Domain Master Browse Server"
|
2001-07-12 23:37:48 +00:00
|
|
|
};
|
|
|
|
static const true_false_string tfs_desire_wins = {
|
2001-08-01 03:47:00 +00:00
|
|
|
"WINS Client",
|
|
|
|
"NOT WINS Client"
|
2001-07-12 23:37:48 +00:00
|
|
|
};
|
|
|
|
static const true_false_string tfs_desire_nt = {
|
2001-08-01 03:47:00 +00:00
|
|
|
"Windows NT Advanced Server",
|
|
|
|
"NOT Windows NT Advanced Server"
|
2001-07-12 23:37:48 +00:00
|
|
|
};
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
#define BROWSE_HOST_ANNOUNCE 1
|
|
|
|
#define BROWSE_REQUEST_ANNOUNCE 2
|
|
|
|
#define BROWSE_ELECTION_REQUEST 8
|
|
|
|
#define BROWSE_BACKUP_LIST_REQUEST 9
|
|
|
|
#define BROWSE_BACKUP_LIST_RESPONSE 10
|
|
|
|
#define BROWSE_BECOME_BACKUP 11
|
|
|
|
#define BROWSE_DOMAIN_ANNOUNCEMENT 12
|
|
|
|
#define BROWSE_MASTER_ANNOUNCEMENT 13
|
2003-03-21 05:28:04 +00:00
|
|
|
#define BROWSE_RESETBROWSERSTATE_ANNOUNCEMENT 14
|
2001-07-12 23:37:48 +00:00
|
|
|
#define BROWSE_LOCAL_MASTER_ANNOUNCEMENT 15
|
|
|
|
|
|
|
|
static const value_string commands[] = {
|
|
|
|
{BROWSE_HOST_ANNOUNCE, "Host Announcement"},
|
|
|
|
{BROWSE_REQUEST_ANNOUNCE, "Request Announcement"},
|
|
|
|
{BROWSE_ELECTION_REQUEST, "Browser Election Request"},
|
|
|
|
{BROWSE_BACKUP_LIST_REQUEST, "Get Backup List Request"},
|
|
|
|
{BROWSE_BACKUP_LIST_RESPONSE, "Get Backup List Response"},
|
|
|
|
{BROWSE_BECOME_BACKUP, "Become Backup Browser"},
|
|
|
|
{BROWSE_DOMAIN_ANNOUNCEMENT, "Domain/Workgroup Announcement"},
|
|
|
|
{BROWSE_MASTER_ANNOUNCEMENT, "Master Announcement"},
|
2003-03-21 05:28:04 +00:00
|
|
|
{BROWSE_RESETBROWSERSTATE_ANNOUNCEMENT, "Reset Browser State Announcement"},
|
2001-07-12 23:37:48 +00:00
|
|
|
{BROWSE_LOCAL_MASTER_ANNOUNCEMENT,"Local Master Announcement"},
|
2001-08-01 03:47:00 +00:00
|
|
|
{0, NULL}
|
2001-07-12 23:37:48 +00:00
|
|
|
};
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
#define OS_WFW 0
|
|
|
|
#define OS_NTW 4
|
|
|
|
#define OS_NTS 5
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
static const value_string os_flags[] = {
|
|
|
|
{OS_WFW, "Windows for Workgroups"},
|
|
|
|
{OS_NTW, "Windows NT Workstation"},
|
|
|
|
{OS_NTS, "Windows NT Server"},
|
2001-08-01 03:47:00 +00:00
|
|
|
{0, NULL}
|
2001-07-12 23:37:48 +00:00
|
|
|
};
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
static const true_false_string tfs_os_wfw = {
|
2001-08-01 03:47:00 +00:00
|
|
|
"Windows for Workgroups",
|
|
|
|
"Not Windows for Workgroups"
|
|
|
|
};
|
2001-07-12 23:37:48 +00:00
|
|
|
static const true_false_string tfs_os_ntw = {
|
2001-08-01 03:47:00 +00:00
|
|
|
"Windows NT Workstation",
|
|
|
|
"Not Windows NT Workstation"
|
2001-07-12 23:37:48 +00:00
|
|
|
};
|
|
|
|
static const true_false_string tfs_os_nts = {
|
2001-08-01 03:47:00 +00:00
|
|
|
"Windows NT Server",
|
|
|
|
"Not Windows NT Server"
|
2001-07-12 23:37:48 +00:00
|
|
|
};
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
static void
|
2002-04-30 11:03:08 +00:00
|
|
|
dissect_election_criterion_os(tvbuff_t *tvb, proto_tree *parent_tree, int offset)
|
2001-07-12 23:37:48 +00:00
|
|
|
{
|
|
|
|
proto_tree *tree = NULL;
|
|
|
|
proto_item *item = NULL;
|
|
|
|
guint8 os;
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
os = tvb_get_guint8(tvb, offset);
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
if (parent_tree) {
|
|
|
|
item = proto_tree_add_uint(parent_tree, hf_election_os, tvb, offset, 1, os);
|
|
|
|
tree = proto_item_add_subtree(item, ett_browse_election_os);
|
|
|
|
}
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_election_os_wfw,
|
2001-07-12 23:37:48 +00:00
|
|
|
tvb, offset, 1, os);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_election_os_ntw,
|
2001-07-12 23:37:48 +00:00
|
|
|
tvb, offset, 1, os);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_election_os_nts,
|
2001-07-12 23:37:48 +00:00
|
|
|
tvb, offset, 1, os);
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
}
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
static void
|
2002-04-30 11:03:08 +00:00
|
|
|
dissect_election_criterion_desire(tvbuff_t *tvb, proto_tree *parent_tree, int offset)
|
2001-07-12 23:37:48 +00:00
|
|
|
{
|
|
|
|
proto_tree *tree = NULL;
|
|
|
|
proto_item *item = NULL;
|
|
|
|
guint8 desire;
|
|
|
|
|
|
|
|
desire = tvb_get_guint8(tvb, offset);
|
|
|
|
|
|
|
|
if (parent_tree) {
|
|
|
|
item = proto_tree_add_uint(parent_tree, hf_election_desire, tvb, offset, 1, desire);
|
|
|
|
tree = proto_item_add_subtree(item, ett_browse_election_desire);
|
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_election_desire_flags_backup,
|
2001-07-12 23:37:48 +00:00
|
|
|
tvb, offset, 1, desire);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_election_desire_flags_standby,
|
2001-07-12 23:37:48 +00:00
|
|
|
tvb, offset, 1, desire);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_election_desire_flags_master,
|
2001-07-12 23:37:48 +00:00
|
|
|
tvb, offset, 1, desire);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_election_desire_flags_domain_master,
|
2001-07-12 23:37:48 +00:00
|
|
|
tvb, offset, 1, desire);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_election_desire_flags_wins,
|
2001-07-12 23:37:48 +00:00
|
|
|
tvb, offset, 1, desire);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_election_desire_flags_nt,
|
2001-07-12 23:37:48 +00:00
|
|
|
tvb, offset, 1, desire);
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
}
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
static void
|
2002-04-30 11:03:08 +00:00
|
|
|
dissect_election_criterion(tvbuff_t *tvb, proto_tree *parent_tree, int offset)
|
2001-07-12 23:37:48 +00:00
|
|
|
{
|
|
|
|
proto_tree *tree = NULL;
|
|
|
|
proto_item *item = NULL;
|
|
|
|
guint32 criterion;
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
criterion = tvb_get_letohl(tvb, offset);
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
if (parent_tree) {
|
|
|
|
item = proto_tree_add_uint(parent_tree, hf_election_criteria, tvb, offset, 4, criterion);
|
|
|
|
tree = proto_item_add_subtree(item, ett_browse_election_criteria);
|
|
|
|
}
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
/* election desire */
|
2002-04-30 11:03:08 +00:00
|
|
|
dissect_election_criterion_desire(tvb, tree, offset);
|
2001-07-12 23:37:48 +00:00
|
|
|
offset += 1;
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-13 00:01:35 +00:00
|
|
|
/* browser protocol major version */
|
|
|
|
proto_tree_add_item(tree, hf_proto_major, tvb, offset, 1, TRUE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* browser protocol minor version */
|
|
|
|
proto_tree_add_item(tree, hf_proto_minor, tvb, offset, 1, TRUE);
|
|
|
|
offset += 1;
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
/* election os */
|
2002-04-30 11:03:08 +00:00
|
|
|
dissect_election_criterion_os(tvb, tree, offset);
|
2001-07-12 23:37:48 +00:00
|
|
|
offset += 1;
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
}
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2003-02-20 07:55:00 +00:00
|
|
|
/*
|
|
|
|
* XXX - this causes non-browser packets to have browser fields.
|
|
|
|
*/
|
2003-02-17 01:59:39 +00:00
|
|
|
int
|
|
|
|
dissect_smb_server_type_flags(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
2004-01-19 20:10:37 +00:00
|
|
|
proto_tree *parent_tree, guint8 *drep,
|
2003-02-17 01:59:39 +00:00
|
|
|
gboolean infoflag)
|
2001-07-12 23:37:48 +00:00
|
|
|
{
|
|
|
|
proto_tree *tree = NULL;
|
|
|
|
proto_item *item = NULL;
|
|
|
|
guint32 flags;
|
|
|
|
int i;
|
|
|
|
|
2003-02-20 07:55:00 +00:00
|
|
|
if (drep != NULL) {
|
|
|
|
/*
|
|
|
|
* Called from a DCE RPC protocol dissector, for a
|
|
|
|
* protocol where a 32-bit NDR integer contains
|
|
|
|
* an server type mask; extract the server type mask
|
2004-07-24 09:59:00 +00:00
|
|
|
* with an NDR call (but don't put it into the
|
|
|
|
* protocol tree, as we can't get a pointer to the
|
|
|
|
* item it puts in, and thus can't put a tree below
|
|
|
|
* it with the values of the individual bits).
|
2003-02-20 07:55:00 +00:00
|
|
|
*/
|
|
|
|
offset = dissect_ndr_uint32(
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset, pinfo, NULL, drep, hf_server_type, &flags);
|
2003-02-20 07:55:00 +00:00
|
|
|
} else {
|
|
|
|
/*
|
2004-07-24 09:59:00 +00:00
|
|
|
* Called from SMB browser or RAP, where the server type
|
2003-02-20 07:55:00 +00:00
|
|
|
* mask is just a 4-byte little-endian quantity with no
|
|
|
|
* special NDR alignment requirement; extract it with
|
|
|
|
* "tvb_get_letohl()".
|
|
|
|
*/
|
|
|
|
flags = tvb_get_letohl(tvb, offset);
|
|
|
|
offset += 4;
|
|
|
|
}
|
2001-07-12 23:37:48 +00:00
|
|
|
|
|
|
|
if (parent_tree) {
|
2004-07-24 09:59:00 +00:00
|
|
|
item = proto_tree_add_uint(parent_tree, hf_server_type, tvb, offset-4, 4, flags);
|
2001-07-12 23:37:48 +00:00
|
|
|
tree = proto_item_add_subtree(item, ett_browse_flags);
|
|
|
|
}
|
|
|
|
|
2001-08-05 01:15:27 +00:00
|
|
|
if (infoflag) {
|
|
|
|
/* Append the type(s) of the system to the COL_INFO line ... */
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
2001-08-05 01:15:27 +00:00
|
|
|
for (i = 0; i < 32; i++) {
|
|
|
|
if (flags & (1<<i)) {
|
2001-12-10 00:26:21 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
|
2001-08-05 01:15:27 +00:00
|
|
|
val_to_str(i, server_types,
|
|
|
|
"Unknown server type:%d"));
|
|
|
|
}
|
2001-07-12 23:37:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_workstation,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_server,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_sql,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_domain,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_backup,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_time,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_apple,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_novell,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_member,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_print,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_dialin,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_xenix,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_ntw,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_wfw,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_nts,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_potentialb,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_backupb,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_masterb,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_domainmasterb,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_osf,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_vms,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_w95,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_local,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_server_type_domainenum,
|
2004-07-24 09:59:00 +00:00
|
|
|
tvb, offset-4, 4, flags);
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2003-02-17 01:59:39 +00:00
|
|
|
return offset;
|
2001-07-12 23:37:48 +00:00
|
|
|
}
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-08-05 01:15:27 +00:00
|
|
|
|
2003-11-19 03:53:33 +00:00
|
|
|
static void
|
2001-07-12 23:37:48 +00:00
|
|
|
dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
|
|
|
|
{
|
|
|
|
int offset = 0;
|
|
|
|
guint8 cmd;
|
|
|
|
proto_tree *tree = NULL;
|
|
|
|
proto_item *item = NULL;
|
|
|
|
guint32 periodicity;
|
2004-01-19 20:10:37 +00:00
|
|
|
guint8 host_name[17];
|
|
|
|
gint namelen;
|
2003-03-24 16:49:10 +00:00
|
|
|
guint8 server_count, reset_cmd;
|
2001-07-12 23:37:48 +00:00
|
|
|
int i;
|
2001-07-13 00:27:51 +00:00
|
|
|
guint32 uptime;
|
2001-07-12 23:37:48 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BROWSER");
|
2001-07-12 23:37:48 +00:00
|
|
|
}
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2001-07-13 07:04:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
cmd = tvb_get_guint8(tvb, offset);
|
2001-07-12 23:37:48 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
2001-07-12 23:37:48 +00:00
|
|
|
/* Put in something, and replace it later */
|
2001-12-10 00:26:21 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, val_to_str(cmd, commands, "Unknown command:0x%02x"));
|
2001-07-12 23:37:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (parent_tree) {
|
2002-01-24 09:20:54 +00:00
|
|
|
item = proto_tree_add_item(parent_tree, proto_smb_browse, tvb, offset, -1, TRUE);
|
2001-07-12 23:37:48 +00:00
|
|
|
|
|
|
|
tree = proto_item_add_subtree(item, ett_browse);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* command */
|
|
|
|
proto_tree_add_uint(tree, hf_command, tvb, offset, 1, cmd);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
switch (cmd) {
|
|
|
|
case BROWSE_DOMAIN_ANNOUNCEMENT:
|
|
|
|
case BROWSE_LOCAL_MASTER_ANNOUNCEMENT:
|
2003-02-17 01:59:39 +00:00
|
|
|
case BROWSE_HOST_ANNOUNCE: {
|
2001-07-12 23:37:48 +00:00
|
|
|
/* update count */
|
|
|
|
proto_tree_add_item(tree, hf_update_count, tvb, offset, 1, TRUE);
|
|
|
|
offset += 1;
|
|
|
|
|
2001-08-01 08:12:15 +00:00
|
|
|
/* periodicity (in milliseconds) */
|
2001-07-12 23:37:48 +00:00
|
|
|
periodicity = tvb_get_letohl(tvb, offset);
|
|
|
|
proto_tree_add_uint_format(tree, hf_periodicity, tvb, offset, 4,
|
|
|
|
periodicity,
|
2001-07-13 00:27:51 +00:00
|
|
|
"Update Periodicity: %s",
|
|
|
|
time_msecs_to_str(periodicity));
|
2001-07-12 23:37:48 +00:00
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
/* server name */
|
2003-04-30 02:35:28 +00:00
|
|
|
tvb_get_nstringz0(tvb, offset, sizeof(host_name), host_name);
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", host_name);
|
2001-07-12 23:37:48 +00:00
|
|
|
}
|
|
|
|
proto_tree_add_string_format(tree, hf_server_name,
|
|
|
|
tvb, offset, 16,
|
|
|
|
host_name,
|
|
|
|
(cmd==BROWSE_DOMAIN_ANNOUNCEMENT)?
|
|
|
|
"Domain/Workgroup: %s":
|
2002-08-28 21:04:11 +00:00
|
|
|
"Host Name: %s",
|
2001-07-12 23:37:48 +00:00
|
|
|
host_name);
|
|
|
|
offset += 16;
|
|
|
|
|
|
|
|
/* OS major version */
|
|
|
|
proto_tree_add_item(tree, hf_os_major, tvb, offset, 1, TRUE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* OS minor version */
|
|
|
|
proto_tree_add_item(tree, hf_os_minor, tvb, offset, 1, TRUE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* server type flags */
|
2003-02-17 01:59:39 +00:00
|
|
|
offset = dissect_smb_server_type_flags(
|
2003-02-20 07:55:00 +00:00
|
|
|
tvb, offset, pinfo, tree, NULL, TRUE);
|
2001-07-12 23:37:48 +00:00
|
|
|
|
2001-07-13 00:01:35 +00:00
|
|
|
if (cmd == BROWSE_DOMAIN_ANNOUNCEMENT) {
|
|
|
|
/*
|
|
|
|
* Network Monitor claims this is a "Comment
|
|
|
|
* Pointer". I don't believe it.
|
|
|
|
*
|
|
|
|
* It's not a browser protocol major/minor
|
|
|
|
* version number, and signature constant,
|
|
|
|
* however.
|
|
|
|
*/
|
|
|
|
proto_tree_add_text(tree, tvb, offset, 4,
|
|
|
|
"Mysterious Field: 0x%08x",
|
|
|
|
tvb_get_letohl(tvb, offset));
|
|
|
|
offset += 4;
|
|
|
|
} else {
|
|
|
|
/* browser protocol major version */
|
|
|
|
proto_tree_add_item(tree, hf_proto_major, tvb, offset, 1, TRUE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* browser protocol minor version */
|
|
|
|
proto_tree_add_item(tree, hf_proto_minor, tvb, offset, 1, TRUE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* signature constant */
|
|
|
|
proto_tree_add_item(tree, hf_sig_const, tvb, offset, 2, TRUE);
|
|
|
|
offset += 2;
|
|
|
|
}
|
2001-07-12 23:37:48 +00:00
|
|
|
|
2001-07-13 07:04:23 +00:00
|
|
|
/* master browser server name or server comment */
|
2001-07-30 05:20:44 +00:00
|
|
|
namelen = tvb_strsize(tvb, offset);
|
2001-07-12 23:37:48 +00:00
|
|
|
proto_tree_add_item(tree,
|
|
|
|
(cmd==BROWSE_DOMAIN_ANNOUNCEMENT)?
|
|
|
|
hf_mb_server_name : hf_server_comment,
|
|
|
|
tvb, offset, namelen, TRUE);
|
|
|
|
offset += namelen;
|
|
|
|
break;
|
2003-02-17 01:59:39 +00:00
|
|
|
}
|
2003-01-30 04:51:30 +00:00
|
|
|
case BROWSE_REQUEST_ANNOUNCE: {
|
2004-01-19 20:10:37 +00:00
|
|
|
guint8 *computer_name;
|
2003-01-30 04:51:30 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
/* unused/unknown flags */
|
|
|
|
proto_tree_add_item(tree, hf_unused_flags,
|
|
|
|
tvb, offset, 1, TRUE);
|
|
|
|
offset += 1;
|
|
|
|
|
2001-07-13 07:04:23 +00:00
|
|
|
/* name of computer to which to send reply */
|
Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
arguments, allocates a buffer big enough to hold a string with
the specified number of bytes plus an added null terminator
(i.e., length+1), copies the specified number of bytes from the
tvbuff, at the specified offset, to that buffer and puts in a
null terminator, and returns a pointer to that buffer (or throws
an exception before allocating the buffer if that many bytes
aren't available in the tvbuff);
tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
a "gint" as arguments, gets the size of the null-terminated
string starting at the specified offset in the tvbuff (throwing
an exception if the null terminator isn't found), allocates a
buffer big enough to hold that string, copies the string to that
buffer, and returns a pointer to that buffer and stores the
length of the string (including the terminating null) in the
variable pointed to by the "gint" pointer.
Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).
Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string). Use "tvb_get_stringz()", instead.
In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.
svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
|
|
|
computer_name = tvb_get_stringz(tvb, offset, &namelen);
|
|
|
|
proto_tree_add_string(tree, hf_response_computer_name,
|
|
|
|
tvb, offset, namelen, computer_name);
|
2003-01-30 04:51:30 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(
|
|
|
|
pinfo->cinfo, COL_INFO, " %s", computer_name);
|
|
|
|
g_free(computer_name);
|
2001-07-12 23:37:48 +00:00
|
|
|
offset += namelen;
|
|
|
|
break;
|
2003-01-30 04:51:30 +00:00
|
|
|
}
|
2001-07-12 23:37:48 +00:00
|
|
|
|
|
|
|
case BROWSE_ELECTION_REQUEST:
|
|
|
|
/* election version */
|
|
|
|
proto_tree_add_item(tree, hf_election_version, tvb, offset, 1, TRUE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* criterion */
|
2002-04-30 11:03:08 +00:00
|
|
|
dissect_election_criterion(tvb, tree, offset);
|
2001-07-12 23:37:48 +00:00
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
/* server uptime */
|
2001-07-13 00:27:51 +00:00
|
|
|
uptime = tvb_get_letohl(tvb, offset);
|
|
|
|
proto_tree_add_uint_format(tree, hf_server_uptime,
|
|
|
|
tvb, offset, 4, uptime,
|
|
|
|
"Uptime: %s",
|
|
|
|
time_msecs_to_str(uptime));
|
2001-07-12 23:37:48 +00:00
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
/* next 4 bytes must be zero */
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
/* server name */
|
2001-07-30 05:20:44 +00:00
|
|
|
namelen = tvb_strsize(tvb, offset);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_item(tree, hf_server_name,
|
2001-07-12 23:37:48 +00:00
|
|
|
tvb, offset, namelen, TRUE);
|
|
|
|
offset += namelen;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BROWSE_BACKUP_LIST_REQUEST:
|
|
|
|
/* backup list requested count */
|
|
|
|
proto_tree_add_item(tree, hf_backup_count, tvb, offset, 1, TRUE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* backup requested token */
|
|
|
|
proto_tree_add_item(tree, hf_backup_token, tvb, offset, 4, TRUE);
|
|
|
|
offset += 4;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BROWSE_BACKUP_LIST_RESPONSE:
|
|
|
|
/* backup list requested count */
|
|
|
|
server_count = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_uint(tree, hf_backup_count, tvb, offset, 1,
|
|
|
|
server_count);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* backup requested token */
|
|
|
|
proto_tree_add_item(tree, hf_backup_token, tvb, offset, 4, TRUE);
|
|
|
|
offset += 4;
|
|
|
|
|
2001-07-13 07:04:23 +00:00
|
|
|
/* backup server names */
|
2001-07-12 23:37:48 +00:00
|
|
|
for (i = 0; i < server_count; i++) {
|
2001-07-30 05:20:44 +00:00
|
|
|
namelen = tvb_strsize(tvb, offset);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_item(tree, hf_backup_server,
|
2001-07-12 23:37:48 +00:00
|
|
|
tvb, offset, namelen, TRUE);
|
|
|
|
offset += namelen;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BROWSE_MASTER_ANNOUNCEMENT:
|
2001-07-13 07:04:23 +00:00
|
|
|
/* master browser server name */
|
2001-07-30 05:20:44 +00:00
|
|
|
namelen = tvb_strsize(tvb, offset);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_item(tree, hf_mb_server_name,
|
2001-07-12 23:37:48 +00:00
|
|
|
tvb, offset, namelen, TRUE);
|
|
|
|
offset += namelen;
|
|
|
|
break;
|
|
|
|
|
2003-03-24 16:49:10 +00:00
|
|
|
case BROWSE_RESETBROWSERSTATE_ANNOUNCEMENT: {
|
|
|
|
proto_tree *sub_tree;
|
|
|
|
proto_item *reset_item;
|
|
|
|
|
2003-03-21 05:28:04 +00:00
|
|
|
/* the subcommand follows ... one of three values */
|
|
|
|
|
2003-03-24 16:49:10 +00:00
|
|
|
reset_cmd = tvb_get_guint8(tvb, offset);
|
|
|
|
reset_item = proto_tree_add_uint(tree, hf_mb_reset_command, tvb,
|
|
|
|
offset, 1, reset_cmd);
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_browse_reset_cmd_flags);
|
|
|
|
proto_tree_add_boolean(sub_tree, hf_mb_reset_demote, tvb,
|
|
|
|
offset, 1, reset_cmd);
|
|
|
|
proto_tree_add_boolean(sub_tree, hf_mb_reset_flush, tvb,
|
|
|
|
offset, 1, reset_cmd);
|
|
|
|
proto_tree_add_boolean(sub_tree, hf_mb_reset_stop, tvb,
|
|
|
|
offset, 1, reset_cmd);
|
2003-03-21 05:28:04 +00:00
|
|
|
offset += 1;
|
|
|
|
break;
|
2003-03-24 16:49:10 +00:00
|
|
|
}
|
2003-03-21 05:28:04 +00:00
|
|
|
|
2001-07-13 07:04:23 +00:00
|
|
|
case BROWSE_BECOME_BACKUP:
|
|
|
|
/* name of browser to promote */
|
2001-07-30 05:20:44 +00:00
|
|
|
namelen = tvb_strsize(tvb, offset);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_item(tree, hf_browser_to_promote,
|
2001-07-13 07:04:23 +00:00
|
|
|
tvb, offset, namelen, TRUE);
|
|
|
|
offset += namelen;
|
|
|
|
break;
|
2001-07-12 23:37:48 +00:00
|
|
|
}
|
|
|
|
}
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-08-01 03:47:00 +00:00
|
|
|
/*
|
|
|
|
* It appears that browser announcements sent to \MAILSLOT\LANMAN aren't
|
|
|
|
* the same as browser announcements sent to \MAILSLOT\BROWSE.
|
|
|
|
* Was that an older version of the protocol?
|
|
|
|
*
|
|
|
|
* The document at
|
|
|
|
*
|
2001-08-01 08:12:15 +00:00
|
|
|
* http://www.samba.org/samba/ftp/specs/brow_rev.txt
|
2001-08-01 03:47:00 +00:00
|
|
|
*
|
|
|
|
* gives both formats of host announcement packets, saying that
|
|
|
|
* "[The first] format seems wrong", that one being what appears to
|
|
|
|
* show up in \MAILSLOT\LANMAN packets, and that "[The second one]
|
|
|
|
* may be better", that one being what appears to show up in
|
|
|
|
* \MAILSLOT\BROWSE packets.
|
|
|
|
*
|
|
|
|
* XXX - what other browser packets go out to that mailslot?
|
|
|
|
*/
|
2003-11-19 03:53:33 +00:00
|
|
|
static void
|
2001-08-01 03:47:00 +00:00
|
|
|
dissect_mailslot_lanman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
|
|
|
|
{
|
|
|
|
int offset = 0;
|
|
|
|
guint8 cmd;
|
|
|
|
proto_tree *tree = NULL;
|
|
|
|
proto_item *item = NULL;
|
|
|
|
guint32 periodicity;
|
2004-01-19 20:10:37 +00:00
|
|
|
const guint8 *host_name;
|
2001-08-01 03:47:00 +00:00
|
|
|
guint namelen;
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BROWSER");
|
2001-08-01 03:47:00 +00:00
|
|
|
}
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2001-08-01 03:47:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
cmd = tvb_get_guint8(tvb, offset);
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
2001-08-01 03:47:00 +00:00
|
|
|
/* Put in something, and replace it later */
|
2001-12-10 00:26:21 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, val_to_str(cmd, commands, "Unknown command:0x%02x"));
|
2001-08-01 03:47:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (parent_tree) {
|
2002-01-24 09:20:54 +00:00
|
|
|
item = proto_tree_add_item(parent_tree, proto_smb_browse, tvb, offset, -1, TRUE);
|
2001-08-01 03:47:00 +00:00
|
|
|
|
|
|
|
tree = proto_item_add_subtree(item, ett_browse);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* command */
|
|
|
|
proto_tree_add_uint(tree, hf_command, tvb, offset, 1, cmd);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
switch (cmd) {
|
|
|
|
case BROWSE_DOMAIN_ANNOUNCEMENT:
|
|
|
|
case BROWSE_LOCAL_MASTER_ANNOUNCEMENT:
|
|
|
|
case BROWSE_HOST_ANNOUNCE:
|
2003-02-17 01:59:39 +00:00
|
|
|
|
2001-08-01 03:47:00 +00:00
|
|
|
/* update count */
|
|
|
|
proto_tree_add_item(tree, hf_update_count, tvb, offset, 1, TRUE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* server type flags */
|
2003-02-17 01:59:39 +00:00
|
|
|
offset = dissect_smb_server_type_flags(
|
2003-02-20 07:55:00 +00:00
|
|
|
tvb, offset, pinfo, tree, NULL, TRUE);
|
2001-08-01 03:47:00 +00:00
|
|
|
|
|
|
|
/* OS major version */
|
|
|
|
proto_tree_add_item(tree, hf_os_major, tvb, offset, 1, TRUE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* OS minor version */
|
|
|
|
proto_tree_add_item(tree, hf_os_minor, tvb, offset, 1, TRUE);
|
|
|
|
offset += 1;
|
|
|
|
|
2001-08-01 08:12:15 +00:00
|
|
|
/* periodicity (in seconds; convert to milliseconds) */
|
|
|
|
periodicity = tvb_get_letohs(tvb, offset)*1000;
|
2001-08-01 03:47:00 +00:00
|
|
|
proto_tree_add_uint_format(tree, hf_periodicity, tvb, offset, 2,
|
|
|
|
periodicity,
|
|
|
|
"Update Periodicity: %s",
|
|
|
|
time_msecs_to_str(periodicity));
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* server name */
|
|
|
|
namelen = tvb_strsize(tvb, offset);
|
|
|
|
host_name = tvb_get_ptr(tvb, offset, namelen);
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", host_name);
|
2001-08-01 03:47:00 +00:00
|
|
|
}
|
|
|
|
proto_tree_add_item(tree, hf_server_name,
|
|
|
|
tvb, offset, namelen, TRUE);
|
|
|
|
offset += namelen;
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-08-01 03:47:00 +00:00
|
|
|
/* master browser server name or server comment */
|
|
|
|
namelen = tvb_strsize(tvb, offset);
|
|
|
|
proto_tree_add_item(tree,
|
|
|
|
(cmd==BROWSE_DOMAIN_ANNOUNCEMENT)?
|
|
|
|
hf_mb_server_name : hf_server_comment,
|
|
|
|
tvb, offset, namelen, TRUE);
|
|
|
|
offset += namelen;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-11-19 10:23:39 +00:00
|
|
|
proto_register_smb_browse(void)
|
2001-08-01 03:47:00 +00:00
|
|
|
{
|
2001-07-12 23:37:48 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_command,
|
|
|
|
{ "Command", "browser.command", FT_UINT8, BASE_HEX,
|
|
|
|
VALS(commands), 0, "Browse command opcode", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_update_count,
|
|
|
|
{ "Update Count", "browser.update_count", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0, "Browse Update Count", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_periodicity,
|
|
|
|
{ "Update Periodicity", "browser.period", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0, "Update Periodicity in ms", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_name,
|
|
|
|
{ "Server Name", "browser.server", FT_STRING, BASE_NONE,
|
|
|
|
NULL, 0, "BROWSE Server Name", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_mb_server_name,
|
|
|
|
{ "Master Browser Server Name", "browser.mb_server", FT_STRING, BASE_NONE,
|
|
|
|
NULL, 0, "BROWSE Master Browser Server Name", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2003-03-21 05:28:04 +00:00
|
|
|
{ &hf_mb_reset_command,
|
|
|
|
{ "ResetBrowserState Command", "browser.reset_cmd", FT_UINT8,
|
|
|
|
BASE_HEX, VALS(&resetbrowserstate_command_names), 0,
|
|
|
|
"ResetBrowserState Command", HFILL }},
|
2003-03-24 16:49:10 +00:00
|
|
|
{ &hf_mb_reset_demote,
|
|
|
|
{ "Demote LMB", "browser.reset_cmd.demote", FT_BOOLEAN,
|
|
|
|
8, TFS(&tfs_demote_to_backup), 0x01, "Demote LMB", HFILL}},
|
|
|
|
{ &hf_mb_reset_flush,
|
|
|
|
{ "Flush Browse List", "browser.reset_cmd.flush", FT_BOOLEAN,
|
|
|
|
8, TFS(&tfs_flush_browse_list), 0x02, "Flush Browse List", HFILL}},
|
|
|
|
{ &hf_mb_reset_stop,
|
|
|
|
{ "Stop Being LMB", "browser.reset_cmd.stop_lmb", FT_BOOLEAN,
|
|
|
|
8, TFS(&tfs_stop_being_lmb), 0x04, "Stop Being LMB", HFILL}},
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_os_major,
|
|
|
|
{ "OS Major Version", "browser.os_major", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0, "Operating System Major Version", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_os_minor,
|
|
|
|
{ "OS Minor Version", "browser.os_minor", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0, "Operating System Minor Version", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type,
|
|
|
|
{ "Server Type", "browser.server_type", FT_UINT32, BASE_HEX,
|
|
|
|
NULL, 0, "Server Type Flags", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_workstation,
|
|
|
|
{ "Workstation", "browser.server_type.workstation", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_workstation), 1<<SERVER_WORKSTATION, "Is This A Workstation?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_server,
|
|
|
|
{ "Server", "browser.server_type.server", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_server), 1<<SERVER_SERVER, "Is This A Server?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_sql,
|
|
|
|
{ "SQL", "browser.server_type.sql", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_sql), 1<<SERVER_SQL_SERVER, "Is This A SQL Server?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_domain,
|
|
|
|
{ "Domain Controller", "browser.server_type.domain_controller", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_domain), 1<<SERVER_DOMAIN_CONTROLLER, "Is This A Domain Controller?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_backup,
|
|
|
|
{ "Backup Controller", "browser.server_type.backup_controller", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_backup), 1<<SERVER_BACKUP_CONTROLLER, "Is This A Backup Domain Controller?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_time,
|
|
|
|
{ "Time Source", "browser.server_type.time", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_time), 1<<SERVER_TIME_SOURCE, "Is This A Time Source?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_apple,
|
|
|
|
{ "Apple", "browser.server_type.apple", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_apple), 1<<SERVER_APPLE_SERVER, "Is This An Apple Server ?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_novell,
|
|
|
|
{ "Novell", "browser.server_type.novell", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_novell), 1<<SERVER_NOVELL_SERVER, "Is This A Novell Server?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_member,
|
|
|
|
{ "Member", "browser.server_type.member", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_member), 1<<SERVER_DOMAIN_MEMBER_SERVER, "Is This A Domain Member Server?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_print,
|
|
|
|
{ "Print", "browser.server_type.print", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_print), 1<<SERVER_PRINT_QUEUE_SERVER, "Is This A Print Server?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_dialin,
|
|
|
|
{ "Dialin", "browser.server_type.dialin", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_dialin), 1<<SERVER_DIALIN_SERVER, "Is This A Dialin Server?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_xenix,
|
|
|
|
{ "Xenix", "browser.server_type.xenix", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_xenix), 1<<SERVER_XENIX_SERVER, "Is This A Xenix Server?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_ntw,
|
|
|
|
{ "NT Workstation", "browser.server_type.ntw", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_ntw), 1<<SERVER_NT_WORKSTATION, "Is This A NT Workstation?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_wfw,
|
|
|
|
{ "WfW", "browser.server_type.wfw", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_wfw), 1<<SERVER_WINDOWS_FOR_WORKGROUPS, "Is This A Windows For Workgroups Server?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_nts,
|
|
|
|
{ "NT Server", "browser.server_type.nts", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_nts), 1<<SERVER_NT_SERVER, "Is This A NT Server?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_potentialb,
|
|
|
|
{ "Potential Browser", "browser.server_type.browser.potential", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_potentialb), 1<<SERVER_POTENTIAL_BROWSER, "Is This A Potential Browser?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_backupb,
|
|
|
|
{ "Backup Browser", "browser.server_type.browser.backup", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_backupb), 1<<SERVER_BACKUP_BROWSER, "Is This A Backup Browser?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_masterb,
|
|
|
|
{ "Master Browser", "browser.server_type.browser.master", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_masterb), 1<<SERVER_MASTER_BROWSER, "Is This A Master Browser?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_domainmasterb,
|
|
|
|
{ "Domain Master Browser", "browser.server_type.browser.domain_master", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_domainmasterb), 1<<SERVER_DOMAIN_MASTER_BROWSER, "Is This A Domain Master Browser?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_osf,
|
|
|
|
{ "OSF", "browser.server_type.osf", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_osf), 1<<SERVER_OSF, "Is This An OSF server ?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_vms,
|
|
|
|
{ "VMS", "browser.server_type.vms", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_vms), 1<<SERVER_VMS, "Is This A VMS Server?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_w95,
|
|
|
|
{ "Windows 95+", "browser.server_type.w95", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_w95), 1<<SERVER_WINDOWS_95, "Is This A Windows 95 or above server?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_local,
|
|
|
|
{ "Local", "browser.server_type.local", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_local), 1<<SERVER_LOCAL_LIST_ONLY, "Is This A Local List Only request?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_type_domainenum,
|
|
|
|
{ "Domain Enum", "browser.server_type.domainenum", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_domainenum), 1<<SERVER_DOMAIN_ENUM, "Is This A Domain Enum request?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_election_version,
|
2001-07-13 00:01:35 +00:00
|
|
|
{ "Election Version", "browser.election.version", FT_UINT8, BASE_DEC,
|
2001-07-12 23:37:48 +00:00
|
|
|
NULL, 0, "Election Version", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_proto_major,
|
|
|
|
{ "Browser Protocol Major Version", "browser.proto_major", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0, "Browser Protocol Major Version", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_proto_minor,
|
|
|
|
{ "Browser Protocol Minor Version", "browser.proto_minor", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0, "Browser Protocol Minor Version", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_sig_const,
|
|
|
|
{ "Signature", "browser.sig", FT_UINT16, BASE_HEX,
|
|
|
|
NULL, 0, "Signature Constant", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_comment,
|
|
|
|
{ "Host Comment", "browser.comment", FT_STRINGZ, BASE_NONE,
|
|
|
|
NULL, 0, "Server Comment", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_unused_flags,
|
|
|
|
{ "Unused flags", "browser.unused", FT_UINT8, BASE_HEX,
|
|
|
|
NULL, 0, "Unused/unknown flags", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-13 07:04:23 +00:00
|
|
|
{ &hf_response_computer_name,
|
|
|
|
{ "Response Computer Name", "browser.response_computer_name", FT_STRINGZ, BASE_NONE,
|
|
|
|
NULL, 0, "Response Computer Name", HFILL }},
|
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_election_criteria,
|
|
|
|
{ "Election Criteria", "browser.election.criteria", FT_UINT32, BASE_HEX,
|
|
|
|
NULL, 0, "Election Criteria", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_election_desire,
|
|
|
|
{ "Election Desire", "browser.election.desire", FT_UINT8, BASE_HEX,
|
|
|
|
NULL, 0, "Election Desire", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_election_desire_flags_backup,
|
|
|
|
{ "Backup", "browser.election.desire.backup", FT_BOOLEAN, 8,
|
|
|
|
TFS(&tfs_desire_backup), 1<<DESIRE_BACKUP, "Is this a backup server", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_election_desire_flags_standby,
|
|
|
|
{ "Standby", "browser.election.desire.standby", FT_BOOLEAN, 8,
|
|
|
|
TFS(&tfs_desire_standby), 1<<DESIRE_STANDBY, "Is this a standby server?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_election_desire_flags_master,
|
|
|
|
{ "Master", "browser.election.desire.master", FT_BOOLEAN, 8,
|
|
|
|
TFS(&tfs_desire_master), 1<<DESIRE_MASTER, "Is this a master server", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_election_desire_flags_domain_master,
|
|
|
|
{ "Domain Master", "browser.election.desire.domain_master", FT_BOOLEAN, 8,
|
|
|
|
TFS(&tfs_desire_domain_master), 1<<DESIRE_DOMAIN_MASTER, "Is this a domain master", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_election_desire_flags_wins,
|
|
|
|
{ "WINS", "browser.election.desire.wins", FT_BOOLEAN, 8,
|
|
|
|
TFS(&tfs_desire_wins), 1<<DESIRE_WINS, "Is this a WINS server", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_election_desire_flags_nt,
|
|
|
|
{ "NT", "browser.election.desire.nt", FT_BOOLEAN, 8,
|
|
|
|
TFS(&tfs_desire_nt), 1<<DESIRE_NT, "Is this a NT server", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_election_revision,
|
|
|
|
{ "Election Revision", "browser.election.revision", FT_UINT16, BASE_DEC,
|
|
|
|
NULL, 0, "Election Revision", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_election_os,
|
|
|
|
{ "Election OS", "browser.election.os", FT_UINT8, BASE_HEX,
|
|
|
|
NULL, 0, "Election OS", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_election_os_wfw,
|
|
|
|
{ "WfW", "browser.election.os.wfw", FT_BOOLEAN, 8,
|
|
|
|
TFS(&tfs_os_wfw), 1<<OS_WFW, "Is this a WfW host?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_election_os_ntw,
|
|
|
|
{ "NT Workstation", "browser.election.os.ntw", FT_BOOLEAN, 8,
|
|
|
|
TFS(&tfs_os_ntw), 1<<OS_NTW, "Is this a NT Workstation?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_election_os_nts,
|
|
|
|
{ "NT Server", "browser.election.os.nts", FT_BOOLEAN, 8,
|
|
|
|
TFS(&tfs_os_nts), 1<<OS_NTS, "Is this a NT Server?", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_server_uptime,
|
|
|
|
{ "Uptime", "browser.uptime", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0, "Server uptime in ms", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_backup_count,
|
|
|
|
{ "Backup List Requested Count", "browser.backup.count", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0, "Backup list requested count", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_backup_token,
|
|
|
|
{ "Backup Request Token", "browser.backup.token", FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0, "Backup requested/response token", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
{ &hf_backup_server,
|
|
|
|
{ "Backup Server", "browser.backup.server", FT_STRING, BASE_NONE,
|
|
|
|
NULL, 0, "Backup Server Name", HFILL }},
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-13 07:04:23 +00:00
|
|
|
{ &hf_browser_to_promote,
|
|
|
|
{ "Browser to Promote", "browser.browser_to_promote", FT_STRINGZ, BASE_NONE,
|
|
|
|
NULL, 0, "Browser to Promote", HFILL }},
|
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
};
|
2000-02-14 04:02:21 +00:00
|
|
|
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_browse,
|
|
|
|
&ett_browse_flags,
|
|
|
|
&ett_browse_election_criteria,
|
|
|
|
&ett_browse_election_os,
|
2003-03-24 16:49:10 +00:00
|
|
|
&ett_browse_election_desire,
|
|
|
|
&ett_browse_reset_cmd_flags,
|
2000-02-14 04:02:21 +00:00
|
|
|
};
|
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_smb_browse = proto_register_protocol("Microsoft Windows Browser Protocol",
|
|
|
|
"BROWSER", "browser");
|
2000-02-14 04:02:21 +00:00
|
|
|
|
2001-07-12 23:37:48 +00:00
|
|
|
proto_register_field_array(proto_smb_browse, hf, array_length(hf));
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2003-11-16 23:17:27 +00:00
|
|
|
|
2003-11-19 03:53:33 +00:00
|
|
|
register_dissector("mailslot_browse", dissect_mailslot_browse,
|
2003-11-16 23:17:27 +00:00
|
|
|
proto_smb_browse);
|
2003-11-19 03:53:33 +00:00
|
|
|
register_dissector("mailslot_lanman", dissect_mailslot_lanman,
|
2003-11-16 23:17:27 +00:00
|
|
|
proto_smb_browse);
|
2000-02-14 04:02:21 +00:00
|
|
|
}
|