More zone updates

This commit is contained in:
Miek Gieben 2012-07-15 23:15:04 +02:00
parent 00ddf6551c
commit 6e31effe78

View File

@ -6,11 +6,16 @@ import (
"github.com/sauerbraten/radix"
)
// Zone represents a DNS zone.
type Zone struct {
Name string // Name of the zone
*radix.Radix // Zone data
// soa parameters in here TODO(mg)
}
// ZoneData holds all the RR belonging to Name.
// TODO(mg): uitbreiden
type ZoneData struct {
Name string // Domain name for this node
RR map[uint16][]RR // Map of the RR type to the RR
@ -26,6 +31,7 @@ func NewZone(name string) *Zone {
return z
}
// Insert inserts an RR into the zone. Overwrites.
func (z *Zone) Insert(r RR) {
zd := z.Radix.Find(r.Header().Name)
if zd == nil {