Fix the all the update operations
This commit is contained in:
parent
7195ce739c
commit
6751a16313
23
update.go
23
update.go
|
@ -79,6 +79,7 @@ func (u *Update) RRsetUsed(rr []RR) {
|
|||
for i, r := range rr {
|
||||
u.Answer[i] = r
|
||||
u.Answer[i].Header().Class = ClassANY
|
||||
u.Answer[i].Header().Ttl = 0
|
||||
u.Answer[i].Header().Rdlength = 0
|
||||
}
|
||||
}
|
||||
|
@ -91,6 +92,7 @@ func (u *Update) RRsetNotUsed(rr []RR) {
|
|||
u.Answer[i] = r
|
||||
u.Answer[i].Header().Class = ClassNONE
|
||||
u.Answer[i].Header().Rdlength = 0
|
||||
u.Answer[i].Header().Ttl = 0
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +105,6 @@ func (u *Update) RRsetNotUsed(rr []RR) {
|
|||
// NONE rrset rr Delete an RR from an RRset
|
||||
// zone rrset rr Add to an RRset
|
||||
|
||||
|
||||
// RRsetAddFull adds an complete RRset, see RFC 2136 section 2.5.1
|
||||
func (u *Update) RRsetAddFull(rr []RR) {
|
||||
u.Ns = make([]RR, len(rr))
|
||||
|
@ -113,17 +114,27 @@ func (u *Update) RRsetAddFull(rr []RR) {
|
|||
}
|
||||
}
|
||||
|
||||
// RRsetDeleteFull delete the full RR, see RFC 2136 section 2.5.2
|
||||
func (u *Update) RRsetDeleteFull(rr []RR) {
|
||||
// RRsetDelete delete an RRset, see RFC 2136 section 2.5.2
|
||||
func (u *Update) RRsetDelete(rr []RR) {
|
||||
u.Ns = make([]RR, len(rr))
|
||||
for i, r := range rr {
|
||||
u.Ns[i] = r
|
||||
u.Ns[i].Header().Class = ClassNONE
|
||||
u.Ns[i].Header().Class = ClassANY
|
||||
u.Ns[i].Header().Rdlength = 0
|
||||
u.Ns[i].Header().Ttl = 0
|
||||
}
|
||||
}
|
||||
|
||||
// RRsetDelete delete the RRset, see RFC 2136 section 2.5.2
|
||||
func (u *Update) DeleteFull(rr []RR) {
|
||||
// NameDelete deletes all RRsets of a name, see RFC 2136 section 2.5.3
|
||||
func (u *Update) NameDelete(rr []RR) {
|
||||
u.Ns = make([]RR, len(rr))
|
||||
for i, r := range rr {
|
||||
u.Ns[i] = &RR_ANY{Hdr: RR_Header{Name: r.Header().Name, Ttl: 0, Rrtype: TypeANY, Class: ClassANY}}
|
||||
}
|
||||
}
|
||||
|
||||
// RRsetDeleteRR deletes RR from the RRSset, see RFC 2136 section 2.5.4
|
||||
func (u *Update) RRsetDeleteRR(rr []RR) {
|
||||
u.Ns = make([]RR, len(rr))
|
||||
for i, r := range rr {
|
||||
u.Ns[i] = r
|
||||
|
|
Loading…
Reference in New Issue