diff options
Diffstat (limited to 'ldap_helper.h')
-rw-r--r-- | ldap_helper.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/ldap_helper.h b/ldap_helper.h index d7239f6..4324fdd 100644 --- a/ldap_helper.h +++ b/ldap_helper.h @@ -1,4 +1,5 @@ /* Authors: Martin Nagy <mnagy@redhat.com> + * Adam Tkac <atkac@redhat.com> * * Copyright (C) 2008 Red Hat * see file 'COPYING' for use and warranty information @@ -22,6 +23,56 @@ typedef struct ldap_db ldap_db_t; typedef struct ldap_instance ldap_instance_t; +/* + * some nice words about ldapdb_rdatalist_t: + * - it is list of all RRs which have same owner name + * - rdata buffer is reachable only via dns_rdata_toregion() + * + * structure: + * + * class1 class2 + * type1 type2 + * ttl1 ttl2 + * rdata1 -> rdata2 -> rdata3 rdata4 -> rdata5 + * next_rdatalist -> next_rdatalist ... + */ +typedef LIST(dns_rdatalist_t) ldapdb_rdatalist_t; + +isc_result_t ldapdb_rdatalist_findrdatatype(ldapdb_rdatalist_t *rdatalist, + dns_rdatatype_t rdtype, + dns_rdatalist_t **rdlistp); +/* + * ldapdb_rdatalist_findrdatatype + * + * find rdatalist in rdatalist which matches rdtype and return it in rdlistp. + * + * Returns ISC_R_SUCCESS or ISC_R_NOTFOUND + */ + +void ldapdb_rdatalist_destroy(isc_mem_t *mctx, ldapdb_rdatalist_t *rdatalist); +/* + * ldapdb_rdatalist_destroy + * + * Free rdatalist list and free all associated rdata buffers. + */ + +isc_result_t ldapdb_rdatalist_get(isc_mem_t *mctx, dns_name_t *name, + ldapdb_rdatalist_t *rdatalist); +/* + * ldapdb_rdatalist_get + * + * Find all RRs in ldap database with specified name and return them in + * rdatalist. + * + * XXX Add partial match handling. + * + * Possible errors include: + * + * ISC_R_NOMEMORY + * ISC_R_NOTFOUND + * DNS_R_PARTIALMATCH + */ + isc_result_t new_ldap_db(isc_mem_t *mctx, ldap_db_t **ldap_dbp, const char * const *argv); void destroy_ldap_db(ldap_db_t **ldap_db); |