idl: dnsserver: Add DNS_RPC_RECORD_STRING data type for TXT DNS record
[garming/samba-autobuild/.git] / librpc / idl / dnsserver.idl
1 #include "idl_types.h"
2 /*
3   dnsserver interface definition
4   for a protocol descrition see [MS-DNSP].pdf
5 */
6
7 import "misc.idl", "dnsp.idl";
8
9 [ uuid("50abc2a4-574d-40b3-9d66-ee4fd5fba076"),
10   version(5.0),
11   pointer_default(unique),
12   endpoint("ncacn_ip_tcp:", "ncacn_np:[\\pipe\\dnsserver]"),
13   helper("../librpc/ndr/ndr_dnsserver.h"),
14   helpstring("DNS Management Server")
15 ] interface dnsserver
16 {
17
18 #define wchar_t uint16
19 #define BOOLEAN boolean8
20 #define BOOL boolean32
21 #define BYTE uint8
22 #define UCHAR uint8
23 #define CHAR char
24 #define PBYTE BYTE*
25 #define DWORD uint32
26 #define PDWORD uint32 *
27
28         /* */
29         /*   DNS RPC data types */
30         /* */
31
32         typedef [v1_enum] enum {
33                 DNS_RPC_USE_TCPIP                       = 0x00000001,
34                 DNS_RPC_USE_NAMED_PIPE          = 0x00000002,
35                 DNS_RPC_USE_LPC                         = 0x00000004,
36                 DNS_RPC_USE_ALL_PROTOCOLS       = 0xFFFFFFFF
37         }
38         DNS_RPC_PROTOCOLS;
39
40         typedef [v1_enum] enum {
41                 DNS_CLIENT_VERSION_W2K          = 0x00000000,
42                 DNS_CLIENT_VERSION_DOTNET       = 0x00060000,
43                 DNS_CLIENT_VERSION_LONGHORN = 0x00070000
44         }
45         DNS_RPC_CLIENT_VERSION;
46
47         /* Return buffer */
48         typedef struct {
49                 DWORD                       dwLength;
50                 [size_is(dwLength)] BYTE    Buffer[];
51         } DNS_RPC_BUFFER;
52
53         /* String Array */
54         typedef struct {
55                 [range(0,10000)]        DWORD       dwCount;
56                 [size_is(dwCount),string,charset(UTF8)]      char *       pszStrings[];
57         } DNS_RPC_UTF8_STRING_LIST;
58
59         /* Name and parameter value */
60         typedef struct {
61                 DWORD       dwParam;
62                 [string, charset(UTF8)] char *       pszNodeName;
63         }
64         DNS_RPC_NAME_AND_PARAM;
65
66
67         /* */
68         /*   DNS Resource Record data types */
69         /* */
70
71         /* DNS_RECORD_TYPE is defined in dnsp.idl as dns_record_type */
72         /* DNS_RPC_NODE_FLAGS is defined in dnsp.idl as dns_rpc_node_flags */
73
74         typedef [public,gensize] struct {
75                 [value(strlen(str))] uint8 len;
76                 [charset(UTF8)] uint8 str[len];
77         }
78         DNS_RPC_NAME;
79
80         typedef struct {
81                 uint16 wLength;
82                 uint16 wRecordCount;
83                 uint32 dwFlags;
84                 uint32 dwChildCount;
85                 DNS_RPC_NAME dnsNodeName;
86         }
87         DNS_RPC_NODE;
88
89         typedef struct {
90                 uint32 dwSerialNo;
91                 uint32 dwRefresh;
92                 uint32 dwRetry;
93                 uint32 dwExpire;
94                 uint32 dwMinimumTtl;
95                 DNS_RPC_NAME NamePrimaryServer;
96                 DNS_RPC_NAME ZoneAdministratorEmail;
97         }
98         DNS_RPC_RECORD_SOA;
99
100         typedef struct {
101                 uint16 wPreference;
102                 DNS_RPC_NAME nameExchange;
103         }
104         DNS_RPC_RECORD_NAME_PREFERENCE;
105
106         typedef [gensize,nopull,nopush] struct {
107                 uint8 count;
108                 DNS_RPC_NAME str[count];
109         }
110         DNS_RPC_RECORD_STRING;
111
112         typedef struct {
113                 uint16 wPriority;
114                 uint16 wWeight;
115                 uint16 wPort;
116                 DNS_RPC_NAME nameTarget;
117         }
118         DNS_RPC_RECORD_SRV;
119
120         typedef [nodiscriminant,gensize,flag(NDR_NOALIGN)] union {
121                 [case(DNS_TYPE_TOMBSTONE)]                  NTTIME timestamp;
122                 [case(DNS_TYPE_A)] [flag(NDR_BIG_ENDIAN)]   ipv4address ipv4;
123                 [case(DNS_TYPE_NS)]                             DNS_RPC_NAME name;
124                 [case(DNS_TYPE_MD)]                             DNS_RPC_NAME name;
125                 [case(DNS_TYPE_MF)]                             DNS_RPC_NAME name;
126                 [case(DNS_TYPE_CNAME)]                          DNS_RPC_NAME name;
127                 [case(DNS_TYPE_SOA)]                            DNS_RPC_RECORD_SOA soa;
128                 [case(DNS_TYPE_MB)]                             DNS_RPC_NAME name;
129                 [case(DNS_TYPE_MG)]                             DNS_RPC_NAME name;
130                 [case(DNS_TYPE_MR)]                             DNS_RPC_NAME name;
131                 [case(DNS_TYPE_PTR)]                            DNS_RPC_NAME ptr;
132                 [case(DNS_TYPE_HINFO)]                          DNS_RPC_NAME hinfo;
133                 [case(DNS_TYPE_MX)]                             DNS_RPC_RECORD_NAME_PREFERENCE mx;
134                 [case(DNS_TYPE_TXT)]                            DNS_RPC_RECORD_STRING txt;
135                 [case(DNS_TYPE_AAAA)]                           ipv6address ipv6;
136                 [case(DNS_TYPE_SRV)]                            DNS_RPC_RECORD_SRV srv;
137                 [case(DNS_TYPE_DNAME)]                          DNS_RPC_NAME name;
138         }
139         DNS_RPC_DATA;
140
141         typedef [public] struct {
142                 [value(ndr_size_DNS_RPC_DATA(&data,wType,0))] uint16 wDataLength;
143                 dns_record_type        wType;
144                 DWORD       dwFlags;
145                 DWORD       dwSerial;
146                 DWORD       dwTtlSeconds;
147                 DWORD       dwTimeStamp;
148                 DWORD       dwReserved;
149                 [subcontext(0),subcontext_size(wDataLength),switch_is(wType)] DNS_RPC_DATA data;
150         }
151         DNS_RPC_RECORD;
152
153         typedef struct {
154                 [value(ndr_size_DNS_RPC_DATA(&rec.data,rec.wType,0))] uint3264 wContextLength;
155                 DNS_RPC_RECORD rec;
156         }
157         DNS_RPC_RECORD_BUF;
158
159
160         /* */
161         /*   DNS Address Information data types */
162         /* */
163
164         typedef [v1_enum] enum {
165                 DNS_IPVAL_DNS_SERVERS           = 0x00,
166                 DNS_IPVAL_DNS_ROOTHINTS         = 0x01,
167                 DNS_IPVAL_DNS_FORWARDERS        = 0x02,
168                 DNS_IPVAL_DNS_ZONE_MASTERS      = 0x03,
169                 DNS_IPVAL_DNS_DELEGATIONS       = 0x04
170         }
171         DNS_IPVAL_CONTEXT;
172
173         typedef [v1_enum] enum {
174                 ERROR_SUCCESS                           = 0x00,
175                 DNS_IPVAL_INVALID_ADDR          = 0x01,
176                 DNS_IPVAL_UNREACHABLE           = 0x02,
177                 DNS_IPVAL_NO_RESPONSE           = 0x03,
178                 DNS_IPVAL_NOT_AUTH_FOR_ZONE     = 0x04,
179                 DNS_IPVAL_UNKNOWN_ERROR         = 0xFF,
180                 DNS_IPVAL_NO_TCP                        = 0x80000000
181         }
182         DNS_IP_VALIDATE_RETURN_FLAGS;
183
184         typedef struct {
185                 DWORD           AddrCount;
186                 [size_is( AddrCount )] DWORD        AddrArray[];
187         } IP4_ARRAY;
188 #define PIP4_ARRAY IP4_ARRAY*
189
190         typedef struct {
191                 CHAR MaxSa[32];
192                 DWORD DnsAddrUserDword[8];
193         } DNS_ADDR;
194
195         typedef struct {
196                 DWORD           MaxCount;
197                 DWORD           AddrCount;
198                 DWORD           Tag;
199                 WORD            Family;
200                 WORD            WordReserved;
201                 DWORD           Flags;
202                 DWORD           MatchFlag;
203                 DWORD           Reserved1;
204                 DWORD           Reserved2;
205                 [size_is( AddrCount )] DNS_ADDR         AddrArray[];
206         } DNS_ADDR_ARRAY;
207 #define PDNS_ADDR_ARRAY DNS_ADDR_ARRAY*
208
209         typedef struct {
210                 DWORD               dwRpcStructureVersion;
211                 DWORD               dwReserved0;
212                 DWORD               dwContext;
213                 DWORD               dwReserved1;
214                 [string, charset(UTF8)] char *                 pszContextName;
215                 PDNS_ADDR_ARRAY     aipValidateAddrs;
216         }
217         DNS_RPC_IP_VALIDATE;
218
219
220         /* */
221         /*   DNS Server data types */
222         /* */
223
224         typedef [enum8bit] enum {
225                 DNS_BOOT_METHOD_UNINITIALIZED   = 0x00,
226                 DNS_BOOT_METHOD_FILE                    = 0x01,
227                 DNS_BOOT_METHOD_REGISTRY                = 0x02,
228                 DNS_BOOT_METHOD_DIRECTORY               = 0x03
229         }
230         DNS_BOOT_METHOD;
231
232         typedef [v1_enum] enum {
233                 DNS_ALLOW_RFC_NAMES_ONLY                = 0x00,
234                 DNS_ALLOW_NONRFC_NAMES                  = 0x01,
235                 DNS_ALLOW_MULTIBYTE_NAMES               = 0x02,
236                 DNS_ALLOW_ALL_NAMES                             = 0x03
237         }
238         DNS_NAME_CHECK_FLAG;
239
240         typedef struct {
241                 /* version */
242                 /* basic configuration flags */
243
244                 DWORD          dwVersion;
245                 DNS_BOOT_METHOD fBootMethod;
246                 BOOLEAN        fAdminConfigured;
247                 BOOLEAN        fAllowUpdate;
248                 BOOLEAN        fDsAvailable;
249
250                 /* pointer section */
251
252                 [string, charset(UTF8)] char *           pszServerName;
253
254                 /* DS container */
255
256                 [string, charset(UTF16)] wchar_t *        pszDsContainer;
257
258                 /* IP interfaces */
259
260                 PIP4_ARRAY     aipServerAddrs;
261                 PIP4_ARRAY     aipListenAddrs;
262
263                 /* forwarders */
264
265                 PIP4_ARRAY     aipForwarders;
266
267                 /* future extensions */
268
269                 PDWORD         pExtension1;
270                 PDWORD         pExtension2;
271                 PDWORD         pExtension3;
272                 PDWORD         pExtension4;
273                 PDWORD         pExtension5;
274
275                 /* DWORD section */
276
277                 /* logging */
278
279                 DWORD          dwLogLevel;
280                 DWORD          dwDebugLevel;
281
282                 /* configuration DWORDs */
283
284                 DWORD         dwForwardTimeout;
285                 DWORD         dwRpcProtocol;
286                 DNS_NAME_CHECK_FLAG         dwNameCheckFlag;
287                 DWORD         cAddressAnswerLimit;
288                 DWORD         dwRecursionRetry;
289                 DWORD         dwRecursionTimeout;
290                 DWORD         dwMaxCacheTtl;
291                 DWORD         dwDsPollingInterval;
292
293                 /* aging / scavenging */
294
295                 DWORD         dwScavengingInterval;
296                 DWORD         dwDefaultRefreshInterval;
297                 DWORD         dwDefaultNoRefreshInterval;
298
299                 DWORD         dwReserveArray[10];
300
301                 /* BYTE section */
302
303                 /* configuration flags */
304
305                 BOOLEAN       fAutoReverseZones;
306                 BOOLEAN       fAutoCacheUpdate;
307
308                 /* recursion control */
309
310                 BOOLEAN       fRecurseAfterForwarding;
311                 BOOLEAN       fForwardDelegations;
312                 BOOLEAN       fNoRecursion;
313                 BOOLEAN       fSecureResponses;
314
315                 /* lookup control */
316
317                 BOOLEAN       fRoundRobin;
318                 BOOLEAN       fLocalNetPriority;
319
320                 /* BIND compatibility and mimicking */
321
322                 BOOLEAN       fBindSecondaries;
323                 BOOLEAN       fWriteAuthorityNs;
324
325                 /* Bells and whistles */
326
327                 BOOLEAN       fStrictFileParsing;
328                 BOOLEAN       fLooseWildcarding;
329
330                 /*   aging / scavenging */
331
332                 BOOLEAN       fDefaultAgingState;
333                 BOOLEAN       fReserveArray[15];
334         }
335         DNS_RPC_SERVER_INFO_W2K;
336
337         typedef struct {
338                 [string, charset(UTF8)] uint8 *extension;
339         } DNS_EXTENSION;
340
341         typedef [public] struct {
342                 DWORD          dwRpcStructureVersion;
343                 DWORD          dwReserved0;
344
345                 /* basic configuration flags */
346
347                 DWORD          dwVersion;
348                 DNS_BOOT_METHOD fBootMethod;
349                 BOOLEAN        fAdminConfigured;
350                 BOOLEAN        fAllowUpdate;
351                 BOOLEAN        fDsAvailable;
352
353                 /* pointer section */
354
355                 [string, charset(UTF8)] char *        pszServerName;
356
357                 /* DS container */
358
359                 [string, charset(UTF16)] wchar_t *     pszDsContainer;
360
361                 /* IP interfaces */
362
363                 PIP4_ARRAY     aipServerAddrs;
364                 PIP4_ARRAY     aipListenAddrs;
365
366                 /* forwarders */
367
368                 PIP4_ARRAY     aipForwarders;
369
370                 /* logging */
371
372                 PIP4_ARRAY aipLogFilter;
373                 [string, charset(UTF16)] wchar_t *  pwszLogFilePath;
374
375                 /* Server domain/forest */
376
377                 [string, charset(UTF8)] char *            pszDomainName;         /*   UTF-8 FQDN */
378                 [string, charset(UTF8)] char *            pszForestName;         /*   UTF-8 FQDN */
379
380                 /* Built-in directory partitions */
381
382                 [string, charset(UTF8)] char *            pszDomainDirectoryPartition;    /*   UTF-8 FQDN */
383                 [string, charset(UTF8)] char *            pszForestDirectoryPartition;    /*   UTF-8 FQDN */
384
385                 /* future extensions */
386                 DNS_EXTENSION       pExtensions[6];
387
388                 /* DWORD section */
389
390                 /* logging */
391
392                 DWORD          dwLogLevel;
393                 DWORD          dwDebugLevel;
394
395                 /* configuration DWORDs */
396
397                 DWORD         dwForwardTimeout;
398                 DWORD         dwRpcProtocol;
399                 DNS_NAME_CHECK_FLAG         dwNameCheckFlag;
400                 DWORD         cAddressAnswerLimit;
401                 DWORD         dwRecursionRetry;
402                 DWORD         dwRecursionTimeout;
403                 DWORD         dwMaxCacheTtl;
404                 DWORD         dwDsPollingInterval;
405                 DWORD         dwLocalNetPriorityNetMask;
406
407                 /* aging and scavenging */
408
409                 DWORD         dwScavengingInterval;
410                 DWORD         dwDefaultRefreshInterval;
411                 DWORD         dwDefaultNoRefreshInterval;
412                 DWORD         dwLastScavengeTime;
413
414                 /* more logging */
415
416                 DWORD         dwEventLogLevel;
417                 DWORD         dwLogFileMaxSize;
418
419                 /* Active Directory information */
420
421                 DWORD         dwDsForestVersion;
422                 DWORD         dwDsDomainVersion;
423                 DWORD         dwDsDsaVersion;
424
425                 DWORD         dwReserveArray[ 4 ];
426
427                 /* BYTE section */
428
429                 /* configuration flags */
430
431                 BOOLEAN       fAutoReverseZones;
432                 BOOLEAN       fAutoCacheUpdate;
433
434                 /* recursion control */
435
436                 BOOLEAN       fRecurseAfterForwarding;
437                 BOOLEAN       fForwardDelegations;
438                 BOOLEAN       fNoRecursion;
439                 BOOLEAN       fSecureResponses;
440
441                 /* lookup control */
442
443                 BOOLEAN       fRoundRobin;
444                 BOOLEAN       fLocalNetPriority;
445
446                 /* BIND compatibility and mimicking */
447
448                 BOOLEAN       fBindSecondaries;
449                 BOOLEAN       fWriteAuthorityNs;
450
451                 /* Bells and whistles */
452
453                 BOOLEAN       fStrictFileParsing;
454                 BOOLEAN        fLooseWildcarding;
455
456                 /* aging \ scavenging */
457
458                 BOOLEAN        fDefaultAgingState;
459
460                 BOOLEAN     fReserveArray[ 15 ];
461         }
462         DNS_RPC_SERVER_INFO_DOTNET;
463
464         typedef [public] struct {
465                 DWORD               dwRpcStructureVersion;
466                 DWORD               dwReserved0;
467
468                 /* basic configuration flags */
469
470                 DWORD                  dwVersion;
471                 DNS_BOOT_METHOD        fBootMethod;
472                 BOOLEAN                fAdminConfigured;
473                 BOOLEAN                fAllowUpdate;
474                 BOOLEAN                fDsAvailable;
475
476                 /* pointer section */
477
478                 [string, charset(UTF8)] char *                     pszServerName;
479
480                 /* DS container */
481
482                 [string, charset(UTF16)] wchar_t *                  pszDsContainer;
483
484                 /* IP interfaces */
485
486                 PDNS_ADDR_ARRAY        aipServerAddrs;
487                 PDNS_ADDR_ARRAY        aipListenAddrs;
488
489                 /* forwarders */
490
491                 PDNS_ADDR_ARRAY        aipForwarders;
492
493                 /* logging */
494
495                 PDNS_ADDR_ARRAY        aipLogFilter;
496                 [string, charset(UTF16)] wchar_t *              pwszLogFilePath;
497
498                 /* Server domain/forest */
499
500                 [string, charset(UTF8)] char *                     pszDomainName;         /*   UTF-8 FQDN */
501                 [string, charset(UTF8)] char *                     pszForestName;         /*   UTF-8 FQDN */
502
503                 /* Built-in directory partitions */
504
505                 [string, charset(UTF8)] char *            pszDomainDirectoryPartition;    /*   UTF-8 FQDN */
506                 [string, charset(UTF8)] char *            pszForestDirectoryPartition;    /*   UTF-8 FQDN */
507
508                 /* future extensions */
509                 DNS_EXTENSION       pExtensions[6];
510
511                 /* DWORD section */
512
513                 /* logging */
514
515                 DWORD          dwLogLevel;
516                 DWORD          dwDebugLevel;
517
518                 /* configuration DWORDs */
519
520                 DWORD          dwForwardTimeout;
521                 DWORD          dwRpcProtocol;
522                 DNS_NAME_CHECK_FLAG          dwNameCheckFlag;
523                 DWORD          cAddressAnswerLimit;
524                 DWORD          dwRecursionRetry;
525                 DWORD          dwRecursionTimeout;
526                 DWORD          dwMaxCacheTtl;
527                 DWORD          dwDsPollingInterval;
528                 DWORD          dwLocalNetPriorityNetMask;
529
530                 /* aging and scavenging */
531
532                 DWORD          dwScavengingInterval;
533                 DWORD          dwDefaultRefreshInterval;
534                 DWORD          dwDefaultNoRefreshInterval;
535                 DWORD          dwLastScavengeTime;
536
537                 /* more logging */
538
539                 DWORD          dwEventLogLevel;
540                 DWORD          dwLogFileMaxSize;
541
542                 /* Active Directory information */
543
544                 DWORD          dwDsForestVersion;
545                 DWORD          dwDsDomainVersion;
546                 DWORD          dwDsDsaVersion;
547                 BOOLEAN        fReadOnlyDC;
548
549                 DWORD          dwReserveArray[ 3 ];
550
551                 /* BYTE section */
552
553                 /* configuration flags */
554
555                 BOOLEAN        fAutoReverseZones;
556                 BOOLEAN        fAutoCacheUpdate;
557
558                 /* recursion control */
559
560                 BOOLEAN        fRecurseAfterForwarding;
561                 BOOLEAN        fForwardDelegations;
562                 BOOLEAN        fNoRecursion;
563                 BOOLEAN        fSecureResponses;
564
565                 /* lookup control */
566
567                 BOOLEAN      fRoundRobin;
568                 BOOLEAN      fLocalNetPriority;
569
570                 /* BIND compatibility and mimicking */
571
572                 BOOLEAN      fBindSecondaries;
573                 BOOLEAN      fWriteAuthorityNs;
574
575                 /* Bells and whistles */
576
577                 BOOLEAN      fStrictFileParsing;
578                 BOOLEAN      fLooseWildcarding;
579
580                 /* aging \ scavenging */
581
582                 BOOLEAN      fDefaultAgingState;
583
584                 BOOLEAN     fReserveArray[ 15 ];
585         }
586         DNS_RPC_SERVER_INFO_LONGHORN;
587 #define DNS_RPC_SERVER_INFO DNS_RPC_SERVER_INFO_LONGHORN
588
589
590         /* */
591         /*   DNS Application directory partition data types */
592         /* */
593
594         typedef [bitmap32bit] bitmap {
595                 DNS_DP_AUTOCREATED              = 0x00000001,
596                 DNS_DP_LEGACY                   = 0x00000002,
597                 DNS_DP_DOMAIN_DEFAULT   = 0x00000004,
598                 DNS_DP_FOREST_DEFAULT   = 0x00000008,
599                 DNS_DP_ENLISTED                 = 0x00000010,
600                 DNS_DP_DELETED                  = 0x00000020
601         }
602         DNS_RPC_DP_FLAGS;
603
604         typedef struct {
605                 [string, charset(UTF16)] wchar_t *      pszReplicaDn;
606         }
607         DNS_RPC_DP_REPLICA;
608 #define PDNS_RPC_DP_REPLICA DNS_RPC_DP_REPLICA*
609
610         typedef [v1_enum] enum {
611                 DNS_DP_OKAY                = 0x00,
612                 DNS_DP_STATE_REPL_INCOMING = 0x01,
613                 DNS_DP_STATE_REPL_OUTGOING = 0x02,
614                 DNS_DP_STATE_UNKNOWN       = 0x03
615         } DNS_DP_STATE;
616
617         typedef struct {
618                 DWORD           dwRpcStructureVersion;
619                 DWORD           dwReserved0;
620
621                 [string, charset(UTF8)] char *          pszDpFqdn;
622                 [string, charset(UTF16)] wchar_t *       pszDpDn;
623                 [string, charset(UTF16)] wchar_t *       pszCrDn;
624                 DWORD           dwFlags;
625                 DWORD           dwZoneCount;
626                 DNS_DP_STATE    dwState;
627
628                 DWORD           dwReserved[    3 ];
629                 DNS_EXTENSION   pwszReserved[ 3 ];
630                 [range(0,10000)]               DWORD                    dwReplicaCount;
631                 [size_is(dwReplicaCount)]      PDNS_RPC_DP_REPLICA      ReplicaArray[];
632         }
633         DNS_RPC_DP_INFO;
634
635         typedef struct {
636                 DWORD           dwRpcStructureVersion;
637                 DWORD           dwReserved0;
638
639                 [string, charset(UTF8)] char * pszDpFqdn;
640                 DWORD           dwFlags;
641                 DWORD           dwZoneCount;
642         }
643         DNS_RPC_DP_ENUM;
644 #define PDNS_RPC_DP_ENUM DNS_RPC_DP_ENUM*
645
646         typedef struct {
647                 DWORD                   dwRpcStructureVersion;
648                 DWORD                   dwReserved0;
649                 [range(0,5000)]         DWORD               dwDpCount;
650                 [size_is(dwDpCount)]    PDNS_RPC_DP_ENUM    DpArray[];
651         }
652         DNS_RPC_DP_LIST;
653
654         typedef struct {
655                 DWORD       dwRpcStructureVersion;
656                 DWORD       dwReserved0;
657                 [string, charset(UTF8)] char * pszDpFqdn;       /*      UTF8 */
658                 DWORD       dwOperation;
659         }
660         DNS_RPC_ENLIST_DP;
661
662         typedef struct {
663                 DWORD       dwRpcStructureVersion;
664                 DWORD       dwReserved0;
665                 [string, charset(UTF8)] char * pszDestPartition;
666         }
667         DNS_RPC_ZONE_CHANGE_DP;
668
669
670         /* */
671         /*   DNS Zone data types */
672         /* */
673
674         /* DNS_ZONE_TYPE defined in dnsp as dns_zone_type */
675
676         typedef [v1_enum] enum {
677                 DNS_ZONE_SECSECURE_NO_SECURITY  = 0x00,
678                 DNS_ZONE_SECSECURE_NS_ONLY              = 0x01,
679                 DNS_ZONE_SECSECURE_LIST_ONLY    = 0x02,
680                 DNS_ZONE_SECSECURE_NO_XFER              = 0x03
681         }
682         DNS_ZONE_SECONDARY_SECURITY;
683
684         typedef [v1_enum] enum {
685                 DNS_ZONE_NOTIFY_OFF                             = 0x00,
686                 DNS_ZONE_NOTIFY_ALL_SECONDARIES = 0x01,
687                 DNS_ZONE_NOTIFY_LIST_ONLY               = 0x02
688         }
689         DNS_ZONE_NOTIFY_LEVEL;
690
691         typedef [v1_enum] enum {
692                 DNS_ZONE_REQUEST_PRIMARY                = 0x00000001,
693                 DNS_ZONE_REQUEST_SECONDARY              = 0x00000002,
694                 DNS_ZONE_REQUEST_CACHE                  = 0x00000004,
695                 DNS_ZONE_REQUEST_AUTO                   = 0x00000008,
696                 DNS_ZONE_REQUEST_FORWARD                = 0x00000010,
697                 DNS_ZONE_REQUEST_REVERSE                = 0x00000020,
698                 DNS_ZONE_REQUEST_FORWARDER              = 0x00000040,
699                 DNS_ZONE_REQUEST_STUB                   = 0x00000080,
700                 DNS_ZONE_REQUEST_DS                             = 0x00000100,
701                 DNS_ZONE_REQUEST_NON_DS                 = 0x00000200,
702                 DNS_ZONE_REQUEST_DOMAIN_DP              = 0x00000400,
703                 DNS_ZONE_REQUEST_FOREST_DP              = 0x00000800,
704                 DNS_ZONE_REQUEST_CUSTOM_DP              = 0x00001000,
705                 DNS_ZONE_REQUEST_LEGACY_DP              = 0x00002000
706         }
707         DNS_ZONE_REQUEST_FILTERS;
708
709         typedef [bitmap32bit] bitmap {
710                 DNS_RPC_ZONE_PAUSED                             = 0x0001,
711                 DNS_RPC_ZONE_SHUTDOWN                   = 0x0002,
712                 DNS_RPC_ZONE_REVERSE                    = 0x0004,
713                 DNS_RPC_ZONE_AUTOCREATED                = 0x0008,
714                 DNS_RPC_ZONE_DSINTEGRATED               = 0x0010,
715                 DNS_RPC_ZONE_AGING                              = 0x0020,
716                 DNS_RPC_ZONE_UPDATE_UNSECURE    = 0x0040,
717                 DNS_RPC_ZONE_UPDATE_SECURE              = 0x0080,
718                 DNS_RPC_ZONE_READONLY                   = 0x0100
719         } DNS_RPC_ZONE_FLAGS;
720
721         typedef struct {
722                 [string, charset(UTF16)] uint16 *      pszZoneName;
723                 DNS_RPC_ZONE_FLAGS      Flags;
724                 UCHAR                   ZoneType;
725                 UCHAR                   Version;
726         }
727         DNS_RPC_ZONE_W2K;
728 #define PDNS_RPC_ZONE_W2K DNS_RPC_ZONE_W2K*
729
730         typedef struct {
731                 DWORD                   dwRpcStructureVersion;
732                 DWORD                   dwReserved0;
733                 [string, charset(UTF16)] wchar_t *      pszZoneName;
734                 DNS_RPC_ZONE_FLAGS      Flags;
735                 UCHAR                   ZoneType;
736                 UCHAR                   Version;
737                 DNS_RPC_DP_FLAGS        dwDpFlags;
738                 [string, charset(UTF8)] char *         pszDpFqdn;
739         }
740         DNS_RPC_ZONE_DOTNET;
741 #define DNS_RPC_ZONE DNS_RPC_ZONE_DOTNET
742 #define PDNS_RPC_ZONE_DOTNET DNS_RPC_ZONE_DOTNET*
743
744         /* Zone enumeration */
745         typedef struct {
746                 [range(0,500000)]       DWORD               dwZoneCount;
747                 [size_is(dwZoneCount)] PDNS_RPC_ZONE_W2K    ZoneArray[];
748         }
749         DNS_RPC_ZONE_LIST_W2K;
750
751         typedef struct {
752                 DWORD                   dwRpcStructureVersion;
753                 DWORD                   dwReserved0;
754                 [range(0,500000)]       DWORD                   dwZoneCount;
755                 [size_is(dwZoneCount)] PDNS_RPC_ZONE_DOTNET     ZoneArray[];
756         }
757         DNS_RPC_ZONE_LIST_DOTNET;
758 #define DNS_RPC_ZONE_LIST DNS_RPC_ZONE_LIST_DOTNET
759
760         /* Zone information */
761         typedef struct {
762                 [string, charset(UTF8)] char * pszZoneName;
763                 DWORD       dwZoneType;
764                 BOOL       fReverse;
765                 dns_zone_update       fAllowUpdate;
766                 DWORD       fPaused;
767                 DWORD       fShutdown;
768                 DWORD       fAutoCreated;
769
770                 /* Database info */
771                 DWORD       fUseDatabase;
772                 [string, charset(UTF8)] char * pszDataFile;
773
774                 /* Masters */
775                 PIP4_ARRAY aipMasters;
776
777                 /* Secondaries */
778                 DNS_ZONE_SECONDARY_SECURITY      fSecureSecondaries;
779                 DNS_ZONE_NOTIFY_LEVEL      fNotifyLevel;
780                 PIP4_ARRAY aipSecondaries;
781                 PIP4_ARRAY aipNotify;
782
783                 /* WINS or NetBIOS lookup */
784                 BOOL      fUseWins;
785                 BOOL      fUseNbstat;
786
787                 /* Aging */
788                 BOOL         fAging;
789                 DWORD         dwNoRefreshInterval;
790                 DWORD         dwRefreshInterval;
791                 DWORD         dwAvailForScavengeTime;
792                 PIP4_ARRAY    aipScavengeServers;
793
794                 /* save some space, just in case */
795                 /* avoid versioning issues if possible */
796                 DWORD      pvReserved1;
797                 DWORD      pvReserved2;
798                 DWORD      pvReserved3;
799                 DWORD       pvReserved4;
800         }
801         DNS_RPC_ZONE_INFO_W2K;
802
803         typedef struct {
804                 DWORD       dwRpcStructureVersion;
805                 DWORD       dwReserved0;
806
807                 [string, charset(UTF8)] char * pszZoneName;
808                 DWORD       dwZoneType;
809                 BOOL       fReverse;
810                 dns_zone_update       fAllowUpdate;
811                 DWORD       fPaused;
812                 DWORD       fShutdown;
813                 DWORD       fAutoCreated;
814
815                 /* Database info */
816                 DWORD       fUseDatabase;
817                 [string, charset(UTF8)] char * pszDataFile;
818
819                 /* Masters */
820                 PIP4_ARRAY aipMasters;
821
822                 /* Secondaries */
823                 DNS_ZONE_SECONDARY_SECURITY      fSecureSecondaries;
824                 DNS_ZONE_NOTIFY_LEVEL      fNotifyLevel;
825                 PIP4_ARRAY aipSecondaries;
826                 PIP4_ARRAY aipNotify;
827
828                 /* WINS or NetBIOS lookup */
829                 BOOL      fUseWins;
830                 BOOL      fUseNbstat;
831
832                 /* Aging */
833                 BOOL         fAging;
834                 DWORD         dwNoRefreshInterval;
835                 DWORD         dwRefreshInterval;
836                 DWORD         dwAvailForScavengeTime;
837                 PIP4_ARRAY    aipScavengeServers;
838
839                 /* Forwarder zones */
840                 DWORD      dwForwarderTimeout;
841                 DWORD      fForwarderSlave;
842
843                 /* Stub zones */
844                 PIP4_ARRAY aipLocalMasters;
845
846                 /* Directory partition */
847                 DWORD       dwDpFlags;
848                 [string, charset(UTF8)] char *      pszDpFqdn;
849                 [string, charset(UTF16)] wchar_t *   pwszZoneDn;
850
851                 /* Xfr time information */
852                 DWORD      dwLastSuccessfulSoaCheck;
853                 DWORD      dwLastSuccessfulXfr;
854
855                 /* save some space, just in case */
856                 DWORD      dwReserved1;
857                 DWORD         dwReserved2;
858                 DWORD         dwReserved3;
859                 DWORD         dwReserved4;
860                 DWORD         dwReserved5;
861                 [string, charset(UTF8)]   char *       pReserved1;
862                 [string, charset(UTF8)]   char *       pReserved2;
863                 [string, charset(UTF8)]   char *       pReserved3;
864                 [string, charset(UTF8)]   char *       pReserved4;
865         }
866         DNS_RPC_ZONE_INFO_DOTNET;
867
868         typedef struct {
869                 DWORD               dwRpcStructureVersion;
870                 DWORD               dwReserved0;
871
872                 [string, charset(UTF8)] char *                  pszZoneName;
873                 DWORD                  dwZoneType;
874                 BOOL                  fReverse;
875                 dns_zone_update        fAllowUpdate;
876                 DWORD                  fPaused;
877                 DWORD                  fShutdown;
878                 DWORD                  fAutoCreated;
879
880                 /* Database info */
881                 DWORD                  fUseDatabase;
882                 [string, charset(UTF8)] char *                  pszDataFile;
883
884                 /* Masters */
885                 PDNS_ADDR_ARRAY        aipMasters;
886
887                 /* Secondaries */
888                 DNS_ZONE_SECONDARY_SECURITY                  fSecureSecondaries;
889                 DNS_ZONE_NOTIFY_LEVEL                  fNotifyLevel;
890                 PDNS_ADDR_ARRAY        aipSecondaries;
891                 PDNS_ADDR_ARRAY        aipNotify;
892
893                 /* WINS or NetBIOS lookup */
894                 BOOL              fUseWins;
895                 BOOL              fUseNbstat;
896
897                 /* Aging */
898                 BOOL                  fAging;
899                 DWORD                  dwNoRefreshInterval;
900                 DWORD                  dwRefreshInterval;
901                 DWORD                  dwAvailForScavengeTime;
902                 PDNS_ADDR_ARRAY        aipScavengeServers;
903
904                 /* Forwarder zones */
905                 DWORD              dwForwarderTimeout;
906                 DWORD              fForwarderSlave;
907
908                 /* Stub zones */
909                 PDNS_ADDR_ARRAY        aipLocalMasters;
910
911                 /* Directory partition */
912                 DWORD              dwDpFlags;
913                 [string, charset(UTF8)] char *              pszDpFqdn;
914                 [string, charset(UTF16)] wchar_t *             pwszZoneDn;
915                 /* Xfr time information */
916                 DWORD              dwLastSuccessfulSoaCheck;
917                 DWORD              dwLastSuccessfulXfr;
918
919                 DWORD                 fQueuedForBackgroundLoad;
920                 DWORD                 fBackgroundLoadInProgress;
921                 BOOL                  fReadOnlyZone;
922
923                 /* Additional zone transfer information */
924                 DWORD              dwLastXfrAttempt;
925                 DWORD              dwLastXfrResult;
926         }
927         DNS_RPC_ZONE_INFO_LONGHORN;
928 #define DNS_RPC_ZONE_INFO DNS_RPC_ZONE_INFO_LONGHORN
929
930         /* Zone property data */
931         typedef struct {
932                 DNS_ZONE_SECONDARY_SECURITY       fSecureSecondaries;
933                 DNS_ZONE_NOTIFY_LEVEL       fNotifyLevel;
934                 PIP4_ARRAY aipSecondaries;
935                 PIP4_ARRAY aipNotify;
936         }
937         DNS_RPC_ZONE_SECONDARIES_W2K;
938
939         typedef struct {
940                 DWORD       dwRpcStructureVersion;
941                 DWORD       dwReserved0;
942
943                 DNS_ZONE_SECONDARY_SECURITY         fSecureSecondaries;
944                 DNS_ZONE_NOTIFY_LEVEL         fNotifyLevel;
945                 PIP4_ARRAY    aipSecondaries;
946                 PIP4_ARRAY    aipNotify;
947         }
948         DNS_RPC_ZONE_SECONDARIES_DOTNET;
949
950         typedef struct {
951                 DWORD               dwRpcStructureVersion;
952                 DWORD               dwReserved0;
953
954                 DNS_ZONE_SECONDARY_SECURITY                 fSecureSecondaries;
955                 DNS_ZONE_NOTIFY_LEVEL                 fNotifyLevel;
956                 PDNS_ADDR_ARRAY       aipSecondaries;
957                 PDNS_ADDR_ARRAY       aipNotify;
958         }
959         DNS_RPC_ZONE_SECONDARIES_LONGHORN;
960 #define DNS_RPC_ZONE_SECONDARIES DNS_RPC_ZONE_SECONDARIES_LONGHORN
961
962         /* Zone database */
963         typedef struct {
964                 DWORD       fDsIntegrated;
965                 [string, charset(UTF8)] char * pszFileName;
966         }
967         DNS_RPC_ZONE_DATABASE_W2K;
968
969         typedef struct {
970                 DWORD       dwRpcStructureVersion;
971                 DWORD       dwReserved0;
972
973                 DWORD       fDsIntegrated;
974                 [string, charset(UTF8)] char * pszFileName;
975         }
976         DNS_RPC_ZONE_DATABASE_DOTNET;
977 #define DNS_RPC_ZONE_DATABASE DNS_RPC_ZONE_DATABASE_DOTNET
978
979         /* Zone create data */
980         typedef struct {
981                 [string, charset(UTF8)] char *       pszZoneName;
982                 DWORD       dwZoneType;
983                 dns_zone_update       fAllowUpdate;
984                 BOOL       fAging;
985                 DWORD       dwFlags;
986
987                 /*   Database info */
988
989                 [string, charset(UTF8)] char *       pszDataFile;
990                 DWORD       fDsIntegrated;
991                 DWORD       fLoadExisting;
992
993                 /*   Admin name (if auto-create SOA) */
994
995                 [string, charset(UTF8)] char *           pszAdmin;
996
997                 /*   Masters (if secondary) */
998
999                 PIP4_ARRAY   aipMasters;
1000
1001                 /*   Secondaries */
1002
1003                 PIP4_ARRAY   aipSecondaries;
1004                 DNS_ZONE_SECONDARY_SECURITY        fSecureSecondaries;
1005                 DNS_ZONE_NOTIFY_LEVEL        fNotifyLevel;
1006
1007                 /*   Reserve some space to avoid versioning issues */
1008
1009                 [string, charset(UTF8)]   char   *       pvReserved1;
1010                 [string, charset(UTF8)]   char   *       pvReserved2;
1011                 [string, charset(UTF8)]   char   *       pvReserved3;
1012                 [string, charset(UTF8)]   char   *       pvReserved4;
1013                 [string, charset(UTF8)]   char   *       pvReserved5;
1014                 [string, charset(UTF8)]   char   *       pvReserved6;
1015                 [string, charset(UTF8)]   char   *       pvReserved7;
1016                 [string, charset(UTF8)]   char   *       pvReserved8;
1017                 DWORD         dwReserved1;
1018                 DWORD         dwReserved2;
1019                 DWORD         dwReserved3;
1020                 DWORD         dwReserved4;
1021                 DWORD         dwReserved5;
1022                 DWORD         dwReserved6;
1023                 DWORD         dwReserved7;
1024                 DWORD         dwReserved8;
1025         }
1026         DNS_RPC_ZONE_CREATE_INFO_W2K;
1027
1028         typedef struct {
1029                 DWORD       dwRpcStructureVersion;
1030                 DWORD       dwReserved0;
1031
1032                 [string, charset(UTF8)] char *       pszZoneName;
1033                 DWORD       dwZoneType;
1034                 dns_zone_update       fAllowUpdate;
1035                 BOOL       fAging;
1036                 DWORD       dwFlags;
1037
1038                 /*   Database info */
1039
1040                 [string, charset(UTF8)] char *       pszDataFile;
1041                 DWORD       fDsIntegrated;
1042                 DWORD       fLoadExisting;
1043
1044                 /*   Admin name (if auto-create SOA) */
1045
1046                 [string, charset(UTF8)] char *            pszAdmin;
1047
1048                 /*   Masters (if secondary) */
1049
1050                 PIP4_ARRAY    aipMasters;
1051
1052                 /*   Secondaries */
1053
1054                 PIP4_ARRAY    aipSecondaries;
1055                 DNS_ZONE_SECONDARY_SECURITY         fSecureSecondaries;
1056                 DNS_ZONE_NOTIFY_LEVEL         fNotifyLevel;
1057
1058                 /*   Forwarder zones */
1059
1060                 DWORD         dwTimeout;
1061                 DWORD         fRecurseAfterForwarding;
1062
1063                 /*   Directory partition */
1064
1065                 DWORD       dwDpFlags;      /* specify built-in DP or */
1066                 [string, charset(UTF8)] char *       pszDpFqdn;     /*      UTF8 FQDN of partition */
1067
1068                 DWORD       dwReserved[ 32 ];
1069         }
1070         DNS_RPC_ZONE_CREATE_INFO_DOTNET;
1071
1072         typedef struct {
1073                 DWORD                  dwRpcStructureVersion;
1074                 DWORD                  dwReserved0;
1075
1076                 [string, charset(UTF8)] char *                  pszZoneName;
1077                 DWORD                  dwZoneType;
1078                 dns_zone_update                  fAllowUpdate;
1079                 BOOL                  fAging;
1080                 DWORD                  dwFlags;
1081
1082                 /*   Database info */
1083
1084                 [string, charset(UTF8)] char *                  pszDataFile;
1085                 DWORD                  fDsIntegrated;
1086                 DWORD                  fLoadExisting;
1087
1088                 /*   Admin name (if auto-create SOA) */
1089
1090                 [string, charset(UTF8)] char *                    pszAdmin;
1091
1092                 /*   Masters (if secondary) */
1093
1094                 PDNS_ADDR_ARRAY        aipMasters;
1095
1096                 /*   Secondaries */
1097
1098                 PDNS_ADDR_ARRAY        aipSecondaries;
1099                 DNS_ZONE_SECONDARY_SECURITY                  fSecureSecondaries;
1100                 DNS_ZONE_NOTIFY_LEVEL                  fNotifyLevel;
1101
1102                 /*   Forwarder zones */
1103
1104                 DWORD                  dwTimeout;
1105                 DWORD                  fRecurseAfterForwarding;
1106
1107                 /*   Directory partition */
1108
1109                 DWORD                  dwDpFlags;      /* specify built-in DP or */
1110                 [string, charset(UTF8)] char *                  pszDpFqdn;     /*      UTF8 FQDN of partition */
1111
1112                 DWORD               dwReserved[ 32 ];
1113         }
1114         DNS_RPC_ZONE_CREATE_INFO_LONGHORN;
1115 #define DNS_RPC_ZONE_CREATE_INFO DNS_RPC_ZONE_CREATE_INFO_LONGHORN
1116
1117         /* Zone export */
1118         typedef struct {
1119                 DWORD       dwRpcStructureVersion;
1120                 DWORD       dwReserved0;
1121
1122                 [string, charset(UTF8)] char * pszZoneExportFile;
1123         }
1124         DNS_RPC_ZONE_EXPORT_INFO;
1125
1126         typedef struct {
1127                 DWORD       dwRpcStructureVersion;
1128                 DWORD       dwReserved0;
1129
1130                 DWORD       dwFilter;
1131                 [string, charset(UTF8)] char *       pszPartitionFqdn;
1132                 [string, charset(UTF8)] char *       pszQueryString;
1133
1134                 DNS_EXTENSION     pszReserved[ 6 ];
1135         }
1136         DNS_RPC_ENUM_ZONES_FILTER;
1137
1138         /* Forwarders information */
1139         typedef struct {
1140                 DWORD       fRecurseAfterForwarding;
1141                 DWORD       dwForwardTimeout;
1142                 PIP4_ARRAY aipForwarders;
1143         }
1144         DNS_RPC_FORWARDERS_W2K;
1145
1146         typedef struct {
1147                 DWORD       dwRpcStructureVersion;
1148                 DWORD       dwReserved0;
1149                 DWORD       fRecurseAfterForwarding;
1150                 DWORD       dwForwardTimeout;
1151                 PIP4_ARRAY aipForwarders;
1152         }
1153         DNS_RPC_FORWARDERS_DOTNET;
1154
1155         typedef struct {
1156                 DWORD               dwRpcStructureVersion;
1157                 DWORD               dwReserved0;
1158                 DWORD               fRecurseAfterForwarding;
1159                 DWORD               dwForwardTimeout;
1160                 PDNS_ADDR_ARRAY     aipForwarders;
1161         }
1162         DNS_RPC_FORWARDERS_LONGHORN;
1163 #define DNS_RPC_FORWARDERS DNS_RPC_FORWARDERS_LONGHORN
1164
1165
1166         /* */
1167         /*   DNS autoconfig data types */
1168         /* */
1169
1170         typedef [v1_enum] enum {
1171                 DNS_RPC_AUTOCONFIG_INTERNAL_ROOTHINTS                   = 0x00000001,
1172                 DNS_RPC_AUTOCONFIG_INTERNAL_FORWARDERS                  = 0x00000002,
1173                 DNS_RPC_AUTOCONFIG_INTERNAL_ZONES                               = 0x00000004,
1174                 DNS_RPC_AUTOCONFIG_INTERNAL_SELFPOINT                   = 0x00000010,
1175                 DNS_RPC_AUTOCONFIG_INTERNAL_SELFPOINT_PREPEND   = 0x00000020,
1176                 DNS_RPC_AUTOCONFIG_INTERNAL_SELFPOINT_APPEND    = 0x00000040,
1177                 DNS_RPC_AUTOCONFIG_INTERNAL_RETURN_ERROR                = 0x00008000,
1178                 DNS_RPC_AUTOCONFIG_ALL                                                  = 0xFFFFFFFF
1179         }
1180         DNS_RPC_AUTOCONFIG;
1181
1182         typedef struct {
1183                 DWORD                  dwRpcStructureVersion;
1184                 DWORD                  dwReserved0;
1185                 DNS_RPC_AUTOCONFIG     dwAutoConfigFlags;
1186                 DWORD                  dwReserved1;
1187                 [string, charset(UTF8)] char * pszNewDomainName;
1188         }
1189         DNS_RPC_AUTOCONFIGURE;
1190
1191
1192         /* */
1193         /*   DNS logging data types */
1194         /* */
1195
1196         typedef [bitmap32bit] bitmap {
1197                 DNS_EVENT_LOG_SUCCESS                   = 0x00000000,
1198                 DNS_EVENT_LOG_ERROR_TYPE                = 0x00000001,
1199                 DNS_EVENT_LOG_WARNING_TYPE              = 0x00000002,
1200                 DNS_EVENT_LOG_INFORMATION_TYPE  = 0x00000004
1201         }
1202         DNS_EVENT_LOG_TYPES;
1203
1204         typedef [bitmap32bit] bitmap {
1205                 DNS_RPC_VIEW_AUTHORITY_DATA             = 0x00000001,
1206                 DNS_RPC_VIEW_CACHE_DATA                 = 0x00000002,
1207                 DNS_RPC_VIEW_GLUE_DATA                  = 0x00000004,
1208                 DNS_RPC_VIEW_ROOT_HINT_DATA             = 0x00000008,
1209                 DNS_RPC_VIEW_ADDITIONAL_DATA    = 0x00000010,
1210                 DNS_RPC_VIEW_NO_CHILDREN                = 0x00010000,
1211                 DNS_RPC_VIEW_ONLY_CHILDREN              = 0x00020000
1212         }
1213         DNS_SELECT_FLAGS;
1214
1215
1216         /* */
1217         /*   DNS statistics data types */
1218         /* */
1219
1220         typedef struct {
1221                 DWORD       StatId;
1222                 WORD        wLength;
1223                 BOOLEAN     fClear;
1224                 UCHAR       fReserved;
1225         }
1226         DNSSRV_STAT_HEADER;
1227
1228         typedef struct {
1229                 DNSSRV_STAT_HEADER Header;
1230                 BYTE                Buffer[1];
1231         }
1232         DNSSRV_STAT;
1233
1234
1235         /* */
1236         /*   DNS Typid and Union of all RPC data types */
1237         /* */
1238
1239         typedef [v1_enum] enum {
1240                 DNSSRV_TYPEID_NULL                      = 0,
1241                 DNSSRV_TYPEID_DWORD                     = 1,
1242                 DNSSRV_TYPEID_LPSTR                     = 2,
1243                 DNSSRV_TYPEID_LPWSTR                    = 3,
1244                 DNSSRV_TYPEID_IPARRAY                   = 4,
1245                 DNSSRV_TYPEID_BUFFER                    = 5,
1246                 DNSSRV_TYPEID_SERVER_INFO_W2K           = 6,
1247                 DNSSRV_TYPEID_STATS                     = 7,
1248                 DNSSRV_TYPEID_FORWARDERS_W2K            = 8,
1249                 DNSSRV_TYPEID_ZONE_W2K                  = 9,
1250                 DNSSRV_TYPEID_ZONE_INFO_W2K             = 10,
1251                 DNSSRV_TYPEID_ZONE_SECONDARIES_W2K      = 11,
1252                 DNSSRV_TYPEID_ZONE_DATABASE_W2K         = 12,
1253                 DNSSRV_TYPEID_ZONE_TYPE_RESET_W2K       = 13,
1254                 DNSSRV_TYPEID_ZONE_CREATE_W2K           = 14,
1255                 DNSSRV_TYPEID_NAME_AND_PARAM            = 15,
1256                 DNSSRV_TYPEID_ZONE_LIST_W2K             = 16,
1257                 DNSSRV_TYPEID_ZONE_RENAME               = 17,
1258                 DNSSRV_TYPEID_ZONE_EXPORT               = 18,
1259                 DNSSRV_TYPEID_SERVER_INFO_DOTNET        = 19,
1260                 DNSSRV_TYPEID_FORWARDERS_DOTNET         = 20,
1261                 DNSSRV_TYPEID_ZONE                      = 21,
1262                 DNSSRV_TYPEID_ZONE_INFO_DOTNET          = 22,
1263                 DNSSRV_TYPEID_ZONE_SECONDARIES_DOTNET   = 23,
1264                 DNSSRV_TYPEID_ZONE_DATABASE             = 24,
1265                 DNSSRV_TYPEID_ZONE_TYPE_RESET_DOTNET    = 25,
1266                 DNSSRV_TYPEID_ZONE_CREATE_DOTNET        = 26,
1267                 DNSSRV_TYPEID_ZONE_LIST                 = 27,
1268                 DNSSRV_TYPEID_DP_ENUM                   = 28,
1269                 DNSSRV_TYPEID_DP_INFO                   = 29,
1270                 DNSSRV_TYPEID_DP_LIST                   = 30,
1271                 DNSSRV_TYPEID_ENLIST_DP                 = 31,
1272                 DNSSRV_TYPEID_ZONE_CHANGE_DP            = 32,
1273                 DNSSRV_TYPEID_ENUM_ZONES_FILTER         = 33,
1274                 DNSSRV_TYPEID_ADDRARRAY                 = 34,
1275                 DNSSRV_TYPEID_SERVER_INFO               = 35,
1276                 DNSSRV_TYPEID_ZONE_INFO                 = 36,
1277                 DNSSRV_TYPEID_FORWARDERS                = 37,
1278                 DNSSRV_TYPEID_ZONE_SECONDARIES          = 38,
1279                 DNSSRV_TYPEID_ZONE_TYPE_RESET           = 39,
1280                 DNSSRV_TYPEID_ZONE_CREATE               = 40,
1281                 DNSSRV_TYPEID_IP_VALIDATE               = 41,
1282                 DNSSRV_TYPEID_AUTOCONFIGURE             = 42,
1283                 DNSSRV_TYPEID_UTF8_STRING_LIST          = 43,
1284                 DNSSRV_TYPEID_UNICODE_STRING_LIST       = 44
1285         }
1286         DNS_RPC_TYPEID;
1287
1288         typedef [switch_type(uint3264)] union {
1289                 [case(DNSSRV_TYPEID_NULL)]      PBYTE       Null;
1290
1291                 [case(DNSSRV_TYPEID_DWORD)]         DWORD        Dword;
1292
1293                 [case(DNSSRV_TYPEID_LPSTR)]         [string, charset(UTF8)] char *        String;
1294
1295                 [case(DNSSRV_TYPEID_LPWSTR)]        [string, charset(UTF16)] wchar_t *     WideString;
1296
1297                 [case(DNSSRV_TYPEID_IPARRAY)]       IP4_ARRAY   *IpArray;
1298
1299                 [case(DNSSRV_TYPEID_BUFFER)]
1300                 DNS_RPC_BUFFER                              *Buffer;
1301
1302                 [case(DNSSRV_TYPEID_SERVER_INFO_W2K)]
1303                 DNS_RPC_SERVER_INFO_W2K                     *ServerInfoW2K;
1304
1305                 [case(DNSSRV_TYPEID_STATS)]
1306                 DNSSRV_STAT                                 *Stats;
1307
1308                 [case(DNSSRV_TYPEID_FORWARDERS_W2K)]
1309                 DNS_RPC_FORWARDERS_W2K                      *ForwardersW2K;
1310
1311                 [case(DNSSRV_TYPEID_ZONE_W2K)]
1312                 DNS_RPC_ZONE_W2K                            *ZoneW2K;
1313
1314                 [case(DNSSRV_TYPEID_ZONE_INFO_W2K)]
1315                 DNS_RPC_ZONE_INFO_W2K                       *ZoneInfoW2K;
1316
1317                 [case(DNSSRV_TYPEID_ZONE_SECONDARIES_W2K)]
1318                 DNS_RPC_ZONE_SECONDARIES_W2K                *SecondariesW2K;
1319
1320                 [case(DNSSRV_TYPEID_ZONE_DATABASE_W2K)]
1321                 DNS_RPC_ZONE_DATABASE_W2K                   *DatabaseW2K;
1322
1323                 [case(DNSSRV_TYPEID_ZONE_CREATE_W2K)]
1324                 DNS_RPC_ZONE_CREATE_INFO_W2K                *ZoneCreateW2K;
1325
1326                 [case(DNSSRV_TYPEID_NAME_AND_PARAM)]
1327                 DNS_RPC_NAME_AND_PARAM                      *NameAndParam;
1328
1329                 [case(DNSSRV_TYPEID_ZONE_LIST_W2K)]
1330                 DNS_RPC_ZONE_LIST_W2K                       *ZoneListW2K;
1331
1332                 [case(DNSSRV_TYPEID_SERVER_INFO_DOTNET)]
1333                 DNS_RPC_SERVER_INFO_DOTNET                  *ServerInfoDotNet;
1334
1335                 [case(DNSSRV_TYPEID_FORWARDERS_DOTNET)]
1336                 DNS_RPC_FORWARDERS_DOTNET                   *ForwardersDotNet;
1337
1338                 [case(DNSSRV_TYPEID_ZONE)]
1339                 DNS_RPC_ZONE                                *Zone;
1340
1341                 [case(DNSSRV_TYPEID_ZONE_INFO_DOTNET)]
1342                 DNS_RPC_ZONE_INFO_DOTNET                    *ZoneInfoDotNet;
1343
1344                 [case(DNSSRV_TYPEID_ZONE_SECONDARIES_DOTNET)]
1345                 DNS_RPC_ZONE_SECONDARIES_DOTNET        *SecondariesDotNet;
1346
1347                 [case(DNSSRV_TYPEID_ZONE_DATABASE)]
1348                 DNS_RPC_ZONE_DATABASE                       *Database;
1349
1350                 [case(DNSSRV_TYPEID_ZONE_CREATE_DOTNET)]
1351                 DNS_RPC_ZONE_CREATE_INFO_DOTNET             *ZoneCreateDotNet;
1352
1353                 [case(DNSSRV_TYPEID_ZONE_LIST)]
1354                 DNS_RPC_ZONE_LIST                           *ZoneList;
1355
1356                 [case(DNSSRV_TYPEID_ZONE_EXPORT)]
1357                 DNS_RPC_ZONE_EXPORT_INFO                    *ZoneExport;
1358
1359                 [case(DNSSRV_TYPEID_DP_INFO)]
1360                 DNS_RPC_DP_INFO                             *DirectoryPartition;
1361
1362                 [case(DNSSRV_TYPEID_DP_ENUM)]
1363                 DNS_RPC_DP_ENUM                             *DirectoryPartitionEnum;
1364
1365                 [case(DNSSRV_TYPEID_DP_LIST)]
1366                 DNS_RPC_DP_LIST                             *DirectoryPartitionList;
1367
1368                 [case(DNSSRV_TYPEID_ENLIST_DP)]
1369                 DNS_RPC_ENLIST_DP                           *EnlistDirectoryPartition;
1370
1371                 [case(DNSSRV_TYPEID_ZONE_CHANGE_DP)]
1372                 DNS_RPC_ZONE_CHANGE_DP                 *ZoneChangeDirectoryPartition;
1373
1374                 [case(DNSSRV_TYPEID_ENUM_ZONES_FILTER)]
1375                 DNS_RPC_ENUM_ZONES_FILTER                   *EnumZonesFilter;
1376
1377                 [case(DNSSRV_TYPEID_ADDRARRAY)]
1378                 DNS_ADDR_ARRAY                              *AddrArray;
1379
1380                 [case(DNSSRV_TYPEID_SERVER_INFO)]
1381                 DNS_RPC_SERVER_INFO                         *ServerInfo;
1382
1383                 [case(DNSSRV_TYPEID_ZONE_CREATE)]
1384                 DNS_RPC_ZONE_CREATE_INFO                    *ZoneCreate;
1385
1386                 [case(DNSSRV_TYPEID_FORWARDERS)]
1387                 DNS_RPC_FORWARDERS                          *Forwarders;
1388
1389                 [case(DNSSRV_TYPEID_ZONE_SECONDARIES)]
1390                 DNS_RPC_ZONE_SECONDARIES                    *Secondaries;
1391
1392                 [case(DNSSRV_TYPEID_IP_VALIDATE)]
1393                 DNS_RPC_IP_VALIDATE                         *IpValidate;
1394
1395                 [case(DNSSRV_TYPEID_ZONE_INFO)]
1396                 DNS_RPC_ZONE_INFO                           *ZoneInfo;
1397
1398                 [case(DNSSRV_TYPEID_AUTOCONFIGURE)]
1399                 DNS_RPC_AUTOCONFIGURE                       *AutoConfigure;
1400
1401                 [case(DNSSRV_TYPEID_UTF8_STRING_LIST)]
1402                 DNS_RPC_UTF8_STRING_LIST                    *Utf8StringList;
1403         } DNSSRV_RPC_UNION;
1404
1405
1406         /* */
1407         /*   DNS RPC interface */
1408         /* */
1409
1410         typedef [public,gensize] struct {
1411                 [value((12+ndr_size_DNS_RPC_NAME(&dnsNodeName,0)+3) & ~3)]  uint16 wLength;
1412                 uint16 wRecordCount;
1413                 uint32 dwFlags;
1414                 uint32 dwChildCount;
1415                 DNS_RPC_NAME dnsNodeName;
1416                 DNS_RPC_RECORD records[wRecordCount];
1417         } DNS_RPC_RECORDS;
1418
1419         typedef [public,nopull,nopush,gensize] struct {
1420                 uint32 count;
1421                 DNS_RPC_RECORDS rec[count];
1422         } DNS_RPC_RECORDS_ARRAY;
1423
1424         WERROR DnssrvOperation(
1425                 [in,unique,string,charset(UTF16)] uint16        *pwszServerName,
1426                 [in,unique,string,charset(UTF8)] uint8          *pszZone,
1427                 [in]                      DWORD                  dwContext,
1428                 [in,unique,string,charset(UTF8)] uint8          *pszOperation,
1429                 [in]                      DNS_RPC_TYPEID         dwTypeId,
1430                 [in, switch_is(dwTypeId)] DNSSRV_RPC_UNION       pData
1431         );
1432
1433         WERROR DnssrvQuery(
1434                 [in,unique,string,charset(UTF16)] uint16       *pwszServerName,
1435                 [in,unique,string,charset(UTF8)] uint8         *pszZone,
1436                 [in,unique,string,charset(UTF8)] uint8         *pszOperation,
1437                 [out]                         DNS_RPC_TYPEID   *pdwTypeId,
1438                 [out, switch_is(*pdwTypeId)]  DNSSRV_RPC_UNION *ppData
1439         );
1440
1441         WERROR DnssrvComplexOperation(
1442                 [in,unique,string,charset(UTF16)] uint16       *pwszServerName,
1443                 [in,unique,string,charset(UTF8)] uint8         *pszZone,
1444                 [in,unique,string,charset(UTF8)] uint8         *pszOperation,
1445                 [in]                          DNS_RPC_TYPEID    dwTypeIn,
1446                 [in, switch_is(dwTypeIn)]     DNSSRV_RPC_UNION  pDataIn,
1447                 [out]                         DNS_RPC_TYPEID   *pdwTypeOut,
1448                 [out, switch_is(*pdwTypeOut)] DNSSRV_RPC_UNION *ppDataOut
1449         );
1450
1451         WERROR DnssrvEnumRecords(
1452                 [in,unique,string,charset(UTF16)] uint16       *pwszServerName,
1453                 [in,unique,string,charset(UTF8)] uint8         *pszZone,
1454                 [in,unique,string,charset(UTF8)]  uint8        *pszNodeName,
1455                 [in,unique,string,charset(UTF8)]  uint8        *pszStartChild,
1456                 [in]                           dns_record_type          wRecordType,
1457                 [in]                           DNS_SELECT_FLAGS        fSelectFlag,
1458                 [in,unique,string,charset(UTF8)]  uint8        *pszFilterStart,
1459                 [in,unique,string,charset(UTF8)]  uint8        *pszFilterStop,
1460                 [out]                          DWORD           *pdwBufferLength,
1461                 [out,ref,subcontext(4),subcontext_size(*pdwBufferLength)] DNS_RPC_RECORDS_ARRAY **pBuffer
1462         );
1463
1464         WERROR DnssrvUpdateRecord(
1465                 [in,unique,string,charset(UTF16)] uint16     *pwszServerName,
1466                 [in,unique,string,charset(UTF8)]  uint8      *pszZone,
1467                 [in,unique,string,charset(UTF8)]  uint8      *pszNodeName,
1468                 [in, unique]    DNS_RPC_RECORD_BUF           *pAddRecord,
1469                 [in, unique]    DNS_RPC_RECORD_BUF           *pDeleteRecord
1470         );
1471
1472         WERROR DnssrvOperation2(
1473                 [in]            DNS_RPC_CLIENT_VERSION     dwClientVersion,
1474                 [in]            uint32                     dwSettingFlags,
1475                 [in,unique,string,charset(UTF16)] uint16  *pwszServerName,
1476                 [in,unique,string,charset(UTF8)] uint8    *pszZone,
1477                 [in]            DWORD                      dwContext,
1478                 [in,unique,string,charset(UTF8)] uint8    *pszOperation,
1479                 [in]            DNS_RPC_TYPEID             dwTypeId,
1480                 [in, switch_is(dwTypeId)] DNSSRV_RPC_UNION pData
1481         );
1482
1483         WERROR DnssrvQuery2(
1484                 [in]            DNS_RPC_CLIENT_VERSION   dwClientVersion,
1485                 [in]            uint32                   dwSettingFlags,
1486                 [in,unique,string,charset(UTF16)] uint16        *pwszServerName,
1487                 [in,unique,string,charset(UTF8)] uint8         *pszZone,
1488                 [in,unique,string,charset(UTF8)] uint8         *pszOperation,
1489                 [out]                         DNS_RPC_TYPEID          *pdwTypeId,
1490                 [out, switch_is(*pdwTypeId)]  DNSSRV_RPC_UNION        *ppData
1491         );
1492
1493         WERROR DnssrvComplexOperation2(
1494                 [in]            DNS_RPC_CLIENT_VERSION          dwClientVersion,
1495                 [in]            uint32                          dwSettingFlags,
1496                 [in,unique,string,charset(UTF16)] uint16       *pwszServerName,
1497                 [in,unique,string,charset(UTF8)] uint8         *pszZone,
1498                 [in,unique,string,charset(UTF8)] uint8         *pszOperation,
1499                 [in]                          DNS_RPC_TYPEID    dwTypeIn,
1500                 [in, switch_is(dwTypeIn)]     DNSSRV_RPC_UNION  pDataIn,
1501                 [out]                         DNS_RPC_TYPEID   *pdwTypeOut,
1502                 [out, switch_is(*pdwTypeOut)] DNSSRV_RPC_UNION *ppDataOut
1503         );
1504
1505         WERROR DnssrvEnumRecords2(
1506                 [in]                           DNS_RPC_CLIENT_VERSION   dwClientVersion,
1507                 [in]                           DWORD                    dwSettingFlags,
1508                 [in,unique,string,charset(UTF16)] uint16               *pwszServerName,
1509                 [in,unique,string,charset(UTF8)]  uint8                *pszZone,
1510                 [in,unique,string,charset(UTF8)]  uint8                *pszNodeName,
1511                 [in,unique,string,charset(UTF8)]  uint8                *pszStartChild,
1512                 [in]                           dns_record_type          wRecordType,
1513                 [in]                           DNS_SELECT_FLAGS         fSelectFlag,
1514                 [in,unique,string,charset(UTF8)]  uint8                *pszFilterStart,
1515                 [in,unique,string,charset(UTF8)]  uint8                *pszFilterStop,
1516                 [out]                             uint32               *pdwBufferLength,
1517                 [out,ref,subcontext(4),subcontext_size(*pdwBufferLength)] DNS_RPC_RECORDS_ARRAY **pBuffer
1518         );
1519
1520         WERROR DnssrvUpdateRecord2(
1521                 [in]            DNS_RPC_CLIENT_VERSION    dwClientVersion,
1522                 [in]            uint32                    dwSettingFlags,
1523                 [in,unique,string,charset(UTF16)] uint16 *pwszServerName,
1524                 [in,unique,string,charset(UTF8)]  uint8  *pszZone,
1525                 [in,string,charset(UTF8)]         uint8  *pszNodeName,
1526                 [in, unique]    DNS_RPC_RECORD_BUF       *pAddRecord,
1527                 [in, unique]    DNS_RPC_RECORD_BUF       *pDeleteRecord
1528         );
1529 }