diff --git a/ex/check-soa/check-soa.go b/ex/check-soa/check-soa.go index 1012b98b..2c8988cd 100644 --- a/ex/check-soa/check-soa.go +++ b/ex/check-soa/check-soa.go @@ -77,7 +77,7 @@ func main() { os.Exit(1) } if ra.Rcode != dns.RcodeSuccess { - fmt.Printf("Error getting the IPv4 address of %s: %s\n", nameserver, dns.Rcode_str[ra.Rcode]) + fmt.Printf("Error getting the IPv4 address of %s: %s\n", nameserver, dns.RcodeToString[ra.Rcode]) os.Exit(1) } for _, ansa := range ra.Answer { @@ -92,7 +92,7 @@ func main() { os.Exit(1) } if raaaa.Rcode != dns.RcodeSuccess { - fmt.Printf("Error getting the IPv6 address of %s: %s\n", nameserver, dns.Rcode_str[raaaa.Rcode]) + fmt.Printf("Error getting the IPv6 address of %s: %s\n", nameserver, dns.RcodeToString[raaaa.Rcode]) os.Exit(1) } for _, ansaaaa := range raaaa.Answer { @@ -123,7 +123,7 @@ func main() { } if soa.Rcode != dns.RcodeSuccess { success = false - fmt.Printf("%s (%s) ", ips, dns.Rcode_str[soa.Rcode]) + fmt.Printf("%s (%s) ", ips, dns.RcodeToString[soa.Rcode]) goto Next } if len(soa.Answer) == 0 { // May happen if the server is a recursor, not authoritative, since we query with RD=0 diff --git a/ex/q/q.go b/ex/q/q.go index 51d2586e..0f111f34 100644 --- a/ex/q/q.go +++ b/ex/q/q.go @@ -78,12 +78,12 @@ Flags: } // First class, then type, to make ANY queries possible // And if it looks like type, it is a type - if k, ok := dns.Str_rr[strings.ToUpper(flag.Arg(i))]; ok { + if k, ok := dns.StringToType[strings.ToUpper(flag.Arg(i))]; ok { qtype = k continue Flags } // If it looks like a class, it is a class - if k, ok := dns.Str_class[strings.ToUpper(flag.Arg(i))]; ok { + if k, ok := dns.StringToClass[strings.ToUpper(flag.Arg(i))]; ok { qclass = k continue Flags } @@ -344,7 +344,7 @@ func getKey(name string, keytag uint16, server string, tcp bool) *dns.RR_DNSKEY // shorten RRSIG to "miek.nl RRSIG(NS)" func shortSig(sig *dns.RR_RRSIG) string { - return sig.Header().Name + " RRSIG(" + dns.Rr_str[sig.TypeCovered] + ")" + return sig.Header().Name + " RRSIG(" + dns.TypeToString[sig.TypeCovered] + ")" } // Walk trough message and short Key data and Sig data @@ -379,7 +379,7 @@ func shortRR(r dns.RR) dns.RR { } func doXfr(c *dns.Client, m *dns.Msg, nameserver string) { - if t, e := c.XfrReceive(m, nameserver); e == nil { + if t, e := c.TransferIn(m, nameserver); e == nil { for r := range t { if r.Error == nil { for _, rr := range r.RR { diff --git a/ex/reflect/reflect.go b/ex/reflect/reflect.go index 03a2f296..ecfe3b6f 100644 --- a/ex/reflect/reflect.go +++ b/ex/reflect/reflect.go @@ -88,9 +88,9 @@ func handleReflect(w dns.ResponseWriter, r *dns.Msg) { switch r.Question[0].Qtype { case dns.TypeAXFR: - c := make(chan *dns.XfrToken) + c := make(chan *dns.Envelope) var e *error - if err := dns.XfrSend(w, r, c, e); err != nil { + if err := dns.TransferOut(w, r, c, e); err != nil { close(c) return } @@ -100,7 +100,7 @@ func handleReflect(w dns.ResponseWriter, r *dns.Msg) { 7200 604800 3600)`) - c <- &dns.XfrToken{RR: []dns.RR{soa, t, rr, soa}} + c <- &dns.Envelope{RR: []dns.RR{soa, t, rr, soa}} close(c) w.Hijack() // w.Close() // Client closes