summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-06 12:32:46 +0200
committerVolker Lendecke <vl@samba.org>2009-06-06 13:10:30 +0200
commit1769c8d81b8b4ad7bae77fabce2bf2051a7d32c1 (patch)
tree9e913f07796a167965ad9975728eb7d0b4771ca1 /source3/include
parent7194937eea7f12a9408655654777fe19832e338a (diff)
downloadsamba-1769c8d81b8b4ad7bae77fabce2bf2051a7d32c1.tar.gz
samba-1769c8d81b8b4ad7bae77fabce2bf2051a7d32c1.tar.bz2
samba-1769c8d81b8b4ad7bae77fabce2bf2051a7d32c1.zip
Add some samba-style tldap utility functions
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/includes.h1
-rw-r--r--source3/include/tldap_util.h53
2 files changed, 54 insertions, 0 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 41f1b4eeeb..3ce63bb7a1 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -685,6 +685,7 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
#include "../lib/util/smb_threads.h"
#include "../lib/util/smb_threads_internal.h"
#include "tldap.h"
+#include "tldap_util.h"
#include "lib/smbconf/smbconf.h"
#include "lib/smbconf/smbconf_init.h"
diff --git a/source3/include/tldap_util.h b/source3/include/tldap_util.h
new file mode 100644
index 0000000000..2d5cf57a9c
--- /dev/null
+++ b/source3/include/tldap_util.h
@@ -0,0 +1,53 @@
+/*
+ Unix SMB/CIFS implementation.
+ Infrastructure for async ldap client requests
+ Copyright (C) Volker Lendecke 2009
+
+ 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
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __TLDAP_UTIL_H__
+#define __TLDAP_UTIL_H__
+
+#include "includes.h"
+
+bool tldap_entry_values(struct tldap_message *msg, const char *attribute,
+ int *num_values, DATA_BLOB **values);
+bool tldap_get_single_valueblob(struct tldap_message *msg,
+ const char *attribute, DATA_BLOB *blob);
+char *tldap_talloc_single_attribute(struct tldap_message *msg,
+ const char *attribute,
+ TALLOC_CTX *mem_ctx);
+bool tldap_pull_binsid(struct tldap_message *msg, const char *attribute,
+ struct dom_sid *sid);
+bool tldap_add_mod_blobs(TALLOC_CTX *mem_ctx, struct tldap_mod **pmods,
+ int mod_op, const char *attrib,
+ int num_values, DATA_BLOB *values);
+bool tldap_make_mod_blob(struct tldap_message *existing, TALLOC_CTX *mem_ctx,
+ int *pnum_mods, struct tldap_mod **pmods,
+ const char *attrib, DATA_BLOB newval);
+bool tldap_make_mod_fmt(struct tldap_message *existing, TALLOC_CTX *mem_ctx,
+ int *pnum_mods, struct tldap_mod **pmods,
+ const char *attrib, const char *fmt, ...);
+
+const char *tldap_errstr(TALLOC_CTX *mem_ctx, struct tldap_context *ld,
+ int rc);
+int tldap_search_fmt(struct tldap_context *ld, const char *base, int scope,
+ const char *attrs[], int num_attrs, int attrsonly,
+ TALLOC_CTX *mem_ctx, struct tldap_message ***res,
+ const char *fmt, ...);
+bool tldap_pull_uint64(struct tldap_message *msg, const char *attr,
+ uint64_t *presult);
+
+#endif