Shuffle the dns constant to dns.go

This commit is contained in:
Miek Gieben 2011-02-28 10:42:03 +01:00
parent 5c6f9f613e
commit e6dc03baeb
3 changed files with 9 additions and 5 deletions

View File

@ -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
}

7
dns.go
View File

@ -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 {

3
msg.go
View File

@ -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 {