autobuild: Run the samba-minimal-smbd build jobs with -j 2
[samba4-gss.git] / librpc / idl / nbt.idl
blob29e733a7b8cbe3bbc6231e283dd142605b98d609
1 #include "idl_types.h"
3 /*
4 IDL structures for NBT operations
6 NBT is not traditionally encoded using IDL/NDR. This is a bit of an
7 experiment, and I may well switch us back to a more traditional
8 encoding if it doesn't work out
9 */
11 import "misc.idl", "security.idl";
13 helper("../librpc/ndr/ndr_nbt.h"),
14 headerhelper("lib/util/time.h"),
15 helpstring("NBT messages"),
16 uuid("6def41b6-86e4-4c32-997c-ed33af7bcd8e")
18 interface nbt
20 const int NBT_NAME_SERVICE_PORT = 137;
21 const int NBT_DGRAM_SERVICE_PORT = 138;
23 typedef [bitmap16bit] bitmap {
24 NBT_RCODE = 0x000F,
25 NBT_FLAG_BROADCAST = 0x0010,
26 NBT_FLAG_RECURSION_AVAIL = 0x0080,
27 NBT_FLAG_RECURSION_DESIRED = 0x0100,
28 NBT_FLAG_TRUNCATION = 0x0200,
29 NBT_FLAG_AUTHORITATIVE = 0x0400,
30 NBT_OPCODE = 0x7800,
31 NBT_FLAG_REPLY = 0x8000
32 } nbt_operation;
34 /* the opcodes are in the operation field, masked with
35 NBT_OPCODE */
36 typedef enum {
37 NBT_OPCODE_QUERY = (0x0<<11),
38 NBT_OPCODE_REGISTER = (0x5<<11),
39 NBT_OPCODE_RELEASE = (0x6<<11),
40 NBT_OPCODE_WACK = (0x7<<11),
41 NBT_OPCODE_REFRESH = (0x8<<11),
42 NBT_OPCODE_REFRESH2 = (0x9<<11),
43 NBT_OPCODE_MULTI_HOME_REG = (0xf<<11)
44 } nbt_opcode;
46 /* rcode values */
47 typedef enum {
48 NBT_RCODE_OK = 0x0,
49 NBT_RCODE_FMT = 0x1,
50 NBT_RCODE_SVR = 0x2,
51 NBT_RCODE_NAM = 0x3,
52 NBT_RCODE_IMP = 0x4,
53 NBT_RCODE_RFS = 0x5,
54 NBT_RCODE_ACT = 0x6,
55 NBT_RCODE_CFT = 0x7
56 } nbt_rcode;
58 /* we support any 8bit name type, but by defining the common
59 ones here we get better debug displays */
60 typedef [enum8bit] enum {
61 NBT_NAME_CLIENT = 0x00,
62 NBT_NAME_MS = 0x01,
63 NBT_NAME_USER = 0x03,
64 NBT_NAME_SERVER = 0x20,
65 NBT_NAME_PDC = 0x1B,
66 NBT_NAME_LOGON = 0x1C,
67 NBT_NAME_MASTER = 0x1D,
68 NBT_NAME_BROWSER = 0x1E
69 } nbt_name_type;
71 /* the ndr parser for nbt_name is separately defined in
72 nbtname.c (along with the parsers for nbt_string) */
73 typedef [public,nopull,nopush] struct {
74 string name;
75 string scope;
76 nbt_name_type type;
77 } nbt_name;
79 typedef [public,enum16bit] enum {
80 NBT_QCLASS_IP = 0x01
81 } nbt_qclass;
83 typedef [public,enum16bit,nopush] enum {
84 NBT_QTYPE_ADDRESS = 0x0001,
85 NBT_QTYPE_NAMESERVICE = 0x0002,
86 NBT_QTYPE_NULL = 0x000A,
87 NBT_QTYPE_NETBIOS = 0x0020,
88 NBT_QTYPE_STATUS = 0x0021,
90 * Indicates that this is a WACK packet. As long as the size of
91 * ‘int’ is larger than 16 bits, this value cannot appear on the
92 * wire. We’ll encode it instead as NBT_QTYPE_NETBIOS.
94 NBT_QTYPE_WACK = -1
95 } nbt_qtype;
97 typedef struct {
98 nbt_name name;
99 nbt_qtype question_type;
100 nbt_qclass question_class;
101 } nbt_name_question;
103 /* these are the possible values of the NBT_NM_OWNER_TYPE
104 field */
105 typedef enum {
106 NBT_NODE_B = 0x0000,
107 NBT_NODE_P = 0x2000,
108 NBT_NODE_M = 0x4000,
109 NBT_NODE_H = 0x6000
110 } nbt_node_type;
112 typedef [bitmap16bit] bitmap {
113 NBT_NM_PERMANENT = 0x0200,
114 NBT_NM_ACTIVE = 0x0400,
115 NBT_NM_CONFLICT = 0x0800,
116 NBT_NM_DEREGISTER = 0x1000,
117 NBT_NM_OWNER_TYPE = 0x6000,
118 NBT_NM_GROUP = 0x8000
119 } nb_flags;
121 typedef struct {
122 nb_flags nb_flags;
123 ipv4address ipaddr;
124 } nbt_rdata_address;
126 typedef struct {
127 uint16 length;
128 nbt_rdata_address addresses[length/6];
129 } nbt_rdata_netbios;
131 typedef struct {
132 uint8 unit_id[6];
133 uint8 jumpers;
134 uint8 test_result;
135 uint16 version_number;
136 uint16 period_of_statistics;
137 uint16 number_of_crcs;
138 uint16 number_alignment_errors;
139 uint16 number_of_collisions;
140 uint16 number_send_aborts;
141 uint32 number_good_sends;
142 uint32 number_good_receives;
143 uint16 number_retransmits;
144 uint16 number_no_resource_conditions;
145 uint16 number_free_command_blocks;
146 uint16 total_number_command_blocks;
147 uint16 max_total_number_command_blocks;
148 uint16 number_pending_sessions;
149 uint16 max_number_pending_sessions;
150 uint16 max_total_sessions_possible;
151 uint16 session_data_packet_size;
152 } nbt_statistics;
154 typedef struct {
155 [charset(DOS)] uint8 name[15];
156 nbt_name_type type;
157 nb_flags nb_flags;
158 } nbt_status_name;
160 typedef struct {
161 [value(num_names * 18 + 47)] uint16 length;
162 uint8 num_names;
163 nbt_status_name names[num_names];
164 nbt_statistics statistics;
165 } nbt_rdata_status;
167 typedef struct {
168 uint16 length;
169 uint8 data[length];
170 } nbt_rdata_data;
172 typedef [nodiscriminant,public] union {
173 [case(NBT_QTYPE_NETBIOS)] nbt_rdata_netbios netbios;
174 [case(NBT_QTYPE_STATUS)] nbt_rdata_status status;
175 [default] nbt_rdata_data data;
176 } nbt_rdata;
178 typedef [flag(LIBNDR_PRINT_ARRAY_HEX)] struct {
179 nbt_name name;
180 nbt_qtype rr_type;
181 nbt_qclass rr_class;
182 uint32 ttl;
183 [switch_is(rr_type)] nbt_rdata rdata;
184 } nbt_res_rec;
186 typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
187 uint16 name_trn_id;
188 nbt_operation operation;
189 uint16 qdcount;
190 uint16 ancount;
191 uint16 nscount;
192 uint16 arcount;
193 nbt_name_question questions[qdcount];
194 nbt_res_rec answers[ancount];
195 nbt_res_rec nsrecs[nscount];
196 nbt_res_rec additional[arcount];
197 [flag(NDR_REMAINING)] DATA_BLOB padding;
198 } nbt_name_packet;
202 NBT DGRAM packets (UDP/138)
205 typedef [enum8bit] enum {
206 DGRAM_DIRECT_UNIQUE = 0x10,
207 DGRAM_DIRECT_GROUP = 0x11,
208 DGRAM_BCAST = 0x12,
209 DGRAM_ERROR = 0x13,
210 DGRAM_QUERY = 0x14,
211 DGRAM_QUERY_POSITIVE = 0x15,
212 DGRAM_QUERY_NEGATIVE = 0x16
213 } dgram_msg_type;
215 typedef [bitmap8bit] bitmap {
216 DGRAM_FLAG_MORE = 0x01,
217 DGRAM_FLAG_FIRST = 0x02,
218 DGRAM_FLAG_NODE_TYPE = 0x0C
219 } dgram_flags;
221 typedef [enum8bit] enum {
222 DGRAM_NODE_B = 0x00,
223 DGRAM_NODE_P = 0x04,
224 DGRAM_NODE_M = 0x08,
225 DGRAM_NODE_NBDD = 0x0C
226 } dgram_node_type;
228 /* a dgram_message is the main dgram body in general use */
230 /* the most common datagram type is a SMB_TRANSACTION
231 operation, where a SMB packet is used in the data section
232 of a dgram_message to hold a trans request, which in turn
233 holds a small command structure. It's a very strange beast
234 indeed. To make the code cleaner we define a basic SMB
235 packet in IDL here. This is not a general purpose SMB
236 packet, and won't be used in the core SMB client/server
237 code, but it does make working with these types of dgrams
238 easier */
240 const string NBT_MAILSLOT_NETLOGON = "\\MAILSLOT\\NET\\NETLOGON";
241 const string NBT_MAILSLOT_NTLOGON = "\\MAILSLOT\\NET\\NTLOGON";
242 const string NBT_MAILSLOT_GETDC = "\\MAILSLOT\\NET\\GETDC";
243 const string NBT_MAILSLOT_BROWSE = "\\MAILSLOT\\BROWSE";
245 typedef [enum8bit] enum {
246 SMB_TRANSACTION = 0x25
247 } smb_command;
249 typedef struct {
250 [range(17,17),value(17)] uint8 wct;
251 uint16 total_param_count;
252 uint16 total_data_count;
253 uint16 max_param_count;
254 uint16 max_data_count;
255 uint8 max_setup_count;
256 uint8 pad;
257 uint16 trans_flags;
258 uint32 timeout;
259 uint16 reserved;
260 uint16 param_count;
261 uint16 param_offset;
262 uint16 data_count;
263 uint16 data_offset;
264 [range(3,3),value(3)] uint8 setup_count;
265 uint8 pad2;
266 uint16 opcode;
267 uint16 priority;
268 uint16 _class;
269 [value(strlen(mailslot_name)+1+data.length)]
270 uint16 byte_count;
271 astring mailslot_name;
272 [flag(NDR_REMAINING)] DATA_BLOB data;
273 } smb_trans_body;
275 typedef [nodiscriminant] union {
276 [case(SMB_TRANSACTION)] smb_trans_body trans;
277 } smb_body;
280 typedef [flag(NDR_NOALIGN|NDR_LITTLE_ENDIAN|NDR_PAHEX),public] struct {
281 smb_command smb_command;
282 uint8 err_class;
283 uint8 pad;
284 uint16 err_code;
285 uint8 flags;
286 uint16 flags2;
287 uint16 pid_high;
288 uint8 signature[8];
289 uint16 reserved;
290 uint16 tid;
291 uint16 pid;
292 uint16 vuid;
293 uint16 mid;
294 [switch_is(smb_command)] smb_body body;
295 } dgram_smb_packet;
297 const uint32 DGRAM_SMB = 0xff534d42; /* 0xffSMB */
299 typedef [nodiscriminant] union {
300 [case(DGRAM_SMB)] dgram_smb_packet smb;
301 } dgram_message_body;
303 typedef struct {
304 uint16 length;
305 uint16 offset;
306 nbt_name source_name;
307 nbt_name dest_name;
308 uint32 dgram_body_type;
309 [switch_is(dgram_body_type)] dgram_message_body body;
310 } dgram_message;
312 typedef [enum8bit] enum {
313 DGRAM_ERROR_NAME_NOT_PRESENT = 0x82,
314 DGRAM_ERROR_INVALID_SOURCE = 0x83,
315 DGRAM_ERROR_INVALID_DEST = 0x84
316 } dgram_err_code;
318 typedef [nodiscriminant] union {
319 [case(DGRAM_DIRECT_UNIQUE)] dgram_message msg;
320 [case(DGRAM_DIRECT_GROUP)] dgram_message msg;
321 [case(DGRAM_BCAST)] dgram_message msg;
322 [case(DGRAM_ERROR)] dgram_err_code error;
323 [case(DGRAM_QUERY)] nbt_name dest_name;
324 [case(DGRAM_QUERY_POSITIVE)] nbt_name dest_name;
325 [case(DGRAM_QUERY_NEGATIVE)] nbt_name dest_name;
326 } dgram_data;
328 typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
329 dgram_msg_type msg_type;
330 dgram_flags flags;
331 uint16 dgram_id;
332 ipv4address src_addr;
333 uint16 src_port;
334 [switch_is(msg_type)] dgram_data data;
335 } nbt_dgram_packet;
338 /******************************************
339 * \MAILSLOT\NET\NETLOGON mailslot requests
340 * and
341 * \MAILSLOT\NET\NTLOGON mailslot requests
344 typedef [public,gensize] struct {
345 uint32 sockaddr_family;
346 [flag(NDR_BIG_ENDIAN)] ipv4address pdc_ip;
347 [flag(NDR_REMAINING)] DATA_BLOB remaining;
348 } nbt_sockaddr;
350 typedef [bitmap32bit,public] bitmap {
351 NBT_SERVER_PDC = 0x00000001,
352 NBT_SERVER_GC = 0x00000004,
353 NBT_SERVER_LDAP = 0x00000008,
354 NBT_SERVER_DS = 0x00000010,
355 NBT_SERVER_KDC = 0x00000020,
356 NBT_SERVER_TIMESERV = 0x00000040,
357 NBT_SERVER_CLOSEST = 0x00000080,
358 NBT_SERVER_WRITABLE = 0x00000100,
359 NBT_SERVER_GOOD_TIMESERV = 0x00000200,
360 NBT_SERVER_NDNC = 0x00000400,
361 NBT_SERVER_SELECT_SECRET_DOMAIN_6 = 0x00000800, /* 2008 / RODC */
362 NBT_SERVER_FULL_SECRET_DOMAIN_6 = 0x00001000, /* 2008 */
363 NBT_SERVER_ADS_WEB_SERVICE = 0x00002000,
364 NBT_SERVER_DS_8 = 0x00004000, /* 2012 */
365 NBT_SERVER_DS_9 = 0x00008000, /* 2012R2 */
366 NBT_SERVER_DS_10 = 0x00010000, /* 2016 */
367 NBT_SERVER_HAS_DNS_NAME = 0x20000000,
368 NBT_SERVER_IS_DEFAULT_NC = 0x40000000,
369 NBT_SERVER_FOREST_ROOT = 0x80000000
370 } nbt_server_type;
372 typedef [bitmap32bit,public] bitmap {
373 NETLOGON_NT_VERSION_1 = 0x00000001,
374 NETLOGON_NT_VERSION_5 = 0x00000002,
375 NETLOGON_NT_VERSION_5EX = 0x00000004,
376 NETLOGON_NT_VERSION_5EX_WITH_IP = 0x00000008,
377 NETLOGON_NT_VERSION_WITH_CLOSEST_SITE = 0x00000010,
378 NETLOGON_NT_VERSION_AVOID_NT4EMUL = 0x01000000,
379 NETLOGON_NT_VERSION_PDC = 0x10000000,
380 NETLOGON_NT_VERSION_IP = 0x20000000,
381 NETLOGON_NT_VERSION_LOCAL = 0x40000000,
382 NETLOGON_NT_VERSION_GC = 0x80000000
383 } netlogon_nt_version_flags;
385 typedef [enum16bit,public] enum {
386 LOGON_REQUEST = 0,
387 LOGON_RESPONSE2 = 6,
388 LOGON_PRIMARY_QUERY = 7, /* Was also NETLOGON_QUERY_FOR_PDC */
389 NETLOGON_ANNOUNCE_UAS = 10,
390 NETLOGON_RESPONSE_FROM_PDC = 12,
391 LOGON_SAM_LOGON_REQUEST = 18, /* Was also NETLOGON_QUERY_FOR_PDC2, NTLOGON_SAM_LOGON */
392 LOGON_SAM_LOGON_RESPONSE = 19, /* Was also NTLOGON_SAM_LOGON_REPLY */
393 LOGON_SAM_LOGON_PAUSE_RESPONSE = 20,
394 LOGON_SAM_LOGON_USER_UNKNOWN = 21, /* Was also NTLOGON_SAM_LOGON_REPLY15 */
395 LOGON_SAM_LOGON_RESPONSE_EX = 23, /* was NETLOGON_RESPONSE_FROM_PDC2 */
396 LOGON_SAM_LOGON_PAUSE_RESPONSE_EX = 24,
397 LOGON_SAM_LOGON_USER_UNKNOWN_EX = 25 /* was NETLOGON_RESPONSE_FROM_PDC_USER */
398 } netlogon_command;
400 /* query to dc hand marshaled, as it has 'optional'
401 * parts */
402 typedef [nopull,nopush] struct {
403 uint16 request_count;
404 nstring computer_name;
405 nstring user_name;
406 astring mailslot_name;
407 uint32 acct_control;
408 /* samr_AcctFlags acct_control; */
409 [value(ndr_size_dom_sid0(&sid, ndr->flags))] uint32 sid_size;
410 /* The manual alignment is required because this
411 * structure is marked flag(NDR_NOALIGN) via the
412 * nbt_netlogon_packet below.
414 * However, both MUST only be present if sid_size > 0
416 [flag(NDR_ALIGN4)] DATA_BLOB _pad;
417 [subcontext(0),subcontext_size(sid_size)] dom_sid0 sid;
418 netlogon_nt_version_flags nt_version;
419 uint16 lmnt_token;
420 uint16 lm20_token;
421 } NETLOGON_SAM_LOGON_REQUEST;
423 typedef struct {
424 astring computer_name;
425 astring user_name;
426 astring mailslot_name;
427 uint8 request_count;
428 uint16 lmnt_token;
429 uint16 lm20_token;
430 } NETLOGON_LOGON_REQUEST;
432 typedef [flag(NDR_NOALIGN),public] struct {
433 netlogon_command command;
434 nstring pdc_name;
435 nstring user_name;
436 nstring domain_name;
437 netlogon_nt_version_flags nt_version;
438 uint16 lmnt_token;
439 uint16 lm20_token;
440 } NETLOGON_SAM_LOGON_RESPONSE_NT40;
442 typedef [flag(NDR_NOALIGN),public] struct {
443 netlogon_command command;
444 nstring pdc_name;
445 nstring user_name;
446 nstring domain_name;
447 GUID domain_uuid;
448 GUID zero_uuid;
449 nbt_string forest;
450 nbt_string dns_domain;
451 nbt_string pdc_dns_name;
452 ipv4address pdc_ip;
453 nbt_server_type server_type;
454 netlogon_nt_version_flags nt_version;
455 uint16 lmnt_token;
456 uint16 lm20_token;
457 } NETLOGON_SAM_LOGON_RESPONSE;
459 /* response from pdc hand marshaled (we have an additional
460 * function that uses this structure), as it has 'optional'
461 * parts */
462 typedef [flag(NDR_NOALIGN),public] struct {
463 netlogon_command command;
464 uint16 sbz; /* From the docs */
465 nbt_server_type server_type;
466 GUID domain_uuid;
467 nbt_string forest;
468 nbt_string dns_domain;
469 nbt_string pdc_dns_name;
470 nbt_string domain_name;
471 nbt_string pdc_name;
472 nbt_string user_name;
473 nbt_string server_site;
474 nbt_string client_site;
476 /* Optional on NETLOGON_NT_VERSION_5EX_WITH_IP */
477 [value(ndr_size_nbt_sockaddr(&sockaddr, ndr->flags))] uint8 sockaddr_size;
478 [subcontext(0),subcontext_size(sockaddr_size)] nbt_sockaddr sockaddr;
480 /* Optional on NETLOGON_NT_VERSION_WITH_CLOSEST_SITE */
481 nbt_string next_closest_site;
483 netlogon_nt_version_flags nt_version;
484 uint16 lmnt_token;
485 uint16 lm20_token;
486 } NETLOGON_SAM_LOGON_RESPONSE_EX;
488 typedef [nopush,nopull] union {
489 [case(NETLOGON_NT_VERSION_1)] NETLOGON_SAM_LOGON_RESPONSE_NT40 nt4;
490 [case(NETLOGON_NT_VERSION_5)] NETLOGON_SAM_LOGON_RESPONSE nt5;
491 [case(NETLOGON_NT_VERSION_5EX)] NETLOGON_SAM_LOGON_RESPONSE_EX nt5_ex;
492 } netlogon_samlogon_response_union;
494 typedef [nopush,nopull,noprint,public] struct {
495 uint32 ntver;
496 [switch_is(ntver)] netlogon_samlogon_response_union data;
497 } netlogon_samlogon_response;
499 /* query for pdc request */
500 typedef struct {
501 astring computer_name;
502 astring mailslot_name;
503 [flag(NDR_ALIGN2)] DATA_BLOB _pad;
504 nstring unicode_name;
505 netlogon_nt_version_flags nt_version;
506 uint16 lmnt_token;
507 uint16 lm20_token;
508 } nbt_netlogon_query_for_pdc;
510 /* response from pdc */
511 typedef [public] struct {
512 netlogon_command command;
513 astring pdc_name;
514 [flag(NDR_ALIGN2)] DATA_BLOB _pad;
515 nstring unicode_pdc_name;
516 nstring domain_name;
517 netlogon_nt_version_flags nt_version;
518 uint16 lmnt_token;
519 uint16 lm20_token;
520 } nbt_netlogon_response_from_pdc;
522 typedef [flag(NDR_NOALIGN),public] struct {
523 netlogon_command command;
524 astring pdc_name;
525 uint16 lm20_token;
526 } nbt_netlogon_response2;
528 /* used to announce SAM changes - MS-NRPC 2.2.1.5.1 */
529 typedef struct {
530 netr_SamDatabaseID db_index;
531 hyper serial;
532 NTTIME timestamp;
533 } nbt_db_change_info;
535 typedef struct {
536 uint32 serial_lo;
537 time_t timestamp;
538 uint32 pulse;
539 uint32 random;
540 astring pdc_name;
541 astring domain;
542 [flag(NDR_ALIGN2)] DATA_BLOB _pad;
543 nstring unicode_pdc_name;
544 nstring unicode_domain;
545 uint32 db_count;
546 nbt_db_change_info dbchange[db_count];
547 [value(ndr_size_dom_sid0(&sid, ndr->flags))] uint32 sid_size;
548 [subcontext(0),subcontext_size(sid_size)] dom_sid0 sid;
549 uint32 message_format_version;
550 uint32 message_token;
551 } NETLOGON_DB_CHANGE;
553 typedef [nodiscriminant] union {
554 [case(LOGON_REQUEST)] NETLOGON_LOGON_REQUEST logon0;
555 [case(LOGON_SAM_LOGON_REQUEST)] NETLOGON_SAM_LOGON_REQUEST logon;
556 [case(LOGON_PRIMARY_QUERY)] nbt_netlogon_query_for_pdc pdc;
557 [case(NETLOGON_ANNOUNCE_UAS)] NETLOGON_DB_CHANGE uas;
558 } nbt_netlogon_request;
560 #if 0
561 /* These responses are all handled manually, as they cannot be encoded in IDL fully
563 See push_nbt_netlogon_response()
565 [case(NETLOGON_RESPONSE_FROM_PDC)] nbt_netlogon_response_from_pdc response;
566 [case(NETLOGON_RESPONSE_FROM_PDC_USER)] nbt_netlogon_response_from_pdc2 response2;
568 [case(LOGON_SAM_LOGON_PAUSE_RESPONSE)] NETLOGON_SAM_LOGON_RESPONSE reply;
569 [case(LOGON_SAM_LOGON_RESPONSE)] NETLOGON_SAM_LOGON_RESPONSE reply;
570 [case(LOGON_SAM_LOGON_USER_UNKNOWN)] NETLOGON_SAM_LOGON_RESPONSE reply;
571 [case(LOGON_SAM_LOGON_RESPONSE_EX)] NETLOGON_SAM_LOGON_RESPONSE_EX reply_ex;
572 [case(LOGON_SAM_LOGON_PAUSE_RESPONSE_EX)] NETLOGON_SAM_LOGON_RESPONSE_EX reply_ex;
573 [case(LOGON_SAM_LOGON_USER_UNKNOWN_EX)] NETLOGON_SAM_LOGON_RESPONSE_EX reply_ex;
574 #endif
576 typedef [flag(NDR_NOALIGN),public] struct {
577 netlogon_command command;
578 [switch_is(command)] nbt_netlogon_request req;
579 } nbt_netlogon_packet;
581 /********************************************************/
582 /* \MAILSLOT\BROWSE mailslot requests */
583 /* for details see http://ubiqx.org/cifs/Browsing.html */
584 /********************************************************/
585 typedef bitmap svcctl_ServerType svcctl_ServerType;
587 typedef [enum8bit] enum {
588 HostAnnouncement = 1,
589 AnnouncementRequest = 2,
590 Election = 8,
591 GetBackupListReq = 9,
592 GetBackupListResp = 10,
593 BecomeBackup = 11,
594 DomainAnnouncement = 12,
595 MasterAnnouncement = 13,
596 ResetBrowserState = 14,
597 LocalMasterAnnouncement = 15
598 } nbt_browse_opcode;
600 typedef struct {
601 uint8 UpdateCount;
602 uint32 Periodicity;
603 [charset(DOS)] uint8 ServerName[16];
604 uint8 OSMajor;
605 uint8 OSMinor;
606 svcctl_ServerType ServerType;
607 uint8 BroMajorVer;
608 uint8 BroMinorVer;
609 uint16 Signature;
610 astring Comment;
611 } nbt_browse_host_announcement;
613 typedef struct {
614 uint8 Unused;
615 astring ResponseName;
616 } nbt_browse_announcement_request;
618 typedef struct {
619 uint8 Version;
620 uint32 Criteria;
621 uint32 UpTime; /* In milliseconds */
622 uint32 Reserved; /* Must be zero */
623 astring ServerName;
624 } nbt_browse_election_request;
626 typedef struct {
627 uint8 ReqCount;
628 uint32 Token;
629 } nbt_browse_backup_list_request;
631 typedef struct {
632 uint8 BackupCount;
633 uint32 Token;
634 nbt_name BackupServerList[BackupCount];/* TODO: this is wrong */
635 } nbt_browse_backup_list_response;
637 typedef struct {
638 astring BrowserName;
639 } nbt_browse_become_backup;
641 typedef struct {
642 uint8 UpdateCount;
643 uint32 Periodicity;
644 [charset(DOS)] uint8 ServerName[16];
645 uint8 OSMajor;
646 uint8 OSMinor;
647 svcctl_ServerType ServerType;
648 uint32 MysteriousField;
649 astring Comment;
650 } nbt_browse_domain_announcement;
652 typedef struct {
653 astring ServerName;
654 } nbt_browse_master_announcement;
656 typedef struct {
657 uint8 Command;
658 } nbt_browse_reset_state;
660 typedef struct {
661 uint8 UpdateCount;
662 uint32 Periodicity;
663 [charset(DOS)] uint8 ServerName[16];
664 uint8 OSMajor;
665 uint8 OSMinor;
666 svcctl_ServerType ServerType;
667 uint8 BroMajorVer;
668 uint8 BroMinorVer;
669 uint16 Signature;
670 astring Comment;
671 } nbt_browse_local_master_announcement;
673 typedef [nodiscriminant] union {
674 [case(HostAnnouncement)] nbt_browse_host_announcement host_annoucement;
675 [case(AnnouncementRequest)] nbt_browse_announcement_request announcement_request;
676 [case(Election)] nbt_browse_election_request election_request;
677 [case(GetBackupListReq)] nbt_browse_backup_list_request backup_list_request;
678 [case(GetBackupListResp)] nbt_browse_backup_list_response backup_list_response;
679 [case(BecomeBackup)] nbt_browse_become_backup become_backup;
680 [case(DomainAnnouncement)] nbt_browse_domain_announcement domain_announcement;
681 [case(MasterAnnouncement)] nbt_browse_master_announcement master_announcement;
682 [case(ResetBrowserState)] nbt_browse_reset_state reset_browser_state;
683 [case(LocalMasterAnnouncement)] nbt_browse_local_master_announcement local_master_announcement;
684 } nbt_browse_payload;
686 typedef [public,flag(NDR_NOALIGN)] struct {
687 nbt_browse_opcode opcode;
688 [switch_is(opcode)] nbt_browse_payload payload;
689 } nbt_browse_packet;