MSWSP: fix dissect_mswsp_smb()
[wireshark-wip.git] / epan / dissectors / packet-smb-browse.c
blobed071c9aa4cb4f9860eb5e8b3ef42fae66d99b96
1 /* packet-smb-browse.c
2 * Routines for SMB Browser packet dissection
3 * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
5 * $Id$
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * Copied from packet-pop.c
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include "config.h"
30 #include <string.h>
32 #include <glib.h>
34 #include <epan/packet.h>
35 #include <epan/to_str.h>
36 #include <epan/dissectors/packet-smb.h>
38 #include "packet-smb-browse.h"
39 #include "packet-dcerpc.h"
41 static int proto_smb_browse = -1;
42 static int hf_command = -1;
43 static int hf_update_count = -1;
44 static int hf_periodicity = -1;
45 static int hf_server_name = -1;
46 static int hf_mb_server_name = -1;
47 static int hf_mb_reset_command = -1;
48 static int hf_mb_reset_demote = -1;
49 static int hf_mb_reset_flush = -1;
50 static int hf_mb_reset_stop = -1;
51 static int hf_os_major = -1;
52 static int hf_os_minor = -1;
53 static int hf_server_type = -1;
54 static int hf_server_type_workstation = -1;
55 static int hf_server_type_server = -1;
56 static int hf_server_type_sql = -1;
57 static int hf_server_type_domain = -1;
58 static int hf_server_type_backup = -1;
59 static int hf_server_type_time = -1;
60 static int hf_server_type_apple = -1;
61 static int hf_server_type_novell = -1;
62 static int hf_server_type_member = -1;
63 static int hf_server_type_print = -1;
64 static int hf_server_type_dialin = -1;
65 static int hf_server_type_xenix = -1;
66 static int hf_server_type_ntw = -1;
67 static int hf_server_type_wfw = -1;
68 static int hf_server_type_nts = -1;
69 static int hf_server_type_potentialb = -1;
70 static int hf_server_type_backupb = -1;
71 static int hf_server_type_masterb = -1;
72 static int hf_server_type_domainmasterb = -1;
73 static int hf_server_type_osf = -1;
74 static int hf_server_type_vms = -1;
75 static int hf_server_type_w95 = -1;
76 static int hf_server_type_dfs = -1;
77 static int hf_server_type_local = -1;
78 static int hf_server_type_domainenum = -1;
79 static int hf_election_version = -1;
80 static int hf_proto_major = -1;
81 static int hf_proto_minor = -1;
82 static int hf_sig_const = -1;
83 static int hf_server_comment = -1;
84 static int hf_unused_flags = -1;
85 static int hf_response_computer_name = -1;
86 static int hf_election_criteria = -1;
87 static int hf_election_desire = -1;
88 static int hf_election_desire_flags_backup = -1;
89 static int hf_election_desire_flags_standby = -1;
90 static int hf_election_desire_flags_master = -1;
91 static int hf_election_desire_flags_domain_master = -1;
92 static int hf_election_desire_flags_wins = -1;
93 static int hf_election_desire_flags_nt = -1;
94 /* static int hf_election_revision = -1; */
95 static int hf_election_os = -1;
96 static int hf_election_os_wfw = -1;
97 static int hf_election_os_ntw = -1;
98 static int hf_election_os_nts = -1;
99 static int hf_server_uptime = -1;
100 static int hf_backup_count = -1;
101 static int hf_backup_token = -1;
102 static int hf_backup_server = -1;
103 static int hf_browser_to_promote = -1;
105 static gint ett_browse = -1;
106 static gint ett_browse_flags = -1;
107 static gint ett_browse_election_criteria = -1;
108 static gint ett_browse_election_os = -1;
109 static gint ett_browse_election_desire = -1;
110 static gint ett_browse_reset_cmd_flags = -1;
112 #define SERVER_WORKSTATION 0
113 #define SERVER_SERVER 1
114 #define SERVER_SQL_SERVER 2
115 #define SERVER_DOMAIN_CONTROLLER 3
116 #define SERVER_BACKUP_CONTROLLER 4
117 #define SERVER_TIME_SOURCE 5
118 #define SERVER_APPLE_SERVER 6
119 #define SERVER_NOVELL_SERVER 7
120 #define SERVER_DOMAIN_MEMBER_SERVER 8
121 #define SERVER_PRINT_QUEUE_SERVER 9
122 #define SERVER_DIALIN_SERVER 10
123 #define SERVER_XENIX_SERVER 11
124 #define SERVER_NT_WORKSTATION 12
125 #define SERVER_WINDOWS_FOR_WORKGROUPS 13
126 #define SERVER_NT_SERVER 15
127 #define SERVER_POTENTIAL_BROWSER 16
128 #define SERVER_BACKUP_BROWSER 17
129 #define SERVER_MASTER_BROWSER 18
130 #define SERVER_DOMAIN_MASTER_BROWSER 19
131 #define SERVER_OSF 20
132 #define SERVER_VMS 21
133 #define SERVER_WINDOWS_95 22
134 #define SERVER_DFS_SERVER 23
135 #define SERVER_LOCAL_LIST_ONLY 30
136 #define SERVER_DOMAIN_ENUM 31
138 static const value_string server_types[] = {
139 {SERVER_WORKSTATION, "Workstation"},
140 {SERVER_SERVER, "Server"},
141 {SERVER_SQL_SERVER, "SQL Server"},
142 {SERVER_DOMAIN_CONTROLLER, "Domain Controller"},
143 {SERVER_BACKUP_CONTROLLER, "Backup Controller"},
144 {SERVER_TIME_SOURCE, "Time Source"},
145 {SERVER_APPLE_SERVER, "Apple Server"},
146 {SERVER_NOVELL_SERVER, "Novell Server"},
147 {SERVER_DOMAIN_MEMBER_SERVER, "Domain Member Server"},
148 {SERVER_PRINT_QUEUE_SERVER, "Print Queue Server"},
149 {SERVER_DIALIN_SERVER, "Dialin Server"},
150 {SERVER_XENIX_SERVER, "Xenix Server"},
151 {SERVER_NT_WORKSTATION, "NT Workstation"},
152 {SERVER_WINDOWS_FOR_WORKGROUPS, "Windows for Workgroups"},
153 {SERVER_NT_SERVER, "NT Server"},
154 {SERVER_POTENTIAL_BROWSER, "Potential Browser"},
155 {SERVER_BACKUP_BROWSER, "Backup Browser"},
156 {SERVER_MASTER_BROWSER, "Master Browser"},
157 {SERVER_DOMAIN_MASTER_BROWSER, "Domain Master Browser"},
158 {SERVER_OSF, "OSF"},
159 {SERVER_VMS, "VMS"},
160 {SERVER_WINDOWS_95, "Windows 95 or above"},
161 {SERVER_DFS_SERVER, "DFS server"},
162 {SERVER_LOCAL_LIST_ONLY, "Local List Only"},
163 {SERVER_DOMAIN_ENUM, "Domain Enum"},
164 {0, NULL}
167 #define SET_WINDOWS_VERSION_STRING(os_major_ver, os_minor_ver, windows_version) \
168 if(os_major_ver == 6 && os_minor_ver == 1) \
169 windows_version = "Windows 7 or Windows Server 2008 R2"; \
171 else if(os_major_ver == 6 && os_minor_ver == 0) \
172 windows_version = "Windows Vista or Windows Server 2008"; \
174 else if(os_major_ver == 5 && os_minor_ver == 2) \
175 windows_version = "Windows Server 2003 R2 or Windows Server 2003"; \
177 else if(os_major_ver == 5 && os_minor_ver == 1) \
178 windows_version = "Windows XP"; \
180 else if(os_major_ver == 5 && os_minor_ver == 0) \
181 windows_version = "Windows 2000"; \
183 else \
184 windows_version = NULL;
186 static const value_string resetbrowserstate_command_names[] = {
187 { 0x01, "Stop being a master browser and become a backup browser"},
188 { 0x02, "Discard browse lists, stop being a master browser, and try again"},
189 { 0x04, "Stop being a master browser for ever"},
190 { 0, NULL}
193 static true_false_string tfs_demote_to_backup = {
194 "Demote an LMB to a Backup Browser",
195 "Do not demote an LMB to a Backup Browser"
198 static true_false_string tfs_flush_browse_list = {
199 "Flush the Browse List",
200 "Do not Flush the Browse List"
203 static true_false_string tfs_stop_being_lmb = {
204 "Stop Being a Local Master Browser",
205 "Do not Stop Being a Local Master Browser"
208 static const true_false_string tfs_workstation = {
209 "This is a Workstation",
210 "This is NOT a Workstation"
212 static const true_false_string tfs_server = {
213 "This is a Server",
214 "This is NOT a Server"
216 static const true_false_string tfs_sql = {
217 "This is an SQL server",
218 "This is NOT an SQL server"
220 static const true_false_string tfs_domain = {
221 "This is a Domain Controller",
222 "This is NOT a Domain Controller"
224 static const true_false_string tfs_backup = {
225 "This is a Backup Controller",
226 "This is NOT a Backup Controller"
228 static const true_false_string tfs_time = {
229 "This is a Time Source",
230 "This is NOT a Time Source"
232 static const true_false_string tfs_apple = {
233 "This is an Apple host",
234 "This is NOT an Apple host"
236 static const true_false_string tfs_novell = {
237 "This is a Novell server",
238 "This is NOT a Novell server"
240 static const true_false_string tfs_member = {
241 "This is a Domain Member server",
242 "This is NOT a Domain Member server"
244 static const true_false_string tfs_print = {
245 "This is a Print Queue server",
246 "This is NOT a Print Queue server"
248 static const true_false_string tfs_dialin = {
249 "This is a Dialin server",
250 "This is NOT a Dialin server"
252 static const true_false_string tfs_xenix = {
253 "This is a Xenix server",
254 "This is NOT a Xenix server"
256 static const true_false_string tfs_ntw = {
257 "This is an NT Workstation",
258 "This is NOT an NT Workstation"
260 static const true_false_string tfs_wfw = {
261 "This is a WfW host",
262 "This is NOT a WfW host"
264 static const true_false_string tfs_nts = {
265 "This is an NT Server",
266 "This is NOT an NT Server"
268 static const true_false_string tfs_potentialb = {
269 "This is a Potential Browser",
270 "This is NOT a Potential Browser"
272 static const true_false_string tfs_backupb = {
273 "This is a Backup Browser",
274 "This is NOT a Backup Browser"
276 static const true_false_string tfs_masterb = {
277 "This is a Master Browser",
278 "This is NOT a Master Browser"
280 static const true_false_string tfs_domainmasterb = {
281 "This is a Domain Master Browser",
282 "This is NOT a Domain Master Browser"
284 static const true_false_string tfs_osf = {
285 "This is an OSF host",
286 "This is NOT an OSF host"
288 static const true_false_string tfs_vms = {
289 "This is a VMS host",
290 "This is NOT a VMS host"
292 static const true_false_string tfs_w95 = {
293 "This is a Windows 95 or above host",
294 "This is NOT a Windows 95 or above host"
296 static const true_false_string tfs_dfs = {
297 "This is a DFS server",
298 "THis is NOT a DFS server"
300 static const true_false_string tfs_local = {
301 "This is a local list only request",
302 "This is NOT a local list only request"
304 static const true_false_string tfs_domainenum = {
305 "This is a Domain Enum request",
306 "This is NOT a Domain Enum request"
309 #define DESIRE_BACKUP 0
310 #define DESIRE_STANDBY 1
311 #define DESIRE_MASTER 2
312 #define DESIRE_DOMAIN_MASTER 3
313 #define DESIRE_WINS 5
314 #define DESIRE_NT 7
316 static const true_false_string tfs_desire_backup = {
317 "Backup Browse Server",
318 "NOT Backup Browse Server"
320 static const true_false_string tfs_desire_standby = {
321 "Standby Browse Server",
322 "NOT Standby Browse Server"
324 static const true_false_string tfs_desire_master = {
325 "Master Browser",
326 "NOT Master Browser"
328 static const true_false_string tfs_desire_domain_master = {
329 "Domain Master Browse Server",
330 "NOT Domain Master Browse Server"
332 static const true_false_string tfs_desire_wins = {
333 "WINS Client",
334 "NOT WINS Client"
336 static const true_false_string tfs_desire_nt = {
337 "Windows NT Advanced Server",
338 "NOT Windows NT Advanced Server"
341 #define BROWSE_HOST_ANNOUNCE 1
342 #define BROWSE_REQUEST_ANNOUNCE 2
343 #define BROWSE_ELECTION_REQUEST 8
344 #define BROWSE_BACKUP_LIST_REQUEST 9
345 #define BROWSE_BACKUP_LIST_RESPONSE 10
346 #define BROWSE_BECOME_BACKUP 11
347 #define BROWSE_DOMAIN_ANNOUNCEMENT 12
348 #define BROWSE_MASTER_ANNOUNCEMENT 13
349 #define BROWSE_RESETBROWSERSTATE_ANNOUNCEMENT 14
350 #define BROWSE_LOCAL_MASTER_ANNOUNCEMENT 15
352 static const value_string commands[] = {
353 {BROWSE_HOST_ANNOUNCE, "Host Announcement"},
354 {BROWSE_REQUEST_ANNOUNCE, "Request Announcement"},
355 {BROWSE_ELECTION_REQUEST, "Browser Election Request"},
356 {BROWSE_BACKUP_LIST_REQUEST, "Get Backup List Request"},
357 {BROWSE_BACKUP_LIST_RESPONSE, "Get Backup List Response"},
358 {BROWSE_BECOME_BACKUP, "Become Backup Browser"},
359 {BROWSE_DOMAIN_ANNOUNCEMENT, "Domain/Workgroup Announcement"},
360 {BROWSE_MASTER_ANNOUNCEMENT, "Master Announcement"},
361 {BROWSE_RESETBROWSERSTATE_ANNOUNCEMENT, "Reset Browser State Announcement"},
362 {BROWSE_LOCAL_MASTER_ANNOUNCEMENT,"Local Master Announcement"},
363 {0, NULL}
366 #define OS_WFW 0
367 #define OS_NTW 4
368 #define OS_NTS 5
370 static const true_false_string tfs_os_wfw = {
371 "Windows for Workgroups",
372 "Not Windows for Workgroups"
374 static const true_false_string tfs_os_ntw = {
375 "Windows NT Workstation",
376 "Not Windows NT Workstation"
378 static const true_false_string tfs_os_nts = {
379 "Windows NT Server",
380 "Not Windows NT Server"
383 static void
384 dissect_election_criterion_os(tvbuff_t *tvb, proto_tree *parent_tree, int offset)
386 proto_tree *tree = NULL;
387 proto_item *item = NULL;
388 guint8 os;
390 os = tvb_get_guint8(tvb, offset);
392 if (parent_tree) {
393 item = proto_tree_add_uint(parent_tree, hf_election_os, tvb, offset, 1, os);
394 tree = proto_item_add_subtree(item, ett_browse_election_os);
397 proto_tree_add_boolean(tree, hf_election_os_wfw,
398 tvb, offset, 1, os);
399 proto_tree_add_boolean(tree, hf_election_os_ntw,
400 tvb, offset, 1, os);
401 proto_tree_add_boolean(tree, hf_election_os_nts,
402 tvb, offset, 1, os);
406 static void
407 dissect_election_criterion_desire(tvbuff_t *tvb, proto_tree *parent_tree, int offset)
409 proto_tree *tree = NULL;
410 proto_item *item = NULL;
411 guint8 desire;
413 desire = tvb_get_guint8(tvb, offset);
415 if (parent_tree) {
416 item = proto_tree_add_uint(parent_tree, hf_election_desire, tvb, offset, 1, desire);
417 tree = proto_item_add_subtree(item, ett_browse_election_desire);
420 proto_tree_add_boolean(tree, hf_election_desire_flags_backup,
421 tvb, offset, 1, desire);
422 proto_tree_add_boolean(tree, hf_election_desire_flags_standby,
423 tvb, offset, 1, desire);
424 proto_tree_add_boolean(tree, hf_election_desire_flags_master,
425 tvb, offset, 1, desire);
426 proto_tree_add_boolean(tree, hf_election_desire_flags_domain_master,
427 tvb, offset, 1, desire);
428 proto_tree_add_boolean(tree, hf_election_desire_flags_wins,
429 tvb, offset, 1, desire);
430 proto_tree_add_boolean(tree, hf_election_desire_flags_nt,
431 tvb, offset, 1, desire);
435 static void
436 dissect_election_criterion(tvbuff_t *tvb, proto_tree *parent_tree, int offset)
438 proto_tree *tree = NULL;
439 proto_item *item = NULL;
440 guint32 criterion;
442 criterion = tvb_get_letohl(tvb, offset);
444 if (parent_tree) {
445 item = proto_tree_add_uint(parent_tree, hf_election_criteria, tvb, offset, 4, criterion);
446 tree = proto_item_add_subtree(item, ett_browse_election_criteria);
449 /* election desire */
450 dissect_election_criterion_desire(tvb, tree, offset);
451 offset += 1;
453 /* browser protocol major version */
454 proto_tree_add_item(tree, hf_proto_major, tvb, offset, 1, ENC_LITTLE_ENDIAN);
455 offset += 1;
457 /* browser protocol minor version */
458 proto_tree_add_item(tree, hf_proto_minor, tvb, offset, 1, ENC_LITTLE_ENDIAN);
459 offset += 1;
461 /* election os */
462 dissect_election_criterion_os(tvb, tree, offset);
467 * XXX - this causes non-browser packets to have browser fields.
470 dissect_smb_server_type_flags(tvbuff_t *tvb, int offset, packet_info *pinfo,
471 proto_tree *parent_tree, guint8 *drep,
472 gboolean infoflag)
474 proto_tree *tree = NULL;
475 proto_item *item = NULL;
476 guint32 flags;
477 int i;
479 if (drep != NULL) {
481 * Called from a DCE RPC protocol dissector, for a
482 * protocol where a 32-bit NDR integer contains
483 * an server type mask; extract the server type mask
484 * with an NDR call (but don't put it into the
485 * protocol tree, as we can't get a pointer to the
486 * item it puts in, and thus can't put a tree below
487 * it with the values of the individual bits).
489 offset = dissect_ndr_uint32(
490 tvb, offset, pinfo, NULL, NULL, drep, hf_server_type, &flags);
491 } else {
493 * Called from SMB browser or RAP, where the server type
494 * mask is just a 4-byte little-endian quantity with no
495 * special NDR alignment requirement; extract it with
496 * "tvb_get_letohl()".
498 flags = tvb_get_letohl(tvb, offset);
499 offset += 4;
502 if (parent_tree) {
503 item = proto_tree_add_uint(parent_tree, hf_server_type, tvb, offset-4, 4, flags);
504 tree = proto_item_add_subtree(item, ett_browse_flags);
507 if (infoflag) {
508 /* Append the type(s) of the system to the COL_INFO line ... */
509 for (i = 0; i < 32; i++) {
510 if (flags & (1<<i)) {
511 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
512 val_to_str(i, server_types,
513 "Unknown server type:%d"));
518 proto_tree_add_boolean(tree, hf_server_type_workstation,
519 tvb, offset-4, 4, flags);
520 proto_tree_add_boolean(tree, hf_server_type_server,
521 tvb, offset-4, 4, flags);
522 proto_tree_add_boolean(tree, hf_server_type_sql,
523 tvb, offset-4, 4, flags);
524 proto_tree_add_boolean(tree, hf_server_type_domain,
525 tvb, offset-4, 4, flags);
526 proto_tree_add_boolean(tree, hf_server_type_backup,
527 tvb, offset-4, 4, flags);
528 proto_tree_add_boolean(tree, hf_server_type_time,
529 tvb, offset-4, 4, flags);
530 proto_tree_add_boolean(tree, hf_server_type_apple,
531 tvb, offset-4, 4, flags);
532 proto_tree_add_boolean(tree, hf_server_type_novell,
533 tvb, offset-4, 4, flags);
534 proto_tree_add_boolean(tree, hf_server_type_member,
535 tvb, offset-4, 4, flags);
536 proto_tree_add_boolean(tree, hf_server_type_print,
537 tvb, offset-4, 4, flags);
538 proto_tree_add_boolean(tree, hf_server_type_dialin,
539 tvb, offset-4, 4, flags);
540 proto_tree_add_boolean(tree, hf_server_type_xenix,
541 tvb, offset-4, 4, flags);
542 proto_tree_add_boolean(tree, hf_server_type_ntw,
543 tvb, offset-4, 4, flags);
544 proto_tree_add_boolean(tree, hf_server_type_wfw,
545 tvb, offset-4, 4, flags);
546 proto_tree_add_boolean(tree, hf_server_type_nts,
547 tvb, offset-4, 4, flags);
548 proto_tree_add_boolean(tree, hf_server_type_potentialb,
549 tvb, offset-4, 4, flags);
550 proto_tree_add_boolean(tree, hf_server_type_backupb,
551 tvb, offset-4, 4, flags);
552 proto_tree_add_boolean(tree, hf_server_type_masterb,
553 tvb, offset-4, 4, flags);
554 proto_tree_add_boolean(tree, hf_server_type_domainmasterb,
555 tvb, offset-4, 4, flags);
556 proto_tree_add_boolean(tree, hf_server_type_osf,
557 tvb, offset-4, 4, flags);
558 proto_tree_add_boolean(tree, hf_server_type_vms,
559 tvb, offset-4, 4, flags);
560 proto_tree_add_boolean(tree, hf_server_type_w95,
561 tvb, offset-4, 4, flags);
562 proto_tree_add_boolean(tree, hf_server_type_dfs,
563 tvb, offset-4, 4, flags);
564 proto_tree_add_boolean(tree, hf_server_type_local,
565 tvb, offset-4, 4, flags);
566 proto_tree_add_boolean(tree, hf_server_type_domainenum,
567 tvb, offset-4, 4, flags);
569 return offset;
573 static void
574 dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
576 int offset = 0;
577 guint8 cmd;
578 proto_tree *tree = NULL;
579 proto_item *item = NULL;
580 guint32 periodicity;
581 gchar host_name[17];
582 gchar *utf8_host_name;
583 gint namelen;
584 guint8 server_count, reset_cmd;
585 guint8 os_major_ver, os_minor_ver;
586 const gchar *windows_version = NULL;
587 int i;
588 guint32 uptime;
590 col_set_str(pinfo->cinfo, COL_PROTOCOL, "BROWSER");
591 col_clear(pinfo->cinfo, COL_INFO);
593 cmd = tvb_get_guint8(tvb, offset);
595 /* Put in something, and replace it later */
596 col_add_str(pinfo->cinfo, COL_INFO, val_to_str(cmd, commands, "Unknown command:0x%02x"));
599 item = proto_tree_add_item(parent_tree, proto_smb_browse, tvb, offset, -1, ENC_NA);
600 tree = proto_item_add_subtree(item, ett_browse);
602 /* command */
603 proto_tree_add_uint(tree, hf_command, tvb, offset, 1, cmd);
604 offset += 1;
606 switch (cmd) {
607 case BROWSE_DOMAIN_ANNOUNCEMENT:
608 case BROWSE_LOCAL_MASTER_ANNOUNCEMENT:
609 case BROWSE_HOST_ANNOUNCE: {
610 /* update count */
611 proto_tree_add_item(tree, hf_update_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
612 offset += 1;
614 /* periodicity (in milliseconds) */
615 periodicity = tvb_get_letohl(tvb, offset);
616 proto_tree_add_uint_format_value(tree, hf_periodicity, tvb, offset, 4,
617 periodicity,
618 "%s",
619 time_msecs_to_str(periodicity));
620 offset += 4;
622 /* server name */
623 tvb_get_nstringz0(tvb, offset, sizeof(host_name), host_name);
624 utf8_host_name = g_convert(host_name, strlen(host_name),
625 "UTF-8", "CP437", NULL, NULL, NULL);
626 if (utf8_host_name == NULL)
627 utf8_host_name = host_name;
628 col_append_fstr(pinfo->cinfo, COL_INFO, " %s", utf8_host_name);
629 proto_tree_add_string_format(tree, hf_server_name,
630 tvb, offset, 16,
631 utf8_host_name,
632 (cmd==BROWSE_DOMAIN_ANNOUNCEMENT)?
633 "Domain/Workgroup: %s":
634 "Host Name: %s",
635 utf8_host_name);
636 if (utf8_host_name != host_name)
637 g_free(utf8_host_name);
638 offset += 16;
640 /* Windows version (See "OSVERSIONINFO Structure" on MSDN) */
641 os_major_ver = tvb_get_guint8(tvb, offset);
642 os_minor_ver = tvb_get_guint8(tvb, offset+1);
644 SET_WINDOWS_VERSION_STRING(os_major_ver, os_minor_ver, windows_version);
646 if(windows_version)
647 proto_tree_add_text(tree, tvb, offset, 2, "Windows version: %s", windows_version);
649 /* OS major version */
650 proto_tree_add_item(tree, hf_os_major, tvb, offset, 1, ENC_LITTLE_ENDIAN);
651 offset += 1;
653 /* OS minor version */
654 proto_tree_add_item(tree, hf_os_minor, tvb, offset, 1, ENC_LITTLE_ENDIAN);
655 offset += 1;
657 /* server type flags */
658 offset = dissect_smb_server_type_flags(
659 tvb, offset, pinfo, tree, NULL, TRUE);
661 if (cmd == BROWSE_DOMAIN_ANNOUNCEMENT && tvb_get_letohs (tvb, offset + 2) != 0xAA55) {
663 * Network Monitor claims this is a "Comment
664 * Pointer". I don't believe it.
666 * It's not a browser protocol major/minor
667 * version number, and signature constant,
668 * however.
670 proto_tree_add_text(tree, tvb, offset, 4,
671 "Mysterious Field: 0x%08x",
672 tvb_get_letohl(tvb, offset));
673 offset += 4;
674 } else {
675 /* browser protocol major version */
676 proto_tree_add_item(tree, hf_proto_major, tvb, offset, 1, ENC_LITTLE_ENDIAN);
677 offset += 1;
679 /* browser protocol minor version */
680 proto_tree_add_item(tree, hf_proto_minor, tvb, offset, 1, ENC_LITTLE_ENDIAN);
681 offset += 1;
683 /* signature constant */
684 proto_tree_add_item(tree, hf_sig_const, tvb, offset, 2, ENC_LITTLE_ENDIAN);
685 offset += 2;
688 /* master browser server name or server comment */
689 namelen = tvb_strsize(tvb, offset);
690 proto_tree_add_item(tree,
691 (cmd==BROWSE_DOMAIN_ANNOUNCEMENT)?
692 hf_mb_server_name : hf_server_comment,
693 tvb, offset, namelen, ENC_ASCII|ENC_NA);
694 break;
696 case BROWSE_REQUEST_ANNOUNCE: {
697 guint8 *computer_name;
699 /* unused/unknown flags */
700 proto_tree_add_item(tree, hf_unused_flags,
701 tvb, offset, 1, ENC_LITTLE_ENDIAN);
702 offset += 1;
704 /* name of computer to which to send reply */
705 computer_name = tvb_get_stringz(wmem_packet_scope(), tvb, offset, &namelen);
706 proto_tree_add_string(tree, hf_response_computer_name,
707 tvb, offset, namelen, computer_name);
708 col_append_fstr(pinfo->cinfo, COL_INFO, " %s", computer_name);
709 break;
712 case BROWSE_ELECTION_REQUEST:
713 /* election version */
714 proto_tree_add_item(tree, hf_election_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
715 offset += 1;
717 /* criterion */
718 dissect_election_criterion(tvb, tree, offset);
719 offset += 4;
721 /* server uptime */
722 uptime = tvb_get_letohl(tvb, offset);
723 proto_tree_add_uint_format_value(tree, hf_server_uptime,
724 tvb, offset, 4, uptime,
725 "%s",
726 time_msecs_to_str(uptime));
727 offset += 4;
729 /* next 4 bytes must be zero */
730 offset += 4;
732 /* server name */
733 namelen = tvb_strsize(tvb, offset);
734 proto_tree_add_item(tree, hf_server_name,
735 tvb, offset, namelen, ENC_ASCII|ENC_NA);
736 break;
738 case BROWSE_BACKUP_LIST_REQUEST:
739 /* backup list requested count */
740 proto_tree_add_item(tree, hf_backup_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
741 offset += 1;
743 /* backup requested token */
744 proto_tree_add_item(tree, hf_backup_token, tvb, offset, 4, ENC_LITTLE_ENDIAN);
745 break;
747 case BROWSE_BACKUP_LIST_RESPONSE:
748 /* backup list requested count */
749 server_count = tvb_get_guint8(tvb, offset);
750 proto_tree_add_uint(tree, hf_backup_count, tvb, offset, 1,
751 server_count);
752 offset += 1;
754 /* backup requested token */
755 proto_tree_add_item(tree, hf_backup_token, tvb, offset, 4, ENC_LITTLE_ENDIAN);
756 offset += 4;
758 /* backup server names */
759 for (i = 0; i < server_count; i++) {
760 namelen = tvb_strsize(tvb, offset);
761 proto_tree_add_item(tree, hf_backup_server,
762 tvb, offset, namelen, ENC_ASCII|ENC_NA);
763 offset += namelen;
765 break;
767 case BROWSE_MASTER_ANNOUNCEMENT:
768 /* master browser server name */
769 namelen = tvb_strsize(tvb, offset);
770 proto_tree_add_item(tree, hf_mb_server_name,
771 tvb, offset, namelen, ENC_ASCII|ENC_NA);
772 break;
774 case BROWSE_RESETBROWSERSTATE_ANNOUNCEMENT: {
775 proto_tree *sub_tree;
776 proto_item *reset_item;
778 /* the subcommand follows ... one of three values */
780 reset_cmd = tvb_get_guint8(tvb, offset);
781 reset_item = proto_tree_add_uint(tree, hf_mb_reset_command, tvb,
782 offset, 1, reset_cmd);
783 sub_tree = proto_item_add_subtree(reset_item, ett_browse_reset_cmd_flags);
784 proto_tree_add_boolean(sub_tree, hf_mb_reset_demote, tvb,
785 offset, 1, reset_cmd);
786 proto_tree_add_boolean(sub_tree, hf_mb_reset_flush, tvb,
787 offset, 1, reset_cmd);
788 proto_tree_add_boolean(sub_tree, hf_mb_reset_stop, tvb,
789 offset, 1, reset_cmd);
790 break;
793 case BROWSE_BECOME_BACKUP:
794 /* name of browser to promote */
795 namelen = tvb_strsize(tvb, offset);
796 proto_tree_add_item(tree, hf_browser_to_promote,
797 tvb, offset, namelen, ENC_ASCII|ENC_NA);
798 break;
803 * It appears that browser announcements sent to \MAILSLOT\LANMAN aren't
804 * the same as browser announcements sent to \MAILSLOT\BROWSE.
805 * Was that an older version of the protocol?
807 * The document at
809 * http://www.samba.org/samba/ftp/specs/brow_rev.txt
811 * gives both formats of host announcement packets, saying that
812 * "[The first] format seems wrong", that one being what appears to
813 * show up in \MAILSLOT\LANMAN packets, and that "[The second one]
814 * may be better", that one being what appears to show up in
815 * \MAILSLOT\BROWSE packets.
817 * XXX - what other browser packets go out to that mailslot?
819 static void
820 dissect_mailslot_lanman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
822 int offset = 0;
823 guint8 cmd;
824 proto_tree *tree = NULL;
825 proto_item *item = NULL;
826 guint32 periodicity;
827 const guint8 *host_name;
828 guint8 os_major_ver, os_minor_ver;
829 const gchar *windows_version = NULL;
830 guint namelen;
832 col_set_str(pinfo->cinfo, COL_PROTOCOL, "BROWSER");
833 col_clear(pinfo->cinfo, COL_INFO);
835 cmd = tvb_get_guint8(tvb, offset);
837 /* Put in something, and replace it later */
838 col_add_str(pinfo->cinfo, COL_INFO, val_to_str(cmd, commands, "Unknown command:0x%02x"));
841 if (parent_tree) {
842 item = proto_tree_add_item(parent_tree, proto_smb_browse, tvb, offset, -1, ENC_NA);
844 tree = proto_item_add_subtree(item, ett_browse);
847 /* command */
848 proto_tree_add_uint(tree, hf_command, tvb, offset, 1, cmd);
849 offset += 1;
851 switch (cmd) {
852 case BROWSE_DOMAIN_ANNOUNCEMENT:
853 case BROWSE_LOCAL_MASTER_ANNOUNCEMENT:
854 case BROWSE_HOST_ANNOUNCE:
856 /* update count */
857 proto_tree_add_item(tree, hf_update_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
858 offset += 1;
860 /* server type flags */
861 offset = dissect_smb_server_type_flags(
862 tvb, offset, pinfo, tree, NULL, TRUE);
864 /* OS version string (See "OSVERSIONINFO Structure" on MSDN) */
865 os_major_ver = tvb_get_guint8(tvb, offset);
866 os_minor_ver = tvb_get_guint8(tvb, offset+1);
868 SET_WINDOWS_VERSION_STRING(os_major_ver, os_minor_ver, windows_version);
870 if(windows_version)
871 proto_tree_add_text(tree, tvb, offset, 2, "Windows version: %s", windows_version);
873 /* OS major version */
874 proto_tree_add_item(tree, hf_os_major, tvb, offset, 1, ENC_LITTLE_ENDIAN);
875 offset += 1;
877 /* OS minor version */
878 proto_tree_add_item(tree, hf_os_minor, tvb, offset, 1, ENC_LITTLE_ENDIAN);
879 offset += 1;
881 /* periodicity (in seconds; convert to milliseconds) */
882 periodicity = tvb_get_letohs(tvb, offset)*1000;
883 proto_tree_add_uint_format_value(tree, hf_periodicity, tvb, offset, 2,
884 periodicity,
885 "%s",
886 time_msecs_to_str(periodicity));
887 offset += 2;
889 /* server name */
890 host_name = tvb_get_const_stringz(tvb, offset, &namelen);
891 col_append_fstr(pinfo->cinfo, COL_INFO, " %s", host_name);
893 proto_tree_add_item(tree, hf_server_name,
894 tvb, offset, namelen, ENC_ASCII|ENC_NA);
895 offset += namelen;
897 /* master browser server name or server comment */
898 namelen = tvb_strsize(tvb, offset);
899 proto_tree_add_item(tree,
900 (cmd==BROWSE_DOMAIN_ANNOUNCEMENT)?
901 hf_mb_server_name : hf_server_comment,
902 tvb, offset, namelen, ENC_ASCII|ENC_NA);
903 break;
907 void
908 proto_register_smb_browse(void)
910 static hf_register_info hf[] = {
911 { &hf_command,
912 { "Command", "browser.command", FT_UINT8, BASE_HEX,
913 VALS(commands), 0, "Browse command opcode", HFILL }},
915 { &hf_update_count,
916 { "Update Count", "browser.update_count", FT_UINT8, BASE_DEC,
917 NULL, 0, "Browse Update Count", HFILL }},
919 { &hf_periodicity,
920 { "Update Periodicity", "browser.period", FT_UINT32, BASE_DEC,
921 NULL, 0, "Update Periodicity in ms", HFILL }},
923 { &hf_server_name,
924 { "Server Name", "browser.server", FT_STRING, BASE_NONE,
925 NULL, 0, "BROWSE Server Name", HFILL }},
927 { &hf_mb_server_name,
928 { "Master Browser Server Name", "browser.mb_server", FT_STRING, BASE_NONE,
929 NULL, 0, "BROWSE Master Browser Server Name", HFILL }},
931 { &hf_mb_reset_command,
932 { "ResetBrowserState Command", "browser.reset_cmd", FT_UINT8,
933 BASE_HEX, VALS(resetbrowserstate_command_names), 0,
934 NULL, HFILL }},
935 { &hf_mb_reset_demote,
936 { "Demote LMB", "browser.reset_cmd.demote", FT_BOOLEAN,
937 8, TFS(&tfs_demote_to_backup), 0x01, NULL, HFILL}},
938 { &hf_mb_reset_flush,
939 { "Flush Browse List", "browser.reset_cmd.flush", FT_BOOLEAN,
940 8, TFS(&tfs_flush_browse_list), 0x02, NULL, HFILL}},
941 { &hf_mb_reset_stop,
942 { "Stop Being LMB", "browser.reset_cmd.stop_lmb", FT_BOOLEAN,
943 8, TFS(&tfs_stop_being_lmb), 0x04, NULL, HFILL}},
944 { &hf_os_major,
945 { "OS Major Version", "browser.os_major", FT_UINT8, BASE_DEC,
946 NULL, 0, "Operating System Major Version", HFILL }},
948 { &hf_os_minor,
949 { "OS Minor Version", "browser.os_minor", FT_UINT8, BASE_DEC,
950 NULL, 0, "Operating System Minor Version", HFILL }},
952 { &hf_server_type,
953 { "Server Type", "browser.server_type", FT_UINT32, BASE_HEX,
954 NULL, 0, "Server Type Flags", HFILL }},
956 { &hf_server_type_workstation,
957 { "Workstation", "browser.server_type.workstation", FT_BOOLEAN, 32,
958 TFS(&tfs_workstation), 1<<SERVER_WORKSTATION, "Is This A Workstation?", HFILL }},
960 { &hf_server_type_server,
961 { "Server", "browser.server_type.server", FT_BOOLEAN, 32,
962 TFS(&tfs_server), 1<<SERVER_SERVER, "Is This A Server?", HFILL }},
964 { &hf_server_type_sql,
965 { "SQL", "browser.server_type.sql", FT_BOOLEAN, 32,
966 TFS(&tfs_sql), 1<<SERVER_SQL_SERVER, "Is This A SQL Server?", HFILL }},
968 { &hf_server_type_domain,
969 { "Domain Controller", "browser.server_type.domain_controller", FT_BOOLEAN, 32,
970 TFS(&tfs_domain), 1<<SERVER_DOMAIN_CONTROLLER, "Is This A Domain Controller?", HFILL }},
972 { &hf_server_type_backup,
973 { "Backup Controller", "browser.server_type.backup_controller", FT_BOOLEAN, 32,
974 TFS(&tfs_backup), 1<<SERVER_BACKUP_CONTROLLER, "Is This A Backup Domain Controller?", HFILL }},
976 { &hf_server_type_time,
977 { "Time Source", "browser.server_type.time", FT_BOOLEAN, 32,
978 TFS(&tfs_time), 1<<SERVER_TIME_SOURCE, "Is This A Time Source?", HFILL }},
980 { &hf_server_type_apple,
981 { "Apple", "browser.server_type.apple", FT_BOOLEAN, 32,
982 TFS(&tfs_apple), 1<<SERVER_APPLE_SERVER, "Is This An Apple Server ?", HFILL }},
984 { &hf_server_type_novell,
985 { "Novell", "browser.server_type.novell", FT_BOOLEAN, 32,
986 TFS(&tfs_novell), 1<<SERVER_NOVELL_SERVER, "Is This A Novell Server?", HFILL }},
988 { &hf_server_type_member,
989 { "Member", "browser.server_type.member", FT_BOOLEAN, 32,
990 TFS(&tfs_member), 1<<SERVER_DOMAIN_MEMBER_SERVER, "Is This A Domain Member Server?", HFILL }},
992 { &hf_server_type_print,
993 { "Print", "browser.server_type.print", FT_BOOLEAN, 32,
994 TFS(&tfs_print), 1<<SERVER_PRINT_QUEUE_SERVER, "Is This A Print Server?", HFILL }},
996 { &hf_server_type_dialin,
997 { "Dialin", "browser.server_type.dialin", FT_BOOLEAN, 32,
998 TFS(&tfs_dialin), 1<<SERVER_DIALIN_SERVER, "Is This A Dialin Server?", HFILL }},
1000 { &hf_server_type_xenix,
1001 { "Xenix", "browser.server_type.xenix", FT_BOOLEAN, 32,
1002 TFS(&tfs_xenix), 1<<SERVER_XENIX_SERVER, "Is This A Xenix Server?", HFILL }},
1004 { &hf_server_type_ntw,
1005 { "NT Workstation", "browser.server_type.ntw", FT_BOOLEAN, 32,
1006 TFS(&tfs_ntw), 1<<SERVER_NT_WORKSTATION, "Is This A NT Workstation?", HFILL }},
1008 { &hf_server_type_wfw,
1009 { "WfW", "browser.server_type.wfw", FT_BOOLEAN, 32,
1010 TFS(&tfs_wfw), 1<<SERVER_WINDOWS_FOR_WORKGROUPS, "Is This A Windows For Workgroups Server?", HFILL }},
1012 { &hf_server_type_nts,
1013 { "NT Server", "browser.server_type.nts", FT_BOOLEAN, 32,
1014 TFS(&tfs_nts), 1<<SERVER_NT_SERVER, "Is This A NT Server?", HFILL }},
1016 { &hf_server_type_potentialb,
1017 { "Potential Browser", "browser.server_type.browser.potential", FT_BOOLEAN, 32,
1018 TFS(&tfs_potentialb), 1<<SERVER_POTENTIAL_BROWSER, "Is This A Potential Browser?", HFILL }},
1020 { &hf_server_type_backupb,
1021 { "Backup Browser", "browser.server_type.browser.backup", FT_BOOLEAN, 32,
1022 TFS(&tfs_backupb), 1<<SERVER_BACKUP_BROWSER, "Is This A Backup Browser?", HFILL }},
1024 { &hf_server_type_masterb,
1025 { "Master Browser", "browser.server_type.browser.master", FT_BOOLEAN, 32,
1026 TFS(&tfs_masterb), 1<<SERVER_MASTER_BROWSER, "Is This A Master Browser?", HFILL }},
1028 { &hf_server_type_domainmasterb,
1029 { "Domain Master Browser", "browser.server_type.browser.domain_master", FT_BOOLEAN, 32,
1030 TFS(&tfs_domainmasterb), 1<<SERVER_DOMAIN_MASTER_BROWSER, "Is This A Domain Master Browser?", HFILL }},
1032 { &hf_server_type_osf,
1033 { "OSF", "browser.server_type.osf", FT_BOOLEAN, 32,
1034 TFS(&tfs_osf), 1<<SERVER_OSF, "Is This An OSF server ?", HFILL }},
1036 { &hf_server_type_vms,
1037 { "VMS", "browser.server_type.vms", FT_BOOLEAN, 32,
1038 TFS(&tfs_vms), 1<<SERVER_VMS, "Is This A VMS Server?", HFILL }},
1040 { &hf_server_type_w95,
1041 { "Windows 95+", "browser.server_type.w95", FT_BOOLEAN, 32,
1042 TFS(&tfs_w95), 1<<SERVER_WINDOWS_95, "Is This A Windows 95 or above server?", HFILL }},
1044 { &hf_server_type_dfs,
1045 { "DFS", "browser.server_type.dfs", FT_BOOLEAN, 32,
1046 TFS(&tfs_dfs), 1<<SERVER_DFS_SERVER, "Is This A DFS server?", HFILL }},
1048 { &hf_server_type_local,
1049 { "Local", "browser.server_type.local", FT_BOOLEAN, 32,
1050 TFS(&tfs_local), 1<<SERVER_LOCAL_LIST_ONLY, "Is This A Local List Only request?", HFILL }},
1052 { &hf_server_type_domainenum,
1053 { "Domain Enum", "browser.server_type.domainenum", FT_BOOLEAN, 32,
1054 TFS(&tfs_domainenum), 1<<SERVER_DOMAIN_ENUM, "Is This A Domain Enum request?", HFILL }},
1056 { &hf_election_version,
1057 { "Election Version", "browser.election.version", FT_UINT8, BASE_DEC,
1058 NULL, 0, NULL, HFILL }},
1060 { &hf_proto_major,
1061 { "Browser Protocol Major Version", "browser.proto_major", FT_UINT8, BASE_DEC,
1062 NULL, 0, NULL, HFILL }},
1064 { &hf_proto_minor,
1065 { "Browser Protocol Minor Version", "browser.proto_minor", FT_UINT8, BASE_DEC,
1066 NULL, 0, NULL, HFILL }},
1068 { &hf_sig_const,
1069 { "Signature", "browser.sig", FT_UINT16, BASE_HEX,
1070 NULL, 0, "Signature Constant", HFILL }},
1072 { &hf_server_comment,
1073 { "Host Comment", "browser.comment", FT_STRINGZ, BASE_NONE,
1074 NULL, 0, "Server Comment", HFILL }},
1076 { &hf_unused_flags,
1077 { "Unused flags", "browser.unused", FT_UINT8, BASE_HEX,
1078 NULL, 0, "Unused/unknown flags", HFILL }},
1080 { &hf_response_computer_name,
1081 { "Response Computer Name", "browser.response_computer_name", FT_STRINGZ, BASE_NONE,
1082 NULL, 0, NULL, HFILL }},
1084 { &hf_election_criteria,
1085 { "Election Criteria", "browser.election.criteria", FT_UINT32, BASE_HEX,
1086 NULL, 0, NULL, HFILL }},
1088 { &hf_election_desire,
1089 { "Election Desire", "browser.election.desire", FT_UINT8, BASE_HEX,
1090 NULL, 0, NULL, HFILL }},
1092 { &hf_election_desire_flags_backup,
1093 { "Backup", "browser.election.desire.backup", FT_BOOLEAN, 8,
1094 TFS(&tfs_desire_backup), 1<<DESIRE_BACKUP, "Is this a backup server", HFILL }},
1096 { &hf_election_desire_flags_standby,
1097 { "Standby", "browser.election.desire.standby", FT_BOOLEAN, 8,
1098 TFS(&tfs_desire_standby), 1<<DESIRE_STANDBY, "Is this a standby server?", HFILL }},
1100 { &hf_election_desire_flags_master,
1101 { "Master", "browser.election.desire.master", FT_BOOLEAN, 8,
1102 TFS(&tfs_desire_master), 1<<DESIRE_MASTER, "Is this a master server", HFILL }},
1104 { &hf_election_desire_flags_domain_master,
1105 { "Domain Master", "browser.election.desire.domain_master", FT_BOOLEAN, 8,
1106 TFS(&tfs_desire_domain_master), 1<<DESIRE_DOMAIN_MASTER, "Is this a domain master", HFILL }},
1108 { &hf_election_desire_flags_wins,
1109 { "WINS", "browser.election.desire.wins", FT_BOOLEAN, 8,
1110 TFS(&tfs_desire_wins), 1<<DESIRE_WINS, "Is this a WINS server", HFILL }},
1112 { &hf_election_desire_flags_nt,
1113 { "NT", "browser.election.desire.nt", FT_BOOLEAN, 8,
1114 TFS(&tfs_desire_nt), 1<<DESIRE_NT, "Is this a NT server", HFILL }},
1116 #if 0
1117 { &hf_election_revision,
1118 { "Election Revision", "browser.election.revision", FT_UINT16, BASE_DEC,
1119 NULL, 0, NULL, HFILL }},
1120 #endif
1122 { &hf_election_os,
1123 { "Election OS", "browser.election.os", FT_UINT8, BASE_HEX,
1124 NULL, 0, NULL, HFILL }},
1126 { &hf_election_os_wfw,
1127 { "WfW", "browser.election.os.wfw", FT_BOOLEAN, 8,
1128 TFS(&tfs_os_wfw), 1<<OS_WFW, "Is this a WfW host?", HFILL }},
1130 { &hf_election_os_ntw,
1131 { "NT Workstation", "browser.election.os.ntw", FT_BOOLEAN, 8,
1132 TFS(&tfs_os_ntw), 1<<OS_NTW, "Is this a NT Workstation?", HFILL }},
1134 { &hf_election_os_nts,
1135 { "NT Server", "browser.election.os.nts", FT_BOOLEAN, 8,
1136 TFS(&tfs_os_nts), 1<<OS_NTS, "Is this a NT Server?", HFILL }},
1138 { &hf_server_uptime,
1139 { "Uptime", "browser.uptime", FT_UINT32, BASE_DEC,
1140 NULL, 0, "Server uptime in ms", HFILL }},
1142 { &hf_backup_count,
1143 { "Backup List Requested Count", "browser.backup.count", FT_UINT8, BASE_DEC,
1144 NULL, 0, NULL, HFILL }},
1146 { &hf_backup_token,
1147 { "Backup Request Token", "browser.backup.token", FT_UINT32, BASE_DEC,
1148 NULL, 0, "Backup requested/response token", HFILL }},
1150 { &hf_backup_server,
1151 { "Backup Server", "browser.backup.server", FT_STRING, BASE_NONE,
1152 NULL, 0, "Backup Server Name", HFILL }},
1154 { &hf_browser_to_promote,
1155 { "Browser to Promote", "browser.browser_to_promote", FT_STRINGZ, BASE_NONE,
1156 NULL, 0, NULL, HFILL }},
1160 static gint *ett[] = {
1161 &ett_browse,
1162 &ett_browse_flags,
1163 &ett_browse_election_criteria,
1164 &ett_browse_election_os,
1165 &ett_browse_election_desire,
1166 &ett_browse_reset_cmd_flags,
1169 proto_smb_browse = proto_register_protocol("Microsoft Windows Browser Protocol",
1170 "BROWSER", "browser");
1172 proto_register_field_array(proto_smb_browse, hf, array_length(hf));
1173 proto_register_subtree_array(ett, array_length(ett));
1175 register_dissector("mailslot_browse", dissect_mailslot_browse,
1176 proto_smb_browse);
1177 register_dissector("mailslot_lanman", dissect_mailslot_lanman,
1178 proto_smb_browse);