It turns out that the Netlogon PAC verification is encrypted.
[kai/samba.git] / source4 / librpc / idl / nbt.idl
index e6af2cd035b8d38532e6311ceb40f6b43f61b5e0..63be489e0d9c5c7d7d3b1de7a689d72beedb9ff5 100644 (file)
@@ -10,7 +10,7 @@
 
 import "misc.idl", "security.idl", "svcctl.idl", "samr.idl";
 [
-helper("libcli/nbt/libnbt.h")
+       helper("libcli/netlogon.h", "libcli/nbt/libnbt.h")
 ]
 interface nbt
 {
@@ -73,11 +73,11 @@ interface nbt
                nbt_name_type type;
        } nbt_name;
 
-       typedef [enum16bit] enum {
+       typedef [public,enum16bit] enum {
                NBT_QCLASS_IP = 0x01
        } nbt_qclass;
 
-       typedef [enum16bit] enum {
+       typedef [public,enum16bit] enum {
                NBT_QTYPE_ADDRESS     = 0x0001,
                NBT_QTYPE_NAMESERVICE = 0x0002,
                NBT_QTYPE_NULL        = 0x000A,
@@ -160,30 +160,24 @@ interface nbt
                uint8  data[length];
        } nbt_rdata_data;
 
-       typedef [nodiscriminant] union {
+       typedef [nodiscriminant,public] union {
                [case(NBT_QTYPE_NETBIOS)] nbt_rdata_netbios netbios;
                [case(NBT_QTYPE_STATUS)]  nbt_rdata_status status;
                [default]                 nbt_rdata_data   data;
        } nbt_rdata;
 
 /*
- * this macro works arround the problem
+ * this macro works around the problem
  * that we need to use nbt_rdata_data
  * together with NBT_QTYPE_NETBIOS
  * for WACK replies
  */
-#define NBT_RES_REC_LEVEL(rr_type, rdata) (\
-       (((rr_type) == NBT_QTYPE_NETBIOS) && \
-       talloc_check_name(ndr, "struct ndr_push") && \
-       ((rdata).data.length == 2)) \
-       ? 0 : rr_type)
-
-       typedef [flag(LIBNDR_PRINT_ARRAY_HEX)] struct {
+       typedef [flag(LIBNDR_PRINT_ARRAY_HEX),nopush] struct {
                nbt_name   name;
                nbt_qtype  rr_type;
                nbt_qclass rr_class;
                uint32     ttl;
-               [switch_is(NBT_RES_REC_LEVEL(rr_type, rdata))] nbt_rdata rdata;
+               [switch_is(rr_type)] nbt_rdata rdata;
        } nbt_res_rec;
 
        typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
@@ -359,7 +353,13 @@ interface nbt
                NBT_SERVER_TIMESERV      = 0x00000040,
                NBT_SERVER_CLOSEST       = 0x00000080,
                NBT_SERVER_WRITABLE      = 0x00000100, 
-               NBT_SERVER_GOOD_TIMESERV = 0x00000200
+               NBT_SERVER_GOOD_TIMESERV = 0x00000200,
+               NBT_SERVER_NDNC          = 0x00000400,
+               NBT_SERVER_SEL_SEC_DOM_6 = 0x00000800,
+               NBT_SERVER_FUL_SEC_DOM_6 = 0x00001000,
+               NBT_SERVER_DS_DNS_CONTR  = 0x04000000,
+               NBT_SERVER_DS_DNS_DOMAIN = 0x02000000,
+               NBT_SERVER_DS_DNS_FOREST = 0x01000000
        } nbt_server_type;
 
        typedef [bitmap32bit,public] bitmap {
@@ -391,15 +391,23 @@ interface nbt
 
        typedef bitmap samr_AcctFlags samr_AcctFlags;
 
-       typedef struct {
+       /* query to dc hand marshaled, as it has 'optional'
+        * parts */
+       typedef [nopull,nopush] struct {
                uint16               request_count;
                nstring              computer_name;
                nstring              user_name;
                astring              mailslot_name;
                samr_AcctFlags       acct_control;
                [value(ndr_size_dom_sid0(&sid, ndr->flags))] uint32 sid_size;
-               /* Must not be present (ie, zero size, in request to \MAILSLOT\NET\NTLOGON */
-               [subcontext(0),subcontext_size(sid_size)] dom_sid0 sid;
+               /* The manual alignment is required because this
+                * structure is marked flag(NDR_NOALIGN) via the
+                * nbt_netlogon_packet below.  
+                *
+                * However, both MUST only be present if sid_size > 0 
+                */
+                [flag(NDR_ALIGN4)]   DATA_BLOB _pad;
+                [subcontext(0),subcontext_size(sid_size)] dom_sid0 sid;
                netlogon_nt_version_flags               nt_version;
                uint16               lmnt_token;
                uint16               lm20_token;