preparing for release of alpha.0.0
[Samba.git] / source / include / rpc_lsa.h
blobf4d36fef9c19d95c00f66d9e2a68a2a4cfc6aa67
1 /*
2 Unix SMB/Netbios implementation.
3 Version 1.9.
4 SMB parameters and setup
5 Copyright (C) Andrew Tridgell 1992-1997
6 Copyright (C) Luke Kenneth Casson Leighton 1996-1997
7 Copyright (C) Paul Ashton 1997
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _RPC_LSA_H /* _RPC_LSA_H */
25 #define _RPC_LSA_H
27 #include "rpc_misc.h"
29 enum SID_NAME_USE
31 SID_NAME_USER = 1, /* user */
32 SID_NAME_DOM_GRP = 2, /* domain group */
33 SID_NAME_DOMAIN = 3, /* domain: don't know what this is */
34 SID_NAME_ALIAS = 4, /* local group */
35 SID_NAME_WKN_GRP = 5, /* well-known group */
36 SID_NAME_DELETED = 6, /* deleted account: needed for c2 rating */
37 SID_NAME_INVALID = 7, /* invalid account */
38 SID_NAME_UNKNOWN = 8 /* oops. */
41 /* ntlsa pipe */
42 #define LSA_CLOSE 0x00
43 #define LSA_QUERYINFOPOLICY 0x07
44 #define LSA_ENUMTRUSTDOM 0x0d
45 #define LSA_LOOKUPNAMES 0x0e
46 #define LSA_LOOKUPSIDS 0x0f
47 #define LSA_OPENPOLICY 0x06
48 #define LSA_OPENPOLICY2 0x2c
49 #define LSA_OPENSECRET 0x1c
50 #define LSA_QUERYSECRET 0x1e
52 #define LSA_MAX_GROUPS 32
53 #define LSA_MAX_SIDS 32
55 /* DOM_QUERY - info class 3 and 5 LSA Query response */
56 typedef struct dom_query_info
58 uint16 uni_dom_max_len; /* domain name string length * 2 */
59 uint16 uni_dom_str_len; /* domain name string length * 2 */
60 uint32 buffer_dom_name; /* undocumented domain name string buffer pointer */
61 uint32 buffer_dom_sid; /* undocumented domain SID string buffer pointer */
62 UNISTR2 uni_domain_name; /* domain name (unicode string) */
63 DOM_SID2 dom_sid; /* domain SID */
65 } DOM_QUERY;
67 /* level 5 is same as level 3. we hope. */
68 typedef DOM_QUERY DOM_QUERY_3;
69 typedef DOM_QUERY DOM_QUERY_5;
71 typedef struct seq_qos_info
73 uint32 len; /* 12 */
74 uint16 sec_imp_level; /* 0x02 - impersonation level */
75 uint8 sec_ctxt_mode; /* 0x01 - context tracking mode */
76 uint8 effective_only; /* 0x00 - effective only */
77 uint32 unknown; /* 0x2000 0000 - not known */
79 } LSA_SEC_QOS;
81 typedef struct obj_attr_info
83 uint32 len; /* 0x18 - length (in bytes) inc. the length field. */
84 uint32 ptr_root_dir; /* 0 - root directory (pointer) */
85 uint32 ptr_obj_name; /* 0 - object name (pointer) */
86 uint32 attributes; /* 0 - attributes (undocumented) */
87 uint32 ptr_sec_desc; /* 0 - security descriptior (pointer) */
88 uint32 ptr_sec_qos; /* security quality of service */
89 LSA_SEC_QOS *sec_qos;
91 } LSA_OBJ_ATTR;
93 /* LSA_Q_OPEN_POL - LSA Query Open Policy */
94 typedef struct lsa_q_open_pol_info
96 uint32 ptr; /* undocumented buffer pointer */
97 uint16 system_name; /* system name BUG!!! (should be \\server!) */
98 LSA_OBJ_ATTR attr ; /* object attributes */
100 uint32 des_access; /* desired access attributes */
102 } LSA_Q_OPEN_POL;
104 /* LSA_R_OPEN_POL - response to LSA Open Policy */
105 typedef struct lsa_r_open_pol_info
107 POLICY_HND pol; /* policy handle */
108 uint32 status; /* return code */
110 } LSA_R_OPEN_POL;
112 /* LSA_Q_OPEN_POL2 - LSA Query Open Policy */
113 typedef struct lsa_q_open_pol2_info
115 uint32 ptr; /* undocumented buffer pointer */
116 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
117 LSA_OBJ_ATTR attr ; /* object attributes */
119 uint32 des_access; /* desired access attributes */
121 } LSA_Q_OPEN_POL2;
123 /* LSA_R_OPEN_POL2 - response to LSA Open Policy */
124 typedef struct lsa_r_open_pol2_info
126 POLICY_HND pol; /* policy handle */
127 uint32 status; /* return code */
129 } LSA_R_OPEN_POL2;
131 /* LSA_Q_QUERY_INFO - LSA query info policy */
132 typedef struct lsa_query_info
134 POLICY_HND pol; /* policy handle */
135 uint16 info_class; /* info class */
137 } LSA_Q_QUERY_INFO;
139 /* LSA_R_QUERY_INFO - response to LSA query info policy */
140 typedef struct lsa_r_query_info
142 uint32 undoc_buffer; /* undocumented buffer pointer */
143 uint16 info_class; /* info class (same as info class in request) */
145 union
147 DOM_QUERY_3 id3;
148 DOM_QUERY_5 id5;
150 } dom;
152 uint32 status; /* return code */
154 } LSA_R_QUERY_INFO;
156 /* LSA_Q_OPEN_SECRET - LSA Open Secret */
157 typedef struct lsa_q_open_secret_info
159 POLICY_HND pol;
160 UNIHDR hdr_secret;
161 UNISTR2 uni_secret;
163 uint32 des_access; /* desired access attributes */
165 } LSA_Q_OPEN_SECRET;
167 /* LSA_R_OPEN_SECRET - response to LSA Open Secret */
168 typedef struct lsa_r_open_secret_info
170 POLICY_HND pol;
171 uint32 status;
173 } LSA_R_OPEN_SECRET;
175 typedef struct lsa_secret_value_info
177 uint32 ptr_secret;
178 STRHDR2 hdr_secret;
179 STRING2 enc_secret; /* encrypted, see nt_encrypt_string2 */
181 } LSA_SECRET_VALUE;
183 typedef struct lsa_secret_info_info
185 uint32 ptr_value;
186 LSA_SECRET_VALUE value;
188 uint32 ptr_update;
189 NTTIME last_update; /* N.B. 64-bit alignment? */
191 } LSA_SECRET_INFO;
193 /* LSA_Q_QUERY_SECRET - LSA Query Secret */
194 typedef struct lsa_q_query_secret_info
196 POLICY_HND pol;
198 LSA_SECRET_INFO info; /* [in, out] */
199 LSA_SECRET_INFO oldinfo;
201 } LSA_Q_QUERY_SECRET;
203 /* LSA_R_QUERY_SECRET - response to LSA Query Secret */
204 typedef struct lsa_r_query_secret_info
206 LSA_SECRET_INFO info;
207 LSA_SECRET_INFO oldinfo;
209 uint32 status;
211 } LSA_R_QUERY_SECRET;
213 /* LSA_Q_ENUM_TRUST_DOM - LSA enumerate trusted domains */
214 typedef struct lsa_enum_trust_dom_info
216 POLICY_HND pol; /* policy handle */
217 uint32 enum_context; /* enumeration context handle */
218 uint32 preferred_len; /* preferred maximum length */
220 } LSA_Q_ENUM_TRUST_DOM;
222 #define MAX_TRUSTED_DOMS 10
224 /* LSA_R_ENUM_TRUST_DOM - response to LSA enumerate trusted domains */
225 typedef struct lsa_r_enum_trust_dom_info
227 uint32 enum_context; /* enumeration context handle */
228 uint32 num_domains; /* number of domains */
229 uint32 ptr_enum_domains; /* buffer pointer to num domains */
231 /* this lot is only added if ptr_enum_domains is non-NULL */
232 uint32 num_domains2; /* number of domains */
233 UNIHDR2 hdr_domain_name[MAX_TRUSTED_DOMS];
234 UNISTR2 uni_domain_name[MAX_TRUSTED_DOMS];
235 DOM_SID2 domain_sid[MAX_TRUSTED_DOMS];
237 uint32 status; /* return code */
239 } LSA_R_ENUM_TRUST_DOM;
241 /* LSA_Q_CLOSE */
242 typedef struct lsa_q_close_info
244 POLICY_HND pol; /* policy handle */
246 } LSA_Q_CLOSE;
248 /* LSA_R_CLOSE */
249 typedef struct lsa_r_close_info
251 POLICY_HND pol; /* policy handle. should be all zeros. */
253 uint32 status; /* return code */
255 } LSA_R_CLOSE;
258 #define MAX_REF_DOMAINS 10
260 /* DOM_TRUST_HDR */
261 typedef struct dom_trust_hdr
263 UNIHDR hdr_dom_name; /* referenced domain unicode string headers */
264 uint32 ptr_dom_sid;
266 } DOM_TRUST_HDR;
268 /* DOM_TRUST_INFO */
269 typedef struct dom_trust_info
271 UNISTR2 uni_dom_name; /* domain name unicode string */
272 DOM_SID2 ref_dom ; /* referenced domain SID */
274 } DOM_TRUST_INFO;
276 /* DOM_R_REF */
277 typedef struct dom_ref_info
279 uint32 num_ref_doms_1; /* num referenced domains */
280 uint32 ptr_ref_dom; /* pointer to referenced domains */
281 uint32 max_entries; /* 32 - max number of entries */
282 uint32 num_ref_doms_2; /* num referenced domains */
284 DOM_TRUST_HDR hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domains */
285 DOM_TRUST_INFO ref_dom [MAX_REF_DOMAINS]; /* referenced domains */
287 } DOM_R_REF;
289 /* the domain_idx points to a SID associated with the name */
291 /* LSA_TRANS_NAME - translated name */
292 typedef struct lsa_trans_name_info
294 uint32 sid_name_use; /* value is 5 for a well-known group; 2 for a domain group; 1 for a user... */
295 UNIHDR hdr_name;
296 uint32 domain_idx; /* index into DOM_R_REF array of SIDs */
298 } LSA_TRANS_NAME;
300 #define MAX_LOOKUP_SIDS 30
302 /* LSA_TRANS_NAME_ENUM - LSA Translated Name Enumeration container */
303 typedef struct lsa_trans_name_enum_info
305 uint32 num_entries;
306 uint32 ptr_trans_names;
307 uint32 num_entries2;
309 LSA_TRANS_NAME name [MAX_LOOKUP_SIDS]; /* translated names */
310 UNISTR2 uni_name[MAX_LOOKUP_SIDS];
312 } LSA_TRANS_NAME_ENUM;
314 /* LSA_SID_ENUM - LSA SID enumeration container */
315 typedef struct lsa_sid_enum_info
317 uint32 num_entries;
318 uint32 ptr_sid_enum;
319 uint32 num_entries2;
321 uint32 ptr_sid[MAX_LOOKUP_SIDS]; /* domain SID pointers to be looked up. */
322 DOM_SID2 sid [MAX_LOOKUP_SIDS]; /* domain SIDs to be looked up. */
324 } LSA_SID_ENUM;
326 /* LSA_Q_LOOKUP_SIDS - LSA Lookup SIDs */
327 typedef struct lsa_q_lookup_sids
329 POLICY_HND pol; /* policy handle */
330 LSA_SID_ENUM sids;
331 LSA_TRANS_NAME_ENUM names;
332 LOOKUP_LEVEL level;
333 uint32 mapped_count;
335 } LSA_Q_LOOKUP_SIDS;
337 /* LSA_R_LOOKUP_SIDS - response to LSA Lookup SIDs */
338 typedef struct lsa_r_lookup_sids
340 uint32 ptr_dom_ref;
341 DOM_R_REF *dom_ref; /* domain reference info */
343 LSA_TRANS_NAME_ENUM *names;
344 uint32 mapped_count;
346 uint32 status; /* return code */
348 } LSA_R_LOOKUP_SIDS;
351 /* LSA_Q_LOOKUP_NAMES - LSA Lookup NAMEs */
352 typedef struct lsa_q_lookup_names
354 POLICY_HND pol; /* policy handle */
355 uint32 num_entries;
356 uint32 num_entries2;
357 UNIHDR hdr_name[MAX_LOOKUP_SIDS]; /* name buffer pointers */
358 UNISTR2 uni_name[MAX_LOOKUP_SIDS]; /* names to be looked up */
360 uint32 num_trans_entries;
361 uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */
362 uint32 lookup_level;
363 uint32 mapped_count;
365 } LSA_Q_LOOKUP_NAMES;
367 /* LSA_R_LOOKUP_NAMES - response to LSA Lookup NAMEs by name */
368 typedef struct lsa_r_lookup_names
370 uint32 ptr_dom_ref;
371 DOM_R_REF *dom_ref; /* domain reference info */
373 uint32 num_entries;
374 uint32 ptr_entries;
375 uint32 num_entries2;
376 DOM_RID2 *dom_rid; /* domain RIDs being looked up */
378 uint32 mapped_count;
380 uint32 status; /* return code */
382 } LSA_R_LOOKUP_NAMES;
385 #endif /* _RPC_LSA_H */