diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-12-14 13:22:12 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-12-14 13:22:12 +0000 |
commit | f6eb8342cba87c7c8f17471ed9783b567d36b0ed (patch) | |
tree | 40484486513e10f1fb4764ce62f7fdc3f8df17ff /source4/rpc_server/echo | |
parent | 4cd6b8a64b5d995190a28b2a8308e688847df49c (diff) | |
download | samba-f6eb8342cba87c7c8f17471ed9783b567d36b0ed.tar.gz samba-f6eb8342cba87c7c8f17471ed9783b567d36b0ed.tar.bz2 samba-f6eb8342cba87c7c8f17471ed9783b567d36b0ed.zip |
added auto-generation of the server side boilerplate code for each
pipe.
The server side code gets generated as librpc/gen_ndr/ndr_NAME_s.c and
gets included in the pipe module
(This used to be commit bd3dcfe5820489a838e19b244266bd9126af5eb4)
Diffstat (limited to 'source4/rpc_server/echo')
-rw-r--r-- | source4/rpc_server/echo/rpc_echo.c | 82 |
1 files changed, 4 insertions, 78 deletions
diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index d62ebc3d26..1d3846aaff 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -55,14 +55,14 @@ static NTSTATUS echo_SourceData(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, s return NT_STATUS_OK; } -static NTSTATUS echo_TestCall(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct TestCall *r) +static NTSTATUS echo_TestCall(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_TestCall *r) { r->out.s2 = "this is a test string"; return NT_STATUS_OK; } -static NTSTATUS echo_TestCall2(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct TestCall2 *r) +static NTSTATUS echo_TestCall2(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, struct echo_TestCall2 *r) { r->out.info = talloc(mem_ctx, sizeof(*r->out.info)); if (!r->out.info) { @@ -109,79 +109,5 @@ static NTSTATUS echo_TestCall2(struct dcesrv_state *dce, TALLOC_CTX *mem_ctx, st } - - -/************************************************************************** - all the code below this point is boilerplate that will be auto-generated -***************************************************************************/ - -static const dcesrv_dispatch_fn_t dispatch_table[] = { - (dcesrv_dispatch_fn_t)echo_AddOne, - (dcesrv_dispatch_fn_t)echo_EchoData, - (dcesrv_dispatch_fn_t)echo_SinkData, - (dcesrv_dispatch_fn_t)echo_SourceData, - (dcesrv_dispatch_fn_t)echo_TestCall, - (dcesrv_dispatch_fn_t)echo_TestCall2 -}; - - -/* - return True if we want to handle the given endpoint -*/ -static BOOL op_query_endpoint(const struct dcesrv_endpoint *ep) -{ - return dcesrv_table_query(&dcerpc_table_rpcecho, ep); -} - -/* - setup for a particular rpc interface -*/ -static BOOL op_set_interface(struct dcesrv_state *dce, const char *uuid, uint32 if_version) -{ - if (strcasecmp(uuid, dcerpc_table_rpcecho.uuid) != 0 || - if_version != dcerpc_table_rpcecho.if_version) { - DEBUG(2,("Attempt to use unknown interface %s/%d\n", uuid, if_version)); - return False; - } - - dce->ndr = &dcerpc_table_rpcecho; - dce->dispatch = dispatch_table; - - return True; -} - - -/* op_connect is called when a connection is made to an endpoint */ -static NTSTATUS op_connect(struct dcesrv_state *dce) -{ - return NT_STATUS_OK; -} - -static void op_disconnect(struct dcesrv_state *dce) -{ - /* nothing to do */ -} - - -static int op_lookup_endpoints(TALLOC_CTX *mem_ctx, struct dcesrv_ep_iface **e) -{ - return dcesrv_lookup_endpoints(&dcerpc_table_rpcecho, mem_ctx, e); -} - -static const struct dcesrv_endpoint_ops rpc_echo_ops = { - op_query_endpoint, - op_set_interface, - op_connect, - op_disconnect, - op_lookup_endpoints -}; - -/* - register with the dcerpc server -*/ -void rpc_echo_init(struct dcesrv_context *dce) -{ - if (!dcesrv_endpoint_register(dce, &rpc_echo_ops, &dcerpc_table_rpcecho)) { - DEBUG(1,("Failed to register rpcecho endpoint\n")); - } -} +/* include the generated boilerplate */ +#include "librpc/gen_ndr/ndr_echo_s.c" |