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