r7552: Use ParseExpr() for [value] attributes; allows
[kai/samba.git] / source4 / librpc / idl / nbt.idl
1 #include "idl_types.h"
2
3 /*
4    IDL structures for NBT operations
5
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 */
10
11 [ uuid("1-2-3-4"),
12   version(1.0),
13   depends(security)
14 ] interface nbt
15 {
16         const int NBT_NAME_SERVICE_PORT  = 137;
17         const int NBT_DGRAM_SERVICE_PORT = 138;
18
19         typedef [bitmap16bit] bitmap {
20                 NBT_RCODE                   = 0x000F,
21                 NBT_FLAG_BROADCAST          = 0x0010,
22                 NBT_FLAG_RECURSION_AVAIL    = 0x0080,
23                 NBT_FLAG_RECURSION_DESIRED  = 0x0100,
24                 NBT_FLAG_TRUNCATION         = 0x0200,
25                 NBT_FLAG_AUTHORITIVE        = 0x0400,
26                 NBT_OPCODE                  = 0x7800,
27                 NBT_FLAG_REPLY              = 0x8000
28         } nbt_operation;
29
30         /* the opcodes are in the operation field, masked with
31            NBT_OPCODE */
32         typedef enum {
33                 NBT_OPCODE_QUERY          =  (0x0<<11),
34                 NBT_OPCODE_REGISTER       =  (0x5<<11),
35                 NBT_OPCODE_RELEASE        =  (0x6<<11),
36                 NBT_OPCODE_WACK           =  (0x7<<11),
37                 NBT_OPCODE_REFRESH        =  (0x8<<11),
38                 NBT_OPCODE_REFRESH2       =  (0x9<<11),
39                 NBT_OPCODE_MULTI_HOME_REG =  (0xf<<11)
40         } nbt_opcode;
41
42         /* rcode values */
43         typedef enum {
44                 NBT_RCODE_OK  = 0x0,
45                 NBT_RCODE_FMT = 0x1,
46                 NBT_RCODE_SVR = 0x2,
47                 NBT_RCODE_NAM = 0x3,
48                 NBT_RCODE_IMP = 0x4,
49                 NBT_RCODE_RFS = 0x5,
50                 NBT_RCODE_ACT = 0x6,
51                 NBT_RCODE_CFT = 0x7
52         } nbt_rcode;
53
54         /* we support any 8bit name type, but by defining the common
55            ones here we get better debug displays */
56         typedef [enum8bit] enum {
57                 NBT_NAME_CLIENT   = 0x00,
58                 NBT_NAME_MS       = 0x01,
59                 NBT_NAME_USER     = 0x03,
60                 NBT_NAME_SERVER   = 0x20,
61                 NBT_NAME_PDC      = 0x1B,
62                 NBT_NAME_LOGON    = 0x1C,
63                 NBT_NAME_MASTER   = 0x1D,
64                 NBT_NAME_BROWSER  = 0x1E
65         } nbt_name_type;
66
67         /* the ndr parser for nbt_name is separately defined in
68            nbtname.c (along with the parsers for nbt_string) */
69         typedef [public,nopull,nopush] struct {
70                 string        name;
71                 string        scope;
72                 nbt_name_type type;
73         } nbt_name;
74
75         typedef [enum16bit] enum {
76                 NBT_QCLASS_IP = 0x01
77         } nbt_qclass;
78
79         typedef [enum16bit] enum {
80                 NBT_QTYPE_ADDRESS     = 0x0001,
81                 NBT_QTYPE_NAMESERVICE = 0x0002,
82                 NBT_QTYPE_NULL        = 0x000A,
83                 NBT_QTYPE_NETBIOS     = 0x0020,
84                 NBT_QTYPE_STATUS      = 0x0021
85         } nbt_qtype;
86
87         typedef struct {
88                 nbt_name   name;
89                 nbt_qtype  question_type;
90                 nbt_qclass question_class;
91         } nbt_name_question;
92
93         /* these are the possible values of the NBT_NM_OWNER_TYPE
94            field */
95         typedef enum {
96                 NBT_NODE_B = 0x0000,
97                 NBT_NODE_P = 0x2000,
98                 NBT_NODE_M = 0x4000,
99                 NBT_NODE_H = 0x6000
100         } nbt_node_type;
101
102         typedef [bitmap16bit] bitmap {
103                 NBT_NM_PERMANENT        = 0x0200,
104                 NBT_NM_ACTIVE           = 0x0400,
105                 NBT_NM_CONFLICT         = 0x0800,
106                 NBT_NM_DEREGISTER       = 0x1000,
107                 NBT_NM_OWNER_TYPE       = 0x6000,
108                 NBT_NM_GROUP            = 0x8000
109         } nb_flags;
110
111         typedef struct {
112                 nb_flags nb_flags;
113                 ipv4address ipaddr;
114         } nbt_rdata_address;
115
116         typedef struct {
117                 uint16 length;
118                 nbt_rdata_address addresses[length/6];
119         } nbt_rdata_netbios;
120
121         typedef struct {
122                 uint8 unit_id[6];
123                 uint8 jumpers;
124                 uint8 test_result;
125                 uint16 version_number;
126                 uint16 period_of_statistics;
127                 uint16 number_of_crcs;
128                 uint16 number_alignment_errors;
129                 uint16 number_of_collisions;
130                 uint16 number_send_aborts;
131                 uint32 number_good_sends;
132                 uint32 number_good_receives;
133                 uint16 number_retransmits;
134                 uint16 number_no_resource_conditions;
135                 uint16 number_free_command_blocks;
136                 uint16 total_number_command_blocks;
137                 uint16 max_total_number_command_blocks;
138                 uint16 number_pending_sessions;
139                 uint16 max_number_pending_sessions;
140                 uint16 max_total_sessions_possible;
141                 uint16 session_data_packet_size;
142         } nbt_statistics;
143
144         typedef struct {
145                 astring15 name;
146                 nbt_name_type type;
147                 nb_flags  nb_flags;
148         } nbt_status_name;
149
150         typedef struct {
151                 [value(num_names * 18 + 47)] uint16 length;
152                 uint8 num_names;
153                 nbt_status_name names[num_names];
154                 nbt_statistics  statistics;
155         } nbt_rdata_status;
156
157         typedef struct {
158                 uint16 length;
159                 uint8  data[length];
160         } nbt_rdata_data;
161
162         typedef [nodiscriminant] union {
163                 [case(NBT_QTYPE_NETBIOS)] nbt_rdata_netbios netbios;
164                 [case(NBT_QTYPE_STATUS)]  nbt_rdata_status status;
165                 [default]                 nbt_rdata_data   data;
166         } nbt_rdata;
167
168         typedef [flag(LIBNDR_PRINT_ARRAY_HEX)] struct {
169                 nbt_name   name;
170                 nbt_qtype  rr_type;
171                 nbt_qclass rr_class;
172                 uint32     ttl;
173                 [switch_is(rr_type)] nbt_rdata rdata;
174         } nbt_res_rec;
175
176         typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
177                 uint16            name_trn_id;
178                 nbt_operation     operation;
179                 uint16            qdcount;
180                 uint16            ancount;
181                 uint16            nscount;
182                 uint16            arcount;
183                 nbt_name_question questions[qdcount];
184                 nbt_res_rec       answers[ancount];
185                 nbt_res_rec       nsrecs[nscount];
186                 nbt_res_rec       additional[arcount];
187                 [flag(NDR_REMAINING)] DATA_BLOB padding;
188         } nbt_name_packet;
189
190
191         /*
192           NBT DGRAM packets (UDP/138)
193         */
194
195         typedef [enum8bit] enum {
196                 DGRAM_DIRECT_UNIQUE  = 0x10,
197                 DGRAM_DIRECT_GROUP   = 0x11,
198                 DGRAM_BCAST          = 0x12,
199                 DGRAM_ERROR          = 0x13,
200                 DGRAM_QUERY          = 0x14,
201                 DGRAM_QUERY_POSITIVE = 0x15,
202                 DGRAM_QUERY_NEGATIVE = 0x16
203         } dgram_msg_type;
204
205         typedef [bitmap8bit] bitmap {
206                 DGRAM_FLAG_MORE         = 0x01,
207                 DGRAM_FLAG_FIRST        = 0x02,
208                 DGRAM_FLAG_NODE_TYPE    = 0x0C
209         } dgram_flags;
210
211         typedef [enum8bit] enum {
212                 DGRAM_NODE_B    = 0x00,
213                 DGRAM_NODE_P    = 0x04,
214                 DGRAM_NODE_M    = 0x08,
215                 DGRAM_NODE_NBDD = 0x0C
216         } dgram_node_type;
217
218         /* a dgram_message is the main dgram body in general use */
219
220         /* the most common datagram type is a SMB_TRANSACTION
221            operation, where a SMB packet is used in the data section
222            of a dgram_message to hold a trans request, which in turn
223            holds a small command structure. It's a very strange beast
224            indeed. To make the code cleaner we define a basic SMB
225            packet in IDL here. This is not a general purpose SMB
226            packet, and won't be used in the core SMB client/server
227            code, but it does make working with these types of dgrams
228            easier */
229
230         const string NBT_MAILSLOT_NETLOGON = "\\MAILSLOT\\NET\\NETLOGON";
231         const string NBT_MAILSLOT_NTLOGON  = "\\MAILSLOT\\NET\\NTLOGON";
232         const string NBT_MAILSLOT_GETDC    = "\\MAILSLOT\\GETDC";
233         const string NBT_MAILSLOT_BROWSE   = "\\MAILSLOT\\BROWSE";
234
235         typedef [enum8bit] enum {
236                 SMB_TRANSACTION = 0x25
237         } smb_command;
238
239         typedef struct {
240                 [range(17,17),value(17)] uint8 wct;
241                 uint16                      total_param_count;
242                 uint16                      total_data_count;
243                 uint16                      max_param_count;
244                 uint16                      max_data_count;
245                 uint8                       max_setup_count;
246                 uint8                       pad;
247                 uint16                      trans_flags;
248                 uint32                      timeout;
249                 uint16                      reserved;
250                 uint16                      param_count;
251                 uint16                      param_offset;
252                 uint16                      data_count;
253                 uint16                      data_offset;
254                 [range(3,3),value(3)] uint8 setup_count;
255                 uint8                       pad2;
256                 uint16                      opcode;
257                 uint16                      priority;
258                 uint16                      class;
259                 [value(strlen(mailslot_name)+1+r->data.length)] 
260                       uint16                byte_count;
261                 astring                     mailslot_name;
262                 [flag(NDR_REMAINING)]       DATA_BLOB data;
263         } smb_trans_body;
264
265         typedef [nodiscriminant] union {
266                 [case(SMB_TRANSACTION)] smb_trans_body trans;
267         } smb_body;
268
269
270         typedef [flag(NDR_NOALIGN|NDR_LITTLE_ENDIAN|NDR_PAHEX),public] struct {
271                 smb_command                smb_command;
272                 uint8                      err_class;
273                 uint8                      pad;
274                 uint16                     err_code;
275                 uint8                      flags;
276                 uint16                     flags2;
277                 uint16                     pid_high;
278                 uint8                      signature[8];
279                 uint16                     reserved;
280                 uint16                     tid;
281                 uint16                     pid;
282                 uint16                     vuid;
283                 uint16                     mid;
284                 [switch_is(smb_command)]   smb_body body;
285         } dgram_smb_packet;
286
287         const uint32 DGRAM_SMB = 0xff534d42; /* 0xffSMB */
288
289         typedef [nodiscriminant] union {
290                 [case(DGRAM_SMB)] dgram_smb_packet smb;
291         } dgram_message_body;
292
293         typedef struct {
294                 uint16          length;
295                 uint16          offset;
296                 nbt_name        source_name;
297                 nbt_name        dest_name;
298                 uint32          dgram_body_type;
299                 [switch_is(dgram_body_type)] dgram_message_body body;
300         } dgram_message;
301
302         typedef [enum8bit] enum {
303                 DGRAM_ERROR_NAME_NOT_PRESENT = 0x82,
304                 DGRAM_ERROR_INVALID_SOURCE   = 0x83,
305                 DGRAM_ERROR_INVALID_DEST     = 0x84
306         } dgram_err_code;
307
308         typedef [nodiscriminant] union {
309                 [case(DGRAM_DIRECT_UNIQUE)]   dgram_message  msg;
310                 [case(DGRAM_DIRECT_GROUP)]    dgram_message  msg;
311                 [case(DGRAM_BCAST)]           dgram_message  msg;
312                 [case(DGRAM_ERROR)]           dgram_err_code error;
313                 [case(DGRAM_QUERY)]           nbt_name       dest_name;
314                 [case(DGRAM_QUERY_POSITIVE)]  nbt_name       dest_name;
315                 [case(DGRAM_QUERY_NEGATIVE)]  nbt_name       dest_name;
316         } dgram_data;
317
318         typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
319                 dgram_msg_type msg_type;
320                 dgram_flags    flags;
321                 uint16         dgram_id;
322                 ipv4address    source;
323                 uint16         src_port;
324                 [switch_is(msg_type)] dgram_data data;
325         } nbt_dgram_packet;
326
327
328         /*******************************************/
329         /* \MAILSLOT\NET\NETLOGON mailslot requests */
330         typedef enum {
331                 NETLOGON_QUERY_FOR_PDC           = 0x7, 
332                 NETLOGON_ANNOUNCE_UAS            = 0xa,
333                 NETLOGON_RESPONSE_FROM_PDC       = 0xc,
334                 NETLOGON_QUERY_FOR_PDC2          = 0x12,
335                 NETLOGON_RESPONSE_FROM_PDC2      = 0x17,
336                 NETLOGON_RESPONSE_FROM_PDC_USER  = 0x19
337         } nbt_netlogon_command;
338
339         /* query for pdc request */
340         typedef struct {
341                 astring              computer_name;
342                 astring              mailslot_name;
343                 [flag(NDR_ALIGN2)]   DATA_BLOB _pad;
344                 nstring              unicode_name;
345                 uint32               nt_version;
346                 uint16               lmnt_token;
347                 uint16               lm20_token;
348         } nbt_netlogon_query_for_pdc;
349
350         /* query for pdc request - new style */
351         typedef struct {
352                 uint16               request_count;
353                 nstring              computer_name;
354                 nstring              user_name;
355                 astring              mailslot_name;
356                 uint32               unknown[2];
357                 uint32               nt_version;
358                 uint16               lmnt_token;
359                 uint16               lm20_token;
360         } nbt_netlogon_query_for_pdc2;
361
362         /* response from pdc */
363         typedef struct {
364                 astring pdc_name;
365                 [flag(NDR_ALIGN2)]   DATA_BLOB _pad;
366                 nstring              unicode_pdc_name;
367                 nstring              domain_name;
368                 uint32               nt_version;
369                 uint16               lmnt_token;
370                 uint16               lm20_token;
371         } nbt_netlogon_response_from_pdc;
372
373         typedef [bitmap32bit] bitmap {
374                 NBT_SERVER_PDC           = 0x00000001,
375                 NBT_SERVER_GC            = 0x00000004,
376                 NBT_SERVER_LDAP          = 0x00000008,
377                 NBT_SERVER_DS            = 0x00000010,
378                 NBT_SERVER_KDC           = 0x00000020,
379                 NBT_SERVER_TIMESERV      = 0x00000040,
380                 NBT_SERVER_CLOSEST       = 0x00000080,
381                 NBT_SERVER_WRITABLE      = 0x00000100, 
382                 NBT_SERVER_GOOD_TIMESERV = 0x00000200
383         } nbt_server_type;
384
385         /* response from pdc - type2 */
386         typedef struct {
387                 [flag(NDR_ALIGN4)]   DATA_BLOB _pad;
388                 nbt_server_type      server_type;
389                 GUID                 domain_uuid;
390                 nbt_string           forest;
391                 nbt_string           dns_domain;
392                 nbt_string           pdc_dns_name;
393                 nbt_string           domain;
394                 nbt_string           pdc_name;
395                 nbt_string           user_name;
396                 nbt_string           site_name;
397                 nbt_string           site_name2;
398                 uint8                unknown;
399                 uint32               unknown2;
400                 [flag(NDR_BIG_ENDIAN)] 
401                   ipv4address          pdc_ip;
402                 uint32               unknown3[2];
403                 uint32               nt_version;
404                 uint16               lmnt_token;
405                 uint16               lm20_token;
406         } nbt_netlogon_response_from_pdc2;
407
408         /* announce change to UAS or SAM */
409         typedef struct {
410                 uint32           db_index;
411                 hyper            serial;
412                 NTTIME           timestamp;
413         } nbt_db_change;
414
415         /* used to announce SAM changes */
416         typedef struct {
417                 uint32           serial_lo;
418                 time_t           timestamp;
419                 uint32           pulse;
420                 uint32           random;
421                 astring          pdc_name;
422                 astring          domain;
423                 [flag(NDR_ALIGN2)] DATA_BLOB _pad;
424                 nstring          unicode_pdc_name;
425                 nstring          unicode_domain;
426                 uint32           db_count;
427                 nbt_db_change    dbchange[db_count];
428                 [value(ndr_size_dom_sid(&sid))] uint32 sid_size;
429                 [flag(NDR_ALIGN4)] DATA_BLOB _pad2;
430                 dom_sid          sid;
431                 uint32           nt_version;
432                 uint16           lmnt_token;
433                 uint16           lm20_token;
434         } nbt_netlogon_announce_uas;
435
436         typedef [nodiscriminant] union {
437                 [case(NETLOGON_QUERY_FOR_PDC)] nbt_netlogon_query_for_pdc pdc;
438                 [case(NETLOGON_QUERY_FOR_PDC2)] nbt_netlogon_query_for_pdc2 pdc2;
439                 [case(NETLOGON_ANNOUNCE_UAS)] nbt_netlogon_announce_uas uas;
440                 [case(NETLOGON_RESPONSE_FROM_PDC)] nbt_netlogon_response_from_pdc response;
441                 [case(NETLOGON_RESPONSE_FROM_PDC2)] nbt_netlogon_response_from_pdc2 response2;
442                 [case(NETLOGON_RESPONSE_FROM_PDC_USER)] nbt_netlogon_response_from_pdc2 response2;
443         } nbt_netlogon_request;
444
445         typedef [flag(NDR_NOALIGN),public] struct {
446                 nbt_netlogon_command command;
447                 [switch_is(command)] nbt_netlogon_request req;
448         } nbt_netlogon_packet;
449
450         /*******************************************/
451         /* CLDAP netlogon response                 */
452
453         /* note that these structures are very similar to, but not
454            quite identical to, the netlogon structures above */
455
456         typedef struct {
457                 [value(19)] uint16   type;
458                 nstring              pdc_name;
459                 nstring              user_name;
460                 nstring              domain_name;
461                 uint32               nt_version;
462                 uint16               lmnt_token;
463                 uint16               lm20_token;                
464         } nbt_cldap_netlogon_1;
465
466         typedef struct {
467                 [value(19)] uint16   type;
468                 nstring              pdc_name;
469                 nstring              user_name;
470                 nstring              domain_name;
471                 GUID                 domain_uuid;
472                 GUID                 unknown_uuid;
473                 nbt_string           forest;
474                 nbt_string           dns_domain;
475                 nbt_string           pdc_dns_name;
476                 ipv4address          pdc_ip;
477                 nbt_server_type      server_type;
478                 uint32               nt_version;
479                 uint16               lmnt_token;
480                 uint16               lm20_token;                
481         } nbt_cldap_netlogon_2;
482
483         typedef struct {
484                 [value(23)] uint32   type;
485                 nbt_server_type      server_type;
486                 GUID                 domain_uuid;
487                 nbt_string           forest;
488                 nbt_string           dns_domain;
489                 nbt_string           pdc_dns_name;
490                 nbt_string           domain;
491                 nbt_string           pdc_name;
492                 nbt_string           user_name;
493                 nbt_string           site_name;
494                 nbt_string           site_name2;
495                 uint32               nt_version;
496                 uint16               lmnt_token;
497                 uint16               lm20_token;
498         } nbt_cldap_netlogon_3;
499
500         typedef struct {
501                 [value(23)] uint32   type;
502                 nbt_server_type      server_type;
503                 GUID                 domain_uuid;
504                 nbt_string           forest;
505                 nbt_string           dns_domain;
506                 nbt_string           pdc_dns_name;
507                 nbt_string           domain;
508                 nbt_string           pdc_name;
509                 nbt_string           user_name;
510                 nbt_string           site_name;
511                 nbt_string           site_name2;
512                 uint8                unknown;
513                 uint32               unknown2;
514                 [flag(NDR_BIG_ENDIAN)] 
515                   ipv4address          pdc_ip;
516                 uint32               unknown3[2];
517                 uint32               nt_version;
518                 uint16               lmnt_token;
519                 uint16               lm20_token;
520         } nbt_cldap_netlogon_4;
521
522         typedef [flag(NDR_NOALIGN),public,nodiscriminant] union {
523                 [case(0)]  nbt_cldap_netlogon_1 logon1;
524                 [case(1)]  nbt_cldap_netlogon_1 logon1;
525                 [case(2)]  nbt_cldap_netlogon_2 logon2;
526                 [case(3)]  nbt_cldap_netlogon_2 logon2;
527                 [case(4)]  nbt_cldap_netlogon_3 logon3;
528                 [case(5)]  nbt_cldap_netlogon_3 logon3;
529                 [case(6)]  nbt_cldap_netlogon_3 logon3;
530                 [case(7)]  nbt_cldap_netlogon_3 logon3;
531                 [default]  nbt_cldap_netlogon_4 logon4;
532         } nbt_cldap_netlogon;
533
534         /*******************************************/
535         /* \MAILSLOT\NET\NTLOGON mailslot requests */
536         typedef enum {
537                 NTLOGON_SAM_LOGON       = 0x12,
538                 NTLOGON_SAM_LOGON_REPLY = 0x13
539         } nbt_ntlogon_command;
540
541         typedef struct {
542                 uint16               request_count;
543                 nstring              computer_name;
544                 nstring              user_name;
545                 astring              mailslot_name;
546                 uint32               acct_control;
547                 [value(ndr_size_dom_sid(&sid))] uint32 sid_size;
548                 [flag(NDR_ALIGN4)]   DATA_BLOB _pad;
549                 dom_sid              sid;
550                 uint32               nt_version;
551                 uint16               lmnt_token;
552                 uint16               lm20_token;
553         } nbt_ntlogon_sam_logon;
554
555         typedef struct {
556                 nstring              server;
557                 nstring              user_name;
558                 nstring              domain;
559                 uint32               nt_version;
560                 uint16               lmnt_token;
561                 uint16               lm20_token;
562         } nbt_ntlogon_sam_logon_reply;
563
564         typedef [nodiscriminant] union {
565                 [case(NTLOGON_SAM_LOGON)]       nbt_ntlogon_sam_logon logon;
566                 [case(NTLOGON_SAM_LOGON_REPLY)] nbt_ntlogon_sam_logon_reply reply;
567         } nbt_ntlogon_request;
568
569         typedef [flag(NDR_NOALIGN),public] struct {
570                 nbt_ntlogon_command command;
571                 [switch_is(command)] nbt_ntlogon_request req;
572         } nbt_ntlogon_packet;
573
574         /*******************************************/
575         /* \MAILSLOT\BROWSE mailslot requests */
576
577         typedef enum { 
578                 HostAnnouncement                        = 1,
579                 AnnouncementRequest             = 2,
580                 Election                                        = 8,
581                 GetBackupListReq                        = 9,
582                 GetBackupListResp                       = 10,
583                 BecomeBackup                            = 11,
584                 DomainAnnouncement                      = 12,
585                 MasterAnnouncement                      = 13,
586                 ResetBrowserState                       = 14,
587                 LocalMasterAnnouncement         = 15
588         } nbt_browse_opcode;
589
590         typedef struct {
591                 uint8 update_count;
592                 uint32 ttl;
593                 uint8 name[16];
594                 uint8 os_major;
595                 uint8 os_minor;
596                 uint32 server_type;
597                 astring comment;
598         } nbt_browse_host_announcement;
599
600         typedef struct {
601                 uint8 unknown;
602                 astring ResponseComputerName; 
603         } nbt_browse_request_announcement;
604
605         typedef struct {
606                 uint8 count;
607                 uint32 token;
608         } nbt_browse_backup_list_request;
609
610         typedef struct {
611                 uint8 count;
612                 uint32 token;
613                 nbt_name BackupServerList[count];
614         } nbt_browse_backup_list_response;
615
616         typedef struct {
617                 astring BrowserToPromote;
618         } nbt_browse_become_backup;
619
620         typedef struct {
621                 uint8 version;
622                 uint32 criteria;
623                 uint32 time_up; /* In milliseconds */
624                 uint32 reserved; /* Must be zero */
625                 astring ServerName; 
626         } nbt_browse_election_request;
627
628         typedef struct {
629                 uint8 options;
630         } nbt_browse_reset_state;
631
632         typedef struct {
633                 astring MasterBrowserServerName; 
634         } nbt_browse_master_announcement;
635
636         typedef [nodiscriminant] union {
637                 [case(HostAnnouncement)] nbt_browse_host_announcement host_annoucement;
638                 [case(AnnouncementRequest)] nbt_browse_request_announcement announcement_request;
639                 [case(Election)] nbt_browse_election_request election_request;
640                 [case(GetBackupListReq)] nbt_browse_backup_list_request backup_list_request;
641                 [case(GetBackupListResp)] nbt_browse_backup_list_response backup_list_response;
642                 [case(BecomeBackup)] nbt_browse_become_backup become_backup;
643                 [case(DomainAnnouncement)] nbt_browse_master_announcement domain_announcement;
644                 [case(MasterAnnouncement)] nbt_browse_master_announcement master_announcement;
645                 [case(ResetBrowserState)] nbt_browse_reset_state reset_browser_state;
646                 [case(LocalMasterAnnouncement)] nbt_browse_master_announcement local_master_announcement;
647         } nbt_browse_payload;
648
649         typedef [public,flag(NDR_NOALIGN)] struct {
650                 nbt_browse_opcode opcode;
651                 nbt_browse_payload payload;     
652         } nbt_browse_packet;
653 }