This commit was manufactured by cvs2svn to create branch 'SAMBA_2_2'.
[Samba.git] / source / include / rpc_lsa.h
blob1a6e178068aa73694a40863ce0bd3b4ba5b74199
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_USE_NONE = 0,/* NOTUSED */
32 SID_NAME_USER = 1, /* user */
33 SID_NAME_DOM_GRP = 2, /* domain group */
34 SID_NAME_DOMAIN = 3, /* domain: don't know what this is */
35 SID_NAME_ALIAS = 4, /* local group */
36 SID_NAME_WKN_GRP = 5, /* well-known group */
37 SID_NAME_DELETED = 6, /* deleted account: needed for c2 rating */
38 SID_NAME_INVALID = 7, /* invalid account */
39 SID_NAME_UNKNOWN = 8 /* oops. */
42 /* ntlsa pipe */
43 #define LSA_CLOSE 0x00
44 #define LSA_QUERYINFOPOLICY 0x07
45 #define LSA_ENUMTRUSTDOM 0x0d
46 #define LSA_LOOKUPNAMES 0x0e
47 #define LSA_LOOKUPSIDS 0x0f
48 #define LSA_OPENPOLICY 0x06
49 #define LSA_OPENPOLICY2 0x2c
50 #define LSA_OPENSECRET 0x1C
51 #define LSA_UNK_GET_CONNUSER 0x2d /* LsaGetConnectedCredentials ? */
53 /* XXXX these are here to get a compile! */
54 #define LSA_LOOKUPRIDS 0xFD
56 #define LSA_MAX_GROUPS 96
57 #define LSA_MAX_SIDS 128
59 /* DOM_QUERY - info class 3 and 5 LSA Query response */
60 typedef struct dom_query_info
62 uint16 uni_dom_max_len; /* domain name string length * 2 */
63 uint16 uni_dom_str_len; /* domain name string length * 2 */
64 uint32 buffer_dom_name; /* undocumented domain name string buffer pointer */
65 uint32 buffer_dom_sid; /* undocumented domain SID string buffer pointer */
66 UNISTR2 uni_domain_name; /* domain name (unicode string) */
67 DOM_SID2 dom_sid; /* domain SID */
69 } DOM_QUERY;
71 /* level 5 is same as level 3. we hope. */
72 typedef DOM_QUERY DOM_QUERY_3;
73 typedef DOM_QUERY DOM_QUERY_5;
75 /* level 2 is auditing settings */
76 typedef struct dom_query_2
78 uint32 auditing_enabled;
79 uint32 count1; /* usualy 7, at least on nt4sp4 */
80 uint32 count2; /* the same */
81 uint32 *auditsettings;
82 } DOM_QUERY_2;
84 /* level 6 is server role information */
85 typedef struct dom_query_6
87 uint16 server_role; /* 2=backup, 3=primary */
88 } DOM_QUERY_6;
90 typedef struct seq_qos_info
92 uint32 len; /* 12 */
93 uint16 sec_imp_level; /* 0x02 - impersonation level */
94 uint8 sec_ctxt_mode; /* 0x01 - context tracking mode */
95 uint8 effective_only; /* 0x00 - effective only */
96 uint32 unknown; /* 0x2000 0000 - not known */
98 } LSA_SEC_QOS;
100 typedef struct obj_attr_info
102 uint32 len; /* 0x18 - length (in bytes) inc. the length field. */
103 uint32 ptr_root_dir; /* 0 - root directory (pointer) */
104 uint32 ptr_obj_name; /* 0 - object name (pointer) */
105 uint32 attributes; /* 0 - attributes (undocumented) */
106 uint32 ptr_sec_desc; /* 0 - security descriptior (pointer) */
107 uint32 ptr_sec_qos; /* security quality of service */
108 LSA_SEC_QOS *sec_qos;
110 } LSA_OBJ_ATTR;
112 /* LSA_Q_OPEN_POL - LSA Query Open Policy */
113 typedef struct lsa_q_open_pol_info
115 uint32 ptr; /* undocumented buffer pointer */
116 uint16 system_name; /* 0x5c - system name */
117 LSA_OBJ_ATTR attr ; /* object attributes */
119 uint32 des_access; /* desired access attributes */
121 } LSA_Q_OPEN_POL;
123 /* LSA_R_OPEN_POL - response to LSA Open Policy */
124 typedef struct lsa_r_open_pol_info
126 POLICY_HND pol; /* policy handle */
127 uint32 status; /* return code */
129 } LSA_R_OPEN_POL;
131 /* LSA_Q_OPEN_POL2 - LSA Query Open Policy */
132 typedef struct lsa_q_open_pol2_info
134 uint32 ptr; /* undocumented buffer pointer */
135 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
136 LSA_OBJ_ATTR attr ; /* object attributes */
138 uint32 des_access; /* desired access attributes */
140 } LSA_Q_OPEN_POL2;
142 /* LSA_R_OPEN_POL2 - response to LSA Open Policy */
143 typedef struct lsa_r_open_pol2_info
145 POLICY_HND pol; /* policy handle */
146 uint32 status; /* return code */
148 } LSA_R_OPEN_POL2;
150 /* LSA_Q_QUERY_SEC_OBJ - LSA query security */
151 typedef struct lsa_query_sec_obj_info
153 POLICY_HND pol; /* policy handle */
154 uint32 sec_info;
156 } LSA_Q_QUERY_SEC_OBJ;
158 /* LSA_R_QUERY_SEC_OBJ - probably an open */
159 typedef struct r_lsa_query_sec_obj_info
161 uint32 ptr;
162 SEC_DESC_BUF *buf;
164 uint32 status; /* return status */
166 } LSA_R_QUERY_SEC_OBJ;
168 /* LSA_Q_QUERY_INFO - LSA query info policy */
169 typedef struct lsa_query_info
171 POLICY_HND pol; /* policy handle */
172 uint16 info_class; /* info class */
174 } LSA_Q_QUERY_INFO;
176 /* LSA_INFO_UNION */
177 typedef union lsa_info_union
179 DOM_QUERY_2 id2;
180 DOM_QUERY_3 id3;
181 DOM_QUERY_5 id5;
182 DOM_QUERY_6 id6;
183 } LSA_INFO_UNION;
185 /* LSA_R_QUERY_INFO - response to LSA query info policy */
186 typedef struct lsa_r_query_info
188 uint32 undoc_buffer; /* undocumented buffer pointer */
189 uint16 info_class; /* info class (same as info class in request) */
191 LSA_INFO_UNION dom;
193 uint32 status; /* return code */
195 } LSA_R_QUERY_INFO;
197 /* LSA_Q_ENUM_TRUST_DOM - LSA enumerate trusted domains */
198 typedef struct lsa_enum_trust_dom_info
200 POLICY_HND pol; /* policy handle */
201 uint32 enum_context; /* enumeration context handle */
202 uint32 preferred_len; /* preferred maximum length */
204 } LSA_Q_ENUM_TRUST_DOM;
206 /* LSA_R_ENUM_TRUST_DOM - response to LSA enumerate trusted domains */
207 typedef struct lsa_r_enum_trust_dom_info
209 uint32 enum_context; /* enumeration context handle */
210 uint32 num_domains; /* number of domains */
211 uint32 ptr_enum_domains; /* buffer pointer to num domains */
213 /* this lot is only added if ptr_enum_domains is non-NULL */
214 uint32 num_domains2; /* number of domains */
215 UNIHDR2 *hdr_domain_name;
216 UNISTR2 *uni_domain_name;
217 DOM_SID2 *domain_sid;
219 uint32 status; /* return code */
221 } LSA_R_ENUM_TRUST_DOM;
223 /* LSA_Q_CLOSE */
224 typedef struct lsa_q_close_info
226 POLICY_HND pol; /* policy handle */
228 } LSA_Q_CLOSE;
230 /* LSA_R_CLOSE */
231 typedef struct lsa_r_close_info
233 POLICY_HND pol; /* policy handle. should be all zeros. */
235 uint32 status; /* return code */
237 } LSA_R_CLOSE;
240 #define MAX_REF_DOMAINS 32
242 /* DOM_TRUST_HDR */
243 typedef struct dom_trust_hdr
245 UNIHDR hdr_dom_name; /* referenced domain unicode string headers */
246 uint32 ptr_dom_sid;
248 } DOM_TRUST_HDR;
250 /* DOM_TRUST_INFO */
251 typedef struct dom_trust_info
253 UNISTR2 uni_dom_name; /* domain name unicode string */
254 DOM_SID2 ref_dom ; /* referenced domain SID */
256 } DOM_TRUST_INFO;
258 /* DOM_R_REF */
259 typedef struct dom_ref_info
261 uint32 num_ref_doms_1; /* num referenced domains */
262 uint32 ptr_ref_dom; /* pointer to referenced domains */
263 uint32 max_entries; /* 32 - max number of entries */
264 uint32 num_ref_doms_2; /* num referenced domains */
266 DOM_TRUST_HDR hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domains */
267 DOM_TRUST_INFO ref_dom [MAX_REF_DOMAINS]; /* referenced domains */
269 } DOM_R_REF;
271 /* the domain_idx points to a SID associated with the name */
273 /* LSA_TRANS_NAME - translated name */
274 typedef struct lsa_trans_name_info
276 uint16 sid_name_use; /* value is 5 for a well-known group; 2 for a domain group; 1 for a user... */
277 UNIHDR hdr_name;
278 uint32 domain_idx; /* index into DOM_R_REF array of SIDs */
280 } LSA_TRANS_NAME;
282 #define MAX_LOOKUP_SIDS 30
284 /* LSA_TRANS_NAME_ENUM - LSA Translated Name Enumeration container */
285 typedef struct lsa_trans_name_enum_info
287 uint32 num_entries;
288 uint32 ptr_trans_names;
289 uint32 num_entries2;
291 LSA_TRANS_NAME *name; /* translated names */
292 UNISTR2 *uni_name;
294 } LSA_TRANS_NAME_ENUM;
296 /* LSA_SID_ENUM - LSA SID enumeration container */
297 typedef struct lsa_sid_enum_info
299 uint32 num_entries;
300 uint32 ptr_sid_enum;
301 uint32 num_entries2;
303 uint32 *ptr_sid; /* domain SID pointers to be looked up. */
304 DOM_SID2 *sid; /* domain SIDs to be looked up. */
306 } LSA_SID_ENUM;
308 /* LSA_Q_LOOKUP_SIDS - LSA Lookup SIDs */
309 typedef struct lsa_q_lookup_sids
311 POLICY_HND pol; /* policy handle */
312 LSA_SID_ENUM sids;
313 LSA_TRANS_NAME_ENUM names;
314 LOOKUP_LEVEL level;
315 uint32 mapped_count;
317 } LSA_Q_LOOKUP_SIDS;
319 /* LSA_R_LOOKUP_SIDS - response to LSA Lookup SIDs */
320 typedef struct lsa_r_lookup_sids
322 uint32 ptr_dom_ref;
323 DOM_R_REF *dom_ref; /* domain reference info */
325 LSA_TRANS_NAME_ENUM *names;
326 uint32 mapped_count;
328 uint32 status; /* return code */
330 } LSA_R_LOOKUP_SIDS;
332 /* LSA_Q_LOOKUP_NAMES - LSA Lookup NAMEs */
333 typedef struct lsa_q_lookup_names
335 POLICY_HND pol; /* policy handle */
336 uint32 num_entries;
337 uint32 num_entries2;
338 UNIHDR *hdr_name; /* name buffer pointers */
339 UNISTR2 *uni_name; /* names to be looked up */
341 uint32 num_trans_entries;
342 uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */
343 uint32 lookup_level;
344 uint32 mapped_count;
346 } LSA_Q_LOOKUP_NAMES;
348 /* LSA_R_LOOKUP_NAMES - response to LSA Lookup NAMEs by name */
349 typedef struct lsa_r_lookup_names
351 uint32 ptr_dom_ref;
352 DOM_R_REF *dom_ref; /* domain reference info */
354 uint32 num_entries;
355 uint32 ptr_entries;
356 uint32 num_entries2;
357 DOM_RID2 *dom_rid; /* domain RIDs being looked up */
359 uint32 mapped_count;
361 uint32 status; /* return code */
363 } LSA_R_LOOKUP_NAMES;
365 /* This is probably a policy handle but at the moment we
366 never read it - so use a dummy struct. */
368 typedef struct lsa_q_open_secret
370 uint32 dummy;
371 } LSA_Q_OPEN_SECRET;
373 /* We always return "not found" at present - so just marshal the minimum. */
375 typedef struct lsa_r_open_secret
377 uint32 dummy1;
378 uint32 dummy2;
379 uint32 dummy3;
380 uint32 dummy4;
381 uint32 status;
382 } LSA_R_OPEN_SECRET;
384 /* LSA_Q_UNK_GET_CONNUSER - gets username\domain of connected user
385 called when "Take Ownership" is clicked -SK */
386 typedef struct lsa_q_unk_get_connuser
388 uint32 ptr_srvname;
389 UNISTR2 uni2_srvname;
390 uint32 unk1; /* 3 unknown uint32's are seen right after uni2_srvname */
391 uint32 unk2; /* unk2 appears to be a ptr, unk1 = unk3 = 0 usually */
392 uint32 unk3;
393 } LSA_Q_UNK_GET_CONNUSER;
395 /* LSA_R_UNK_GET_CONNUSER */
396 typedef struct lsa_r_unk_get_connuser
398 uint32 ptr_user_name;
399 UNIHDR hdr_user_name;
400 UNISTR2 uni2_user_name;
402 uint32 unk1;
404 uint32 ptr_dom_name;
405 UNIHDR hdr_dom_name;
406 UNISTR2 uni2_dom_name;
408 uint32 status;
409 } LSA_R_UNK_GET_CONNUSER;
411 #endif /* _RPC_LSA_H */