/* Authors: Martin Nagy * Adam Tkac * * Copyright (C) 2008 Red Hat * see file 'COPYING' for use and warranty information * * 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; version 2 only * * 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, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _LD_LDAP_HELPER_H_ 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); void get_zone_list(ldap_db_t *ldap_db); #endif /* !_LD_LDAP_HELPER_H_ */