summaryrefslogtreecommitdiff
path: root/source4/rpc_server/dcerpc_server.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-01-11 16:53:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:43 -0500
commitfae215266b6711b24f4893653b146751885e4e5f (patch)
treeaf13886f2431e1aa8a55a6da473e950dd3d5a053 /source4/rpc_server/dcerpc_server.h
parent90d65c2e85c8042391b8219eeaedd780e6eb3c7c (diff)
downloadsamba-fae215266b6711b24f4893653b146751885e4e5f.tar.gz
samba-fae215266b6711b24f4893653b146751885e4e5f.tar.bz2
samba-fae215266b6711b24f4893653b146751885e4e5f.zip
r4690: - add support for async rpc server replies
the backend should check for (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_MAY_ASYNC) then it's allowed to reply async then the backend should mark that call as async with dce_call->state_flags |= DCESRV_CALL_STATE_FLAG_ASYNC; later it has to manualy set r->out.result and then send the reply by calling status = dcesrv_reply(p->dce_call); NOTE: that ncacn_np doesn't support async replies yet - implement an async version of echo_TestSleep - reenable the echo_TestSleep torture test (this need to be more strict when we have support for async ncacn_np) metze (This used to be commit f0a0dbeb25b034b1333078ca085999359f5f6209)
Diffstat (limited to 'source4/rpc_server/dcerpc_server.h')
-rw-r--r--source4/rpc_server/dcerpc_server.h41
1 files changed, 39 insertions, 2 deletions
diff --git a/source4/rpc_server/dcerpc_server.h b/source4/rpc_server/dcerpc_server.h
index 49fbd4477b..2738cee040 100644
--- a/source4/rpc_server/dcerpc_server.h
+++ b/source4/rpc_server/dcerpc_server.h
@@ -3,8 +3,8 @@
server side dcerpc defines
- Copyright (C) Andrew Tridgell 2003
- Copyright (C) Stefan (metze) Metzmacher 2004
+ Copyright (C) Andrew Tridgell 2003-2005
+ Copyright (C) Stefan (metze) Metzmacher 2004-2005
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
@@ -54,6 +54,10 @@ struct dcesrv_interface {
*/
NTSTATUS (*dispatch)(struct dcesrv_call_state *, TALLOC_CTX *, void *);
+ /* the reply function for the chosen interface.
+ */
+ NTSTATUS (*reply)(struct dcesrv_call_state *, TALLOC_CTX *, void *);
+
/* the ndr_push function for the chosen interface.
*/
NTSTATUS (*ndr_push)(struct dcesrv_call_state *, TALLOC_CTX *, struct ndr_push *,void *);
@@ -69,6 +73,33 @@ struct dcesrv_call_state {
struct dcesrv_connection_context *context;
struct dcerpc_packet pkt;
+ /* the backend can mark the call
+ * with DCESRV_CALL_STATE_FLAG_ASYNC
+ * that will cause the frontend to not touch r->out
+ * and skip the reply
+ *
+ * this is only allowed to the backend when DCESRV_CALL_STATE_FLAG_MAY_ASYNC
+ * is alerady set by the frontend
+ *
+ * the backend then needs to call dcesrv_reply() when it's
+ * ready to send the reply
+ */
+#define DCESRV_CALL_STATE_FLAG_ASYNC (1<<0)
+#define DCESRV_CALL_STATE_FLAG_MAY_ASYNC (1<<1)
+ uint32_t state_flags;
+
+ /* the time the request arrived in the server */
+ struct timeval time;
+
+ /* the backend can use this event context for async replies */
+ struct event_context *event_ctx;
+
+ /* this is the pointer to the allocated function struct */
+ void *r;
+
+ /* that's the ndr push context used in dcesrv_request */
+ struct ndr_pull *ndr_pull;
+
DATA_BLOB input;
struct dcesrv_call_reply {
@@ -132,6 +163,9 @@ struct dcesrv_connection {
/* the state of the current calls */
struct dcesrv_call_state *call_list;
+ /* the state of the async pending calls */
+ struct dcesrv_call_state *pending_call_list;
+
/* the maximum size the client wants to receive */
uint32_t cli_max_recv_frag;
@@ -187,6 +221,9 @@ struct dcesrv_context {
struct dcesrv_interface iface;
} *interface_list;
} *endpoint_list;
+
+ /* this is the default state_flags for dcesrv_call_state structs */
+ uint32_t state_flags;
};
/* this structure is used by modules to determine the size of some critical types */