func AA(d dns.DNS) { fmt.Printf("AA: ") if d.GetAA() { fmt.Println("Authorative") } else { fmt.Println("Non authorative") } }
func RCODE(d dns.DNS) { fmt.Printf("RCODE: ") switch d.GetRCODE() { case 0: fmt.Println("0 No error condition") case 1: fmt.Println("1 Format error") case 2: fmt.Println("2 Server failure") case 3: if d.GetAA() { fmt.Println("3 Name error") } else { fmt.Println("3 ERROR! Only meaningful if AA is set") } case 4: fmt.Println("4 Not implemented") case 5: fmt.Println("5 Refused") default: fmt.Println(">5 Reserved for future use") } }