r4335: Fix some potential memleaks, implement CreateDomAlias. Hmmmm. Isn't there
[samba.git] / source4 / librpc / idl / krb5pac.idl
1 /*
2   krb5 PAC
3 */
4
5 #include "idl_types.h"
6
7 [
8   uuid("46746756-7567-7567-5677-756756756756"),
9   version(0.0),
10   pointer_default(unique),
11   depends(security)
12 ]
13 interface krb5pac
14 {
15         typedef struct {
16                 NTTIME logon_time;
17                 [flag(STR_SIZE2|STR_NOTERM|STR_BYTESIZE)] string account_name;
18         } UNKNOWN_TYPE_10;
19
20         typedef [flag(NDR_PAHEX)] struct {
21                 uint32 type;
22                 uint8 signature[16];
23         } PAC_SIGNATURE_DATA;
24
25         typedef struct {
26                 uint32 rid;
27                 uint32 attrs;
28         } GROUP_MEMBERSHIP;
29
30         typedef struct {
31                 dom_sid2 *sid;
32                 uint32 attrs;
33         } EXTRA_SIDS;
34
35         typedef struct {
36                 [value(strlen_m(r->string)*2)]  uint16 size;
37                 [value(r->size)]                uint16 length;
38                 unistr_noterm                   *string;
39         } pac_String;
40
41         /* This is awfully similar to a samr_user_info_23, but not identical.
42            Many of the field names have been swiped from there, because it is
43            so similar that they are likely the same, but many have been verified.
44            Some are in a different order, though... */
45         typedef struct {
46                 uint32 unknown[5];
47                 NTTIME logon_time;            /* logon time */
48                 NTTIME logoff_time;           /* logoff time */
49                 NTTIME kickoff_time;          /* kickoff time */
50                 NTTIME pass_last_set_time;    /* password last set time */
51                 NTTIME pass_can_change_time;  /* password can change time */
52                 NTTIME pass_must_change_time; /* password must change time */
53
54                 pac_String account_name;
55                 pac_String full_name;
56                 pac_String logon_script;
57                 pac_String profile_path;
58                 pac_String home_directory;
59                 pac_String home_drive;
60
61                 uint16 logon_count; /* number of times user has logged onto domain */
62                 uint16 reserved12;
63
64                 uint32 user_rid;
65                 uint32 group_rid;
66
67                 uint32 groups_count;
68                 [size_is(groups_count)] GROUP_MEMBERSHIP *groups;
69
70                 uint32 user_flags;
71
72                 uint32 reserved13[4];
73                 pac_String dom_controller;
74                 pac_String dom_name;
75
76                 dom_sid2 *dom_sid;
77
78                 uint32 reserved16[2];
79                 uint32 acct_flags;      /* looks like it may be acb_info */
80                 uint32 reserved18[7];
81
82                 uint32 extra_sids_count;
83                 [size_is(extra_sids_count)] EXTRA_SIDS *extra_sids;
84
85                 dom_sid2 *res_group_dom_sid;
86
87                 uint32 res_groups_count;
88                 [size_is(res_groups_count)] GROUP_MEMBERSHIP *res_groups;
89         } PAC_LOGON_INFO;
90
91         const uint8 PAC_TYPE_LOGON_INFO = 1;
92         const uint8 PAC_TYPE_SRV_CHECKSUM = 6;
93         const uint8 PAC_TYPE_KDC_CHECKSUM = 7;
94         const uint8 PAC_TYPE_UNKNOWN_10 = 10;
95
96         typedef [nodiscriminant] union {
97                 [case(PAC_TYPE_LOGON_INFO)]     PAC_LOGON_INFO logon_info;
98                 [case(PAC_TYPE_SRV_CHECKSUM)]   PAC_SIGNATURE_DATA srv_cksum;
99                 [case(PAC_TYPE_KDC_CHECKSUM)]   PAC_SIGNATURE_DATA kdc_cksum;
100                 [case(PAC_TYPE_UNKNOWN_10)]     UNKNOWN_TYPE_10 type_10;
101         } PAC_INFO;
102
103         typedef struct {
104                 uint32 type;
105                 uint32 size;
106                 [relative,switch_is(type)] PAC_INFO *info;
107                 uint32 _pad;
108         } PAC_BUFFER;
109
110         typedef [public,flag(NDR_ALIGN8)] struct {
111                 uint32 num_buffers;
112                 uint32 version;
113                 PAC_BUFFER buffers[num_buffers];
114         } PAC_DATA;
115
116         void decode_pac(
117                 [in] PAC_DATA pac
118                 );
119
120         void decode_login_info(
121                 [in] PAC_LOGON_INFO logon_info
122                 );
123 }