summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-09-24 11:27:35 +0200
committerStefan Metzmacher <metze@samba.org>2013-10-29 15:33:26 +0100
commitb86b4d0db1f6838799f66bed4ed2a1083599eaea (patch)
treee9e20caf12bfd74c223daebddb460409b2898de4 /source3
parenteec05fb70f5f3558ef5f08816c22d0edaf7fedab (diff)
downloadsamba-b86b4d0db1f6838799f66bed4ed2a1083599eaea.tar.gz
samba-b86b4d0db1f6838799f66bed4ed2a1083599eaea.tar.xz
samba-b86b4d0db1f6838799f66bed4ed2a1083599eaea.zip
s3-rpc_server: Add npa_state_init() function.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/rpc_ncacn_np.c27
-rw-r--r--source3/rpc_server/rpc_ncacn_np.h13
2 files changed, 40 insertions, 0 deletions
diff --git a/source3/rpc_server/rpc_ncacn_np.c b/source3/rpc_server/rpc_ncacn_np.c
index c58f97dec9..f2c45d9b11 100644
--- a/source3/rpc_server/rpc_ncacn_np.c
+++ b/source3/rpc_server/rpc_ncacn_np.c
@@ -41,6 +41,33 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV
+static struct npa_state *npa_state_init(TALLOC_CTX *mem_ctx)
+{
+ struct npa_state *npa;
+
+ npa = talloc_zero(mem_ctx, struct npa_state);
+ if (npa == NULL) {
+ return NULL;
+ }
+
+ npa->read_queue = tevent_queue_create(npa, "npa_cli_read");
+ if (npa->read_queue == NULL) {
+ DEBUG(0, ("tevent_queue_create failed\n"));
+ goto fail;
+ }
+
+ npa->write_queue = tevent_queue_create(npa, "npa_cli_write");
+ if (npa->write_queue == NULL) {
+ DEBUG(0, ("tevent_queue_create failed\n"));
+ goto fail;
+ }
+
+ return npa;
+fail:
+ talloc_free(npa);
+ return NULL;
+}
+
/****************************************************************************
Make an internal namedpipes structure
****************************************************************************/
diff --git a/source3/rpc_server/rpc_ncacn_np.h b/source3/rpc_server/rpc_ncacn_np.h
index 67cd8a1285..2665b7f590 100644
--- a/source3/rpc_server/rpc_ncacn_np.h
+++ b/source3/rpc_server/rpc_ncacn_np.h
@@ -24,6 +24,19 @@ struct dcerpc_binding_handle;
struct ndr_interface_table;
struct tsocket_address;
+struct npa_state {
+ struct tstream_context *stream;
+
+ struct tevent_queue *read_queue;
+ struct tevent_queue *write_queue;
+
+ uint64_t allocation_size;
+ uint16_t device_state;
+ uint16_t file_type;
+
+ void *private_data;
+};
+
struct np_proxy_state {
uint16_t file_type;
uint16_t device_state;