From e6dc03baeb6e06cd1b4d973a152d1c9b7f65c7ef Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Mon, 28 Feb 2011 10:42:03 +0100 Subject: [PATCH] Shuffle the dns constant to dns.go --- _examples/q/q.go | 4 ++++ dns.go | 7 +++++-- msg.go | 3 --- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/_examples/q/q.go b/_examples/q/q.go index 538c89f1..a7d78c54 100644 --- a/_examples/q/q.go +++ b/_examples/q/q.go @@ -96,6 +96,10 @@ Flags: if *nsid { opt.SetNsid("") } + println("Setting ", *tcp, dns.MaxMsgSize-1) + if *tcp { + opt.SetUDPSize(dns.MaxMsgSize-1) + } m.Extra = make([]dns.RR, 1) m.Extra[0] = opt } diff --git a/dns.go b/dns.go index 1c15272d..eebfda83 100644 --- a/dns.go +++ b/dns.go @@ -19,8 +19,11 @@ import ( "strconv" ) -// For RFC1982 (Serial Arithmetic) calculations in 32 bits. -const Year68 = 2 << (32 - 1) +const ( + Year68 = 2 << (32 - 1) // For RFC1982 (Serial Arithmetic) calculations in 32 bits. + DefaultMsgSize = 4096 // A standard default for larger than 512 packets. + MaxMsgSize = 65536 // Largest possible DNS packet. +) // Error represents a DNS error type Error struct { diff --git a/msg.go b/msg.go index bf97ced8..82da25a6 100644 --- a/msg.go +++ b/msg.go @@ -26,9 +26,6 @@ import ( "encoding/hex" ) -// The size of the standard buffer. -const DefaultMsgSize = 4096 - // A manually-unpacked version of (id, bits). // This is in its own struct for easy printing. type MsgHdr struct {