xref: /titanic_51/usr/src/lib/smbsrv/libsmbns/common/smbns_browser.h (revision 193974072f41a843678abf5f61979c748687e66b)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_BROWSER_H_
27 #define	_BROWSER_H_
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 /*
32  * NetBIOS name types describe the functionality of the registration.
33  * A following list of NetBIOS suffixes (16th Character of the NetBIOS
34  * Name) is detailed in Microsoft knowledge base article Q163409.
35  *
36  * Name                Number(h)  Type  Usage
37  * --------------------------------------------------------------------------
38  * <computername>         00       U    Workstation Service
39  * <computername>         01       U    Messenger Service
40  * <\\--__MSBROWSE__>     01       G    Master Browser
41  * <computername>         03       U    Messenger Service
42  * <computername>         06       U    RAS Server Service
43  * <computername>         1F       U    NetDDE Service
44  * <computername>         20       U    File Server Service
45  * <computername>         21       U    RAS Client Service
46  * <computername>         22       U    Microsoft Exchange Interchange(MSMail
47  *                                      Connector)
48  * <computername>         23       U    Microsoft Exchange Store
49  * <computername>         24       U    Microsoft Exchange Directory
50  * <computername>         30       U    Modem Sharing Server Service
51  * <computername>         31       U    Modem Sharing Client Service
52  * <computername>         43       U    SMS Clients Remote Control
53  * <computername>         44       U    SMS Administrators Remote Control
54  *                                      Tool
55  * <computername>         45       U    SMS Clients Remote Chat
56  * <computername>         46       U    SMS Clients Remote Transfer
57  * <computername>         4C       U    DEC Pathworks TCPIP service on
58  *                                      Windows NT
59  * <computername>         52       U    DEC Pathworks TCPIP service on
60  *                                      Windows NT
61  * <computername>         87       U    Microsoft Exchange Message Transfer
62  *                                      Agent
63  * <computername>         6A       U    Microsoft Exchange IMC
64  * <computername>         BE       U    Network Monitor Agent
65  * <computername>         BF       U    Network Monitor Application
66  * <username>             03       U    Messenger Service
67  * <domain>               00       G    Domain Name
68  * <domain>               1B       U    Domain Master Browser
69  * <domain>               1C       G    Domain Controllers
70  * <domain>               1D       U    Master Browser
71  * <domain>               1E       G    Browser Service Elections
72  * <INet~Services>        1C       G    IIS
73  * <IS~computer name>     00       U    IIS
74  * <computername>         [2B]     U    Lotus Notes Server Service
75  * IRISMULTICAST          [2F]     G    Lotus Notes
76  * IRISNAMESERVER         [33]     G    Lotus Notes
77  * Forte_$ND800ZA         [20]     U    DCA IrmaLan Gateway Server Service
78  *
79  * Unique (U): The name may have only one IP address assigned to it. On
80  * a network device multiple occurrences of a single name may appear to
81  * be registered. The suffix may be the only unique character in the name.
82  *
83  * Group (G): A normal group; the single name may exist with many IP
84  * addresses. WINS responds to a name query on a group name with the
85  * limited broadcast address (255.255.255.255). Because routers block
86  * the transmission of these addresses, the Internet Group was designed
87  * to service communications between subnets.
88  *
89  * Multihomed (M): The name is unique, but due to multiple network
90  * interfaces on the same computer this configuration is necessary to
91  * permit the registration. The maximum number of addresses is 25.
92  *
93  * Internet Group (I): This is a special configuration of the group name
94  * used to manage Windows NT Domain names.
95  *
96  * Domain Name (D): New in Windows NT 4.0.
97  */
98 
99 
100 #ifdef __cplusplus
101 extern "C" {
102 #endif
103 
104 
105 /*
106  * Message flags used when building the SMB transact headers.
107  */
108 #define	TWO_WAY_TRANSACTION			0x00
109 #define	END_SESSION_TRANSACTION			0x01
110 #define	ONE_WAY_TRANSACTION				0x02
111 
112 
113 /*
114  * Browser commands associated with the BROWSE and MSBROWSE mailslots.
115  */
116 #define	HOST_ANNOUNCEMENT			0x01
117 #define	ANNOUNCEMENT_REQUEST			0x02
118 #define	REQUEST_ELECTION			0x08
119 #define	GET_BACKUP_LIST_REQ			0x09
120 #define	GET_BACKUP_LIST_RESP			0x0A
121 #define	BECOME_BACKUP				0x0B
122 #define	DOMAIN_ANNOUNCEMENT			0x0C
123 #define	MASTER_ANNOUNCEMENT			0x0D
124 #define	LOCAL_MASTER_ANNOUNCEMENT		0x0F
125 
126 
127 /*
128  * Opcodes associated with NETLOGON or NTLOGON mailslots (KB 109626).
129  *	LOGON_REQUEST			LM1.0/2.0 LOGON Request from client
130  *	LOGON_RESPONSE			LM1.0 Response to LOGON_REQUEST
131  *	LOGON_CENTRAL_QUERY		LM1.0 QUERY for centralized init
132  *	LOGON_DISTRIB_QUERY		LM1.0 QUERY for non-centralized init
133  *	LOGON_CENTRAL_RESPONSE		LM1.0 response to LOGON_CENTRAL_QUERY
134  *	LOGON_DISTRIB_RESPONSE		LM1.0 resp to LOGON_DISTRIB_QUERY
135  *	LOGON_RESPONSE2			LM2.0 Response to LOGON_REQUEST
136  *	LOGON_PRIMARY_QUERY		QUERY for Primary DC
137  *	LOGON_START_PRIMARY		announce startup of Primary DC
138  *	LOGON_FAIL_PRIMARY		announce failed  Primary DC
139  *	LOGON_UAS_CHANGE		announce change to UAS or SAM
140  *	LOGON_NO_USER			announce no user on machine
141  *	LOGON_PRIMARY_RESPONSE		response to LOGON_PRIMARY_QUERY
142  *	LOGON_RELOGON_RESPONSE		LM1.0/2.0 resp to relogon request
143  *	LOGON_WKSTINFO_RESPONSE		LM1.0/2.0 resp to interrogate request
144  *	LOGON_PAUSE_RESPONSE		LM2.0 resp when NETLOGON is paused
145  *	LOGON_USER_UNKNOWN		LM2.0 response when user is unknown
146  *	LOGON_UPDATE_ACCOUNT		LM2.1 announce account updates
147  *	LOGON_SAM_LOGON_REQUEST		SAM LOGON request from client
148  *	LOGON_SAM_LOGON_RESPONSE	SAM Response to SAM logon request
149  *	LOGON_SAM_PAUSE_RESPONSE	SAM response when NETLOGON is paused
150  *	LOGON_SAM_USER_UNKNOWN		SAM response when user is unknown
151  *	LOGON_SAM_WKSTINFO_RESPONSE	SAM response to interrogate request
152  */
153 #define	LOGON_REQUEST			0
154 #define	LOGON_RESPONSE			1
155 #define	LOGON_CENTRAL_QUERY		2
156 #define	LOGON_DISTRIB_QUERY		3
157 #define	LOGON_CENTRAL_RESPONSE		4
158 #define	LOGON_DISTRIB_RESPONSE		5
159 #define	LOGON_RESPONSE2			6
160 #define	LOGON_PRIMARY_QUERY		7
161 #define	LOGON_START_PRIMARY		8
162 #define	LOGON_FAIL_PRIMARY		9
163 #define	LOGON_UAS_CHANGE		10
164 #define	LOGON_NO_USER			11
165 #define	LOGON_PRIMARY_RESPONSE		12
166 #define	LOGON_RELOGON_RESPONSE		13
167 #define	LOGON_WKSTINFO_RESPONSE		14
168 #define	LOGON_PAUSE_RESPONSE		15
169 #define	LOGON_USER_UNKNOWN		16
170 #define	LOGON_UPDATE_ACCOUNT		17
171 #define	LOGON_SAM_LOGON_REQUEST		18
172 #define	LOGON_SAM_LOGON_RESPONSE	19
173 #define	LOGON_SAM_PAUSE_RESPONSE	20
174 #define	LOGON_SAM_USER_UNKNOWN		21
175 #define	LOGON_SAM_WKSTINFO_RESPONSE	22
176 
177 
178 /*
179  * Local protocol flags used to indicate which version of the
180  * netlogon protocol to use when attempting to find the PDC.
181  */
182 #define	NETLOGON_PROTO_NETLOGON			0x01
183 #define	NETLOGON_PROTO_SAMLOGON			0x02
184 
185 #ifdef __cplusplus
186 }
187 #endif
188 
189 
190 #endif /* _BROWSER_H_ */
191