2010-07-17 23:22:26 +04:00
/*
2010-06-18 19:00:38 +04:00
* RPC Server helper headers
2010-07-17 23:22:26 +04:00
* Almost completely rewritten by ( C ) Jeremy Allison 2005 - 2010
* Copyright ( C ) Simo Sorce < idra @ samba . org > - 2010
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , see < http : //www.gnu.org/licenses/>.
*/
# ifndef _RPC_SERVER_H_
# define _RPC_SERVER_H_
2019-03-15 16:31:57 +03:00
# include "librpc/rpc/rpc_common.h" /* For enum dcerpc_transport_t */
2011-05-02 15:19:51 +04:00
struct pipes_struct ;
2011-03-14 14:29:49 +03:00
typedef bool ( * dcerpc_ncacn_disconnect_fn ) ( struct pipes_struct * p ) ;
2011-04-26 01:24:15 +04:00
typedef void ( named_pipe_termination_fn ) ( void * private_data ) ;
2011-03-14 14:29:49 +03:00
2013-09-25 13:34:56 +04:00
struct named_pipe_client {
const char * pipe_name ;
struct tevent_context * ev ;
struct messaging_context * msg_ctx ;
uint16_t file_type ;
uint16_t device_state ;
uint64_t allocation_size ;
struct tstream_context * tstream ;
2017-03-10 02:33:06 +03:00
struct tsocket_address * remote_client_addr ;
char * remote_client_name ;
struct tsocket_address * local_server_addr ;
char * local_server_name ;
2013-09-25 13:34:56 +04:00
struct auth_session_info * session_info ;
struct pipes_struct * p ;
struct tevent_queue * write_queue ;
struct iovec * iov ;
size_t count ;
named_pipe_termination_fn * term_fn ;
void * private_data ;
} ;
struct named_pipe_client * named_pipe_client_init ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev_ctx ,
struct messaging_context * msg_ctx ,
const char * pipe_name ,
named_pipe_termination_fn * term_fn ,
uint16_t file_type ,
uint16_t device_state ,
uint64_t allocation_size ,
void * private_data ) ;
2013-09-25 18:33:00 +04:00
int make_server_pipes_struct ( TALLOC_CTX * mem_ctx ,
struct messaging_context * msg_ctx ,
const char * pipe_name ,
enum dcerpc_transport_t transport ,
const struct tsocket_address * remote_address ,
2017-03-10 02:38:33 +03:00
const struct tsocket_address * local_address ,
2019-03-20 15:50:03 +03:00
struct auth_session_info * * session_info ,
2013-09-25 18:33:00 +04:00
struct pipes_struct * * _p ,
int * perrno ) ;
2010-07-28 11:46:43 +04:00
void set_incoming_fault ( struct pipes_struct * p ) ;
2013-12-10 16:59:06 +04:00
void process_complete_pdu ( struct pipes_struct * p , struct ncacn_packet * pkt ) ;
2019-06-04 16:15:11 +03:00
NTSTATUS dcesrv_create_ncacn_np_socket ( const char * pipe_name , int * out_fd ) ;
2019-06-04 16:34:11 +03:00
bool dcesrv_setup_ncacn_np_socket ( const char * pipe_name ,
struct tevent_context * ev_ctx ,
struct messaging_context * msg_ctx ) ;
2011-04-21 23:05:12 +04:00
void named_pipe_accept_function ( struct tevent_context * ev_ctx ,
struct messaging_context * msg_ctx ,
2011-04-26 01:24:15 +04:00
const char * pipe_name , int fd ,
named_pipe_termination_fn * term_fn ,
void * private_data ) ;
2013-09-25 12:25:39 +04:00
void named_pipe_packet_process ( struct tevent_req * subreq ) ;
2010-07-17 23:22:26 +04:00
2011-02-14 12:29:14 +03:00
uint16_t setup_dcerpc_ncacn_tcpip_socket ( struct tevent_context * ev_ctx ,
struct messaging_context * msg_ctx ,
const struct sockaddr_storage * ifss ,
uint16_t port ) ;
2019-06-04 15:17:03 +03:00
NTSTATUS dcesrv_create_ncalrpc_socket ( const char * name , int * out_fd ) ;
2011-02-23 17:38:14 +03:00
bool setup_dcerpc_ncalrpc_socket ( struct tevent_context * ev_ctx ,
struct messaging_context * msg_ctx ,
2011-03-14 14:29:49 +03:00
const char * name ,
dcerpc_ncacn_disconnect_fn fn ) ;
2011-02-23 17:38:14 +03:00
2011-07-20 18:26:48 +04:00
void dcerpc_ncacn_accept ( struct tevent_context * ev_ctx ,
struct messaging_context * msg_ctx ,
enum dcerpc_transport_t transport ,
const char * name ,
struct tsocket_address * cli_addr ,
struct tsocket_address * srv_addr ,
int s ,
dcerpc_ncacn_disconnect_fn fn ) ;
2010-07-17 23:22:26 +04:00
# endif /* _PRC_SERVER_H_ */