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 { if *nsid {
opt.SetNsid("") opt.SetNsid("")
} }
println("Setting ", *tcp, dns.MaxMsgSize-1)
if *tcp {
opt.SetUDPSize(dns.MaxMsgSize-1)
}
m.Extra = make([]dns.RR, 1) m.Extra = make([]dns.RR, 1)
m.Extra[0] = opt m.Extra[0] = opt
} }

7
dns.go
View File

@ -19,8 +19,11 @@ import (
"strconv" "strconv"
) )
// For RFC1982 (Serial Arithmetic) calculations in 32 bits. const (
const Year68 = 2 << (32 - 1) 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 // Error represents a DNS error
type Error struct { type Error struct {

3
msg.go
View File

@ -26,9 +26,6 @@ import (
"encoding/hex" "encoding/hex"
) )
// The size of the standard buffer.
const DefaultMsgSize = 4096
// A manually-unpacked version of (id, bits). // A manually-unpacked version of (id, bits).
// This is in its own struct for easy printing. // This is in its own struct for easy printing.
type MsgHdr struct { type MsgHdr struct {