package dns

// NameUsed sets the RRs in the prereq section to
// "Name is in use" RRs. RFC 2136 section 2.4.4.
// See [ANY] on how to make RRs without rdata.
func ( *Msg) ( []RR) {
	if .Answer == nil {
		.Answer = make([]RR, 0, len())
	}
	for ,  := range  {
		.Answer = append(.Answer, &ANY{Hdr: RR_Header{Name: .Header().Name, Ttl: 0, Rrtype: TypeANY, Class: ClassANY}})
	}
}

// NameNotUsed sets the RRs in the prereq section to
// "Name is in not use" RRs. RFC 2136 section 2.4.5.
func ( *Msg) ( []RR) {
	if .Answer == nil {
		.Answer = make([]RR, 0, len())
	}
	for ,  := range  {
		.Answer = append(.Answer, &ANY{Hdr: RR_Header{Name: .Header().Name, Ttl: 0, Rrtype: TypeANY, Class: ClassNONE}})
	}
}

// Used sets the RRs in the prereq section to
// "RRset exists (value dependent -- with rdata)" RRs. RFC 2136 section 2.4.2.
func ( *Msg) ( []RR) {
	if len(.Question) == 0 {
		panic("dns: empty question section")
	}
	if .Answer == nil {
		.Answer = make([]RR, 0, len())
	}
	for ,  := range  {
		 := .Header()
		.Class = .Question[0].Qclass
		.Ttl = 0
		.Answer = append(.Answer, )
	}
}

// RRsetUsed sets the RRs in the prereq section to
// "RRset exists (value independent -- no rdata)" RRs. RFC 2136 section 2.4.1.
// See [ANY] on how to make RRs without rdata.
func ( *Msg) ( []RR) {
	if .Answer == nil {
		.Answer = make([]RR, 0, len())
	}
	for ,  := range  {
		 := .Header()
		.Answer = append(.Answer, &ANY{Hdr: RR_Header{Name: .Name, Ttl: 0, Rrtype: .Rrtype, Class: ClassANY}})
	}
}

// RRsetNotUsed sets the RRs in the prereq section to
// "RRset does not exist" RRs. RFC 2136 section 2.4.3.
// See [ANY] on how to make RRs without rdata.
func ( *Msg) ( []RR) {
	if .Answer == nil {
		.Answer = make([]RR, 0, len())
	}
	for ,  := range  {
		 := .Header()
		.Answer = append(.Answer, &ANY{Hdr: RR_Header{Name: .Name, Ttl: 0, Rrtype: .Rrtype, Class: ClassNONE}})
	}
}

// Insert creates a dynamic update packet that adds an complete RRset, see RFC 2136 section 2.5.1.
// See [ANY] on how to make RRs without rdata.
func ( *Msg) ( []RR) {
	if len(.Question) == 0 {
		panic("dns: empty question section")
	}
	if .Ns == nil {
		.Ns = make([]RR, 0, len())
	}
	for ,  := range  {
		.Header().Class = .Question[0].Qclass
		.Ns = append(.Ns, )
	}
}

// RemoveRRset creates a dynamic update packet that deletes an RRset, see RFC 2136 section 2.5.2.
// See [ANY] on how to make RRs without rdata.
func ( *Msg) ( []RR) {
	if .Ns == nil {
		.Ns = make([]RR, 0, len())
	}
	for ,  := range  {
		 := .Header()
		.Ns = append(.Ns, &ANY{Hdr: RR_Header{Name: .Name, Ttl: 0, Rrtype: .Rrtype, Class: ClassANY}})
	}
}

// RemoveName creates a dynamic update packet that deletes all RRsets of a name, see RFC 2136 section 2.5.3
// See [ANY] on how to make RRs without rdata.
func ( *Msg) ( []RR) {
	if .Ns == nil {
		.Ns = make([]RR, 0, len())
	}
	for ,  := range  {
		.Ns = append(.Ns, &ANY{Hdr: RR_Header{Name: .Header().Name, Ttl: 0, Rrtype: TypeANY, Class: ClassANY}})
	}
}

// Remove creates a dynamic update packet deletes RR from a RRSset, see RFC 2136 section 2.5.4
// See [ANY] on how to make RRs without rdata.
func ( *Msg) ( []RR) {
	if .Ns == nil {
		.Ns = make([]RR, 0, len())
	}
	for ,  := range  {
		 := .Header()
		.Class = ClassNONE
		.Ttl = 0
		.Ns = append(.Ns, )
	}
}