tldap: Add tldap_get/set_stream
authorVolker Lendecke <vl@samba.org>
Sun, 27 Dec 2015 11:37:25 +0000 (12:37 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 15 Apr 2016 13:32:11 +0000 (15:32 +0200)
This will be used to replace a nonencrypted socket with a sasl sealed one.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/tldap.h
source3/lib/tldap.c

index 0d7e55df9ca0957d8c31a5e3c4bda8805cb53ac4..74279a4ba18ff75307a169435f654c8d7bed4fb0 100644 (file)
@@ -117,6 +117,10 @@ bool tevent_req_ldap_error(struct tevent_req *req, TLDAPRC rc);
 bool tevent_req_is_ldap_error(struct tevent_req *req, TLDAPRC *perr);
 
 struct tldap_context *tldap_context_create(TALLOC_CTX *mem_ctx, int fd);
+struct tstream_context *tldap_get_tstream(struct tldap_context *ld);
+void tldap_set_tstream(struct tldap_context *ld,
+                      struct tstream_context *stream);
+
 bool tldap_connection_ok(struct tldap_context *ld);
 bool tldap_context_setattr(struct tldap_context *ld,
                           const char *name, const void *pptr);
index 6f42e6120bee2bb15ea2ff138c003ac54de0b40a..5fcb43c29f4e75dbb62d812f374c558b75eef6ff 100644 (file)
@@ -196,6 +196,17 @@ static size_t tldap_pending_reqs(struct tldap_context *ld)
        return talloc_array_length(ld->pending);
 }
 
+struct tstream_context *tldap_get_tstream(struct tldap_context *ld)
+{
+       return ld->conn;
+}
+
+void tldap_set_tstream(struct tldap_context *ld,
+                      struct tstream_context *stream)
+{
+       ld->conn = stream;
+}
+
 static struct tldap_ctx_attribute *tldap_context_findattr(
        struct tldap_context *ld, const char *name)
 {