LIBDNS_SOURCES = rdata.c util.c rr.c packet.c wire2host.c \
host2str.c buffer.c str2host.c resolver.c \
net.c host2wire.c dname.c dnssec.c keys.c \
- higher.c rr_functions.c parse.c error.c
+ higher.c rr_functions.c parse.c error.c zone.c
LIBDNS_HEADERS = ldns/error.h \
ldns/packet.h \
ldns/common.h \
ldns/parse.h \
ldns/rr_functions.h \
ldns/dns.h \
+ ldns/zone.h \
ldns/util.h
PROG_SOURCES = mx.c chaos.c keygen.c
PROG_TARGETS = $(PROG_SOURCES:.c=)
#include <ldns/rr_functions.h>
#include <ldns/keys.h>
#include <ldns/parse.h>
+#include <ldns/zone.h>
#define LDNS_IP4ADDRLEN (32/8)
#define LDNS_IP6ADDRLEN (128/8)
--- /dev/null
+/**
+ * zone.h
+ *
+ * zone definitions
+ * - what is it
+ * - get_glue function
+ * - search etc
+ *
+ * a Net::DNS like library for C
+ *
+ * (c) NLnet Labs, 2004
+ *
+ * See the file LICENSE for the license
+ */
+
+#ifndef _LDNS_ZONE_H
+#define _LDNS_ZONE_H
+
+#include <ldns/common.h>
+#include <ldns/rdata.h>
+#include <ldns/rr.h>
+#include <ldns/error.h>
+
+/**
+ * Zone type
+ *
+ * basicly a list of RR's with some
+ * extra information which comes from the SOA RR
+ */
+struct ldns_struct_zone
+{
+ /** the soa defines a zone */
+ ldns_rr *_soa;
+ /* basicly a zone is a list of rr's */
+ ldns_rr_list *_rrs;
+ /* we could change this to be a b-tree etc etc todo */
+};
+typedef struct ldns_struct_zone ldns_zone;
+
+#endif /* LDNS_ZONE_H */
" ldns/resolver.h
syn keyword ldnsType ldns_resolver
+" ldns/zone.h
+syn keyword ldnsType ldns_rr_zone
+
" ldns/rr.h
syn keyword ldnsType ldns_rr_list
syn keyword ldnsType ldns_rr_descriptor
--- /dev/null
+/* zone.c
+ *
+ * access functions for ldns_zone
+ * a Net::DNS like library for C
+*
+ * (c) NLnet Labs, 2004
+ * See the file LICENSE for the license
+ */
+#include <ldns/config.h>
+
+#include <ldns/dns.h>
+
+#include <strings.h>
+#include <limits.h>
+
+/**
+ * \param[in] z the zone to read from
+ * \return the soa record in the zone
+ */
+ldns_rr *
+ldns_zone_soa(ldns_zone *z)
+{
+ return z->_soa;
+}
+
+/**
+ * \param[in] z the zone to put the new soa in
+ * \param[in] soa the soa to set
+ */
+void
+ldns_zone_set_soa(ldns_zone *z, ldns_rr *soa)
+{
+ z->_soa = soa;
+}
+
+/**
+ * \param[in] z the zone to read from
+ * \return the rrs from this zone
+ */
+ldns_rr_list *
+ldns_zone_rrs(ldns_zone *z)
+{
+ return z->_rrs;
+}
+
+/**
+ * \param[in] z the zone to put the new soa in
+ * \param[in] rrlist the rrlist to use
+ */
+void
+ldns_zone_set_rrs(ldns_zone *z, ldns_rr_list *rrlist)
+{
+ z->_rrs = rrlist;
+}