documenation
This commit is contained in:
parent
47c859bc81
commit
6f7aad15d8
|
@ -41,7 +41,7 @@ func (dns *Msg) SetNotify(z string) *Msg {
|
|||
return dns
|
||||
}
|
||||
|
||||
// SetRcode creates an error packet.
|
||||
// SetRcode creates an error packet suitable for the request.
|
||||
func (dns *Msg) SetRcode(request *Msg, rcode int) *Msg {
|
||||
dns.MsgHdr.Rcode = rcode
|
||||
dns.MsgHdr.Opcode = OpcodeQuery
|
||||
|
@ -64,7 +64,7 @@ func (dns *Msg) SetRcodeFormatError(request *Msg) *Msg {
|
|||
}
|
||||
|
||||
// SetUpdate makes the message a dynamic update packet. It
|
||||
// sets the ZONE section to: z, TypeSOA, classINET.
|
||||
// sets the ZONE section to: z, TypeSOA, ClassINET.
|
||||
func (dns *Msg) SetUpdate(z string) *Msg {
|
||||
dns.MsgHdr.Id = Id()
|
||||
dns.MsgHdr.Response = false
|
||||
|
@ -98,7 +98,7 @@ func (dns *Msg) SetAxfr(z string) *Msg {
|
|||
}
|
||||
|
||||
// SetTsig appends a TSIG RR to the message.
|
||||
// This is only a skeleton Tsig RR that is added as the last RR in the
|
||||
// This is only a skeleton TSIG RR that is added as the last RR in the
|
||||
// additional section. The Tsig is calculated when the message is being send.
|
||||
func (dns *Msg) SetTsig(z, algo string, fudge, timesigned int64) *Msg {
|
||||
t := new(RR_TSIG)
|
||||
|
|
|
@ -306,7 +306,7 @@ func (s *RR_RRSIG) Sign(k PrivateKey, rrset []RR) error {
|
|||
|
||||
// Verify validates an RRSet with the signature and key. This is only the
|
||||
// cryptographic test, the signature validity period must be checked separately.
|
||||
// This function modifies the rdata of some RRs (lowercases domain names) for the validation to work.
|
||||
// This function copies the rdata of some RRs (to lowercases domain names) for the validation to work.
|
||||
func (s *RR_RRSIG) Verify(k *RR_DNSKEY, rrset []RR) error {
|
||||
// First the easy checks
|
||||
if len(rrset) == 0 {
|
||||
|
|
2
msg.go
2
msg.go
|
@ -1118,7 +1118,7 @@ func reverseInt(m map[int]string) map[string]int {
|
|||
return n
|
||||
}
|
||||
|
||||
// Convert a MsgHdr to a string, mimic the way Dig displays headers:
|
||||
// Convert a MsgHdr to a string, with dig-like headers:
|
||||
//
|
||||
//;; opcode: QUERY, status: NOERROR, id: 48404
|
||||
//
|
||||
|
|
|
@ -22,7 +22,7 @@ type Handler interface {
|
|||
type ResponseWriter interface {
|
||||
// RemoteAddr returns the net.Addr of the client that sent the current request.
|
||||
RemoteAddr() net.Addr
|
||||
// TsigStatus returns the status of the Tsig (TsigNone, TsigVerified or TsigBad).
|
||||
// TsigStatus returns the status of the Tsig.
|
||||
TsigStatus() error
|
||||
// Write writes a reply back to the client.
|
||||
Write(*Msg) error
|
||||
|
@ -167,7 +167,7 @@ type Server struct {
|
|||
Addr string // address to listen on, ":dns" if empty
|
||||
Net string // if "tcp" it will invoke a TCP listener, otherwise an UDP one
|
||||
Handler Handler // handler to invoke, dns.DefaultServeMux if nil
|
||||
UDPSize int // default buffer to use to read incoming UDP messages
|
||||
UDPSize int // default buffer size to use to read incoming UDP messages
|
||||
ReadTimeout time.Duration // the net.Conn.SetReadTimeout value for new connections
|
||||
WriteTimeout time.Duration // the net.Conn.SetWriteTimeout value for new connections
|
||||
TsigSecret map[string]string // secret(s) for Tsig map[<zonename>]<base64 secret>
|
||||
|
|
4
zscan.go
4
zscan.go
|
@ -93,7 +93,7 @@ type Token struct {
|
|||
}
|
||||
|
||||
// NewRR reads the RR contained in the string s. Only the first RR is returned.
|
||||
// The class defaults to IN and TTL defaults to DefaultTtl. The full zone file
|
||||
// The class defaults to IN and TTL defaults to 3600. The full zone file
|
||||
// syntax like $TTL, $ORIGIN, etc. is supported.
|
||||
func NewRR(s string) (RR, error) {
|
||||
if s[len(s)-1] != '\n' { // We need a closing newline
|
||||
|
@ -103,7 +103,7 @@ func NewRR(s string) (RR, error) {
|
|||
}
|
||||
|
||||
// ReadRR reads the RR contained in q. Only the first RR is returned.
|
||||
// The class defaults to IN and TTL defaults to DefaultTtl.
|
||||
// The class defaults to IN and TTL defaults to 3600.
|
||||
func ReadRR(q io.Reader, filename string) (RR, error) {
|
||||
r := <-parseZoneHelper(q, ".", filename, 1)
|
||||
if r.Error != nil {
|
||||
|
|
Loading…
Reference in New Issue