Documentation
¶
Index ¶
- func AddECS(opt *dns.OPT, ecs *dns.EDNS0_SUBNET, overwrite bool) (newECS bool)
- func ApplyMaximumTTL(m *dns.Msg, ttl uint32)
- func ApplyMinimalTTL(m *dns.Msg, ttl uint32)
- func FakeSOA(name string) *dns.SOA
- func GenEmptyReply(q *dns.Msg, rcode int) *dns.Msg
- func GetECS(opt *dns.OPT) (e *dns.EDNS0_SUBNET)
- func GetEDNS0Option(opt *dns.OPT, option uint16) dns.EDNS0
- func GetMinimalTTL(m *dns.Msg) uint32
- func GetMsgECS(m *dns.Msg) (e *dns.EDNS0_SUBNET)
- func NewEDNS0Subnet(ip net.IP, mask uint8, v6 bool) *dns.EDNS0_SUBNET
- func PadToMinimum(m *dns.Msg, minLen int) (upgraded, newPadding bool)
- func QclassToString(u uint16) string
- func QtypeToString(u uint16) string
- func ReadMsgFromTCP(c io.Reader) (*dns.Msg, int, error)
- func ReadMsgFromUDP(c io.Reader, bufSize int) (*dns.Msg, int, error)
- func ReadRawMsgFromTCP(c io.Reader) (*pool.Buffer, int, error)
- func RemoveECS(opt *dns.OPT)
- func RemoveEDNS0(m *dns.Msg)
- func RemoveEDNS0Option(opt *dns.OPT, option uint16)
- func RemoveMsgECS(m *dns.Msg)
- func SetTTL(m *dns.Msg, ttl uint32)
- func SubtractTTL(m *dns.Msg, delta uint32) (overflowed bool)
- func UpgradeEDNS0(m *dns.Msg) *dns.OPT
- func WriteMsgToTCP(c io.Writer, m *dns.Msg) (n int, err error)
- func WriteMsgToUDP(c io.Writer, m *dns.Msg) (int, error)
- func WriteRawMsgToTCP(c io.Writer, b []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyMaximumTTL ¶
func ApplyMinimalTTL ¶
func GetMinimalTTL ¶
GetMinimalTTL returns the minimal ttl of this msg. If msg m has no record, it returns 0.
func NewEDNS0Subnet ¶
func PadToMinimum ¶
PadToMinimum pads m to the minimum length. If the length of m is larger than minLen, PadToMinimum won't do anything. upgraded indicates the m was upgraded to an EDNS0 msg. newPadding indicates the Padding option is new to m.
func QclassToString ¶
func QtypeToString ¶
func ReadMsgFromTCP ¶
ReadMsgFromTCP reads msg from c in RFC 1035 format (msg is prefixed with a two byte length field). n represents how many bytes are read from c.
func ReadRawMsgFromTCP ¶
ReadRawMsgFromTCP reads msg from c in RFC 1035 format (msg is prefixed with a two byte length field). n represents how many bytes are read from c.
func RemoveEDNS0Option ¶
func RemoveMsgECS ¶
RemoveMsgECS removes the *dns.EDNS0_SUBNET record in m.
func SubtractTTL ¶
SubtractTTL subtract delta from every m's RR. If RR's TTL is smaller than delta, SubtractTTL will return overflowed = true.
func UpgradeEDNS0 ¶
UpgradeEDNS0 enables EDNS0 for m and returns it's dns.OPT record. m must be a msg without dns.OPT.
func WriteMsgToTCP ¶
WriteMsgToTCP packs and writes m to c in RFC 1035 format. n represents how many bytes are written to c.
Types ¶
This section is empty.