2 Unix SMB/Netbios implementation.
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_MISC_H /* _RPC_MISC_H */
28 * macros to wrap prs_xxxx routines.
30 #define prs_uint8(name, ps, depth, data8) \
31 if (!_prs_uint8(name, ps, depth, data8)) \
36 #define prs_uint16(name, ps, depth, data16) \
37 if (!_prs_uint16(name, ps, depth, data16)) \
42 #define prs_hash1(x_ps, x_offset, x_sess_key) \
43 if (!_prs_hash1(x_ps, x_offset, x_sess_key)) \
48 #define prs_uint32(name, ps, depth, data32) \
49 if (!_prs_uint32(name, ps, depth, data32)) \
54 #define prs_uint8s(charmode, name, ps, depth, data8s, len) \
55 if (!_prs_uint8s(charmode, name, ps, depth, data8s, len)) \
60 #define prs_uint16s(charmode, name, ps, depth, data16s, len) \
61 if (!_prs_uint16s(charmode, name, ps, depth, data16s, len)) \
66 #define prs_uint32s(charmode, name, ps, depth, data32s, len) \
67 if (!_prs_uint32s(charmode, name, ps, depth, data32s, len)) \
72 #define prs_buffer2(charmode, name, ps, depth, str) \
73 if (!_prs_buffer2(charmode, name, ps, depth, str)) \
78 #define prs_string2(charmode, name, ps, depth, str) \
79 if (!_prs_string2(charmode, name, ps, depth, str)) \
84 #define prs_unistr2(charmode, name, ps, depth, str) \
85 if (!_prs_unistr2(charmode, name, ps, depth, str)) \
90 #define prs_unistr3(charmode, name, str, ps, depth) \
91 if (!_prs_unistr3(charmode, name, str, ps, depth)) \
96 #define prs_unistr(name, ps, depth, str) \
97 if (!_prs_unistr(name, ps, depth, str)) \
102 #define prs_string(name, ps, depth, str, len, max_buf_size) \
103 if (!_prs_string(name, ps, depth, str, len, max_buf_size)) \
108 #define prs_uint16_pre(x_name, x_ps, x_depth, x_data16, x_offset) \
109 if (!_prs_uint16_pre(x_name, x_ps, x_depth, x_data16, x_offset)) \
114 #define prs_uint16_post(name, ps, depth, data16, ptr_uint16, data_size) \
115 if (!_prs_uint16_post(name, ps, depth, data16, ptr_uint16, data_size)) \
120 #define prs_uint32_pre(x_name, x_ps, x_depth, x_data32, x_offset) \
121 if (!_prs_uint32_pre(x_name, x_ps, x_depth, x_data32, x_offset)) \
126 #define prs_uint32_post(name, ps, depth, data32, ptr_uint32, data_size) \
127 if (!_prs_uint32_post(name, ps, depth, data32, ptr_uint32, data_size)) \
135 /* well-known RIDs - Relative IDs */
137 /* RIDs - Well-known users ... */
138 #define DOMAIN_USER_RID_ADMIN (0x000001F4L)
139 #define DOMAIN_USER_RID_GUEST (0x000001F5L)
141 /* RIDs - well-known groups ... */
142 #define DOMAIN_GROUP_RID_ADMINS (0x00000200L)
143 #define DOMAIN_GROUP_RID_USERS (0x00000201L)
144 #define DOMAIN_GROUP_RID_GUESTS (0x00000202L)
146 /* RIDs - well-known aliases ... */
147 #define BUILTIN_ALIAS_RID_ADMINS (0x00000220L)
148 #define BUILTIN_ALIAS_RID_USERS (0x00000221L)
149 #define BUILTIN_ALIAS_RID_GUESTS (0x00000222L)
150 #define BUILTIN_ALIAS_RID_POWER_USERS (0x00000223L)
151 #define BUILTIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L)
152 #define BUILTIN_ALIAS_RID_SYSTEM_OPS (0x00000225L)
153 #define BUILTIN_ALIAS_RID_PRINT_OPS (0x00000226L)
154 #define BUILTIN_ALIAS_RID_BACKUP_OPS (0x00000227L)
155 #define BUILTIN_ALIAS_RID_REPLICATOR (0x00000228L)
158 * Masks for mappings between unix uid and gid types and
162 /* Take the bottom bits. */
163 #define RID_TYPE_MASK 2
164 #define RID_MULTIPLIER 4
166 /* The three common types. */
167 #define RID_TYPE_USER 0
168 #define RID_TYPE_GROUP 1
169 #define RID_TYPE_ALIAS 2
171 /* BIGINT - NT-style 64-bit integer */
172 typedef struct bigint_info
181 typedef struct enum_hnd_info
183 uint32 ptr_hnd; /* pointer to enumeration handle */
184 uint32 handle; /* enumeration handle */
188 /* LOOKUP_LEVEL - switch value */
189 typedef struct lookup_level_info
195 /* DOM_SID2 - security id */
196 typedef struct sid_info_2
198 uint32 num_auths; /* length, bytes, including length of len :-) */
204 /* STRHDR - string header */
205 typedef struct header_info
209 uint32 buffer; /* non-zero */
213 /* STRHDR2 - string header, 32-bit lengths */
214 typedef struct header2_info
222 /* UNIHDR - unicode string header */
223 typedef struct unihdr_info
227 uint32 buffer; /* usually has a value of 4 */
231 /* UNIHDR2 - unicode string header and undocumented buffer */
232 typedef struct unihdr2_info
235 uint32 buffer; /* 32 bit buffer pointer */
239 /* clueless as to what maximum length should be */
240 #define MAX_UNISTRLEN 256
241 #define MAX_STRINGLEN 256
242 #define MAX_BUFFERLEN 512
244 /* UNISTR - unicode string size and buffer */
245 typedef struct unistr_info
247 uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. ***MUST*** be null-terminated */
251 /* BUFHDR - buffer header */
252 typedef struct bufhdr_info
259 /* BUFHDR2 - another buffer header, with info level */
260 typedef struct bufhdr2_info
263 uint32 length; /* uint8 chars */
268 /* BUFFER2 - unicode string, size (in uint8 ascii chars) and buffer */
269 /* pathetic. some stupid team of \PIPE\winreg writers got the concept */
270 /* of a unicode string different from the other \PIPE\ writers */
271 typedef struct buffer2_info
276 uint8 buffer[MAX_UNISTRLEN];
281 typedef struct buffer3_info
284 uint8 buffer[MAX_BUFFERLEN]; /* data */
289 /* BUFFER4 - simple length and buffer */
290 typedef struct buffer4_info
293 uint8 buffer[MAX_BUFFERLEN];
298 typedef struct buffer5_info
301 uint16 *buffer; /* data */
304 /* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */
305 typedef struct unistr2_info
310 uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */
314 /* STRING2 - string size (in uint8 chars) and buffer */
315 typedef struct string2_info
320 uint8 buffer[MAX_STRINGLEN]; /* uint8 characters. **NOT** necessarily null-terminated */
324 /* UNISTR3 - XXXX not sure about this structure */
325 typedef struct unistr3_info
333 /* DOM_RID2 - domain RID structure for ntlsa pipe */
334 typedef struct domrid2_info
336 uint8 type; /* value is SID_NAME_USE enum */
338 uint32 rid_idx; /* referenced domain index */
342 /* DOM_RID3 - domain RID structure for samr pipe */
343 typedef struct domrid3_info
345 uint32 rid; /* domain-relative (to a SID) id */
346 uint32 type1; /* value is 0x1 */
347 uint32 ptr_type; /* undocumented pointer */
348 uint32 type2; /* value is 0x1 */
349 uint32 unk; /* value is 0x2 */
353 /* DOM_CLNT_SRV - client / server names */
354 typedef struct clnt_srv_info
356 uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */
357 UNISTR2 uni_logon_srv; /* logon server name */
358 uint32 undoc_buffer2; /* undocumented 32 bit buffer pointer */
359 UNISTR2 uni_comp_name; /* client machine name */
363 /* DOM_LOG_INFO - login info */
364 typedef struct log_info
366 uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */
367 UNISTR2 uni_logon_srv; /* logon server name */
368 UNISTR2 uni_acct_name; /* account name */
369 uint16 sec_chan; /* secure channel type */
370 UNISTR2 uni_comp_name; /* client machine name */
374 /* DOM_CLNT_INFO - client info */
375 typedef struct clnt_info
382 /* DOM_CLNT_INFO2 - client info */
383 typedef struct clnt_info2
391 /* DOM_LOGON_ID - logon id */
392 typedef struct logon_info
400 typedef struct owf_info
407 /* DOM_GID - group id + user attributes */
408 typedef struct gid_info
410 uint32 g_rid; /* a group RID */
415 #define POL_HND_SIZE 20
418 typedef struct lsa_policy_info
420 uint8 data[POL_HND_SIZE]; /* policy handle */
424 #endif /* _RPC_MISC_H */