librpc: add decode_netlogon_samlogon_response_packet for mailslot debugging.
[samba.git] / librpc / idl / netlogon.idl
index 1685cf9a1e90a6de3cd4418879527a2c380fd12a..5eb8e6ae2361c8ad4596e04060ebda1cb82d8851 100644 (file)
@@ -4,18 +4,25 @@
   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")
+
 [
   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)
 ]
 
@@ -179,6 +186,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 +213,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;
@@ -225,18 +233,22 @@ interface netlogon
                netr_UserFlags user_flags;
                netr_UserSessionKey key;
                lsa_StringLarge logon_server;
-               lsa_StringLarge domain;
+               lsa_StringLarge logon_domain;
                dom_sid2 *domain_sid;
                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;
        } netr_SidAttr;
@@ -252,7 +264,7 @@ interface netlogon
                uint32 sidcount;
                [size_is(sidcount)] netr_SidAttr *sids;
                lsa_String dns_domainname;
-               lsa_String principle;
+               lsa_String principal_name;
                uint32 unknown4[20];
        } netr_SamInfo6;
 
@@ -291,6 +303,7 @@ 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 {
@@ -302,7 +315,7 @@ interface netlogon
                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 +614,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 +633,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 +695,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 +730,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 +871,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 +880,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 +920,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;
@@ -1105,6 +1108,9 @@ 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 |
                                         DS_RETURN_FLAT_NAME |
                                         DS_RETURN_DNS_NAME);
 
@@ -1137,21 +1143,23 @@ 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,
+               DS_SERVER_FULL_SECRET_DOMAIN_6   = 0x00001000,
+               DS_SERVER_WEBSERV                = 0x00002000,
+               DS_SERVER_DS_8                   = 0x00004000,
+               DS_DNS_CONTROLLER                = 0x20000000,
+               DS_DNS_DOMAIN                    = 0x40000000,
+               DS_DNS_FOREST_ROOT               = 0x80000000
        } netr_DsR_DcFlags;
 
        typedef [public] struct {
@@ -1334,7 +1342,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;
@@ -1379,14 +1387,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 +1397,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;
@@ -1448,7 +1448,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,
@@ -1501,30 +1501,13 @@ 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 {
                [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;
@@ -1609,8 +1592,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
        );
 
        /****************/