From b0526987aeff25dd6a954798a1d29fbca29a4f14 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 13 Oct 1999 22:04:18 +0000 Subject: [PATCH] add declaration for dns_zt_load() add function descriptions and contract details. --- lib/dns/include/dns/zt.h | 88 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 87 insertions(+), 1 deletion(-) diff --git a/lib/dns/include/dns/zt.h b/lib/dns/include/dns/zt.h index d3564d21a7..9970981def 100644 --- a/lib/dns/include/dns/zt.h +++ b/lib/dns/include/dns/zt.h @@ -23,20 +23,106 @@ #include #include #include +#include #include -typedef struct dns_zt dns_zt_t; ISC_LANG_BEGINDECLS + dns_result_t dns_zt_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, dns_zt_t **zt); +/* + * Creates a new zone table. + * + * Requires: + * 'mctx' to be initalised. + * + * Returns: + * DNS_R_SUCCESS on success. + * DNS_R_NOMEMORY + */ + dns_result_t dns_zt_mount(dns_zt_t *zt, dns_zone_t *zone); + +/* + * Mounts the zone on the zone table. + * + * Requires: + * 'zt' to be valid + * 'zone' to be valid + * + * Returns: + * DNS_R_SUCCESS + * DNS_R_EXISTS + * DNS_R_NOSPACE + * DNS_R_NOMEMORY + */ + dns_result_t dns_zt_unmount(dns_zt_t *zt, dns_zone_t *zone); + +/* + * Unmount the given zone from the table. + * + * Requires: + * 'zt' to be valid + * 'zone' to be valid + * + * Returns: + * DNS_R_SUCCESS + * DNS_R_NOTFOUND + * DNS_R_NOMEMORY + */ + dns_result_t dns_zt_find(dns_zt_t *zt, dns_name_t *name, dns_name_t *foundname, dns_zone_t **zone); + +/* + * Find the best match for 'name' in 'zt'. If foundname is non NULL + * then the name of the zone found is returned. + * + * Requires: + * 'zt' to be valid + * 'name' to be valid + * 'foundname' to be initalised and associated with a fixedname or NULL + * 'zone' to be non NULL and '*zone' to be NULL + * + * Returns: + * DNS_R_SUCCESS + * DNS_R_PARTIALMATCH + * DNS_R_NOTFOUND + * DNS_R_NOSPACE + */ + void dns_zt_detach(dns_zt_t **ztp); + +/* + * Detach the give zonetable, if the reference count goes to zero the + * zonetable will be freed. In either case 'ztp' is set to NULL. + * + * Requires: + * '*ztp' to be valid + */ + void dns_zt_attach(dns_zt_t *zt, dns_zt_t **ztp); +/* + * Attach 'zt' to '*ztp'. + * + * Requires: + * 'zt' to be valid + * '*ztp' to be NULL + */ + +void dns_zt_load(dns_zt_t *zt); + +/* + * Load all zones in the table. + * + * Requires: + * 'zt' to be valid + */ + + ISC_LANG_ENDDECLS #endif