s4:kdc: Add resource SID compression
[samba.git] / librpc / idl / netlogon.idl
index 7670d345487f54633498636162f670ebb759c88b..c6231c41aee45dd9ddb6c65fcc30dedfb59f0a2c 100644 (file)
@@ -4,25 +4,38 @@
   who contributed!
 */
 
-import "misc.idl", "lsa.idl", "samr.idl", "security.idl", "nbt.idl";
+import "misc.idl", "lsa.idl", "samr.idl", "security.idl";
 
 #include "idl_types.h"
 
 cpp_quote("#define netr_DeltaEnum8Bit netr_DeltaEnum")
 cpp_quote("#define netr_SamDatabaseID8Bit netr_SamDatabaseID")
 
+cpp_quote("#define ENC_CRC32 KERB_ENCTYPE_DES_CBC_CRC")
+cpp_quote("#define ENC_RSA_MD5 KERB_ENCTYPE_DES_CBC_MD5")
+cpp_quote("#define ENC_RC4_HMAC_MD5 KERB_ENCTYPE_RC4_HMAC_MD5")
+cpp_quote("#define ENC_HMAC_SHA1_96_AES128 KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96")
+cpp_quote("#define ENC_HMAC_SHA1_96_AES256 KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96")
+cpp_quote("#define ENC_HMAC_SHA1_96_AES256_SK KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96_SK")
+cpp_quote("#define ENC_FAST_SUPPORTED KERB_ENCTYPE_FAST_SUPPORTED")
+cpp_quote("#define ENC_COMPOUND_IDENTITY_SUPPORTED KERB_ENCTYPE_COMPOUND_IDENTITY_SUPPORTED")
+cpp_quote("#define ENC_CLAIMS_SUPPORTED KERB_ENCTYPE_CLAIMS_SUPPORTED")
+cpp_quote("#define ENC_RESOURCE_SID_COMPRESSION_DISABLED KERB_ENCTYPE_RESOURCE_SID_COMPRESSION_DISABLED")
+cpp_quote("#define NETLOGON_SERVER_PIPE_STATE_MAGIC 0x4f555358")
+
 [
   uuid("12345678-1234-abcd-ef00-01234567cffb"),
   version(1.0),
   endpoint("ncacn_np:[\\pipe\\netlogon]","ncacn_ip_tcp:","ncalrpc:"),
   helper("../librpc/ndr/ndr_netlogon.h"),
+  ms_union,
   pointer_default(unique)
 ]
 
 interface netlogon
 {
        typedef bitmap samr_AcctFlags samr_AcctFlags;
-       typedef bitmap samr_GroupAttrs samr_GroupAttrs;
+       typedef bitmap security_GroupAttrs security_GroupAttrs;
        typedef enum netr_DeltaEnum8Bit netr_DeltaEnum8Bit;
        typedef enum netr_SamDatabaseID8Bit netr_SamDatabaseID8Bit;
 
@@ -126,11 +139,35 @@ interface netlogon
                MSV1_0_SUBAUTHENTICATION_DLL_EX         = 0x00100000
        } netr_LogonParameterControl;
 
+       /* Summary of the of the Query and Response from Microsoft on
+        * the usage of logon_id in netr_IdendityInfo
+        *
+        * [REG:119013019612095] [MS-NRPC]: NETLOGON_LOGON_IDENTITY_INFO: Does
+        * the Reserved field have LogonId meaning?
+        *
+        * Questions:
+        *   In NetrLogonSamLogonEx does the Reserved field
+        *   (of NETLOGON_LOGON_IDENTITY_INFO) have LogonId meaning?
+        *
+        *   What is a valid LogonID, and does have any audit usage?
+        *
+        *   Samba is sending a constant "deadbeef" in hex and would like to
+        *   understand any usage of this field.
+        *
+        * Response:
+        *   The NRPC spec is accurate in defining the field as Reserved, and
+        *   without protocol significance. In the header file in our source
+        *   code, it is defined as LogonId and commented as such, but it’s
+        *   effectively not used. This is probably why the API structure has
+        *   that field name. It may have been intended as such but it’s not
+        *    used.
+        *
+        * Samba now sends a random value in this field.
+        */
        typedef struct {
                lsa_String  domain_name;
                netr_LogonParameterControl parameter_control; /* see MSV1_0_* */
-               uint32      logon_id_low;
-               uint32      logon_id_high;
+               udlong logon_id;
                lsa_String  account_name;
                lsa_String  workstation;
        } netr_IdentityInfo;
@@ -161,7 +198,7 @@ interface netlogon
                [size_is(length)] uint8 *data;
        } netr_GenericInfo;
 
-       typedef enum {
+       typedef [public] enum {
                NetlogonInteractiveInformation = 1,
                NetlogonNetworkInformation = 2,
                NetlogonServiceInformation = 3,
@@ -179,6 +216,7 @@ interface netlogon
                [case(NetlogonInteractiveTransitiveInformation)] netr_PasswordInfo *password;
                [case(NetlogonNetworkTransitiveInformation)]     netr_NetworkInfo  *network;
                [case(NetlogonServiceTransitiveInformation)]     netr_PasswordInfo *password;
+               [default];
        } netr_LogonLevel;
 
        typedef [public,flag(NDR_PAHEX)] struct {
@@ -205,9 +243,9 @@ interface netlogon
        } netr_UserFlags;
 
        typedef struct {
-               NTTIME last_logon;
-               NTTIME last_logoff;
-               NTTIME acct_expiry;
+               NTTIME logon_time;
+               NTTIME logoff_time;
+               NTTIME kickoff_time;
                NTTIME last_password_change;
                NTTIME allow_password_change;
                NTTIME force_password_change;
@@ -223,22 +261,26 @@ interface netlogon
                uint32 primary_gid;
                samr_RidWithAttributeArray groups;
                netr_UserFlags user_flags;
-               netr_UserSessionKey key;
+               [flag(NDR_SECRET)] netr_UserSessionKey key;
                lsa_StringLarge logon_server;
-               lsa_StringLarge domain;
+               lsa_StringLarge logon_domain;
                dom_sid2 *domain_sid;
-               netr_LMSessionKey LMSessKey;
+               [flag(NDR_SECRET)] netr_LMSessionKey LMSessKey;
                samr_AcctFlags acct_flags;
-               uint32 unknown[7];
+               uint32 sub_auth_status;
+               NTTIME last_successful_logon;
+               NTTIME last_failed_logon;
+               uint32 failed_logon_count;
+               uint32 reserved;
        } netr_SamBaseInfo;
 
        typedef struct {
                netr_SamBaseInfo base;
        } netr_SamInfo2;
 
-       typedef struct {
+       typedef [public] struct {
                dom_sid2 *sid;
-               samr_GroupAttrs attributes;
+               security_GroupAttrs attributes;
        } netr_SidAttr;
 
        typedef [public] struct {
@@ -251,8 +293,16 @@ interface netlogon
                netr_SamBaseInfo base;
                uint32 sidcount;
                [size_is(sidcount)] netr_SidAttr *sids;
+               /*
+                * On ndr_push:
+                * Should pointer values be allocated
+                * of sids[*].sid before the following ones?
+                *
+                * That's at least the case for
+                * PAC_LOGON_INFO.
+                */
                lsa_String dns_domainname;
-               lsa_String principle;
+               lsa_String principal_name;
                uint32 unknown4[20];
        } netr_SamInfo6;
 
@@ -291,18 +341,24 @@ interface netlogon
                [case(4)] netr_PacInfo  *pac;
                [case(NetlogonValidationGenericInfo2)] netr_GenericInfo2  *generic;
                [case(NetlogonValidationSamInfo4)] netr_SamInfo6 *sam6;
+               [default];
        } netr_Validation;
 
        typedef [public, flag(NDR_PAHEX)] struct {
                uint8 data[8];
        } netr_Credential;
 
+       typedef [public] struct {
+               netr_Credential client_challenge;
+               netr_Credential server_challenge;
+       } netlogon_server_pipe_state;
+
        typedef [public] struct {
                netr_Credential cred;
                time_t timestamp;
        } netr_Authenticator;
 
-       NTSTATUS netr_LogonSamLogon(
+       [public] NTSTATUS netr_LogonSamLogon(
                [in,unique] [string,charset(UTF16)] uint16 *server_name,
                [in,unique] [string,charset(UTF16)] uint16 *computer_name,
                [in,unique] netr_Authenticator *credential,
@@ -601,10 +657,6 @@ interface netlogon
                uint32 unknown8;
        } netr_DELTA_TRUSTED_DOMAIN;
 
-       typedef struct {
-               uint16 unknown;
-       } netr_DELTA_DELETE_TRUST;
-
        typedef struct {
                uint32 privilege_entries;
                uint32 privilege_control;
@@ -624,14 +676,6 @@ interface netlogon
                uint32 unknown8;
        } netr_DELTA_ACCOUNT;
 
-       typedef struct {
-               uint16 unknown;
-       } netr_DELTA_DELETE_ACCOUNT;
-
-       typedef struct {
-               uint16 unknown;
-       } netr_DELTA_DELETE_SECRET;
-
        typedef struct {
                uint32 len;
                uint32 maxlen;
@@ -694,15 +738,16 @@ interface netlogon
                [case(NETR_DELTA_RENAME_ALIAS)]    netr_DELTA_RENAME          *rename_alias;
                [case(NETR_DELTA_ALIAS_MEMBER)]    netr_DELTA_ALIAS_MEMBER    *alias_member;
                [case(NETR_DELTA_POLICY)]          netr_DELTA_POLICY          *policy;
-               [case(NETR_DELTA_TRUSTED_DOMAIN)]  netr_DELTA_TRUSTED_DOMAIN   *trusted_domain;
-               [case(NETR_DELTA_DELETE_TRUST)]    netr_DELTA_DELETE_TRUST     delete_trust;
+               [case(NETR_DELTA_TRUSTED_DOMAIN)]  netr_DELTA_TRUSTED_DOMAIN  *trusted_domain;
+               [case(NETR_DELTA_DELETE_TRUST)]    ; /* sid only */
                [case(NETR_DELTA_ACCOUNT)]         netr_DELTA_ACCOUNT         *account;
-               [case(NETR_DELTA_DELETE_ACCOUNT)]  netr_DELTA_DELETE_ACCOUNT   delete_account;
+               [case(NETR_DELTA_DELETE_ACCOUNT)]  ; /* sid only */
                [case(NETR_DELTA_SECRET)]          netr_DELTA_SECRET          *secret;
-               [case(NETR_DELTA_DELETE_SECRET)]   netr_DELTA_DELETE_SECRET    delete_secret;
+               [case(NETR_DELTA_DELETE_SECRET)]   ; /* name only */
                [case(NETR_DELTA_DELETE_GROUP2)]   netr_DELTA_DELETE_USER     *delete_group;
                [case(NETR_DELTA_DELETE_USER2)]    netr_DELTA_DELETE_USER     *delete_user;
                [case(NETR_DELTA_MODIFY_COUNT)]    udlong                     *modified_count;
+               [default];
        } netr_DELTA_UNION;
 
        typedef [switch_type(netr_DeltaEnum)] union {
@@ -728,6 +773,7 @@ interface netlogon
                [case(NETR_DELTA_DELETE_GROUP2)]   uint32 rid;
                [case(NETR_DELTA_DELETE_USER2)]    uint32 rid;
                [case(NETR_DELTA_MODIFY_COUNT)]    ;
+               [default];
        } netr_DELTA_ID_UNION;
 
        typedef struct {
@@ -868,7 +914,7 @@ interface netlogon
                [string,charset(UTF16)] uint16 *trusted_domain_name;
        } netr_NETLOGON_INFO_4;
 
-       typedef union {
+       typedef [public] union {
                [case(1)]  netr_NETLOGON_INFO_1 *info1;
                [case(2)]  netr_NETLOGON_INFO_2 *info2;
                [case(3)]  netr_NETLOGON_INFO_3 *info3;
@@ -877,7 +923,7 @@ interface netlogon
        } netr_CONTROL_QUERY_INFORMATION;
 
        /* function_code values */
-       typedef [v1_enum] enum {
+       typedef [v1_enum,public] enum {
                NETLOGON_CONTROL_QUERY                  = 0x00000001,
                NETLOGON_CONTROL_REPLICATE              = 0x00000002,
                NETLOGON_CONTROL_SYNCHRONIZE            = 0x00000003,
@@ -917,7 +963,7 @@ interface netlogon
        /*****************/
        /* Function 0x0E */
 
-       typedef union {
+       typedef [public,switch_type(netr_LogonControlCode)] union {
                [case(NETLOGON_CONTROL_REDISCOVER)]        [string,charset(UTF16)] uint16 *domain;
                [case(NETLOGON_CONTROL_TC_QUERY)]          [string,charset(UTF16)] uint16 *domain;
                [case(NETLOGON_CONTROL_TRANSPORT_NOTIFY)]  [string,charset(UTF16)] uint16 *domain;
@@ -1088,7 +1134,7 @@ interface netlogon
        /*****************/
        /* Function 0x14 */
 
-       /* one unkown bit still: DS_IP_VERSION_AGNOSTIC - gd*/
+       /* one unknown bit still: DS_IP_VERSION_AGNOSTIC - gd*/
 
        const int DSGETDC_VALID_FLAGS = (DS_FORCE_REDISCOVERY |
                                         DS_DIRECTORY_SERVICE_REQUIRED |
@@ -1105,6 +1151,16 @@ interface netlogon
                                         DS_ONLY_LDAP_NEEDED |
                                         DS_IS_FLAT_NAME |
                                         DS_IS_DNS_NAME |
+                                        DS_TRY_NEXTCLOSEST_SITE |
+                                        DS_DIRECTORY_SERVICE_6_REQUIRED |
+                                        DS_WEB_SERVICE_REQUIRED |
+                                        /*
+                                         * For now we skip these until
+                                         * we have test for them:
+                                         * DS_DIRECTORY_SERVICE_8_REQUIRED |
+                                         * DS_DIRECTORY_SERVICE_9_REQUIRED |
+                                         * DS_DIRECTORY_SERVICE_10_REQUIRED |
+                                         */
                                         DS_RETURN_FLAT_NAME |
                                         DS_RETURN_DNS_NAME);
 
@@ -1125,8 +1181,11 @@ interface netlogon
                DS_IS_FLAT_NAME                 = 0x00010000,
                DS_IS_DNS_NAME                  = 0x00020000,
                DS_TRY_NEXTCLOSEST_SITE         = 0x00040000,
-               DS_DIRECTORY_SERVICE_6_REQUIRED = 0x00080000,
+               DS_DIRECTORY_SERVICE_6_REQUIRED = 0x00080000, /* 2008 */
                DS_WEB_SERVICE_REQUIRED         = 0x00100000,
+               DS_DIRECTORY_SERVICE_8_REQUIRED = 0x00200000, /* 2012 */
+               DS_DIRECTORY_SERVICE_9_REQUIRED = 0x00400000, /* 2012R2 */
+               DS_DIRECTORY_SERVICE_10_REQUIRED= 0x00800000, /* 2016 */
                DS_RETURN_DNS_NAME              = 0x40000000,
                DS_RETURN_FLAT_NAME             = 0x80000000
        } netr_DsRGetDCName_flags;
@@ -1137,21 +1196,25 @@ interface netlogon
        } netr_DsRGetDCNameInfo_AddressType;
 
        typedef [bitmap32bit] bitmap {
-               DS_SERVER_PDC                    = NBT_SERVER_PDC,
-               DS_SERVER_GC                     = NBT_SERVER_GC,
-               DS_SERVER_LDAP                   = NBT_SERVER_LDAP,
-               DS_SERVER_DS                     = NBT_SERVER_DS,
-               DS_SERVER_KDC                    = NBT_SERVER_KDC,
-               DS_SERVER_TIMESERV               = NBT_SERVER_TIMESERV,
-               DS_SERVER_CLOSEST                = NBT_SERVER_CLOSEST,
-               DS_SERVER_WRITABLE               = NBT_SERVER_WRITABLE,
-               DS_SERVER_GOOD_TIMESERV          = NBT_SERVER_GOOD_TIMESERV,
-               DS_SERVER_NDNC                   = NBT_SERVER_NDNC,
-               DS_SERVER_SELECT_SECRET_DOMAIN_6 = NBT_SERVER_SELECT_SECRET_DOMAIN_6,
-               DS_SERVER_FULL_SECRET_DOMAIN_6   = NBT_SERVER_FULL_SECRET_DOMAIN_6,
-               DS_DNS_CONTROLLER                = NBT_SERVER_HAS_DNS_NAME,
-               DS_DNS_DOMAIN                    = NBT_SERVER_IS_DEFAULT_NC,
-               DS_DNS_FOREST_ROOT               = NBT_SERVER_FOREST_ROOT
+               DS_SERVER_PDC                    = 0x00000001,
+               DS_SERVER_GC                     = 0x00000004,
+               DS_SERVER_LDAP                   = 0x00000008,
+               DS_SERVER_DS                     = 0x00000010,
+               DS_SERVER_KDC                    = 0x00000020,
+               DS_SERVER_TIMESERV               = 0x00000040,
+               DS_SERVER_CLOSEST                = 0x00000080,
+               DS_SERVER_WRITABLE               = 0x00000100,
+               DS_SERVER_GOOD_TIMESERV          = 0x00000200,
+               DS_SERVER_NDNC                   = 0x00000400,
+               DS_SERVER_SELECT_SECRET_DOMAIN_6 = 0x00000800, /* 2008 / RODC */
+               DS_SERVER_FULL_SECRET_DOMAIN_6   = 0x00001000, /* 2008 / RWDC */
+               DS_SERVER_WEBSERV                = 0x00002000,
+               DS_SERVER_DS_8                   = 0x00004000, /* 2012 */
+               DS_SERVER_DS_9                   = 0x00008000, /* 2012R2 */
+               DS_SERVER_DS_10                  = 0x00010000, /* 2016 */
+               DS_DNS_CONTROLLER                = 0x20000000,
+               DS_DNS_DOMAIN                    = 0x40000000,
+               DS_DNS_FOREST_ROOT               = 0x80000000
        } netr_DsR_DcFlags;
 
        typedef [public] struct {
@@ -1245,7 +1308,7 @@ interface netlogon
 
        /****************/
        /* Function 0x1d */
-       typedef [bitmap32bit] bitmap {
+       typedef [public,bitmap32bit] bitmap {
                NETR_TRUST_FLAG_IN_FOREST = 0x00000001,
                NETR_TRUST_FLAG_OUTBOUND  = 0x00000002,
                NETR_TRUST_FLAG_TREEROOT  = 0x00000004,
@@ -1307,9 +1370,10 @@ interface netlogon
                   actually encodes this structure as a UNICODE_STRING
                   - see MS-NRPC section 2.2.1.3.9 */
                /* 142 * 2 = 284 (length of structure "netr_OsVersionInfoEx") */
-               [value(142)] uint32 length;
-               [value(0)] uint32 dummy;
-               [value(142)] uint32 size;
+               [value(142)] uint3264 length;
+               [value(0)] uint3264 dummy;
+               [value(142)] uint3264 size;
+               [subcontext(0),subcontext_size(size*2)]
                netr_OsVersionInfoEx os;
        } netr_OsVersion;
 
@@ -1334,7 +1398,7 @@ interface netlogon
                lsa_String dummy_string3;
                lsa_String dummy_string4;
                netr_WorkstationFlags workstation_flags;
-               uint32 dummy_long2;
+               kerb_EncTypes supported_enc_types;
                uint32 dummy_long3;
                uint32 dummy_long4;
        } netr_WorkstationInformation;
@@ -1344,22 +1408,28 @@ interface netlogon
                [case(2)] netr_WorkstationInformation *lsa_policy_info;
        } netr_WorkstationInfo;
 
+       typedef struct {
+               netr_TrustFlags flags;
+               uint32 parent_index;
+               lsa_TrustType trust_type;
+               lsa_TrustAttributes trust_attributes;
+       } netr_trust_extension_info;
+
        typedef struct {
                /* these first 3 values come from the fact windows
                   actually encodes this structure as a UNICODE_STRING
                   - see MS-NRPC section 2.2.1.3.9 */
-               [value(8)] uint32 length;
-               [value(0)] uint32 dummy;
-               [value(8)] uint32 size;
-               netr_TrustFlags flags;
-               uint32 parent_index;
-               uint32 trust_type;
-               uint32 trust_attributes;
+               [value(8)] uint3264 length;
+               [value(0)] uint3264 dummy;
+               [value(8)] uint3264 size;
+               [subcontext(0),subcontext_size(size*2)]
+               netr_trust_extension_info info;
        } netr_trust_extension;
 
        typedef struct {
-               uint16 length; /* value is 16 when info != NULL, otherwise 0 */
-               [value(length)] uint16 size;   /* value is 16 when info != NULL, otherwise 0 */
+               /* value is 16 when info != NULL, otherwise 0 */
+               [value(info == NULL ? 0 : 16)] uint16 length;
+               [value(info == NULL ? 0 : 16)] uint16 size;
                netr_trust_extension *info;
        } netr_trust_extension_container;
 
@@ -1379,14 +1449,6 @@ interface netlogon
                uint32 dummy_long4;
        } netr_OneDomainInfo;
 
-       typedef [public,bitmap32bit] bitmap {
-               ENC_CRC32 = 0x00000001,
-               ENC_RSA_MD5 = 0x00000002,
-               ENC_RC4_HMAC_MD5 = 0x00000004,
-               ENC_HMAC_SHA1_96_AES128  = 0x00000008,
-               ENC_HMAC_SHA1_96_AES256  = 0x00000010
-       } netr_SupportedEncTypes;
-
        typedef struct {
                netr_OneDomainInfo primary_domain;
                uint32 trusted_domain_count;
@@ -1397,7 +1459,7 @@ interface netlogon
                lsa_StringLarge dummy_string3;
                lsa_StringLarge dummy_string4;
                netr_WorkstationFlags workstation_flags;
-               netr_SupportedEncTypes supported_enc_types;
+               kerb_EncTypes supported_enc_types;
                uint32 dummy_long3;
                uint32 dummy_long4;
        } netr_DomainInformation;
@@ -1407,7 +1469,7 @@ interface netlogon
                [case(2)] netr_LsaPolicyInformation *lsa_policy_info;
        } netr_DomainInfo;
        
-       NTSTATUS netr_LogonGetDomainInfo(
+       [public] NTSTATUS netr_LogonGetDomainInfo(
                [in]         [string,charset(UTF16)] uint16 *server_name,
                [in,unique]  [string,charset(UTF16)] uint16 *computer_name,
                [in,ref]     netr_Authenticator *credential,
@@ -1448,7 +1510,7 @@ interface netlogon
 
        /****************/
        /* Function 0x1f */
-       WERROR netr_ServerPasswordGet(
+       NTSTATUS netr_ServerPasswordGet(
                [in,unique] [string,charset(UTF16)] uint16 *server_name,
                [in]  [string,charset(UTF16)] uint16 *account_name,
                [in]  netr_SchannelType secure_channel_type,
@@ -1458,9 +1520,46 @@ interface netlogon
                [out,ref] samr_Password *password
                );
 
+       typedef [public] enum {
+               SendToSamUpdatePassword = 0,
+               SendToSamResetBadPasswordCount = 1,
+               SendToSamUpdatePasswordForward = 2,
+               SendToSamUpdateLastLogonTimestamp = 3,
+               SendToSamResetSmartCardPassword = 4
+       } netr_SendToSamType;
+
+       typedef struct {
+               GUID guid;
+       } netr_SendToSamResetBadPasswordCount;
+
+       typedef [nodiscriminant, public,switch_type(netr_SendToSamType)] union {
+               /* TODO Implement other SendToSam message types
+                * [case(SendToSamUpdatePassword)] netr_SendToSamUpdatePassword ...; */
+               [case(SendToSamResetBadPasswordCount)] netr_SendToSamResetBadPasswordCount reset_bad_password;
+               /*
+                * [case(SendToSamUpdatePasswordForward)] netrSendToSamUpdatePasswordForward ...;
+                * [case(SendToSamUpdateLastLogonTimestamp)] netrSendToSamUpdateLastLogonTimestamp ...;
+                * [case(SendToSamResetSmartCardPassword)]   netrSendToSamResetSmartCardPassword ...;
+                */
+               [default];
+       } netr_SendToSamMessage;
+
+       typedef [public] struct {
+               netr_SendToSamType message_type;
+               uint32 message_size;
+               [switch_is(message_type), subcontext(0), subcontext_size(message_size)] netr_SendToSamMessage message;
+       } netr_SendToSamBase;
+
        /****************/
        /* Function 0x20 */
-       [todo] WERROR netr_NETRLOGONSENDTOSAM();
+       NTSTATUS netr_NetrLogonSendToSam(
+               [in,unique] [string,charset(UTF16)] uint16 *server_name,
+               [in]  [string,charset(UTF16)] uint16 *computer_name,
+               [in,ref] netr_Authenticator *credential,
+               [out,ref] netr_Authenticator *return_authenticator,
+               [in,ref]  [size_is(buffer_len)] uint8 *opaque_buffer,
+               [in] uint32 buffer_len
+               );
 
        /****************/
        /* Function 0x21 */
@@ -1501,35 +1600,18 @@ interface netlogon
        /****************/
        /* Function 0x24 */
 
-       typedef [v1_enum] enum {
-               NETR_TRUST_TYPE_DOWNLEVEL       = 1,
-               NETR_TRUST_TYPE_UPLEVEL         = 2,
-               NETR_TRUST_TYPE_MIT             = 3,
-               NETR_TRUST_TYPE_DCE             = 4
-       } netr_TrustType;
-
-       typedef [bitmap32bit] bitmap {
-               NETR_TRUST_ATTRIBUTE_NON_TRANSITIVE     = 0x00000001,
-               NETR_TRUST_ATTRIBUTE_UPLEVEL_ONLY       = 0x00000002,
-               NETR_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN = 0x00000004,
-               NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE  = 0x00000008,
-               NETR_TRUST_ATTRIBUTE_CROSS_ORGANIZATION = 0x00000010,
-               NETR_TRUST_ATTRIBUTE_WITHIN_FOREST      = 0x00000020,
-               NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL  = 0x00000040
-       } netr_TrustAttributes;
-
-       typedef struct {
+       typedef [public] struct {
                [string,charset(UTF16)] uint16                  *netbios_name;
                [string,charset(UTF16)] uint16                  *dns_name;
                netr_TrustFlags         trust_flags;
                uint32                  parent_index;
-               netr_TrustType          trust_type;
-               netr_TrustAttributes    trust_attributes;
+               lsa_TrustType           trust_type;
+               lsa_TrustAttributes     trust_attributes;
                dom_sid2                *sid;
                GUID                    guid;
        } netr_DomainTrust;
 
-        typedef struct {
+        typedef [public] struct {
                 uint32 count;
                 [size_is(count)] netr_DomainTrust *array;
         } netr_DomainTrustList;
@@ -1569,6 +1651,17 @@ interface netlogon
 
        /****************/
        /* Function 0x27 */
+       typedef [public,bitmap32bit] bitmap {
+               /* Request MUST be passed to the domain controller at the root of the forest. */
+               NETLOGON_SAMLOGON_FLAG_PASS_TO_FOREST_ROOT = 0x00000001,
+               /* Request MUST be passed to the DC at the end of the first hop over a cross-forest trust. */
+               NETLOGON_SAMLOGON_FLAG_PASS_CROSS_FOREST_HOP = 0x00000002,
+               /* Request was passed by an RODC to a DC in a different domain. */
+               NETLOGON_SAMLOGON_FLAG_RODC_TO_OTHER_DOMAIN = 0x00000004,
+               /* Request is an NTLM authentication package request passed by an RODC. */
+               NETLOGON_SAMLOGON_FLAG_RODC_NTLM_REQUEST = 0x00000008
+       } netr_LogonSamLogon_flags;
+
        NTSTATUS netr_LogonSamLogonEx(
                [in,unique] [string,charset(UTF16)] uint16 *server_name,
                [in,unique] [string,charset(UTF16)] uint16 *computer_name,
@@ -1577,7 +1670,7 @@ interface netlogon
                [in]  uint16 validation_level,
                [out,ref] [switch_is(validation_level)] netr_Validation *validation,
                [out,ref] uint8 *authoritative,
-               [in,out,ref] uint32 *flags
+               [in,out,ref] netr_LogonSamLogon_flags *flags
                );
 
        /****************/
@@ -1609,8 +1702,8 @@ interface netlogon
                [in]  [string,charset(UTF16)] uint16 *computer_name,
                [in,ref] netr_Authenticator *credential,
                [out,ref] netr_Authenticator *return_authenticator,
-               [out,ref] samr_Password *password,
-               [out,ref] samr_Password *password2
+               [out,ref] samr_Password *new_owf_password,
+               [out,ref] samr_Password *old_owf_password
        );
 
        /****************/
@@ -1650,7 +1743,7 @@ interface netlogon
                [in]  uint16 validation_level,
                [out,ref] [switch_is(validation_level)] netr_Validation *validation,
                [out,ref] uint8 *authoritative,
-               [in,out,ref] uint32 *flags
+               [in,out,ref] netr_LogonSamLogon_flags *flags
                );
 
        /****************/
@@ -1674,4 +1767,59 @@ interface netlogon
                [out,ref] samr_Password *old_owf_password,
                [out,ref] netr_TrustInfo **trust_info
                );
+
+       /****************/
+       /* Function 0x2f */
+
+       NTSTATUS netr_Unused47(void);
+
+
+       /****************/
+       /* Function 0x30 */
+
+       typedef enum {
+               NlDnsLdapAtSite       = 22,
+               NlDnsGcAtSite         = 25,
+               NlDnsDsaCname         = 28,
+               NlDnsKdcAtSite        = 30,
+               NlDnsDcAtSite         = 32,
+               NlDnsRfc1510KdcAtSite = 34,
+               NlDnsGenericGcAtSite  = 36
+       } netr_DnsType;
+
+       typedef enum {
+               NlDnsInfoTypeNone    = 0,
+               NlDnsDomainName      = 1,
+               NlDnsDomainNameAlias = 2,
+               NlDnsForestName      = 3,
+               NlDnsForestNameAlias = 4,
+               NlDnsNdncDomainName  = 5,
+               NlDnsRecordName      = 6
+       } netr_DnsDomainInfoType;
+
+       typedef struct {
+               netr_DnsType type;
+               [string,charset(UTF16)] uint16 *dns_domain_info;
+               netr_DnsDomainInfoType dns_domain_info_type;
+               uint32 priority;
+               uint32 weight;
+               uint32 port;
+               boolean32 dns_register;
+               uint32 status;
+       } NL_DNS_NAME_INFO;
+
+       typedef [public] struct {
+               uint32 count;
+               [size_is(count)] NL_DNS_NAME_INFO *names;
+       } NL_DNS_NAME_INFO_ARRAY;
+
+       NTSTATUS netr_DsrUpdateReadOnlyServerDnsRecords(
+               [in,unique] [string,charset(UTF16)] uint16 *server_name,
+               [in,ref] [string,charset(UTF16)] uint16 *computer_name,
+               [in, ref] netr_Authenticator *credential,
+               [out,ref]   netr_Authenticator *return_authenticator,
+               [in,unique] [string,charset(UTF16)] uint16 *site_name,
+               [in] uint32 dns_ttl,
+               [in,out,ref] NL_DNS_NAME_INFO_ARRAY *dns_names
+               );
 }