winbindd: assert wb_parent_idmap_setup_send/recv() was called before idmap_child_handle()
[Samba.git] / source3 / rpc_server / rpc_pipes.h
blob1d59d2dd82037ada8cb01f42dbeec71abc67ef82
1 /*
2 Unix SMB/Netbios implementation.
3 RPC Server Headers
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/>.
24 #ifndef _RPC_PIPES_H_
25 #define _RPC_PIPES_H_
27 #include "librpc/rpc/dcerpc.h"
29 struct dcesrv_ep_entry_list;
30 struct tsocket_address;
31 struct pipes_struct;
32 struct dcesrv_context;
35 * DCE/RPC-specific samba-internal-specific handling of data on
36 * NamedPipes.
38 struct pipes_struct {
39 struct pipes_struct *next, *prev;
41 const struct tsocket_address *local_address;
42 const struct tsocket_address *remote_address;
44 enum dcerpc_transport_t transport;
46 struct auth_session_info *session_info;
47 struct messaging_context *msg_ctx;
49 struct dcesrv_ep_entry_list *ep_entries;
51 struct pipe_auth_data auth;
54 * Set to true when an RPC bind has been done on this pipe.
56 bool pipe_bound;
59 * Set the DCERPC_FAULT to return.
61 int fault_state;
63 /* This context is used for PDU data and is freed between each pdu.
64 Don't use for pipe state storage. */
65 TALLOC_CTX *mem_ctx;
67 /* handle database to use on this pipe. */
68 struct dcesrv_call_state *dce_call;
70 /* call id retrieved from the pdu header */
71 uint32_t call_id;
73 /* operation number retrieved from the rpc header */
74 uint16_t opnum;
76 /* private data for the interface implementation */
77 void *private_data;
81 int make_base_pipes_struct(TALLOC_CTX *mem_ctx,
82 struct messaging_context *msg_ctx,
83 const char *pipe_name,
84 enum dcerpc_transport_t transport,
85 const struct tsocket_address *remote_address,
86 const struct tsocket_address *local_address,
87 struct pipes_struct **_p);
89 bool check_open_pipes(void);
90 size_t num_pipe_handles(void);
92 bool create_policy_hnd(struct pipes_struct *p,
93 struct policy_handle *hnd,
94 uint8_t handle_type,
95 void *data_ptr);
97 void *_find_policy_by_hnd(struct pipes_struct *p,
98 const struct policy_handle *hnd,
99 uint8_t handle_type,
100 NTSTATUS *pstatus);
101 #define find_policy_by_hnd(_p, _hnd, _hnd_type, _type, _pstatus) \
102 (_type *)_find_policy_by_hnd((_p), (_hnd), (_hnd_type), (_pstatus));
104 bool close_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd);
105 void close_policy_by_pipe(struct pipes_struct *p);
106 bool pipe_access_check(struct pipes_struct *p);
108 #endif /* _RPC_PIPES_H_ */