From 3e92471d4cfa169b97da73752b6eb6d1ea8cb466 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 15 Jun 2005 01:02:53 +0000 Subject: r7596: next step in ldap cleanup. I'm aiming to get rid of the cut&pasted ldif parsing code in libcli/ldap/ldap_ldif.c, and instead use the ldb ldif code. To do that I have changed the ldap code to use 'struct ldb_message_element' instead of 'struct ldap_attribute'. They are essentially the same structure anyway, so by making them really the same it will be much easier to use the ldb code in libcli/ldap/ I have also made 'struct ldb_val' the same as a DATA_BLOB, which will simplify data handling in quite a few places (I haven't yet removed all the code that maps between these two, that will come later) (This used to be commit 87fc3073392236221a3a6b933284e9e477c24ae5) --- source4/libcli/ldap/ldap.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'source4/libcli/ldap/ldap.h') diff --git a/source4/libcli/ldap/ldap.h b/source4/libcli/ldap/ldap.h index f0f43e65fc..577df1fc3d 100644 --- a/source4/libcli/ldap/ldap.h +++ b/source4/libcli/ldap/ldap.h @@ -101,12 +101,6 @@ struct ldap_Result { const char *referral; }; -struct ldap_attribute { - const char *name; - int num_values; - DATA_BLOB *values; -}; - struct ldap_BindRequest { int version; const char *dn; @@ -159,7 +153,7 @@ struct ldap_SearchRequest { struct ldap_SearchResEntry { const char *dn; int num_attributes; - struct ldap_attribute *attributes; + struct ldb_message_element *attributes; }; struct ldap_SearchResRef { @@ -175,7 +169,7 @@ enum ldap_modify_type { struct ldap_mod { enum ldap_modify_type type; - struct ldap_attribute attrib; + struct ldb_message_element attrib; }; struct ldap_ModifyRequest { @@ -187,7 +181,7 @@ struct ldap_ModifyRequest { struct ldap_AddRequest { const char *dn; int num_attributes; - struct ldap_attribute *attributes; + struct ldb_message_element *attributes; }; struct ldap_DelRequest { @@ -338,10 +332,10 @@ NTSTATUS ldap2nterror(int ldaperror); /* The following definitions come from libcli/ldap/ldap_ldif.c */ BOOL add_value_to_attrib(TALLOC_CTX *mem_ctx, struct ldb_val *value, - struct ldap_attribute *attrib); + struct ldb_message_element *attrib); BOOL add_attrib_to_array_talloc(TALLOC_CTX *mem_ctx, - const struct ldap_attribute *attrib, - struct ldap_attribute **attribs, + const struct ldb_message_element *attrib, + struct ldb_message_element **attribs, int *num_attribs); BOOL add_mod_to_array_talloc(TALLOC_CTX *mem_ctx, struct ldap_mod *mod, -- cgit