loadparm.c: Removed 'domain other sids' parameter.
[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 /* pipe string names */
31 #define PIPE_SRVSVC   "\\PIPE\\srvsvc"
32 #define PIPE_SAMR     "\\PIPE\\samr"
33 #define PIPE_WINREG   "\\PIPE\\winreg"
34 #define PIPE_WKSSVC   "\\PIPE\\wkssvc"
35 #define PIPE_NETLOGON "\\PIPE\\NETLOGON"
36 #define PIPE_NTLSA    "\\PIPE\\ntlsa"
37 #define PIPE_NTSVCS   "\\PIPE\\ntsvcs"
38 #define PIPE_LSASS    "\\PIPE\\lsass"
39 #define PIPE_LSARPC   "\\PIPE\\lsarpc"
40
41 /* well-known RIDs - Relative IDs */
42
43 /* RIDs - Well-known users ... */
44 #define DOMAIN_USER_RID_ADMIN          (0x000001F4L)
45 #define DOMAIN_USER_RID_GUEST          (0x000001F5L)
46
47 /* RIDs - well-known groups ... */
48 #define DOMAIN_GROUP_RID_ADMINS        (0x00000200L)
49 #define DOMAIN_GROUP_RID_USERS         (0x00000201L)
50 #define DOMAIN_GROUP_RID_GUESTS        (0x00000202L)
51
52 /* RIDs - well-known aliases ... */
53 #define BUILTIN_ALIAS_RID_ADMINS        (0x00000220L)
54 #define BUILTIN_ALIAS_RID_USERS         (0x00000221L)
55 #define BUILTIN_ALIAS_RID_GUESTS        (0x00000222L)
56 #define BUILTIN_ALIAS_RID_POWER_USERS   (0x00000223L)
57
58 #define BUILTIN_ALIAS_RID_ACCOUNT_OPS   (0x00000224L)
59 #define BUILTIN_ALIAS_RID_SYSTEM_OPS    (0x00000225L)
60 #define BUILTIN_ALIAS_RID_PRINT_OPS     (0x00000226L)
61 #define BUILTIN_ALIAS_RID_BACKUP_OPS    (0x00000227L)
62
63 #define BUILTIN_ALIAS_RID_REPLICATOR    (0x00000228L)
64
65 /*
66  * Masks for mappings between unix uid and gid types and
67  * NT RIDS.
68  */
69
70 /* Take the bottom bit. */
71 #define RID_TYPE_MASK 1
72 #define RID_MULTIPLIER 2
73
74 /* The two common types. */
75 #define USER_RID_TYPE 0
76 #define GROUP_RID_TYPE 1
77
78 /* ENUM_HND */
79 typedef struct enum_hnd_info
80 {
81         uint32 ptr_hnd;          /* pointer to enumeration handle */
82         uint32 handle;           /* enumeration handle */
83
84 } ENUM_HND;
85
86 /* LOOKUP_LEVEL - switch value */
87 typedef struct lookup_level_info
88 {
89   uint16 value;
90
91 } LOOKUP_LEVEL;
92
93 #define MAXSUBAUTHS 15 /* max sub authorities in a SID */
94
95 /* DOM_SID - security id */
96 typedef struct sid_info
97 {
98   uint8  sid_rev_num;             /* SID revision number */
99   uint8  num_auths;               /* number of sub-authorities */
100   uint8  id_auth[6];              /* Identifier Authority */
101   /*
102    * Note that the values in these uint32's are in *native* byteorder,
103    * not neccessarily little-endian...... JRA.
104    */
105   uint32 sub_auths[MAXSUBAUTHS];  /* pointer to sub-authorities. */
106
107 } DOM_SID;
108
109 /* DOM_SID2 - security id */
110 typedef struct sid_info_2
111 {
112         uint32 num_auths; /* length, bytes, including length of len :-) */
113
114         DOM_SID sid;
115
116 } DOM_SID2;
117
118 /* STRHDR - string header */
119 typedef struct header_info
120 {
121   uint16 str_max_len;
122   uint16 str_str_len;
123   uint32 buffer; /* non-zero */
124
125 } STRHDR;
126
127 /* UNIHDR - unicode string header */
128 typedef struct unihdr_info
129 {
130   uint16 uni_max_len;
131   uint16 uni_str_len;
132   uint32 buffer; /* usually has a value of 4 */
133
134 } UNIHDR;
135
136 /* UNIHDR2 - unicode string header and undocumented buffer */
137 typedef struct unihdr2_info
138 {
139   UNIHDR unihdr;
140   uint32 buffer; /* 32 bit buffer pointer */
141
142 } UNIHDR2;
143
144 /* clueless as to what maximum length should be */
145 #define MAX_UNISTRLEN 256
146 #define MAX_STRINGLEN 256
147
148 /* UNISTR - unicode string size and buffer */
149 typedef struct unistr_info
150 {
151   uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. ***MUST*** be null-terminated */
152
153 } UNISTR;
154
155 /* UNINOTSTR2 - unicode string, size (in uint8 ascii chars) and buffer */
156 /* pathetic.  some stupid team of \PIPE\winreg writers got the concept */
157 /* of a unicode string different from the other \PIPE\ writers */
158 typedef struct uninotstr2_info
159 {
160   uint32 uni_max_len;
161   uint32 undoc;
162   uint32 uni_buf_len;
163   uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */
164
165 } UNINOTSTR2;
166
167 /* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */
168 typedef struct unistr2_info
169 {
170   uint32 uni_max_len;
171   uint32 undoc;
172   uint32 uni_str_len;
173   uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */
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
188 /* DOM_RID2 - domain RID structure for ntlsa pipe */
189 typedef struct domrid2_info
190 {
191   uint32 type; /* value is 5 */
192   uint32 undoc; /* value is non-zero */
193   uint32 rid;
194   uint32 rid_idx; /* don't know what this is */
195
196 } DOM_RID2;
197
198 /* DOM_RID3 - domain RID structure for samr pipe */
199 typedef struct domrid3_info
200 {
201   uint32 rid;        /* domain-relative (to a SID) id */
202   uint32 type1;      /* value is 0x1 */
203   uint32 ptr_type;   /* undocumented pointer */
204   uint32 type2;      /* value is 0x1 */
205
206 } DOM_RID3;
207
208 /* DOM_RID4 - rid + user attributes */
209 typedef struct domrid4_info
210 {
211   uint32 unknown;      
212   uint16 attr;
213   uint32 rid;  /* user RID */
214
215 } DOM_RID4;
216
217 /* DOM_CLNT_SRV - client / server names */
218 typedef struct clnt_srv_info
219 {
220   uint32  undoc_buffer; /* undocumented 32 bit buffer pointer */
221   UNISTR2 uni_logon_srv; /* logon server name */
222   uint32  undoc_buffer2; /* undocumented 32 bit buffer pointer */
223   UNISTR2 uni_comp_name; /* client machine name */
224
225 } DOM_CLNT_SRV;
226
227 /* DOM_LOG_INFO - login info */
228 typedef struct log_info
229 {
230   uint32  undoc_buffer; /* undocumented 32 bit buffer pointer */
231   UNISTR2 uni_logon_srv; /* logon server name */
232   UNISTR2 uni_acct_name; /* account name */
233   uint16  sec_chan;      /* secure channel type */
234   UNISTR2 uni_comp_name; /* client machine name */
235
236 } DOM_LOG_INFO;
237
238 /* DOM_CLNT_INFO - client info */
239 typedef struct clnt_info
240 {
241   DOM_LOG_INFO login;
242   DOM_CRED     cred;
243
244 } DOM_CLNT_INFO;
245
246 /* DOM_CLNT_INFO2 - client info */
247 typedef struct clnt_info2
248 {
249   DOM_CLNT_SRV login;
250   uint32        ptr_cred;
251   DOM_CRED      cred;
252
253 } DOM_CLNT_INFO2;
254
255 /* DOM_LOGON_ID - logon id */
256 typedef struct logon_info
257 {
258   uint32 low;
259   uint32 high;
260
261 } DOM_LOGON_ID;
262
263 /* OWF INFO */
264 typedef struct owf_info
265 {
266   uint8 data[16];
267
268 } OWF_INFO;
269
270
271 /* DOM_GID - group id + user attributes */
272 typedef struct gid_info
273 {
274   uint32 g_rid;  /* a group RID */
275   uint32 attr;
276
277 } DOM_GID;
278
279 #define POL_HND_SIZE 20
280
281 /* POLICY_HND */
282 typedef struct lsa_policy_info
283 {
284   uint8 data[POL_HND_SIZE]; /* policy handle */
285
286 } POLICY_HND;
287
288 #endif /* _RPC_MISC_H */
289