Documentation ¶
Index ¶
- Constants
- func ApplyMaximumTTL(m *dns.Msg, ttl uint32)
- func ApplyMinimalTTL(m *dns.Msg, ttl uint32)
- func GetMinimalTTL(m *dns.Msg) uint32
- func IsIOErr(err error) (innerErr error)
- func ReadMsgFromTCP(c io.Reader) (m *dns.Msg, n int, err error)
- func ReadMsgFromUDP(c io.Reader, bufSize int) (m *dns.Msg, n int, err error)
- func ReadUDPMsgFrom(c net.PacketConn, bufSize int) (m *dns.Msg, from net.Addr, n int, err error)
- func SetTTL(m *dns.Msg, ttl uint32)
- func WriteMsgToTCP(c io.Writer, m *dns.Msg) (n int, err error)
- func WriteMsgToUDP(c io.Writer, m *dns.Msg) (n int, err error)
- func WriteRawMsgToTCP(c io.Writer, b []byte) (n int, err error)
- func WriteRawMsgToUDP(c io.Writer, b []byte) (n int, err error)
- func WriteUDPMsgTo(m *dns.Msg, c net.PacketConn, to net.Addr) (n int, err error)
- type IOErr
Constants ¶
const ( IPv4UdpMaxPayload = 1472 // MTU 1500 - 20 IPv4 header - 8 udp header IPv6UdpMaxPayload = 1452 // MTU 1500 - 40 IPv6 header - 8 udp header )
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 ReadMsgFromTCP ¶
ReadMsgFromTCP reads msg from c in RFC 7766 format. n represents how many bytes are read from c. This includes two-octet length field. An io err will be wrapped into an IOErr. IsIOErr(err) can check and unwrap the inner io err.
func ReadMsgFromUDP ¶
ReadMsgFromUDP See ReadUDPMsgFrom.
func ReadUDPMsgFrom ¶
ReadUDPMsgFrom reads dns msg from c in a wire format. The bufSize cannot be greater than dns.MaxMsgSize. Typically IPv4UdpMaxPayload is big enough. An io err will be wrapped into an IOErr. IsIOErr(err) can check and unwrap the inner io err.
func WriteMsgToTCP ¶
WriteMsgToTCP packs and writes m to c in RFC 7766 format. n represents how many bytes are written to c. This includes 2 bytes length header. An io err will be wrapped into an IOErr. IsIOErr(err) can check and unwrap the inner io err.
func WriteMsgToUDP ¶
WriteMsgToUDP packs and writes m to c in a wire format. An io err will be wrapped into an IOErr. IsIOErr(err) can check and unwrap the inner io err.
func WriteRawMsgToTCP ¶
WriteRawMsgToTCP See WriteMsgToTCP
func WriteRawMsgToUDP ¶
WriteRawMsgToUDP See WriteMsgToUDP.
func WriteUDPMsgTo ¶
WriteUDPMsgTo See WriteMsgToUDP.