adding group member code, made a start. found that the group members'
[ira/wip.git] / source3 / include / rpc_misc.h
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
8    
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.
13    
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.
18    
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.
22 */
23
24 #ifndef _RPC_MISC_H /* _RPC_MISC_H */
25 #define _RPC_MISC_H 
26
27
28 #include "rpc_dce.h"
29
30 /* well-known RIDs - Relative IDs */
31
32 /* RIDs - Well-known users ... */
33 #define DOMAIN_USER_RID_ADMIN          (0x000001F4L)
34 #define DOMAIN_USER_RID_GUEST          (0x000001F5L)
35
36 /* RIDs - well-known groups ... */
37 #define DOMAIN_GROUP_RID_ADMINS        (0x00000200L)
38 #define DOMAIN_GROUP_RID_USERS         (0x00000201L)
39 #define DOMAIN_GROUP_RID_GUESTS        (0x00000202L)
40
41 /* RIDs - well-known aliases ... */
42 #define BUILTIN_ALIAS_RID_ADMINS        (0x00000220L)
43 #define BUILTIN_ALIAS_RID_USERS         (0x00000221L)
44 #define BUILTIN_ALIAS_RID_GUESTS        (0x00000222L)
45 #define BUILTIN_ALIAS_RID_POWER_USERS   (0x00000223L)
46 #define BUILTIN_ALIAS_RID_ACCOUNT_OPS   (0x00000224L)
47 #define BUILTIN_ALIAS_RID_SYSTEM_OPS    (0x00000225L)
48 #define BUILTIN_ALIAS_RID_PRINT_OPS     (0x00000226L)
49 #define BUILTIN_ALIAS_RID_BACKUP_OPS    (0x00000227L)
50 #define BUILTIN_ALIAS_RID_REPLICATOR    (0x00000228L)
51
52 /*
53  * Masks for mappings between unix uid and gid types and
54  * NT RIDS.
55  */
56
57 /* Take the bottom bits. */
58 #define RID_TYPE_MASK 2
59 #define RID_MULTIPLIER 4
60
61 /* The three common types. */
62 #define RID_TYPE_USER    0
63 #define RID_TYPE_GROUP   1
64 #define RID_TYPE_ALIAS   2
65
66 /* ENUM_HND */
67 typedef struct enum_hnd_info
68 {
69         uint32 ptr_hnd;          /* pointer to enumeration handle */
70         uint32 handle;           /* enumeration handle */
71
72 } ENUM_HND;
73
74 /* LOOKUP_LEVEL - switch value */
75 typedef struct lookup_level_info
76 {
77   uint16 value;
78
79 } LOOKUP_LEVEL;
80
81 /* DOM_SID2 - security id */
82 typedef struct sid_info_2
83 {
84         uint32 num_auths; /* length, bytes, including length of len :-) */
85
86         DOM_SID sid;
87
88 } DOM_SID2;
89
90 /* STRHDR - string header */
91 typedef struct header_info
92 {
93   uint16 str_str_len;
94   uint16 str_max_len;
95   uint32 buffer; /* non-zero */
96
97 } STRHDR;
98
99 /* UNIHDR - unicode string header */
100 typedef struct unihdr_info
101 {
102   uint16 uni_str_len;
103   uint16 uni_max_len;
104   uint32 buffer; /* usually has a value of 4 */
105
106 } UNIHDR;
107
108 /* UNIHDR2 - unicode string header and undocumented buffer */
109 typedef struct unihdr2_info
110 {
111   UNIHDR unihdr;
112   uint32 buffer; /* 32 bit buffer pointer */
113
114 } UNIHDR2;
115
116 /* clueless as to what maximum length should be */
117 #define MAX_UNISTRLEN 256
118 #define MAX_STRINGLEN 256
119 #define MAX_BUFFERLEN 512
120
121 /* UNISTR - unicode string size and buffer */
122 typedef struct unistr_info
123 {
124   uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. ***MUST*** be null-terminated */
125
126 } UNISTR;
127
128 /* BUFHDR - buffer header */
129 typedef struct bufhdr_info
130 {
131   uint32 buf_max_len;
132   uint32 buf_len;
133
134 } BUFHDR;
135
136 /* BUFFER2 - unicode string, size (in uint8 ascii chars) and buffer */
137 /* pathetic.  some stupid team of \PIPE\winreg writers got the concept */
138 /* of a unicode string different from the other \PIPE\ writers */
139 typedef struct buffer2_info
140 {
141   uint32 buf_max_len;
142   uint32 undoc;
143   uint32 buf_len;
144   uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */
145
146 } BUFFER2;
147
148 /* BUFFER3 */
149 typedef struct buffer3_info
150 {
151   uint32 buf_max_len;
152   uint8  buffer[MAX_BUFFERLEN]; /* data */
153   uint32 buf_len;
154
155 } BUFFER3;
156
157 /* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */
158 typedef struct unistr2_info
159 {
160   uint32 uni_max_len;
161   uint32 undoc;
162   uint32 uni_str_len;
163   uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */
164
165 } UNISTR2;
166
167 /* STRING2 - string size (in uint8 chars) and buffer */
168 typedef struct string2_info
169 {
170   uint32 str_max_len;
171   uint32 undoc;
172   uint32 str_str_len;
173   uint8  buffer[MAX_STRINGLEN]; /* uint8 characters. **NOT** necessarily null-terminated */
174
175 } STRING2;
176
177 /* UNISTR3 - XXXX not sure about this structure */
178 typedef struct unistr3_info
179 {
180         uint32 uni_str_len;
181         UNISTR str;
182
183 } UNISTR3;
184
185
186 /* DOM_RID2 - domain RID structure for ntlsa pipe */
187 typedef struct domrid2_info
188 {
189         uint8 type; /* value is SID_NAME_USE enum */
190         uint32 rid;
191         uint32 rid_idx; /* referenced domain index */
192
193 } DOM_RID2;
194
195 /* DOM_RID3 - domain RID structure for samr pipe */
196 typedef struct domrid3_info
197 {
198         uint32 rid;        /* domain-relative (to a SID) id */
199         uint32 type1;      /* value is 0x1 */
200         uint32 ptr_type;   /* undocumented pointer */
201         uint32 type2;      /* value is 0x1 */
202         uint32 unk; /* value is 0x2 */
203
204 } DOM_RID3;
205
206 /* DOM_RID4 - rid + user attributes */
207 typedef struct domrid4_info
208 {
209         uint32 unknown;      
210         uint16 attr;
211         uint32 rid;  /* user RID */
212
213 } DOM_RID4;
214
215 /* DOM_CLNT_SRV - client / server names */
216 typedef struct clnt_srv_info
217 {
218   uint32  undoc_buffer; /* undocumented 32 bit buffer pointer */
219   UNISTR2 uni_logon_srv; /* logon server name */
220   uint32  undoc_buffer2; /* undocumented 32 bit buffer pointer */
221   UNISTR2 uni_comp_name; /* client machine name */
222
223 } DOM_CLNT_SRV;
224
225 /* DOM_LOG_INFO - login info */
226 typedef struct log_info
227 {
228   uint32  undoc_buffer; /* undocumented 32 bit buffer pointer */
229   UNISTR2 uni_logon_srv; /* logon server name */
230   UNISTR2 uni_acct_name; /* account name */
231   uint16  sec_chan;      /* secure channel type */
232   UNISTR2 uni_comp_name; /* client machine name */
233
234 } DOM_LOG_INFO;
235
236 /* DOM_CLNT_INFO - client info */
237 typedef struct clnt_info
238 {
239   DOM_LOG_INFO login;
240   DOM_CRED     cred;
241
242 } DOM_CLNT_INFO;
243
244 /* DOM_CLNT_INFO2 - client info */
245 typedef struct clnt_info2
246 {
247   DOM_CLNT_SRV login;
248   uint32        ptr_cred;
249   DOM_CRED      cred;
250
251 } DOM_CLNT_INFO2;
252
253 /* DOM_LOGON_ID - logon id */
254 typedef struct logon_info
255 {
256   uint32 low;
257   uint32 high;
258
259 } DOM_LOGON_ID;
260
261 /* OWF INFO */
262 typedef struct owf_info
263 {
264   uint8 data[16];
265
266 } OWF_INFO;
267
268
269 /* DOM_GID - group id + user attributes */
270 typedef struct gid_info
271 {
272   uint32 g_rid;  /* a group RID */
273   uint32 attr;
274
275 } DOM_GID;
276
277 #define POL_HND_SIZE 20
278
279 /* POLICY_HND */
280 typedef struct lsa_policy_info
281 {
282   uint8 data[POL_HND_SIZE]; /* policy handle */
283
284 } POLICY_HND;
285
286 #endif /* _RPC_MISC_H */
287