/* Unix SMB/CIFS implementation. DCERPC interface structures Copyright (C) Tim Potter 2003 Copyright (C) Andrew Tridgell 2003 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 2 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ enum dcerpc_transport_t {NCACN_NP, NCACN_IP_TCP}; /* this defines a generic security context for signed/sealed dcerpc pipes. */ struct dcerpc_pipe; struct dcerpc_security { struct dcerpc_auth *auth_info; struct gensec_security *generic_state; }; struct dcerpc_pipe { TALLOC_CTX *mem_ctx; int reference_count; uint32_t call_id; uint32_t srv_max_xmit_frag; uint32_t srv_max_recv_frag; uint_t flags; struct dcerpc_security security_state; const char *binding_string; struct dcerpc_transport { enum dcerpc_transport_t transport; void *private; NTSTATUS (*full_request)(struct dcerpc_pipe *, TALLOC_CTX *, DATA_BLOB *, DATA_BLOB *); NTSTATUS (*secondary_request)(struct dcerpc_pipe *, TALLOC_CTX *, DATA_BLOB *); NTSTATUS (*initial_request)(struct dcerpc_pipe *, TALLOC_CTX *, DATA_BLOB *); NTSTATUS (*shutdown_pipe)(struct dcerpc_pipe *); const char *(*peer_name)(struct dcerpc_pipe *); } transport; /* the last fault code from a DCERPC fault */ uint32_t last_fault_code; }; /* dcerpc pipe flags */ #define DCERPC_DEBUG_PRINT_IN (1<<0) #define DCERPC_DEBUG_PRINT_OUT (1<<1) #define DCERPC_DEBUG_PRINT_BOTH (DCERPC_DEBUG_PRINT_IN | DCERPC_DEBUG_PRINT_OUT) #define DCERPC_DEBUG_VALIDATE_IN (1<<2) #define DCERPC_DEBUG_VALIDATE_OUT (1<<3) #define DCERPC_DEBUG_VALIDATE_BOTH (DCERPC_DEBUG_VALIDATE_IN | DCERPC_DEBUG_VALIDATE_OUT) #define DCERPC_SIGN (1<<4) #define DCERPC_SEAL (1<<5) #define DCERPC_PUSH_BIGENDIAN (1<<6) #define DCERPC_PULL_BIGENDIAN (1<<7) #define DCERPC_SCHANNEL_BDC (1<<8) #define DCERPC_SCHANNEL_WORKSTATION (1<<9) #define DCERPC_SCHANNEL_DOMAIN (1<<10) #define DCERPC_SCHANNEL_ANY (DCERPC_SCHANNEL_BDC| \ DCERPC_SCHANNEL_DOMAIN| \ DCERPC_SCHANNEL_WORKSTATION) /* use a 128 bit session key */ #define DCERPC_SCHANNEL_128 (1<<11) #define DCERPC_AUTH_OPTIONS (DCERPC_SEAL|DCERPC_SIGN|DCERPC_SCHANNEL_ANY) /* this is used to find pointers to calls */ struct dcerpc_interface_call { const char *name; size_t struct_size; NTSTATUS (*ndr_push)(struct ndr_push *, int , void *); NTSTATUS (*ndr_pull)(struct ndr_pull *, int , void *); void (*ndr_print)(struct ndr_print *, const char *, int, void *); }; struct dcerpc_endpoint_list { uint32_t count; const char * const *names; }; struct dcerpc_interface_table { const char *name; const char *uuid; uint32_t if_version; uint32_t num_calls; const struct dcerpc_interface_call *calls; const struct dcerpc_endpoint_list *endpoints; }; /* this describes a binding to a particular transport/pipe */ struct dcerpc_binding { enum dcerpc_transport_t transport; const char *host; const char **options; uint32_t flags; };