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 _NT_DOMAIN_H /* _NT_DOMAIN_H */
31 /* dce/rpc authentication support */
32 #include "rpc_ntlmssp.h"
33 #include "rpc_netsec.h"
35 /* miscellaneous structures / defines */
38 /* security descriptor structures */
39 #include "rpc_secdes.h"
41 /* different dce/rpc pipes */
43 #include "rpc_netlogon.h"
45 #include "rpc_srvsvc.h"
46 #include "rpc_svcctl.h"
47 #include "rpc_wkssvc.h"
48 #include "rpc_atsvc.h"
49 #include "rpc_eventlog.h"
52 /* MS AD prototypes */
56 * A bunch of stuff that was put into smb.h
57 * in the NTDOM branch - it didn't belong there.
60 #define CHECK_STRUCT(data) \
62 if ((data)->struct_start != 0xfefefefe || \
63 (data)->struct_end != 0xdcdcdcdc) \
65 DEBUG(0,("uninitialised structure (%s, %d)\n", \
66 FUNCTION_MACRO, __LINE__)); \
71 typedef struct parse_struct
75 char *data
; /* memory buffer */
76 size_t data_size
; /* current memory buffer size */
77 /* array memory offsets */
81 uint32 offset
; /* offset currently being accessed in memory buffer */
82 uint8 align
; /* data alignment */
83 BOOL io
; /* parsing in or out of data stream */
84 BOOL error
; /* error occurred while parsing (out of memory bounds) */
85 BOOL bigendian
; /* big-endian data */
87 struct parse_struct
*next
;
95 * Defines for io member of prs_struct.
101 #define MARSHALLING(ps) (!(ps)->io)
102 #define UNMARSHALLING(ps) ((ps)->io)
104 #include "rpc_spoolss.h"
106 typedef struct netsec_auth_struct
108 RPC_AUTH_NETSEC_NEG netsec_neg
;
116 typedef struct ntlmssp_auth_struct
118 RPC_AUTH_NTLMSSP_CHAL ntlmssp_chal
;
120 unsigned char ntlmssp_hash
[258];
121 uint32 ntlmssp_seq_num
;
128 typedef struct rpcsrv_struct
130 prs_struct data_i
; /* input data (intermediate, for fragments) */
131 prs_struct rdata
; /* output data (to create fragments from */
133 /* indicates how far in rdata we have got, creating fragments */
140 struct srv_auth_fns
*auth
;
142 /* set of authentication modules. does not include noauth */
144 struct srv_auth_fns
**auth_fns
;
147 BOOL faulted_once_before
;
155 vuser_key initial_pipe_key
;
162 struct cli_connection
;
164 typedef struct cli_auth_fns
166 /* these three will do for now. they *should* match with server-side */
167 BOOL (*create_bind_req
) (struct cli_connection
*, prs_struct
*,
168 uint32
, RPC_IFACE
*, RPC_IFACE
*);
169 BOOL (*decode_bind_resp
) (struct cli_connection
*, prs_struct
*);
170 BOOL (*create_bind_cont
) (struct cli_connection
*, prs_struct
*,
172 /* creates an authenticated PDU */
173 BOOL (*cli_create_pdu
) (struct cli_connection
*, uint8
,
174 prs_struct
*, int, int *,
175 prs_struct
*, uint8
*);
176 /* decodes an authenticated PDU */
177 BOOL (*cli_decode_pdu
) (struct cli_connection
*, prs_struct
*,
183 typedef struct srv_auth_fns
185 BOOL (*api_is_auth
) (RPC_HDR_AUTH
*, void **auth_info
);
187 /* state-based authentication: one to decode, one to generate */
188 BOOL (*api_auth_chk
) (rpcsrv_struct
*, enum RPC_PKT_TYPE
);
189 BOOL (*api_auth_gen
) (rpcsrv_struct
*, prs_struct
*,
192 /* decodes an authenticated PDU */
193 BOOL (*api_decode_pdu
) (rpcsrv_struct
*);
194 /* creates an authenticated PDU */
195 BOOL (*api_create_pdu
) (rpcsrv_struct
*, uint32
, prs_struct
*);
200 typedef struct pipes_struct
202 struct pipes_struct
*next
, *prev
;
208 fstring pipe_srv_name
;
210 /* remote, server-side rpc redirection */
211 struct msrpc_local
*m
;
213 /* local, server-side rpc state processing */
219 typedef struct msrpc_service_fns
221 void (*auth_init
) (rpcsrv_struct
*);
222 void (*service_init
) (char *);
223 BOOL (*reload_services
) (BOOL
);
224 int (*main_init
) (int, char *[]);
234 BOOL (*fn
) (prs_struct
*, prs_struct
*);
239 fstring acct_name
; /* account name */
240 fstring acct_desc
; /* account description */
241 uint32 rid
; /* domain-relative RID */
245 * higher order functions for use with msrpc client code
248 #define ALIAS_FN(fn)\
249 void (*fn)(const char*, const DOM_SID*, uint32, const char*)
250 #define ALIAS_INFO_FN(fn)\
251 void (*fn)(const char*, const DOM_SID*, uint32, ALIAS_INFO_CTR *const)
252 #define ALIAS_MEM_FN(fn)\
253 void(*fn)(const char*, const DOM_SID*, uint32, const char*,\
254 uint32, DOM_SID *const *const, char *const *const,\
257 #define GROUP_FN(fn)\
258 void (*fn)(const char*, const DOM_SID*, uint32, const char*)
259 #define GROUP_INFO_FN(fn)\
260 void (*fn)(const char*, const DOM_SID*, uint32, GROUP_INFO_CTR *const)
261 #define GROUP_MEM_FN(fn)\
262 void(*fn)(const char*, const DOM_SID*, uint32, const char*,\
263 uint32, const uint32*, char *const *const,\
266 #define DOMAIN_FN(fn)\
267 void (*fn)(const char*)
268 #define DOMAIN_INFO_FN(fn)\
269 void (*fn)(const char*, const DOM_SID *, uint32, SAM_UNK_CTR *)
272 void (*fn)(const char*, const DOM_SID*, uint32, const char*)
273 #define USER_INFO_FN(fn)\
274 void (*fn)(const char*, const DOM_SID*, uint32, \
275 SAM_USERINFO_CTR *const)
276 #define USER_MEM_FN(fn)\
277 void (*fn)(const char*, const DOM_SID*, uint32, const char*,\
278 uint32, const uint32*, char *const *const, uint32* const)
281 void (*fn)(const char*, const DOM_SID*, uint16, uint32, \
285 void (*fn)(int, const char *, int)
286 #define REG_KEY_FN(fn)\
287 void (*fn)(const char*, const char*, time_t)
288 #define REG_VAL_FN(fn)\
289 void (*fn)(const char *, const char*, uint32, const BUFFER2 *)
291 #define SVC_QUERY_FN(fn)\
292 void (*fn)(const QUERY_SERVICE_CONFIG *)
293 #define SVC_INFO_FN(fn)\
294 void (*fn)(const ENUM_SRVC_STATUS *)
296 #define TPRT_INFO_FN(fn)\
297 void (*fn)(const SRV_TPRT_INFO_CTR *)
299 #define PRINT_INFO_FN(fn)\
300 void (*fn)(const char*, uint32, uint32, void *const *const)
301 #define JOB_INFO_FN(fn)\
302 void (*fn)(const char*, const char*, uint32, uint32, void *const *const)
304 #endif /* _NT_DOMAIN_H */