2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A * Temporary. It should be removed once NBTD is integrated. 2N/A * 3. Browser Overview 2N/A * Hosts involved in the browsing process can be separated into two 2N/A * distinct groups, browser clients and browser servers (often referred to 2N/A * simply as "browsers"). 2N/A * A browser is a server which maintains information about servers - 2N/A * primarily the domain they are in and the services that they are running 2N/A * -- and about domains. Browsers may assume several different roles in 2N/A * their lifetimes, and dynamically switch between them. 2N/A * Browser clients are of two types: workstations and (non-browser) 2N/A * servers. In the context of browsing, workstations query browsers for the 2N/A * information they contain; servers supply browsers the information by 2N/A * registering with them. Note that, at times, browsers may themselves 2N/A * behave as browser clients and query other browsers. 2N/A * For the purposes of this specification, a domain is simply a name with 2N/A * which to associate a group of resources such as computers, servers and 2N/A * users. Domains allow a convenient means for browser clients to restrict 2N/A * the scope of a search when they query browser servers. Every domain has 2N/A * a "master" server called the Primary Domain Controller (PDC) that 2N/A * manages various activities within the domain. 2N/A * One browser for each domain on a subnet is designated the Local Master 2N/A * Browser for that domain. Servers in its domain on the subnet register 2N/A * with it, as do the Local Master Browsers for other domains on the 2N/A * subnet. It uses these registrations to maintain authoritative 2N/A * information about its domain on its subnet. If there are other subnets 2N/A * in the network, it also knows the name of the server running the 2N/A * domain's Domain Master Browser; it registers with it, and uses it to 2N/A * obtain information about the rest of the network (see below). 2N/A * Clients on a subnet query browsers designated as the Backup Browsers for 2N/A * the subnet (not the Master Browser). Backup Browsers maintain a copy of 2N/A * the information on the Local Master Browser; they get it by periodically 2N/A * querying the Local Master Browser for all of its information. Clients 2N/A * find the Backup Browsers by asking the Local Master Browser. Clients are 2N/A * expected to spread their queries evenly across Backup Browsers to 2N/A * The Local Master Browser is dynamically elected automatically. Multiple 2N/A * Backup Browser Servers may exist per subnet; they are selected from 2N/A * among the potential browser servers by the Local Master Browser, which 2N/A * is configured to select enough to handle the expected query load. 2N/A * When there are multiple subnets, a Domain Master Browser is assigned 2N/A * the task of keeping the multiple subnets in synchronization. The Primary 2N/A * Domain Controller (PDC) always acts as the Domain Master Browser. The 2N/A * Domain Master Browser periodically acts as a client and queries all the 2N/A * Local Master Browsers for its domain, asking them for a list containing 2N/A * all the domains and all the servers in their domain known within their 2N/A * subnets; it merges all the replies into a single master list. This 2N/A * allows a Domain Master Browser server to act as a collection point for 2N/A * inter-subnet browsing information. Local Master Browsers periodically 2N/A * query the Domain Master Browser to retrieve the network-wide information 2N/A * When a domain spans only a single subnet, there will not be any distinct 2N/A * Local Master Browser; this role will be handled by the Domain Master 2N/A * Browser. Similarly, the Domain Master Browser is always the Local Master 2N/A * Browser for the subnet it is on. 2N/A * When a browser client suspects that the Local Master Browser has failed, 2N/A * the client will instigate an election in which the browser servers 2N/A * participate, and some browser servers may change roles. 2N/A * Some characteristics of a good browsing mechanism include: 2N/A * . minimal network traffic 2N/A * . minimum server discovery time 2N/A * . minimum change discovery latency 2N/A * . immunity to machine failures 2N/A * Historically, Browser implementations had been very closely tied to 2N/A * NETBIOS and datagrams. The early implementations caused a lot of 2N/A * broadcast traffic. See Appendix D for an overview that presents how the 2N/A * Browser specification evolved. 2N/A * 4. Browsing Protocol Architecture 2N/A * This section first describes the how the browsing protocol is layered, 2N/A * then describes the roles of clients, servers, and browsers in the 2N/A * browsing subsystem. 2N/A * 4.1 Layering of Browsing Protocol Requests 2N/A * Most of the browser functionality is implemented using mailslots. 2N/A * Mailslots provide a mechanism for fast, unreliable unidirectional data 2N/A * transfer; they are named via ASCII "mailslot (path) name". Mailslots are 2N/A * implemented using the CIFS Transact SMB which is encapsulated in a 2N/A * NETBIOS datagram. Browser protocol requests are sent to browser specific 2N/A * mailslots using some browser-specific NETBIOS names. These datagrams can 2N/A * either be unicast or broadcast, depending on whether the NETBIOS name is 2N/A * a "unique name" or a "group name". Various data structures, which are 2N/A * detailed subsequently within this document, flow as the data portion of 2N/A * Here is an example of a generic browser SMB, showing how a browser 2N/A * request is encapsulated in a TRANSACT SMB request. Note that the PID, 2N/A * TID, MID, UID, and Flags are all 0 in mailslot requests. 2N/A * SMB: C transact, File = \MAILSLOT\BROWSE 2N/A * SMB: SMB Status = Error Success 2N/A * SMB: Error class = No Error 2N/A * SMB: Error code = No Error 2N/A * SMB: Header: PID = 0x0000 TID = 0x0000 MID = 0x0000 UID = 0x0000 2N/A * SMB: Tree ID (TID) = 0 (0x0) 2N/A * SMB: Process ID (PID) = 0 (0x0) 2N/A * SMB: User ID (UID) = 0 (0x0) 2N/A * SMB: Multiplex ID (MID) = 0 (0x0) 2N/A * SMB: Flags Summary = 0 (0x0) 2N/A * SMB: Command = C transact 2N/A * SMB: Word count = 17 2N/A * SMB: Word parameters 2N/A * SMB: Total parm bytes = 0 2N/A * SMB: Total data bytes = 33 2N/A * SMB: Max parm bytes = 0 2N/A * SMB: Max data bytes = 0 2N/A * SMB: Max setup words = 0 2N/A * SMB: Transact Flags Summary = 0 (0x0) 2N/A * SMB: ...............0 = Leave session intact 2N/A * SMB: ..............0. = Response required 2N/A * SMB: Transact timeout = 0 (0x0) 2N/A * SMB: Parameter bytes = 0 (0x0) 2N/A * SMB: Parameter offset = 0 (0x0) 2N/A * SMB: Data bytes = 33 (0x21) 2N/A * SMB: Data offset = 86 (0x56) 2N/A * SMB: Setup word count = 3 2N/A * SMB: Mailslot opcode = Write mailslot 2N/A * SMB: Transaction priority = 1 2N/A * SMB: Mailslot class = Unreliable (broadcast) 2N/A * SMB: Byte count = 50 2N/A * SMB: Byte parameters 2N/A * SMB: Path name = \MAILSLOT\BROWSE 2N/A * SMB: Transaction data 2N/A * SMB: Data: Number of data bytes remaining = 33 (0x0021) 2N/A * Note the SMB command is Transact, the opcode within the Transact SMB is 2N/A * Mailslot Write, and the browser data structure is carried as the 2N/A * The Transaction data begins with an opcode, that signifies the operation 2N/A * and determines the size and structure of data that follows. This opcode 2N/A * is named as per one of the below: 2N/A * HostAnnouncement 1 2N/A * AnnouncementRequest 2 2N/A * GetBackupListReq 9 2N/A * GetBackupListResp 10 2N/A * DomainAnnouncment 12 2N/A * MasterAnnouncement 13 2N/A * LocalMasterAnnouncement 15 2N/A * Browser datagrams are often referred to as simply browser frames. The 2N/A * frames are in particular, referred to by the name of the opcode within 2N/A * the Transaction data e.g. a GetBackupListReq browser frame, a 2N/A * RequestElection browser frame, etc. 2N/A * The structures that are sent as the data portion of the Transact SMB are 2N/A * described in section(s) 6.2 through 6.12 in this document. These 2N/A * structures are tightly packed, i.e. there are no intervening pad bytes 2N/A * in the structure, unless they are explicitly described as being there. 2N/A * All quantities are sent in native Intel format and multi-byte values are 2N/A * transmitted least significant byte first. 2N/A * Besides mailslots and Transaction SMBs, the other important piece of the 2N/A * browser architecture is the NetServerEnum2 request. This request that 2N/A * allows an application to interrogate a Browser Server and obtain a 2N/A * complete list of resources (servers, domains, etc) known to that Browser 2N/A * server. Details of the NetServerEnum2 request are presented in section 2N/A * 6.4. Some examples of the NetServerEnum2 request being used are when a 2N/A * Local Master Browser sends a NetServerEnum2 request to the Domain Master 2N/A * Browser and vice versa. Another example is when a browser client sends a 2N/A * NetServerEnum2 request to a Backup Browser server. 2N/A * 4.3 Non-Browser Server 2N/A * A non-browser server is a server that has some resource(s) or service(s) 2N/A * it wishes to advertise as being available using the browsing protocol. 2N/A * Examples of non-browser servers would be an SQL server, print server, 2N/A * A non-browser server MUST periodically send a HostAnnouncement browser 2N/A * frame, specifying the type of resources or services it is advertising. 2N/A * Details are in section 6.5. 2N/A * A non-browser server SHOULD announce itself relatively frequently when 2N/A * it first starts up in order to make its presence quickly known to the 2N/A * browsers and thence to potential clients. The frequency of the 2N/A * announcements SHOULD then be gradually stretched, so as to minimize 2N/A * network traffic. Typically, non-browser servers announce themselves 2N/A * once every minute upon start up and then gradually adjust the frequency 2N/A * of the announcements to once every 12 minutes. 2N/A * A non-browser server SHOULD send a HostAnnouncement browser frame 2N/A * specifying a type of 0 just prior to shutting down, to allow it to 2N/A * quickly be removed from the list of available servers. 2N/A * A non-browser server MUST receive and process AnnouncementRequest frames 2N/A * from the Local Master Browser, and MUST respond with a HostAnnouncement 2N/A * frame, after a delay chosen randomly from the interval [0,30] seconds. 2N/A * AnnouncementRequests typically happen when a Local Master Browser starts 2N/A * up with an empty list of servers for the domain, and wants to fill it 2N/A * quickly. The 30 second range for responses prevents the Master Browser 2N/A * from becoming overloaded and losing replies, as well as preventing the 2N/A * network from being flooded with responses. 2N/A * 4.4 Browser Servers 2N/A * The following sections describe the roles of the various types of 2N/A * 4.4.1 Potential Browser Server 2N/A * A Potential Browser server is a browser server that is capable of being 2N/A * a Backup Browser server or Master Browser server, but is not currently 2N/A * fulfilling either of those roles. 2N/A * A Potential Browser MUST set type SV_TYPE_POTENTIAL_BROWSER (see section 2N/A * 6.4.1) in its HostAnnouncement until it is ready to shut down. In its 2N/A * last HostAnnouncement frame before it shuts down, it SHOULD specify a 2N/A * A Potential Browser server MUST receive and process BecomeBackup frames 2N/A * (see section 6.9) and become a backup browser upon their receipt. 2N/A * A Potential Browser MUST participate in browser elections (see section 2N/A * 4.4.2 Backup Browser 2N/A * Backup Browser servers are a subset of the Potential Browsers that have 2N/A * been chosen by the Master Browser on their subnet to be the Backup 2N/A * Browsers for the subnet. 2N/A * A Backup Browser MUST set type SV_TYPE_BACKUP_BROWSER (see section 2N/A * 6.4.1) in its HostAnnouncement until it is ready to shut down. In its 2N/A * last HostAnnouncement frame before it shuts down, it SHOULD specify a 2N/A * A Backup Browser MUST listen for a LocalMasterAnnouncement frame (see 2N/A * section 6.10) from the Local Master Browser, and use it to set the name 2N/A * of the Master Browser it queries for the server and domain lists. 2N/A * A Backup Browsers MUST periodically make a NetServerEnum2 request of 2N/A * the Master Browser on its subnet for its domain to get a list of servers 2N/A * in that domain, as well as a list of domains. The period is a 2N/A * configuration option balancing currency of the information with network 2N/A * traffic costs - a typical value is 15 minutes. 2N/A * A Backup Browser SHOULD force an election by sending a RequestElection 2N/A * frame (see section 6.7) if it does not get a response to its periodic 2N/A * NetServeEnum2 request to the Master Browser. 2N/A * A Backup Browser MUST receive and process NetServerEnum2 requests from 2N/A * browser clients, for its own domain and others. If the request is for a 2N/A * list of servers in its domain, or for a list of domains, it can answer 2N/A * from its internal lists. If the request is for a list of servers in a 2N/A * domain different than the one it serves, it sends a NetServerEnum2 2N/A * request to the Domain Master Browser for that domain (which it can in 2N/A * find in its list of domains and their Domain Master Browsers). 2N/A * A Backup Browser MUST participate in browser elections (see section 2N/A * 4.4.3 Master Browser 2N/A * Master Browsers are responsible for: 2N/A * . indicating it is a Master Browser 2N/A * . receiving server announcements and building a list of such servers 2N/A * and keeping it reasonably up-to-date. 2N/A * . returning lists of Backup Browsers to browser clients. 2N/A * . ensuring an appropriate number of Backup Browsers are available. 2N/A * . announcing their existence to other Master Browsers on their subnet, 2N/A * to the Domain Master Browser for their domain, and to all browsers in 2N/A * their domain on their subnet 2N/A * . forwarding requests for lists of servers on other domains to the 2N/A * Master Browser for that domain 2N/A * . keeping a list of domains in its subnet 2N/A * . synchronizing with the Domain Master Browser (if any) for its domain 2N/A * . participating in browser elections 2N/A * . ensuring that there is only one Master Browser on its subnet 2N/A * A Master Browser MUST set type SV_TYPE_MASTER_BROWSER (see section 2N/A * 6.4.1) in its HostAnnouncement until it is ready to shut down. In its 2N/A * last HostAnnouncement frame before it shuts down, it SHOULD specify a 2N/A * A Master Browser MUST receive and process HostAnnouncement frames from 2N/A * servers, adding the server name and other information to its servers 2N/A * list; it must mark them as "local" entries. Periodically, it MUST check 2N/A * all local server entries to see if a server's HostAnnouncement has timed 2N/A * out (no HostAnnouncement received for three times the periodicity the 2N/A * server gave in the last received HostAnnouncement) and remove timed-out 2N/A * servers from its list. 2N/A * A Master Browser MUST receive and process DomainAnnouncement frames (see 2N/A * section 6.12) and maintain the domain names and their associated (Local) 2N/A * Master Browsers in its internal domain list until they time out; it must 2N/A * mark these as "local" entries. Periodically, it MUST check all local 2N/A * domain entries to see if a server's DomainAnnouncement has timed out (no 2N/A * DomainAnnouncement received for three times the periodicity the server 2N/A * gave in the last received DomainAnnouncement) and remove timed-out 2N/A * servers from its list. 2N/A * A Master Browser MUST receive and process GetBackupListRequest frames 2N/A * from clients, returning GetBackupListResponse frames containing a list 2N/A * of the Backup Servers for its domain. 2N/A * A Master Browser MUST eventually send BecomeBackup frames (see section 2N/A * 6.9) to one or more Potential Browser servers to increase the number of 2N/A * Backup Browsers if there are not enough Backup Browsers to handle the 2N/A * anticipated query load. Note: possible good times for checking for 2N/A * sufficient backup browsers are after being elected, when timing out 2N/A * server HostAnnouncements, and when receiving a server's HostAnnouncement 2N/A * for the first time. 2N/A * A Master Browser MUST periodically announce itself and the domain it 2N/A * serves to other (Local) Master Browsers on its subnet, by sending a 2N/A * DomainAnnouncement frame (see section 6.12) to its subnet. 2N/A * A Master Browser MUST send a MasterAnnouncement frame (see section 6.11) 2N/A * to the Domain Master Browser after it is first elected, and periodically 2N/A * thereafter. This informs the Domain Master Browser of the presence of 2N/A * all the Master Browsers. 2N/A * A Master Browser MUST periodically announce itself to all browsers for 2N/A * its domain on its subnet by sending a LocalMasterAnnouncement frame (see 2N/A * A Master Browser MUST receive and process NetServerEnum2 requests from 2N/A * browser clients, for its own domain and others. If the request is for a 2N/A * list of servers in its domain, or for a list of domains, it can answer 2N/A * from its internal lists. Entries in its list marked "local" MUST have 2N/A * the SV_TYPE_LOCAL_LIST_ONLY bit set in the returned results; it must be 2N/A * clear for all other entries. If the request is for a list of servers in 2N/A * a domain different than the one it serves, it sends a NetServerEnum2 2N/A * request to the Domain Master Browser for that domain (which it can in 2N/A * find in its list of domains and their Domain Master Browsers). 2N/A * Note: The list of servers that the Master Browser maintains and 2N/A * returns to the Backup Browsers, is limited in size to 64K of 2N/A * data. This will limit the number of systems that can be in a 2N/A * browse list in a single workgroup or domain to approximately two 2N/A * A Master Browser SHOULD request all servers to register with it by 2N/A * sending an AnnouncementRequest frame, if, on becoming the Master Browser 2N/A * by winning an election, its server list is empty. Otherwise, clients 2N/A * might get an incomplete list of servers until the servers' periodic 2N/A * registrations fill the server list. 2N/A * If the Master Browser on a subnet is not the Primary Domain Controller 2N/A * (PDC), then it is a Local Master Browser. 2N/A * A Local Master Browser MUST periodically synchronize with the Domain 2N/A * Master Browser (which is the PDC). This synchronization is performed by 2N/A * making a NetServerEnum2 request to the Domain Master Browser and merging 2N/A * the results with its list of servers and domains. An entry from the 2N/A * Domain Master Browser should be marked "non-local", and must not 2N/A * overwrite an entry with the same name marked "local". The Domain Master 2N/A * Browser is located as specified in Appendix B. 2N/A * A Master Browser MUST participate in browser elections (see section 2N/A * A Master Browser MUST, if it receives a HostAnnouncement, 2N/A * DomainAnnouncement, or LocalMasterAnnouncement frame another system that 2N/A * claims to be the Master Browser for its domain, demote itself from 2N/A * Master Browser and force an election. This ensures that there is only 2N/A * ever one Master Browser in each workgroup or domain. 2N/A * A Master Browser SHOULD, if it loses an election, become a Backup 2N/A * Browser (without being told to do so by the new Master Browser). Since 2N/A * it has more up-to-date information in its lists than a Potential 2N/A * Browser, it is more efficient to have it be a Backup Browser than to 2N/A * promote a Potential Browser. 2N/A * 4.4.3.1 Preferred Master Browser 2N/A * A Preferred Master Browser supports exactly the same protocol elements 2N/A * as a Potential Browser, except as follows. 2N/A * A Preferred Master Browser MUST always force an election when it starts 2N/A * A Preferred Master Browser MUST participate in browser elections (see 2N/A * A Preferred Master Browser MUST set the Preferred Master bit in the 2N/A * RequestElection frame (see section 6.7) to bias the election in its 2N/A * A Preferred Master Browser SHOULD, if it loses an election, 2N/A * automatically become a Backup Browser, without being told to do so by 2N/A * the Master Browser. 2N/A * 4.4.4 Domain Master Browser 2N/A * Since the Domain Master Browser always runs on the PDC, it must 2N/A * implement all the protocols required of a PDC in addition to the 2N/A * browsing protocol, and that is way beyond the scope of this 2N/A * 5. Mailslot Protocol Specification 2N/A * The only transaction allowed to a mailslot is a mailslot write. Mailslot 2N/A * writes requests are encapsulated in TRANSACT SMBs. The following table 2N/A * shows the interpretation of the TRANSACT SMB parameters for a mailslot 2N/A * Name Value Description 2N/A * Command SMB_COM_TRANSACTION 2N/A * Name <name> STRING name of mail slot to write; 2N/A * must start with "\\MAILSLOT\\" 2N/A * SetupCount 3 Always 3 for mailslot writes 2N/A * Setup[0] 1 Command code == write mailslot 2N/A * TotalDataCount n Size of data in bytes to write to 2N/A * Data[ n ] The data to write to the mailslot 2N/A * SMB: C transact, File = \MAILSLOT\BROWSE 2N/A * SMB: SMB Status = Error Success 2N/A * SMB: Error class = No Error 2N/A * SMB: Error code = No Error 2N/A * SMB: Header: PID = 0x0000 TID = 0x0000 MID = 0x0000 UID = 0x0000 2N/A * SMB: Tree ID (TID) = 0 (0x0) 2N/A * SMB: Process ID (PID) = 0 (0x0) 2N/A * SMB: User ID (UID) = 0 (0x0) 2N/A * SMB: Multiplex ID (MID) = 0 (0x0) 2N/A * SMB: Flags Summary = 0 (0x0) 2N/A * SMB: Command = C transact 2N/A * SMB: Word count = 17 2N/A * SMB: Word parameters 2N/A * SMB: Total parm bytes = 0 2N/A * SMB: Total data bytes = 33 2N/A * SMB: Max parm bytes = 0 2N/A * SMB: Max data bytes = 0 2N/A * SMB: Max setup words = 0 2N/A * SMB: Transact Flags Summary = 0 (0x0) 2N/A * SMB: ...............0 = Leave session intact 2N/A * SMB: ..............0. = Response required 2N/A * SMB: Transact timeout = 0 (0x0) 2N/A * SMB: Parameter bytes = 0 (0x0) 2N/A * SMB: Parameter offset = 0 (0x0) 2N/A * SMB: Data bytes = 33 (0x21) 2N/A * SMB: Data offset = 86 (0x56) 2N/A * SMB: Setup word count = 3 2N/A * SMB: Mailslot opcode = Write mailslot 2N/A * SMB: Transaction priority = 1 2N/A * SMB: Mailslot class = Unreliable (broadcast) 2N/A * SMB: Byte count = 50 2N/A * SMB: Byte parameters 2N/A * SMB: Path name = \MAILSLOT\BROWSE 2N/A * SMB: Transaction data 2N/A * SMB: Data: Number of data bytes remaining = 33 (0x0021) 2N/A * 5. Mailslot Protocol Specification 2N/A * The only transaction allowed to a mailslot is a mailslot write. Mailslot 2N/A * writes requests are encapsulated in TRANSACT SMBs. The following table 2N/A * shows the interpretation of the TRANSACT SMB parameters for a mailslot 2N/A * Name Value Description 2N/A * Command SMB_COM_TRANSACTION 2N/A * Name <name> STRING name of mail slot to write; 2N/A * must start with "\MAILSLOT\" 2N/A * SetupCount 3 Always 3 for mailslot writes 2N/A * Setup[0] 1 Command code == write mailslot 2N/A * TotalDataCount n Size of data in bytes to write to 2N/A * Data[ n ] The data to write to the mailslot 2N/A * Magic 0xFF 'S' 'M' 'B' 2N/A * smb_com a byte, the "first" command 2N/A * Error a 4-byte union, ignored in a request 2N/A * smb_flg a one byte set of eight flags 2N/A * smb_flg2 a two byte set of 16 flags 2N/A * . twelve reserved bytes, have a role 2N/A * in connectionless transports (IPX, UDP?) 2N/A * smb_tid a 16-bit tree ID, a mount point sorta, 2N/A * 0xFFFF is this command does not have 2N/A * or require a tree context 2N/A * smb_pid a 16-bit process ID 2N/A * smb_uid a 16-bit user ID, specific to this "session" 2N/A * and mapped to a system (bona-fide) UID 2N/A * smb_mid a 16-bit multiplex ID, used to differentiate 2N/A * multiple simultaneous requests from the same 2N/A * process (pid) (ref RPC "xid") 2N/A * If the mailboxlen is an even number we need to pad the 2N/A * header so that the data starts on a word boundary. 2N/A fmt =
"Mb4.bw20.bwwwwb.wl2.wwwwb.wwwws";
2N/A fmt =
"Mb4.bw20.bwwwwb.wl2.wwwwb.wwwws.";
2N/A 17,
/* Count of parameter words */ 2N/A 0,
/* Total Parameter words sent */ 2N/A 2,
/* Max Parameters to return */ 2N/A 0,
/* Max data bytes to return */ 2N/A 0,
/* Max setup bytes to return */ 2N/A 0xffffffff,
/* Timeout */ 2N/A 0,
/* Parameter bytes sent */ 2N/A 0,
/* Parameter offset */ 2N/A 3,
/* Setup word count */ 2N/A 1,
/* Setup word[0] */ 2N/A 0,
/* Setup word[1] */ 2N/A * 6.5 HostAnnouncement Browser Frame 2N/A * To advertise its presence, i.e. to publish itself as being available, a 2N/A * non-browser server sends a HostAnnouncement browser frame. If the server 2N/A * is a member of domain "D", this frame is sent to the NETBIOS unique name 2N/A * D(1d) and mailslot "\\MAILSLOT\\BROWSE". The definition of the 2N/A * HostAnnouncement frame is: 2N/A * unsigned short Opcode; 2N/A * unsigned char UpdateCount; 2N/A * uint32_t Periodicity; 2N/A * unsigned char ServerName[]; 2N/A * unsigned char VersionMajor; 2N/A * unsigned char VersionMinor; 2N/A * uint32_t Signature; 2N/A * unsigned char Comment[]; 2N/A * Opcode - Identifies this structure as a browser server 2N/A * announcement and is defined as HostAnnouncement with a 2N/A * value of decimal 1. 2N/A * UpdateCount - must be sent as zero and ignored on receipt. 2N/A * Periodicity - The announcement frequency of the server (in 2N/A * seconds). The server will be removed from the browse list 2N/A * if it has not been heard from in 3X its announcement 2N/A * frequency. In no case will the server be removed from the 2N/A * browse list before the period 3X has elapsed. Actual 2N/A * implementations may take more than 3X to actually remove 2N/A * the server from the browse list. 2N/A * ServerName - Null terminated ASCII server name (up to 16 bytes 2N/A * VersionMajor - The major version number of the OS the server 2N/A * is running. it will be returned by NetServerEnum2. 2N/A * VersionMinor - The minor version number of the OS the server 2N/A * is running. This is entirely informational and does not 2N/A * have any significance for the browsing protocol. 2N/A * Type - Specifies the type of the server. The server type bits 2N/A * are specified in the NetServerEnum2 section. 2N/A * Signature - The browser protocol minor version number in the 2N/A * low 8 bits, the browser protocol major version number in 2N/A * the next higher 8 bits and the signature 0xaa55 in the 2N/A * high 16 bits of this field. Thus, for this version of the 2N/A * browser protocol (1.15) this field has the value 2N/A * 0xaa55010f. This may used to isolate browser servers that 2N/A * are running out of revision browser software; otherwise, 2N/A * Comment - Null terminated ASCII comment for the server. 2N/A * Limited to 43 bytes. 2N/A * When a non-browser server starts up, it announces itself in the manner 2N/A * described once every minute. The frequency of these statements is 2N/A * gradually stretched to once every 12 minutes. 2N/A * Note: older non-browser servers in a domain "D" sent HostAnnouncement 2N/A * frames to the NETBIOS group name D(00). Non-Browser servers supporting 2N/A * version 1.15 of the browsing protocol SHOULD NOT use this NETBIOS name, 2N/A * but for backwards compatibility Master Browsers MAY receive and process 2N/A * HostAnnouncement frames on this name as described above for D(1d). 2N/A /* Local master Browser */ 2N/A /* give some extra room */ 2N/A * A non-browser server SHOULD send a HostAnnouncement browser frame 2N/A * specifying a type of 0 just prior to shutting down, to allow it to 2N/A * quickly be removed from the list of available servers. 2N/A * The PDC location protocol, i.e. anything on the \\NET 2N/A * mailslot, is handled by the smb_netlogon module. 2N/A * If it's not a netlogon message, assume it's a browser request. 2N/A * This is not the most elegant way to extract the command byte 2N/A * but at least we no longer use it to get the netlogon opcode. 2N/A * 11.1 Registered unique names 2N/A * This name is used by all servers and clients to receive second 2N/A * class mailslot messages. A system must add this name in order to 2N/A * receive mailslot messages. The only browser requests that should 2N/A * appear on this name are BecomeBackup, GetBackupListResp, 2N/A * MasterAnnouncement, and LocalMasterAnnouncement frames. All other 2N/A * datagrams (other than the expected non-browser datagrams) may be 2N/A * ignored and an error logged. 2N/A * This name is used to identify a master browser server for domain 2N/A * "DOMAIN" on a subnet. A master browser server adds this name as a 2N/A * unique NETBIOS name when it becomes master browser. If the attempt 2N/A * to add the name fails, the master browser server assumes that there 2N/A * is another master in the domain and will fail to come up. It may 2N/A * log an error if the failure occurs more than 3 times in a row (this 2N/A * either indicates some form of network misconfiguration or a 2N/A * software error). The only requests that should appear on this name 2N/A * are GetBackupListRequest and HostAnnouncement requests. All other 2N/A * datagrams on this name may be ignored (and an error logged). If 2N/A * running a NETBIOS name service (NBNS, such as WINS), this name 2N/A * should not be registered with the NBNS. 2N/A * This name is used to identify the Domain Master Browser for domain 2N/A * "DOMAIN" (which is also the primary domain controller). It is a 2N/A * unique name added only by the primary domain controller. The 2N/A * primary domain controller will respond to GetBackupListRequest on 2N/A * this name just as it responds to these requests on the <DOMAIN>(1d) 2N/A * 11.2 Registered group names 2N/A * (01)(02)__MSBROWSE__(02)(01) 2N/A * This name is used by Master Browsers to announce themselves to the 2N/A * other Master Browsers on a subnet. It is added as a group name by 2N/A * all Master Browser servers. The only broadcasts that should appear 2N/A * on this name is DomainAnnouncement requests. All other datagrams 2N/A * This name is used by clients and servers in domain "DOMAIN" to 2N/A * process server announcements. The only requests that should appear 2N/A * on this name that the browser is interested in are 2N/A * AnnouncementRequest and NETLOGON_QUERY (to locate the PDC) packets. 2N/A * All other unidentifiable requests may be ignored (and an error 2N/A * This name is used for announcements to browsers for domain "DOMAIN" 2N/A * on a subnet. This name is registered by all the browser servers in 2N/A * the domain. The only requests that should appear on this name are 2N/A * RequestElection and AnnouncementRequest packets. All other 2N/A * datagrams may be ignored (and an error logged). 2N/A * This name is registered by Primary Domain Controllers. 2N/A /* All our local master browsers */ 2N/A "smb browser: master browser found at %s",
2N/A /* Domain master browser */ 2N/A "smb browser: domain master browser for %s is %s",
2N/A /* One Minute announcements for first five */ 2N/A /* This is the name used for HostAnnouncement */ 2N/A /* 0x20: file server service */ 2N/A * smb_browser_non_master_duties 2N/A * To advertise its presence, i.e. to publish itself as being available, a 2N/A * non-browser server sends a HostAnnouncement browser frame. If the server 2N/A * is a member of domain "D", this frame is sent to the NETBIOS unique name 2N/A * D(1d) and mailslot "\\MAILSLOT\\BROWSE". 2N/A * One Minute announcements for first five 2N/A * minutes, one minute longer each round 2N/A * until 12 minutes and every 12 minutes 2N/A * SMB NetBIOS Browser Service 2N/A /* Check to see whether reconfig is needed */ 2N/A * smb_browser_netlogon 2N/A * aliases, to find a domain controller. 2N/A * The dc argument will be set if a DC is found. 2N/A * smb_browser_infoinit 2N/A * This function is called only once when the browser starts 2N/A * to initialize the global smb_binfo structure. 2N/A * smb_browser_infoterm 2N/A * This function is called only once when the browser stops 2N/A * to destroy the smb_binfo structure. 2N/A * smb_browser_infofree 2N/A * Removes all the hostinfo structures from the browser list 2N/A * and frees the allocated memory