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 */
2019-02-27 16:01:11 +03:00
# include "librpc/rpc/dcesrv_core.h"
2011-05-02 15:19:51 +04:00
struct pipes_struct ;
2019-02-18 20:25:48 +03:00
struct auth_session_info ;
2019-01-25 11:50:15 +03:00
struct cli_credentials ;
2011-05-02 15:19:51 +04:00
2019-12-05 13:45:54 +03:00
typedef void ( * dcerpc_ncacn_termination_fn ) ( struct dcesrv_connection * ,
void * ) ;
2011-03-14 14:29:49 +03:00
2019-02-18 20:25:48 +03:00
struct dcerpc_ncacn_conn {
int sock ;
struct pipes_struct * p ;
2019-02-18 20:48:57 +03:00
dcerpc_ncacn_termination_fn termination_fn ;
void * termination_data ;
2019-02-18 20:25:48 +03:00
struct tevent_context * ev_ctx ;
struct messaging_context * msg_ctx ;
2019-02-28 01:44:16 +03:00
struct dcesrv_context * dce_ctx ;
struct dcesrv_endpoint * endpoint ;
2019-02-18 20:25:48 +03:00
struct tstream_context * tstream ;
struct tsocket_address * remote_client_addr ;
char * remote_client_name ;
struct tsocket_address * local_server_addr ;
char * local_server_name ;
struct auth_session_info * session_info ;
} ;
2019-02-18 21:31:04 +03:00
NTSTATUS dcerpc_ncacn_conn_init ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev_ctx ,
struct messaging_context * msg_ctx ,
2019-02-28 01:44:16 +03:00
struct dcesrv_context * dce_ctx ,
struct dcesrv_endpoint * endpoint ,
2019-02-18 21:31:04 +03:00
dcerpc_ncacn_termination_fn term_fn ,
void * termination_data ,
struct dcerpc_ncacn_conn * * out ) ;
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 ) ;
2021-01-12 19:53:57 +03:00
2021-01-12 18:48:25 +03:00
struct dcerpc_ncacn_listen_state ;
int dcesrv_setup_ncacn_listener (
TALLOC_CTX * mem_ctx ,
struct dcesrv_context * dce_ctx ,
struct tevent_context * ev_ctx ,
struct messaging_context * msg_ctx ,
struct dcesrv_endpoint * e ,
int * fd ,
dcerpc_ncacn_termination_fn term_fn ,
void * termination_data ,
struct dcerpc_ncacn_listen_state * * listen_state ) ;
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 ,
2019-02-27 22:21:44 +03:00
struct dcesrv_context * dce_ctx ,
struct dcesrv_endpoint * e ,
2021-01-12 11:26:24 +03:00
struct tsocket_address * * cli_addr ,
struct tsocket_address * * srv_addr ,
2011-07-20 18:26:48 +04:00
int s ,
2019-02-18 20:48:57 +03:00
dcerpc_ncacn_termination_fn termination_fn ,
void * termination_data ) ;
2011-07-20 18:26:48 +04:00
2021-01-29 20:16:08 +03:00
NTSTATUS dcesrv_auth_gensec_prepare (
TALLOC_CTX * mem_ctx ,
struct dcesrv_call_state * call ,
struct gensec_security * * out ,
void * private_data ) ;
void dcesrv_log_successful_authz (
struct dcesrv_call_state * call ,
void * private_data ) ;
NTSTATUS dcesrv_assoc_group_find (
struct dcesrv_call_state * call ,
void * private_data ) ;
2019-01-25 11:50:15 +03:00
2019-02-27 23:36:22 +03:00
NTSTATUS dcesrv_endpoint_by_ncacn_np_name ( struct dcesrv_context * dce_ctx ,
const char * endpoint ,
struct dcesrv_endpoint * * out ) ;
2019-02-28 01:28:25 +03:00
struct pipes_struct * dcesrv_get_pipes_struct ( struct dcesrv_connection * conn ) ;
2019-12-05 13:45:54 +03:00
void dcesrv_transport_terminate_connection ( struct dcesrv_connection * dce_conn ,
const char * reason ) ;
2010-07-17 23:22:26 +04:00
# endif /* _PRC_SERVER_H_ */