Shuffle the dns constant to dns.go
This commit is contained in:
parent
5c6f9f613e
commit
e6dc03baeb
|
@ -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
7
dns.go
|
@ -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
3
msg.go
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue