Makefile: Added CC=gcc to DGUX on Intel. Comment from ross@filmworks.com.
[abartlet/samba.git/.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 #define MAXSUBAUTHS 15 /* max sub authorities in a SID */
83
84 /* DOM_SID - security id */
85 typedef struct sid_info
86 {
87   uint8  sid_rev_num;             /* SID revision number */
88   uint8  num_auths;               /* number of sub-authorities */
89   uint8  id_auth[6];              /* Identifier Authority */
90   /*
91    * Note that the values in these uint32's are in *native* byteorder,
92    * not neccessarily little-endian...... JRA.
93    */
94   uint32 sub_auths[MAXSUBAUTHS];  /* pointer to sub-authorities. */
95
96 } DOM_SID;
97
98 /* DOM_SID2 - security id */
99 typedef struct sid_info_2
100 {
101         uint32 num_auths; /* length, bytes, including length of len :-) */
102
103         DOM_SID sid;
104
105 } DOM_SID2;
106
107 /* STRHDR - string header */
108 typedef struct header_info
109 {
110   uint16 str_max_len;
111   uint16 str_str_len;
112   uint32 buffer; /* non-zero */
113
114 } STRHDR;
115
116 /* UNIHDR - unicode string header */
117 typedef struct unihdr_info
118 {
119   uint16 uni_max_len;
120   uint16 uni_str_len;
121   uint32 buffer; /* usually has a value of 4 */
122
123 } UNIHDR;
124
125 /* UNIHDR2 - unicode string header and undocumented buffer */
126 typedef struct unihdr2_info
127 {
128   UNIHDR unihdr;
129   uint32 buffer; /* 32 bit buffer pointer */
130
131 } UNIHDR2;
132
133 /* clueless as to what maximum length should be */
134 #define MAX_UNISTRLEN 256
135 #define MAX_STRINGLEN 256
136
137 /* UNISTR - unicode string size and buffer */
138 typedef struct unistr_info
139 {
140   uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. ***MUST*** be null-terminated */
141
142 } UNISTR;
143
144 /* UNINOTSTR2 - unicode string, size (in uint8 ascii chars) and buffer */
145 /* pathetic.  some stupid team of \PIPE\winreg writers got the concept */
146 /* of a unicode string different from the other \PIPE\ writers */
147 typedef struct uninotstr2_info
148 {
149   uint32 uni_max_len;
150   uint32 undoc;
151   uint32 uni_buf_len;
152   uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */
153
154 } UNINOTSTR2;
155
156 /* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */
157 typedef struct unistr2_info
158 {
159   uint32 uni_max_len;
160   uint32 undoc;
161   uint32 uni_str_len;
162   uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */
163
164 } UNISTR2;
165
166 /* STRING2 - string size (in uint8 chars) and buffer */
167 typedef struct string2_info
168 {
169   uint32 str_max_len;
170   uint32 undoc;
171   uint32 str_str_len;
172   uint8  buffer[MAX_STRINGLEN]; /* uint8 characters. **NOT** necessarily null-terminated */
173
174 } STRING2;
175
176
177 /* DOM_RID2 - domain RID structure for ntlsa pipe */
178 typedef struct domrid2_info
179 {
180   uint32 type; /* value is 5 */
181   uint32 undoc; /* value is non-zero */
182   uint32 rid;
183   uint32 rid_idx; /* don't know what this is */
184
185 } DOM_RID2;
186
187 /* DOM_RID3 - domain RID structure for samr pipe */
188 typedef struct domrid3_info
189 {
190   uint32 rid;        /* domain-relative (to a SID) id */
191   uint32 type1;      /* value is 0x1 */
192   uint32 ptr_type;   /* undocumented pointer */
193   uint32 type2;      /* value is 0x1 */
194
195 } DOM_RID3;
196
197 /* DOM_RID4 - rid + user attributes */
198 typedef struct domrid4_info
199 {
200   uint32 unknown;      
201   uint16 attr;
202   uint32 rid;  /* user RID */
203
204 } DOM_RID4;
205
206 /* DOM_CLNT_SRV - client / server names */
207 typedef struct clnt_srv_info
208 {
209   uint32  undoc_buffer; /* undocumented 32 bit buffer pointer */
210   UNISTR2 uni_logon_srv; /* logon server name */
211   uint32  undoc_buffer2; /* undocumented 32 bit buffer pointer */
212   UNISTR2 uni_comp_name; /* client machine name */
213
214 } DOM_CLNT_SRV;
215
216 /* DOM_LOG_INFO - login info */
217 typedef struct log_info
218 {
219   uint32  undoc_buffer; /* undocumented 32 bit buffer pointer */
220   UNISTR2 uni_logon_srv; /* logon server name */
221   UNISTR2 uni_acct_name; /* account name */
222   uint16  sec_chan;      /* secure channel type */
223   UNISTR2 uni_comp_name; /* client machine name */
224
225 } DOM_LOG_INFO;
226
227 /* DOM_CLNT_INFO - client info */
228 typedef struct clnt_info
229 {
230   DOM_LOG_INFO login;
231   DOM_CRED     cred;
232
233 } DOM_CLNT_INFO;
234
235 /* DOM_CLNT_INFO2 - client info */
236 typedef struct clnt_info2
237 {
238   DOM_CLNT_SRV login;
239   uint32        ptr_cred;
240   DOM_CRED      cred;
241
242 } DOM_CLNT_INFO2;
243
244 /* DOM_LOGON_ID - logon id */
245 typedef struct logon_info
246 {
247   uint32 low;
248   uint32 high;
249
250 } DOM_LOGON_ID;
251
252 /* OWF INFO */
253 typedef struct owf_info
254 {
255   uint8 data[16];
256
257 } OWF_INFO;
258
259
260 /* DOM_GID - group id + user attributes */
261 typedef struct gid_info
262 {
263   uint32 g_rid;  /* a group RID */
264   uint32 attr;
265
266 } DOM_GID;
267
268 #define POL_HND_SIZE 20
269
270 /* POLICY_HND */
271 typedef struct lsa_policy_info
272 {
273   uint8 data[POL_HND_SIZE]; /* policy handle */
274
275 } POLICY_HND;
276
277 #endif /* _RPC_MISC_H */
278