summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/composite/composite.c28
-rw-r--r--source4/libcli/composite/composite.h1
2 files changed, 29 insertions, 0 deletions
diff --git a/source4/libcli/composite/composite.c b/source4/libcli/composite/composite.c
index 9a745e3013..aea25f183e 100644
--- a/source4/libcli/composite/composite.c
+++ b/source4/libcli/composite/composite.c
@@ -24,12 +24,30 @@
#include "includes.h"
#include "lib/events/events.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/smb2/smb2.h"
#include "libcli/composite/composite.h"
#include "lib/messaging/irpc.h"
#include "librpc/rpc/dcerpc.h"
#include "libcli/nbt/libnbt.h"
/*
+ create a new composite_context structure
+ and initialize it
+*/
+_PUBLIC_ struct composite_context *composite_create(TALLOC_CTX *mem_ctx,
+ struct event_context *ev)
+{
+ struct composite_context *c;
+
+ c = talloc_zero(mem_ctx, struct composite_context);
+ if (!c) return NULL;
+ c->state = COMPOSITE_STATE_IN_PROGRESS;
+ c->event_ctx = ev;
+
+ return c;
+}
+
+/*
block until a composite function has completed, then return the status
*/
_PUBLIC_ NTSTATUS composite_wait(struct composite_context *c)
@@ -156,6 +174,16 @@ _PUBLIC_ void composite_continue_smb(struct composite_context *ctx,
new_req->async.private = private_data;
}
+_PUBLIC_ void composite_continue_smb2(struct composite_context *ctx,
+ struct smb2_request *new_req,
+ void (*continuation)(struct smb2_request *),
+ void *private_data)
+{
+ if (composite_nomem(new_req, ctx)) return;
+ new_req->async.fn = continuation;
+ new_req->async.private = private_data;
+}
+
_PUBLIC_ void composite_continue_nbt(struct composite_context *ctx,
struct nbt_name_request *new_req,
void (*continuation)(struct nbt_name_request *),
diff --git a/source4/libcli/composite/composite.h b/source4/libcli/composite/composite.h
index dc04f5a883..d8873684fc 100644
--- a/source4/libcli/composite/composite.h
+++ b/source4/libcli/composite/composite.h
@@ -63,6 +63,7 @@ struct composite_context {
struct irpc_request;
struct smbcli_request;
+struct smb2_request;
struct rpc_request;
struct nbt_name_request;