Documentation
¶
Overview ¶
Package protocol contains helpers to manage encoding/decoding DNS protocol to/from a byte array.
Index ¶
- Constants
- func ErrorPacket(hdr dnsmessage.Header, rcode dnsmessage.RCode, q *dnsmessage.Question) []byte
- func QDCount(raw []byte) uint16
- func ReadTCPFrame(r io.Reader) ([]byte, error)
- func RequestSanityCheck(raw []byte) bool
- func ResponseSanityCheck(raw []byte) bool
- func SetTxnID(raw []byte, id uint16)
- func WriteTCPFrame(w io.Writer, msg []byte) error
Constants ¶
View Source
const ( // TypeIXFR is the incremental zone transfer QTYPE (RFC 1995). TypeIXFR dnsmessage.Type = 251 )
Variables ¶
This section is empty.
Functions ¶
func ErrorPacket ¶
func ErrorPacket(hdr dnsmessage.Header, rcode dnsmessage.RCode, q *dnsmessage.Question) []byte
ErrorPacket returns a serialized DNS packet signaling an error.
func ReadTCPFrame ¶
ReadTCPFrame reads a single RFC 1035 §4.2.2 2-byte big-endian length-prefixed DNS message from r.
func RequestSanityCheck ¶
RequestSanityCheck filters out obviously invalid packets.
func ResponseSanityCheck ¶
ResponseSanityCheck filters out obviously invalid packets.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.