From 63a70ba0ad306e39311db3145d85323276e02c02 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 6 Jun 2009 21:06:33 +0200 Subject: Prepare control support We will have arrays of controls passed to tldap.c. Follow a mantra from the classic book "Thinking Forth" by Leo Brodie: Favor counts over terminators :-) This makes the parameter lists to tldap pretty long, but everyone will have wrapper routines anyway, see for example tldap_search_fmt. And the OpenLDAP manpages call the non-_ext routines deprecated, probably for a reason. --- source3/include/tldap.h | 52 +++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 19 deletions(-) (limited to 'source3/include') diff --git a/source3/include/tldap.h b/source3/include/tldap.h index 96272449e5..3da7d69d86 100644 --- a/source3/include/tldap.h +++ b/source3/include/tldap.h @@ -58,15 +58,19 @@ struct tevent_req *tldap_sasl_bind_send(TALLOC_CTX *mem_ctx, const char *dn, const char *mechanism, DATA_BLOB *creds, - struct tldap_control **sctrls, - struct tldap_control **cctrls); + struct tldap_control *sctrls, + int num_sctrls, + struct tldap_control *cctrls, + int num_cctrls); int tldap_sasl_bind_recv(struct tevent_req *req); int tldap_sasl_bind(struct tldap_context *ldap, const char *dn, const char *mechanism, DATA_BLOB *creds, - struct tldap_control **sctrls, - struct tldap_control **cctrls); + struct tldap_control *sctrls, + int num_sctrls, + struct tldap_control *cctrls, + int num_ctrls); struct tevent_req *tldap_simple_bind_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, @@ -85,8 +89,10 @@ struct tevent_req *tldap_search_send(TALLOC_CTX *mem_ctx, const char **attrs, int num_attrs, int attrsonly, - struct tldap_control **sctrls, - struct tldap_control **cctrls, + struct tldap_control *sctrls, + int num_sctrls, + struct tldap_control *cctrls, + int num_cctrls, int timelimit, int sizelimit, int deref); @@ -95,7 +101,8 @@ int tldap_search_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, int tldap_search(struct tldap_context *ld, const char *base, int scope, const char *filter, const char **attrs, int num_attrs, int attrsonly, - struct tldap_control **sctrls, struct tldap_control **cctrls, + struct tldap_control *sctrls, int num_sctrls, + struct tldap_control *cctrls, int num_cctrls, int timelimit, int sizelimit, int deref, TALLOC_CTX *mem_ctx, struct tldap_message ***pentries, struct tldap_message ***refs); @@ -107,38 +114,45 @@ struct tevent_req *tldap_add_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct tldap_context *ld, const char *dn, - int num_attributes, struct tldap_mod *attributes, - struct tldap_control **sctrls, - struct tldap_control **cctrls); + int num_attributes, + struct tldap_control *sctrls, + int num_sctrls, + struct tldap_control *cctrls, + int num_cctrls); int tldap_add_recv(struct tevent_req *req); int tldap_add(struct tldap_context *ld, const char *dn, int num_attributes, struct tldap_mod *attributes, - struct tldap_control **sctrls, struct tldap_control **cctrls); + struct tldap_control *sctrls, int num_sctrls, + struct tldap_control *cctrls, int num_cctrls); struct tevent_req *tldap_modify_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct tldap_context *ld, const char *dn, int num_mods, struct tldap_mod *mods, - struct tldap_control **sctrls, - struct tldap_control **cctrls); + struct tldap_control *sctrls, + int num_sctrls, + struct tldap_control *cctrls, + int num_cctrls); int tldap_modify_recv(struct tevent_req *req); int tldap_modify(struct tldap_context *ld, const char *dn, int num_mods, struct tldap_mod *mods, - struct tldap_control **sctrls, struct tldap_control **cctrls); - + struct tldap_control *sctrls, int num_sctrls, + struct tldap_control *cctrls, int num_cctrls); struct tevent_req *tldap_delete_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct tldap_context *ld, const char *dn, - struct tldap_control **sctrls, - struct tldap_control **cctrls); + struct tldap_control *sctrls, + int num_sctrls, + struct tldap_control *cctrls, + int num_cctrls); int tldap_delete_recv(struct tevent_req *req); int tldap_delete(struct tldap_context *ld, const char *dn, - struct tldap_control **sctrls, struct tldap_control **cctrls); - + struct tldap_control *sctrls, int num_sctrls, + struct tldap_control *cctrls, int num_cctrls); int tldap_msg_id(const struct tldap_message *msg); int tldap_msg_type(const struct tldap_message *msg); -- cgit