From 3db2249886bf19be4c357a0966d9efa2f2e692f6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 15 Apr 2008 17:55:44 +0200 Subject: Add simple implementation of several functions in the Samba 4 RPC library on top of the Samba 3 RPC library: * dcerpc_pipe_connect * dcerpc_ndr_request_recv * dcerpc_ndr_request_send These are the main functions used by the generated client calls in Samba 4. (This used to be commit 350177824239343365d5c99ad4efd71e3b2ed6fa) --- source3/librpc/rpc/dcerpc.h | 70 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 source3/librpc/rpc/dcerpc.h (limited to 'source3/librpc/rpc/dcerpc.h') diff --git a/source3/librpc/rpc/dcerpc.h b/source3/librpc/rpc/dcerpc.h new file mode 100644 index 0000000000..9e2bd9b4f6 --- /dev/null +++ b/source3/librpc/rpc/dcerpc.h @@ -0,0 +1,70 @@ +/* + Unix SMB/CIFS implementation. + + DCERPC client side interface structures + + Copyright (C) 2008 Jelmer Vernooij + + 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 . +*/ + +/* 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. */ + +#ifndef __DCERPC_H__ +#define __DCERPC_H__ + +#include "includes.h" +#include "librpc/rpc/dcerpc.h" +#include "librpc/gen_ndr/epmapper.h" + +struct loadparm_context; +struct cli_credentials; + +struct dcerpc_pipe { + const struct ndr_interface_table *table; + struct rpc_pipe_client *cli; +}; + +struct rpc_request { + const struct ndr_interface_call *call; + prs_struct q_ps; + uint32_t opnum; + struct dcerpc_pipe *pipe; + void *r; +}; + +enum dcerpc_transport_t { + 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, + NCADG_UNIX_DGRAM, NCACN_HTTP, NCADG_IPX, NCACN_SPX }; + + +/* this describes a binding to a particular transport/pipe */ +struct dcerpc_binding { + enum dcerpc_transport_t transport; + struct ndr_syntax_id object; + const char *host; + const char *target_hostname; + const char *endpoint; + const char **options; + uint32_t flags; + uint32_t assoc_group_id; +}; + + + + +#endif /* __DCERPC_H__ */ -- cgit From e3246e8720c74bb62a2b86b21f6147ea6f050054 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 15 Apr 2008 18:24:11 +0200 Subject: Actually connect to RPC. (This used to be commit 3082534454ff936ac0b78b5a2c72c9b060e21244) --- source3/librpc/rpc/dcerpc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/librpc/rpc/dcerpc.h') diff --git a/source3/librpc/rpc/dcerpc.h b/source3/librpc/rpc/dcerpc.h index 9e2bd9b4f6..a225f82189 100644 --- a/source3/librpc/rpc/dcerpc.h +++ b/source3/librpc/rpc/dcerpc.h @@ -35,7 +35,8 @@ struct cli_credentials; struct dcerpc_pipe { const struct ndr_interface_table *table; - struct rpc_pipe_client *cli; + struct cli_state *cli; + struct rpc_pipe_client *rpc_cli; }; struct rpc_request { -- cgit From 194d5014d8c07a786acf94063a5c4b227f0b7d4b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 17 Apr 2008 13:51:00 +0200 Subject: Add some comments. (This used to be commit fd321fd77fcb9fbebcaa724c58a1beee606e87cd) --- source3/librpc/rpc/dcerpc.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source3/librpc/rpc/dcerpc.h') diff --git a/source3/librpc/rpc/dcerpc.h b/source3/librpc/rpc/dcerpc.h index a225f82189..739e60a341 100644 --- a/source3/librpc/rpc/dcerpc.h +++ b/source3/librpc/rpc/dcerpc.h @@ -33,9 +33,16 @@ struct loadparm_context; struct cli_credentials; +/** + * Connection to a particular DCE/RPC interface. + */ struct dcerpc_pipe { const struct ndr_interface_table *table; + + /** SMB context used when transport is ncacn_np. */ struct cli_state *cli; + + /** Samba 3 DCE/RPC client context. */ struct rpc_pipe_client *rpc_cli; }; @@ -53,7 +60,7 @@ enum dcerpc_transport_t { NCADG_UNIX_DGRAM, NCACN_HTTP, NCADG_IPX, NCACN_SPX }; -/* this describes a binding to a particular transport/pipe */ +/** this describes a binding to a particular transport/pipe */ struct dcerpc_binding { enum dcerpc_transport_t transport; struct ndr_syntax_id object; @@ -65,7 +72,4 @@ struct dcerpc_binding { uint32_t assoc_group_id; }; - - - #endif /* __DCERPC_H__ */ -- cgit