2003-11-03 06:22:45 +00:00
/*
Unix SMB / CIFS implementation .
2005-01-09 08:34:05 +00:00
DCERPC client side interface structures
2003-11-03 06:22:45 +00:00
Copyright ( C ) Tim Potter 2003
2005-01-09 08:34:05 +00:00
Copyright ( C ) Andrew Tridgell 2003 - 2005
2003-11-03 06:22:45 +00:00
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
2007-07-10 02:07:03 +00:00
the Free Software Foundation ; either version 3 of the License , or
2003-11-03 06:22:45 +00:00
( 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
2007-07-10 02:07:03 +00:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2003-11-03 06:22:45 +00:00
*/
2008-04-01 16:18:31 +02:00
/* This is a public header file that is installed as part of Samba.
* If you remove any functions or change their signature , update
* the so version number . */
2006-01-03 13:41:17 +00:00
# ifndef __DCERPC_H__
# define __DCERPC_H__
2008-10-11 21:05:38 +02:00
# include "../lib/util/data_blob.h"
2006-03-14 00:37:05 +00:00
# include "librpc/gen_ndr/dcerpc.h"
2008-10-31 16:15:08 +01:00
# include "../librpc/ndr/libndr.h"
2006-03-14 00:37:05 +00:00
2010-03-08 12:29:52 +01:00
struct tevent_context ;
struct tevent_req ;
struct dcerpc_binding_handle ;
2004-10-21 12:47:02 +00:00
enum dcerpc_transport_t {
2007-08-28 17:45:57 +00:00
NCA_UNKNOWN , NCACN_NP , NCACN_IP_TCP , NCACN_IP_UDP , NCACN_VNS_IPC ,
NCACN_VNS_SPP , NCACN_AT_DSP , NCADG_AT_DDP , NCALRPC , NCACN_UNIX_STREAM ,
2010-03-19 17:38:32 +01:00
NCADG_UNIX_DGRAM , NCACN_HTTP , NCADG_IPX , NCACN_SPX , NCACN_INTERNAL } ;
2003-11-03 06:22:45 +00:00
2004-02-10 10:22:12 +00:00
/*
this defines a generic security context for signed / sealed dcerpc pipes .
2003-11-03 06:22:45 +00:00
*/
2005-01-09 08:34:05 +00:00
struct dcerpc_connection ;
2008-11-02 02:05:48 +01:00
struct gensec_settings ;
2004-06-07 12:30:22 +00:00
struct dcerpc_security {
struct dcerpc_auth * auth_info ;
r1294: A nice, large, commit...
This implements gensec for Samba's server side, and brings gensec up
to the standards of a full subsystem.
This means that use of the subsystem is by gensec_* functions, not
function pointers in structures (this is internal). This causes
changes in all the existing gensec users.
Our RPC server no longer contains it's own generalised security
scheme, and now calls gensec directly.
Gensec has also taken over the role of auth/auth_ntlmssp.c
An important part of gensec, is the output of the 'session_info'
struct. This is now reference counted, so that we can correctly free
it when a pipe is closed, no matter if it was inherited, or created by
per-pipe authentication.
The schannel code is reworked, to be in the same file for client and
server.
ntlm_auth is reworked to use gensec.
The major problem with this code is the way it relies on subsystem
auto-initialisation. The primary reason for this commit now.is to
allow these problems to be looked at, and fixed.
There are problems with the new code:
- I've tested it with smbtorture, but currently don't have VMware and
valgrind working (this I'll fix soon).
- The SPNEGO code is client-only at this point.
- We still do not do kerberos.
Andrew Bartlett
(This used to be commit 07fd885fd488fd1051eacc905a2d4962f8a018ec)
2004-06-29 09:40:10 +00:00
struct gensec_security * generic_state ;
2004-09-11 15:11:36 +00:00
/* get the session key */
2005-01-09 08:34:05 +00:00
NTSTATUS ( * session_key ) ( struct dcerpc_connection * , DATA_BLOB * ) ;
2004-02-10 10:22:12 +00:00
} ;
2004-01-20 06:07:09 +00:00
2005-01-09 08:34:05 +00:00
/*
this holds the information that is not specific to a particular rpc context_id
*/
struct dcerpc_connection {
2004-05-25 16:24:13 +00:00
uint32_t call_id ;
uint32_t srv_max_xmit_frag ;
uint32_t srv_max_recv_frag ;
2006-01-03 13:41:17 +00:00
uint32_t flags ;
2004-06-07 12:30:22 +00:00
struct dcerpc_security security_state ;
2004-01-20 06:07:09 +00:00
const char * binding_string ;
2008-12-29 20:24:57 +01:00
struct tevent_context * event_ctx ;
2004-07-09 12:26:34 +00:00
2008-11-02 00:26:04 +01:00
/** Directory in which to save ndrdump-parseable files */
const char * packet_log_dir ;
2007-04-22 23:00:22 +00:00
bool dead ;
bool free_skipped ;
2003-11-24 11:45:33 +00:00
struct dcerpc_transport {
2004-01-20 06:07:09 +00:00
enum dcerpc_transport_t transport ;
2007-05-16 14:52:54 +00:00
void * private_data ;
2004-08-30 03:10:43 +00:00
2007-04-22 23:00:22 +00:00
NTSTATUS ( * shutdown_pipe ) ( struct dcerpc_connection * , NTSTATUS status ) ;
2004-08-30 03:10:43 +00:00
2005-01-09 08:34:05 +00:00
const char * ( * peer_name ) ( struct dcerpc_connection * ) ;
2004-08-30 03:10:43 +00:00
2006-03-25 11:39:09 +00:00
const char * ( * target_hostname ) ( struct dcerpc_connection * ) ;
2004-08-30 03:10:43 +00:00
/* send a request to the server */
2007-08-27 18:10:19 +00:00
NTSTATUS ( * send_request ) ( struct dcerpc_connection * , DATA_BLOB * , bool trigger_read ) ;
2004-08-30 03:10:43 +00:00
/* send a read request to the server */
2005-01-09 08:34:05 +00:00
NTSTATUS ( * send_read ) ( struct dcerpc_connection * ) ;
2004-08-30 03:10:43 +00:00
/* a callback to the dcerpc code when a full fragment
has been received */
2005-01-09 08:34:05 +00:00
void ( * recv_data ) ( struct dcerpc_connection * , DATA_BLOB * , NTSTATUS status ) ;
2003-11-24 11:45:33 +00:00
} transport ;
2003-11-27 04:02:15 +00:00
2005-11-02 05:34:17 +00:00
/* Requests that have been sent, waiting for a reply */
2004-08-30 03:10:43 +00:00
struct rpc_request * pending ;
2005-11-02 05:34:17 +00:00
/* Sync requests waiting to be shipped */
struct rpc_request * request_queue ;
2005-01-09 11:32:12 +00:00
/* the next context_id to be assigned */
uint32_t next_context_id ;
2003-11-03 06:22:45 +00:00
} ;
2005-01-09 08:34:05 +00:00
/*
this encapsulates a full dcerpc client side pipe
*/
struct dcerpc_pipe {
2010-08-05 18:14:04 +02:00
struct dcerpc_binding_handle * binding_handle ;
2005-01-09 08:34:05 +00:00
uint32_t context_id ;
2007-02-23 11:00:20 +00:00
uint32_t assoc_group_id ;
2007-08-18 06:57:49 +00:00
struct ndr_syntax_id syntax ;
struct ndr_syntax_id transfer_syntax ;
2005-01-09 08:34:05 +00:00
struct dcerpc_connection * conn ;
2006-01-12 09:33:49 +00:00
struct dcerpc_binding * binding ;
2005-01-09 08:34:05 +00:00
2008-11-02 00:26:04 +01:00
/** the last fault code from a DCERPC fault */
2005-01-09 08:34:05 +00:00
uint32_t last_fault_code ;
2005-06-12 02:42:40 +00:00
2008-11-02 00:26:04 +01:00
/** timeout for individual rpc requests, in seconds */
2006-01-03 13:41:17 +00:00
uint32_t request_timeout ;
2005-01-09 08:34:05 +00:00
} ;
2005-06-12 02:42:40 +00:00
/* default timeout for all rpc requests, in seconds */
# define DCERPC_REQUEST_TIMEOUT 60
2005-01-09 08:34:05 +00:00
2003-11-18 01:18:24 +00:00
/* dcerpc pipe flags */
2004-06-06 07:14:10 +00:00
# define DCERPC_DEBUG_PRINT_IN (1<<0)
# define DCERPC_DEBUG_PRINT_OUT (1<<1)
2003-11-18 01:18:24 +00:00
# define DCERPC_DEBUG_PRINT_BOTH (DCERPC_DEBUG_PRINT_IN | DCERPC_DEBUG_PRINT_OUT)
2004-06-06 07:14:10 +00:00
# define DCERPC_DEBUG_VALIDATE_IN (1<<2)
# define DCERPC_DEBUG_VALIDATE_OUT (1<<3)
2003-11-22 08:11:32 +00:00
# define DCERPC_DEBUG_VALIDATE_BOTH (DCERPC_DEBUG_VALIDATE_IN | DCERPC_DEBUG_VALIDATE_OUT)
2003-11-23 13:44:19 +00:00
2004-09-25 07:25:51 +00:00
# define DCERPC_CONNECT (1<<4)
# define DCERPC_SIGN (1<<5)
# define DCERPC_SEAL (1<<6)
2003-11-26 12:29:08 +00:00
2004-09-25 07:25:51 +00:00
# define DCERPC_PUSH_BIGENDIAN (1<<7)
# define DCERPC_PULL_BIGENDIAN (1<<8)
2003-12-16 09:02:58 +00:00
2005-05-01 19:29:00 +00:00
# define DCERPC_SCHANNEL (1<<9)
2004-06-06 07:14:10 +00:00
2009-06-18 12:33:46 +10:00
# define DCERPC_ANON_FALLBACK (1<<10)
2005-01-10 07:14:12 +00:00
/* use a 128 bit session key */
# define DCERPC_SCHANNEL_128 (1<<12)
2004-09-02 10:45:58 +00:00
/* check incoming pad bytes */
2004-09-25 07:25:51 +00:00
# define DCERPC_DEBUG_PAD_CHECK (1<<13)
2004-09-02 10:45:58 +00:00
2004-09-06 10:29:18 +00:00
/* set LIBNDR_FLAG_REF_ALLOC flag when decoding NDR */
2004-09-25 07:25:51 +00:00
# define DCERPC_NDR_REF_ALLOC (1<<14)
2004-09-06 10:29:18 +00:00
2006-05-04 10:03:41 +00:00
# define DCERPC_AUTH_OPTIONS (DCERPC_SEAL|DCERPC_SIGN|DCERPC_SCHANNEL|DCERPC_AUTH_SPNEGO|DCERPC_AUTH_KRB5|DCERPC_AUTH_NTLM)
2005-01-10 08:56:55 +00:00
2006-05-04 10:03:41 +00:00
/* select spnego auth */
2005-01-10 07:14:12 +00:00
# define DCERPC_AUTH_SPNEGO (1<<15)
2006-05-04 10:03:41 +00:00
/* select krb5 auth */
2005-01-24 14:44:15 +00:00
# define DCERPC_AUTH_KRB5 (1<<16)
2005-11-25 05:25:37 +00:00
# define DCERPC_SMB2 (1<<17)
2006-05-04 10:03:41 +00:00
/* select NTLM auth */
# define DCERPC_AUTH_NTLM (1<<18)
2007-02-23 11:00:20 +00:00
/* this triggers the DCERPC_PFC_FLAG_CONC_MPX flag in the bind request */
# define DCERPC_CONCURRENT_MULTIPLEX (1<<19)
2008-08-06 21:35:07 +02:00
/* this triggers the DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN flag in the bind request */
# define DCERPC_HEADER_SIGNING (1<<20)
2009-09-17 09:09:48 -07:00
/* use NDR64 transport */
# define DCERPC_NDR64 (1<<21)
2003-12-15 03:29:55 +00:00
/* this describes a binding to a particular transport/pipe */
struct dcerpc_binding {
enum dcerpc_transport_t transport ;
2007-08-18 06:57:49 +00:00
struct ndr_syntax_id object ;
2003-12-15 03:29:55 +00:00
const char * host ;
2006-10-13 13:01:48 +00:00
const char * target_hostname ;
2004-10-24 22:46:47 +00:00
const char * endpoint ;
2003-12-15 03:29:55 +00:00
const char * * options ;
2004-05-25 16:24:13 +00:00
uint32_t flags ;
2007-02-23 11:00:20 +00:00
uint32_t assoc_group_id ;
2003-12-15 03:29:55 +00:00
} ;
2004-08-30 03:10:43 +00:00
2005-12-06 08:58:21 +00:00
struct dcerpc_pipe_connect {
struct dcerpc_pipe * pipe ;
struct dcerpc_binding * binding ;
const char * pipe_name ;
2007-08-19 20:46:45 +00:00
const struct ndr_interface_table * interface ;
2005-12-06 08:58:21 +00:00
struct cli_credentials * creds ;
2007-12-10 18:41:19 +01:00
struct resolve_context * resolve_ctx ;
2005-12-06 08:58:21 +00:00
} ;
2004-08-30 03:10:43 +00:00
enum rpc_request_state {
2007-03-13 03:43:16 +00:00
RPC_REQUEST_QUEUED ,
2004-08-30 03:10:43 +00:00
RPC_REQUEST_PENDING ,
RPC_REQUEST_DONE
} ;
/*
handle for an async dcerpc request
*/
struct rpc_request {
struct rpc_request * next , * prev ;
struct dcerpc_pipe * p ;
NTSTATUS status ;
uint32_t call_id ;
enum rpc_request_state state ;
DATA_BLOB payload ;
2006-01-03 13:41:17 +00:00
uint32_t flags ;
2004-08-30 03:10:43 +00:00
uint32_t fault_code ;
2006-05-10 05:57:20 +00:00
/* this is used to distinguish bind and alter_context requests
from normal requests */
void ( * recv_handler ) ( struct rpc_request * conn ,
DATA_BLOB * blob , struct ncacn_packet * pkt ) ;
2005-11-02 05:34:17 +00:00
const struct GUID * object ;
uint16_t opnum ;
DATA_BLOB request_data ;
2007-08-27 18:10:19 +00:00
bool ignore_timeout ;
2005-11-02 05:34:17 +00:00
2004-08-30 03:10:43 +00:00
/* use by the ndr level async recv call */
2004-12-07 09:26:00 +00:00
struct {
2007-08-19 20:46:45 +00:00
const struct ndr_interface_table * table ;
2004-12-07 09:26:00 +00:00
uint32_t opnum ;
2004-08-30 03:10:43 +00:00
void * struct_ptr ;
TALLOC_CTX * mem_ctx ;
} ndr ;
2004-09-02 12:03:16 +00:00
struct {
void ( * callback ) ( struct rpc_request * ) ;
2007-05-16 14:52:54 +00:00
void * private_data ;
2004-09-02 12:03:16 +00:00
} async ;
2004-08-30 03:10:43 +00:00
} ;
2005-12-28 15:38:36 +00:00
2006-01-03 17:27:33 +00:00
struct epm_tower ;
struct epm_floor ;
2006-03-14 15:22:36 +00:00
struct smbcli_tree ;
struct smb2_tree ;
struct socket_address ;
2008-04-02 04:53:27 +02:00
NTSTATUS dcerpc_pipe_connect ( TALLOC_CTX * parent_ctx ,
struct dcerpc_pipe * * pp ,
const char * binding ,
const struct ndr_interface_table * table ,
struct cli_credentials * credentials ,
2008-12-29 20:24:57 +01:00
struct tevent_context * ev ,
2008-04-02 04:53:27 +02:00
struct loadparm_context * lp_ctx ) ;
NTSTATUS dcerpc_ndr_request_recv ( struct rpc_request * req ) ;
struct rpc_request * dcerpc_ndr_request_send ( struct dcerpc_pipe * p ,
const struct GUID * object ,
const struct ndr_interface_table * table ,
uint32_t opnum ,
2009-04-17 11:48:31 +02:00
bool async ,
2008-04-02 04:53:27 +02:00
TALLOC_CTX * mem_ctx ,
void * r ) ;
const char * dcerpc_server_name ( struct dcerpc_pipe * p ) ;
2010-05-09 17:20:01 +02:00
struct dcerpc_pipe * dcerpc_pipe_init ( TALLOC_CTX * mem_ctx , struct tevent_context * ev ) ;
2008-04-02 04:53:27 +02:00
NTSTATUS dcerpc_pipe_open_smb ( struct dcerpc_pipe * p ,
struct smbcli_tree * tree ,
const char * pipe_name ) ;
NTSTATUS dcerpc_bind_auth_none ( struct dcerpc_pipe * p ,
const struct ndr_interface_table * table ) ;
NTSTATUS dcerpc_fetch_session_key ( struct dcerpc_pipe * p ,
DATA_BLOB * session_key ) ;
struct composite_context ;
NTSTATUS dcerpc_secondary_connection_recv ( struct composite_context * c ,
struct dcerpc_pipe * * p2 ) ;
NTSTATUS dcerpc_parse_binding ( TALLOC_CTX * mem_ctx , const char * s , struct dcerpc_binding * * b_out ) ;
struct composite_context * dcerpc_pipe_connect_b_send ( TALLOC_CTX * parent_ctx ,
struct dcerpc_binding * binding ,
const struct ndr_interface_table * table ,
struct cli_credentials * credentials ,
2008-12-29 20:24:57 +01:00
struct tevent_context * ev ,
2008-04-02 04:53:27 +02:00
struct loadparm_context * lp_ctx ) ;
NTSTATUS dcerpc_pipe_connect_b_recv ( struct composite_context * c , TALLOC_CTX * mem_ctx ,
struct dcerpc_pipe * * p ) ;
NTSTATUS dcerpc_pipe_connect_b ( TALLOC_CTX * parent_ctx ,
struct dcerpc_pipe * * pp ,
struct dcerpc_binding * binding ,
const struct ndr_interface_table * table ,
struct cli_credentials * credentials ,
2008-12-29 20:24:57 +01:00
struct tevent_context * ev ,
2008-04-02 04:53:27 +02:00
struct loadparm_context * lp_ctx ) ;
const char * dcerpc_errstr ( TALLOC_CTX * mem_ctx , uint32_t fault_code ) ;
2010-03-20 11:31:55 +01:00
NTSTATUS dcerpc_fault_to_nt_status ( uint32_t fault_code ) ;
2008-04-02 04:53:27 +02:00
NTSTATUS dcerpc_pipe_auth ( TALLOC_CTX * mem_ctx ,
struct dcerpc_pipe * * p ,
struct dcerpc_binding * binding ,
const struct ndr_interface_table * table ,
struct cli_credentials * credentials ,
struct loadparm_context * lp_ctx ) ;
char * dcerpc_binding_string ( TALLOC_CTX * mem_ctx , const struct dcerpc_binding * b ) ;
NTSTATUS dcerpc_secondary_connection ( struct dcerpc_pipe * p ,
struct dcerpc_pipe * * p2 ,
struct dcerpc_binding * b ) ;
NTSTATUS dcerpc_bind_auth_schannel ( TALLOC_CTX * tmp_ctx ,
struct dcerpc_pipe * p ,
const struct ndr_interface_table * table ,
struct cli_credentials * credentials ,
struct loadparm_context * lp_ctx ,
uint8_t auth_level ) ;
2008-12-29 20:24:57 +01:00
struct tevent_context * dcerpc_event_context ( struct dcerpc_pipe * p ) ;
2008-11-02 17:04:22 +01:00
NTSTATUS dcerpc_init ( struct loadparm_context * lp_ctx ) ;
2008-04-02 04:53:27 +02:00
struct smbcli_tree * dcerpc_smb_tree ( struct dcerpc_connection * c ) ;
uint16_t dcerpc_smb_fnum ( struct dcerpc_connection * c ) ;
NTSTATUS dcerpc_secondary_context ( struct dcerpc_pipe * p ,
struct dcerpc_pipe * * pp2 ,
const struct ndr_interface_table * table ) ;
NTSTATUS dcerpc_alter_context ( struct dcerpc_pipe * p ,
TALLOC_CTX * mem_ctx ,
const struct ndr_syntax_id * syntax ,
const struct ndr_syntax_id * transfer_syntax ) ;
NTSTATUS dcerpc_bind_auth ( struct dcerpc_pipe * p ,
const struct ndr_interface_table * table ,
struct cli_credentials * credentials ,
2008-11-02 02:05:48 +01:00
struct gensec_settings * gensec_settings ,
2008-04-02 04:53:27 +02:00
uint8_t auth_type , uint8_t auth_level ,
const char * service ) ;
struct composite_context * dcerpc_pipe_connect_send ( TALLOC_CTX * parent_ctx ,
const char * binding ,
const struct ndr_interface_table * table ,
struct cli_credentials * credentials ,
2008-12-29 20:24:57 +01:00
struct tevent_context * ev , struct loadparm_context * lp_ctx ) ;
2008-04-02 04:53:27 +02:00
NTSTATUS dcerpc_pipe_connect_recv ( struct composite_context * c ,
TALLOC_CTX * mem_ctx ,
struct dcerpc_pipe * * pp ) ;
NTSTATUS dcerpc_epm_map_binding ( TALLOC_CTX * mem_ctx , struct dcerpc_binding * binding ,
2008-12-29 20:24:57 +01:00
const struct ndr_interface_table * table , struct tevent_context * ev ,
2008-04-02 04:53:27 +02:00
struct loadparm_context * lp_ctx ) ;
struct composite_context * dcerpc_secondary_auth_connection_send ( struct dcerpc_pipe * p ,
struct dcerpc_binding * binding ,
const struct ndr_interface_table * table ,
struct cli_credentials * credentials ,
struct loadparm_context * lp_ctx ) ;
NTSTATUS dcerpc_secondary_auth_connection_recv ( struct composite_context * c ,
TALLOC_CTX * mem_ctx ,
struct dcerpc_pipe * * p ) ;
struct composite_context * dcerpc_secondary_connection_send ( struct dcerpc_pipe * p ,
struct dcerpc_binding * b ) ;
2008-11-02 00:26:04 +01:00
void dcerpc_log_packet ( const char * lockdir ,
2010-08-10 15:11:02 +02:00
const struct ndr_interface_table * ndr ,
uint32_t opnum , uint32_t flags ,
const DATA_BLOB * pkt ) ;
2009-01-06 21:54:51 +01:00
NTSTATUS dcerpc_binding_build_tower ( TALLOC_CTX * mem_ctx ,
const struct dcerpc_binding * binding ,
struct epm_tower * tower ) ;
2008-04-02 04:53:27 +02:00
2009-01-06 21:45:13 +01:00
NTSTATUS dcerpc_floor_get_lhs_data ( const struct epm_floor * epm_floor , struct ndr_syntax_id * syntax ) ;
2008-04-02 04:53:27 +02:00
2009-01-09 18:32:20 +01:00
enum dcerpc_transport_t dcerpc_transport_by_tower ( const struct epm_tower * tower ) ;
const char * derpc_transport_string_by_transport ( enum dcerpc_transport_t t ) ;
2008-04-02 04:53:27 +02:00
NTSTATUS dcerpc_ndr_request ( struct dcerpc_pipe * p ,
const struct GUID * object ,
const struct ndr_interface_table * table ,
uint32_t opnum ,
TALLOC_CTX * mem_ctx ,
void * r ) ;
2008-04-03 02:28:31 +02:00
NTSTATUS dcerpc_binding_from_tower ( TALLOC_CTX * mem_ctx ,
struct epm_tower * tower ,
struct dcerpc_binding * * b_out ) ;
2008-05-24 21:02:56 +02:00
NTSTATUS dcerpc_request ( struct dcerpc_pipe * p ,
struct GUID * object ,
uint16_t opnum ,
TALLOC_CTX * mem_ctx ,
DATA_BLOB * stub_data_in ,
DATA_BLOB * stub_data_out ) ;
2008-09-16 04:15:39 +02:00
enum dcerpc_transport_t dcerpc_transport_by_endpoint_protocol ( int prot ) ;
2009-01-25 05:32:30 +01:00
const char * dcerpc_floor_get_rhs_data ( TALLOC_CTX * mem_ctx , struct epm_floor * epm_floor ) ;
2010-08-05 18:14:04 +02:00
struct dcerpc_binding_handle_ops {
const char * name ;
bool ( * is_connected ) ( struct dcerpc_binding_handle * h ) ;
struct tevent_req * ( * raw_call_send ) ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct dcerpc_binding_handle * h ,
const struct GUID * object ,
uint32_t opnum ,
uint32_t in_flags ,
const uint8_t * in_data ,
size_t in_length ) ;
NTSTATUS ( * raw_call_recv ) ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
uint8_t * * out_data ,
size_t * out_length ,
uint32_t * out_flags ) ;
struct tevent_req * ( * disconnect_send ) ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct dcerpc_binding_handle * h ) ;
NTSTATUS ( * disconnect_recv ) ( struct tevent_req * req ) ;
/* TODO: remove the following functions */
bool ( * push_bigendian ) ( struct dcerpc_binding_handle * h ) ;
bool ( * ref_alloc ) ( struct dcerpc_binding_handle * h ) ;
2010-08-05 18:18:30 +02:00
bool ( * use_ndr64 ) ( struct dcerpc_binding_handle * h ) ;
2010-08-05 18:14:04 +02:00
void ( * do_ndr_print ) ( struct dcerpc_binding_handle * h ,
int ndr_flags ,
const void * struct_ptr ,
const struct ndr_interface_call * call ) ;
void ( * ndr_push_failed ) ( struct dcerpc_binding_handle * h ,
NTSTATUS error ,
const void * struct_ptr ,
const struct ndr_interface_call * call ) ;
void ( * ndr_pull_failed ) ( struct dcerpc_binding_handle * h ,
NTSTATUS error ,
const DATA_BLOB * blob ,
const struct ndr_interface_call * call ) ;
NTSTATUS ( * ndr_validate_in ) ( struct dcerpc_binding_handle * h ,
TALLOC_CTX * mem_ctx ,
const DATA_BLOB * blob ,
const struct ndr_interface_call * call ) ;
NTSTATUS ( * ndr_validate_out ) ( struct dcerpc_binding_handle * h ,
struct ndr_pull * pull_in ,
const void * struct_ptr ,
const struct ndr_interface_call * call ) ;
} ;
struct dcerpc_binding_handle * _dcerpc_binding_handle_create ( TALLOC_CTX * mem_ctx ,
const struct dcerpc_binding_handle_ops * ops ,
const struct GUID * object ,
const struct ndr_interface_table * table ,
void * pstate ,
size_t psize ,
const char * type ,
const char * location ) ;
# define dcerpc_binding_handle_create(mem_ctx, ops, object, table, \
state , type , location ) \
_dcerpc_binding_handle_create ( mem_ctx , ops , object , table , \
state , sizeof ( type ) , # type , location )
void * _dcerpc_binding_handle_data ( struct dcerpc_binding_handle * h ) ;
# define dcerpc_binding_handle_data(_h, _type) \
talloc_get_type_abort ( _dcerpc_binding_handle_data ( _h ) , _type )
_DEPRECATED_ void dcerpc_binding_handle_set_sync_ev ( struct dcerpc_binding_handle * h ,
struct tevent_context * ev ) ;
bool dcerpc_binding_handle_is_connected ( struct dcerpc_binding_handle * h ) ;
struct tevent_req * dcerpc_binding_handle_raw_call_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct dcerpc_binding_handle * h ,
const struct GUID * object ,
uint32_t opnum ,
uint32_t in_flags ,
const uint8_t * in_data ,
size_t in_length ) ;
NTSTATUS dcerpc_binding_handle_raw_call_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
uint8_t * * out_data ,
size_t * out_length ,
uint32_t * out_flags ) ;
struct tevent_req * dcerpc_binding_handle_disconnect_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct dcerpc_binding_handle * h ) ;
NTSTATUS dcerpc_binding_handle_disconnect_recv ( struct tevent_req * req ) ;
struct tevent_req * dcerpc_binding_handle_call_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct dcerpc_binding_handle * h ,
const struct GUID * object ,
const struct ndr_interface_table * table ,
uint32_t opnum ,
TALLOC_CTX * r_mem ,
void * r_ptr ) ;
NTSTATUS dcerpc_binding_handle_call_recv ( struct tevent_req * req ) ;
NTSTATUS dcerpc_binding_handle_call ( struct dcerpc_binding_handle * h ,
const struct GUID * object ,
const struct ndr_interface_table * table ,
uint32_t opnum ,
TALLOC_CTX * r_mem ,
void * r_ptr ) ;
2006-01-03 13:41:17 +00:00
# endif /* __DCERPC_H__ */