2 Unix SMB/CIFS implementation.
3 Infrastructure for async ldap client requests
4 Copyright (C) Volker Lendecke 2009
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __TLDAP_UTIL_H__
21 #define __TLDAP_UTIL_H__
25 bool tldap_entry_values(struct tldap_message
*msg
, const char *attribute
,
26 DATA_BLOB
**values
, int *num_values
);
27 bool tldap_get_single_valueblob(struct tldap_message
*msg
,
28 const char *attribute
, DATA_BLOB
*blob
);
29 char *tldap_talloc_single_attribute(struct tldap_message
*msg
,
30 const char *attribute
,
32 bool tldap_pull_binsid(struct tldap_message
*msg
, const char *attribute
,
34 bool tldap_pull_guid(struct tldap_message
*msg
, const char *attribute
,
36 bool tldap_add_mod_blobs(TALLOC_CTX
*mem_ctx
,
37 struct tldap_mod
**pmods
, int *pnum_mods
,
38 int mod_op
, const char *attrib
,
39 DATA_BLOB
*newvals
, int num_newvals
);
40 bool tldap_add_mod_str(TALLOC_CTX
*mem_ctx
,
41 struct tldap_mod
**pmods
, int *pnum_mods
,
42 int mod_op
, const char *attrib
, const char *str
);
43 bool tldap_make_mod_blob(struct tldap_message
*existing
, TALLOC_CTX
*mem_ctx
,
44 struct tldap_mod
**pmods
, int *pnum_mods
,
45 const char *attrib
, DATA_BLOB newval
);
46 bool tldap_make_mod_fmt(struct tldap_message
*existing
, TALLOC_CTX
*mem_ctx
,
47 struct tldap_mod
**pmods
, int *pnum_mods
,
48 const char *attrib
, const char *fmt
, ...)
49 PRINTF_ATTRIBUTE(6,7);
51 const char *tldap_errstr(TALLOC_CTX
*mem_ctx
, struct tldap_context
*ld
,
53 TLDAPRC
tldap_search_va(struct tldap_context
*ld
, const char *base
, int scope
,
54 const char *attrs
[], int num_attrs
, int attrsonly
,
55 TALLOC_CTX
*mem_ctx
, struct tldap_message
***res
,
56 const char *fmt
, va_list ap
) PRINTF_ATTRIBUTE(9,0);
57 TLDAPRC
tldap_search_fmt(struct tldap_context
*ld
, const char *base
, int scope
,
58 const char *attrs
[], int num_attrs
, int attrsonly
,
59 TALLOC_CTX
*mem_ctx
, struct tldap_message
***res
,
60 const char *fmt
, ...) PRINTF_ATTRIBUTE(9,10);
61 bool tldap_pull_uint64(struct tldap_message
*msg
, const char *attr
,
63 bool tldap_pull_uint32(struct tldap_message
*msg
, const char *attr
,
66 struct tevent_req
*tldap_fetch_rootdse_send(TALLOC_CTX
*mem_ctx
,
67 struct tevent_context
*ev
,
68 struct tldap_context
*ld
);
69 TLDAPRC
tldap_fetch_rootdse_recv(struct tevent_req
*req
);
70 TLDAPRC
tldap_fetch_rootdse(struct tldap_context
*ld
);
71 struct tldap_message
*tldap_rootdse(struct tldap_context
*ld
);
73 bool tldap_entry_has_attrvalue(struct tldap_message
*msg
,
74 const char *attribute
,
75 const DATA_BLOB blob
);
76 bool tldap_supports_control(struct tldap_context
*ld
, const char *oid
);
78 struct tldap_control
*tldap_add_control(TALLOC_CTX
*mem_ctx
,
79 struct tldap_control
*ctrls
,
81 struct tldap_control
*ctrl
);
82 struct tldap_control
*tldap_msg_findcontrol(struct tldap_message
*msg
,
85 struct tevent_req
*tldap_search_paged_send(TALLOC_CTX
*mem_ctx
,
86 struct tevent_context
*ev
,
87 struct tldap_context
*ld
,
88 const char *base
, int scope
,
93 struct tldap_control
*sctrls
,
95 struct tldap_control
*cctrls
,
101 TLDAPRC
tldap_search_paged_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
102 struct tldap_message
**pmsg
);