2 Unix SMB/Netbios implementation.
4 Copyright (C) Andrew Tridgell 1992-1997
5 Copyright (C) Luke Kenneth Casson Leighton 1996-1997
6 Copyright (C) Paul Ashton 1997
7 Copyright (C) Jeremy Allison 2000-2004
8 Copyright (C) Simo Sorce 2010-2011
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
27 #include "librpc/rpc/dcerpc.h"
29 struct dcesrv_ep_entry_list;
30 struct tsocket_address;
36 struct pipe_rpc_fns *next, *prev;
38 /* RPC function table associated with the current rpc_bind (associated by context) */
41 struct ndr_syntax_id syntax;
44 * shall we allow "connect" auth level for this interface ?
49 * minimal required auth level
51 enum dcerpc_AuthLevel min_auth_level;
55 * DCE/RPC-specific samba-internal-specific handling of data on
59 struct pipes_struct *next, *prev;
61 const struct tsocket_address *local_address;
62 const struct tsocket_address *remote_address;
64 enum dcerpc_transport_t transport;
66 struct auth_session_info *session_info;
67 struct messaging_context *msg_ctx;
69 struct dcesrv_ep_entry_list *ep_entries;
71 /* linked list of rpc dispatch tables associated
72 with the open rpc contexts */
74 struct pipe_rpc_fns *contexts;
76 struct pipe_auth_data auth;
79 * Set to true when an RPC bind has been done on this pipe.
84 * Set the DCERPC_FAULT to return.
89 * Set to RPC_BIG_ENDIAN when dealing with big-endian PDU's
93 /* This context is used for PDU data and is freed between each pdu.
94 Don't use for pipe state storage. */
97 /* handle database to use on this pipe. */
98 struct handle_list *pipe_handles;
100 /* call id retrieved from the pdu header */
103 /* operation number retrieved from the rpc header */
106 /* private data for the interface implementation */
111 int make_base_pipes_struct(TALLOC_CTX *mem_ctx,
112 struct messaging_context *msg_ctx,
113 const char *pipe_name,
114 enum dcerpc_transport_t transport,
116 const struct tsocket_address *remote_address,
117 const struct tsocket_address *local_address,
118 struct pipes_struct **_p);
119 bool check_open_pipes(void);
120 int close_internal_rpc_pipe_hnd(struct pipes_struct *p);
122 size_t num_pipe_handles(struct pipes_struct *p);
123 bool init_pipe_handles(struct pipes_struct *p, const struct ndr_syntax_id *syntax);
124 bool create_policy_hnd(struct pipes_struct *p,
125 struct policy_handle *hnd,
128 bool find_policy_by_hnd(struct pipes_struct *p, const struct policy_handle *hnd,
130 bool close_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd);
131 void close_policy_by_pipe(struct pipes_struct *p);
132 bool pipe_access_check(struct pipes_struct *p);
134 void *_policy_handle_create(struct pipes_struct *p,
135 struct policy_handle *hnd,
137 uint32_t access_granted,
141 #define policy_handle_create(_p, _hnd, _hnd_type, _access, _type, _pstatus) \
142 (_type *)_policy_handle_create((_p), (_hnd), (_hnd_type), (_access), sizeof(_type), #_type, \
145 void *_policy_handle_find(struct pipes_struct *p,
146 const struct policy_handle *hnd,
147 uint32_t access_required, uint32_t *paccess_granted,
148 const char *name, const char *location,
150 #define policy_handle_find(_p, _hnd, _access_required, _access_granted, _type, _pstatus) \
151 (_type *)_policy_handle_find((_p), (_hnd), (_access_required), \
152 (_access_granted), #_type, __location__, (_pstatus))
154 #endif /* _RPC_PIPES_H_ */