Quite a lot of dependency updates
This commit is contained in:
parent
19647e03a6
commit
26ebb55c8c
6
go.mod
6
go.mod
|
@ -22,9 +22,9 @@ require (
|
|||
github.com/kardianos/service v1.0.1-0.20191211031725-3c356ae54c8a
|
||||
github.com/miekg/dns v1.1.28
|
||||
github.com/powerman/check v1.2.1
|
||||
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae
|
||||
golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4
|
||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a
|
||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527
|
||||
golang.org/x/text v0.3.2 // indirect
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0
|
||||
gopkg.in/yaml.v2 v2.2.7 // indirect
|
||||
|
|
14
go.sum
14
go.sum
|
@ -48,8 +48,6 @@ github.com/k-sone/critbitgo v1.4.0 h1:l71cTyBGeh6X5ATh6Fibgw3+rtNT80BA0uNNWgkPrb
|
|||
github.com/k-sone/critbitgo v1.4.0/go.mod h1:7E6pyoyADnFxlUBEKcnfS49b7SUAQGMK+OAp/UQvo0s=
|
||||
github.com/kardianos/service v1.0.1-0.20191211031725-3c356ae54c8a h1:T/nL7taPRFDwzB7c31FQTuykulaA11ERY3K6NcoQ/Bg=
|
||||
github.com/kardianos/service v1.0.1-0.20191211031725-3c356ae54c8a/go.mod h1:8CzDhVuCuugtsHyZoTvsOBuvonN/UDBvl0kH+BUxvbo=
|
||||
github.com/miekg/dns v1.1.27 h1:aEH/kqUzUxGJ/UHcEKdJY+ugH6WEzsEBBSPa8zuy1aM=
|
||||
github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
|
||||
github.com/miekg/dns v1.1.28 h1:gQhy5bsJa8zTlVI8lywCTZp1lguor+xevFoYlzeCTQY=
|
||||
github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
|
||||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
||||
|
@ -66,15 +64,15 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9
|
|||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d h1:1ZiEyfaQIg3Qh0EoqpwAakHVhecoE5wlSg5GjnafJGw=
|
||||
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4 h1:QmwruyY+bKbDDL0BaglrbZABEali68eoMFhTZpCjYVA=
|
||||
golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0=
|
||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
|
@ -84,8 +82,8 @@ golang.org/x/sys v0.0.0-20190529164535-6a60838ec259/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||
golang.org/x/sys v0.0.0-20190909082730-f460065e899a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191029155521-f43be2a4598c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
|
||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
||||
|
|
|
@ -105,7 +105,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
|
||||
// additional section. The Tsig is calculated when the message is being send.
|
||||
// additional section. The TSIG is calculated when the message is being send.
|
||||
func (dns *Msg) SetTsig(z, algo string, fudge uint16, timesigned int64) *Msg {
|
||||
t := new(TSIG)
|
||||
t.Hdr = RR_Header{z, TypeTSIG, ClassANY, 0, 0}
|
||||
|
@ -364,7 +364,7 @@ func (t Type) String() string {
|
|||
// String returns the string representation for the class c.
|
||||
func (c Class) String() string {
|
||||
if s, ok := ClassToString[uint16(c)]; ok {
|
||||
// Only emit mnemonics when they are unambiguous, specically ANY is in both.
|
||||
// Only emit mnemonics when they are unambiguous, specially ANY is in both.
|
||||
if _, ok := StringToType[s]; !ok {
|
||||
return s
|
||||
}
|
||||
|
|
|
@ -209,7 +209,7 @@ Basic use pattern validating and replying to a message that has TSIG set.
|
|||
// *Msg r has an TSIG record and it was validated
|
||||
m.SetTsig("axfr.", dns.HmacMD5, 300, time.Now().Unix())
|
||||
} else {
|
||||
// *Msg r has an TSIG records and it was not valided
|
||||
// *Msg r has an TSIG records and it was not validated
|
||||
}
|
||||
}
|
||||
w.WriteMsg(m)
|
||||
|
|
|
@ -3,9 +3,8 @@ package dns
|
|||
//go:generate go run duplicate_generate.go
|
||||
|
||||
// IsDuplicate checks of r1 and r2 are duplicates of each other, excluding the TTL.
|
||||
// So this means the header data is equal *and* the RDATA is the same. Return true
|
||||
// is so, otherwise false.
|
||||
// It's a protocol violation to have identical RRs in a message.
|
||||
// So this means the header data is equal *and* the RDATA is the same. Returns true
|
||||
// if so, otherwise false. It's a protocol violation to have identical RRs in a message.
|
||||
func IsDuplicate(r1, r2 RR) bool {
|
||||
// Check whether the record header is identical.
|
||||
if !r1.Header().isDuplicate(r2.Header()) {
|
||||
|
|
|
@ -83,7 +83,7 @@ func CompareDomainName(s1, s2 string) (n int) {
|
|||
return
|
||||
}
|
||||
|
||||
// CountLabel counts the the number of labels in the string s.
|
||||
// CountLabel counts the number of labels in the string s.
|
||||
// s must be a syntactically valid domain name.
|
||||
func CountLabel(s string) (labels int) {
|
||||
if s == "." {
|
||||
|
|
|
@ -661,7 +661,6 @@ func unpackRRslice(l int, msg []byte, off int) (dst1 []RR, off1 int, err error)
|
|||
}
|
||||
// If offset does not increase anymore, l is a lie
|
||||
if off1 == off {
|
||||
l = i
|
||||
break
|
||||
}
|
||||
dst = append(dst, r)
|
||||
|
|
|
@ -73,7 +73,7 @@ func (dns *Msg) Truncate(size int) {
|
|||
|
||||
var numExtra int
|
||||
if l < size {
|
||||
l, numExtra = truncateLoop(dns.Extra, size, l, compression)
|
||||
_, numExtra = truncateLoop(dns.Extra, size, l, compression)
|
||||
}
|
||||
|
||||
// See the function documentation for when we set this.
|
||||
|
|
|
@ -43,7 +43,7 @@ func HashName(label string, ha uint8, iter uint16, salt string) string {
|
|||
return toBase32(nsec3)
|
||||
}
|
||||
|
||||
// Cover returns true if a name is covered by the NSEC3 record
|
||||
// Cover returns true if a name is covered by the NSEC3 record.
|
||||
func (rr *NSEC3) Cover(name string) bool {
|
||||
nameHash := HashName(name, rr.Hash, rr.Iterations, rr.Salt)
|
||||
owner := strings.ToUpper(rr.Hdr.Name)
|
||||
|
|
|
@ -13,7 +13,6 @@ type PrivateRdata interface {
|
|||
// Pack is used when packing a private RR into a buffer.
|
||||
Pack([]byte) (int, error)
|
||||
// Unpack is used when unpacking a private RR from a buffer.
|
||||
// TODO(miek): diff. signature than Pack, see edns0.go for instance.
|
||||
Unpack([]byte) (int, error)
|
||||
// Copy copies the Rdata into the PrivateRdata argument.
|
||||
Copy(PrivateRdata) error
|
||||
|
|
|
@ -103,15 +103,12 @@ type ttlState struct {
|
|||
isByDirective bool // isByDirective indicates whether ttl was set by a $TTL directive
|
||||
}
|
||||
|
||||
// NewRR reads the RR contained in the string s. Only the first RR is
|
||||
// returned. If s contains no records, NewRR will return nil with no
|
||||
// error.
|
||||
// NewRR reads the RR contained in the string s. Only the first RR is returned.
|
||||
// If s contains no records, NewRR will return nil with no error.
|
||||
//
|
||||
// The class defaults to IN and TTL defaults to 3600. The full zone
|
||||
// file syntax like $TTL, $ORIGIN, etc. is supported.
|
||||
//
|
||||
// All fields of the returned RR are set, except RR.Header().Rdlength
|
||||
// which is set to 0.
|
||||
// The class defaults to IN and TTL defaults to 3600. The full zone file syntax
|
||||
// like $TTL, $ORIGIN, etc. is supported. All fields of the returned RR are
|
||||
// set, except RR.Header().Rdlength which is set to 0.
|
||||
func NewRR(s string) (RR, error) {
|
||||
if len(s) > 0 && s[len(s)-1] != '\n' { // We need a closing newline
|
||||
return ReadRR(strings.NewReader(s+"\n"), "")
|
||||
|
@ -247,7 +244,7 @@ type ZoneParser struct {
|
|||
|
||||
includeDepth uint8
|
||||
|
||||
includeAllowed bool
|
||||
includeAllowed bool
|
||||
generateDisallowed bool
|
||||
}
|
||||
|
||||
|
|
|
@ -403,7 +403,7 @@ func (rr *SOA) parse(c *zlexer, o string) *ParseError {
|
|||
if l.err {
|
||||
return &ParseError{"", "bad SOA zone parameter", l}
|
||||
}
|
||||
if j, e := strconv.ParseUint(l.token, 10, 32); e != nil {
|
||||
if j, err := strconv.ParseUint(l.token, 10, 32); err != nil {
|
||||
if i == 0 {
|
||||
// Serial must be a number
|
||||
return &ParseError{"", "bad SOA zone parameter", l}
|
||||
|
@ -446,16 +446,16 @@ func (rr *SRV) parse(c *zlexer, o string) *ParseError {
|
|||
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next() // zString
|
||||
i, e = strconv.ParseUint(l.token, 10, 16)
|
||||
if e != nil || l.err {
|
||||
i, e1 := strconv.ParseUint(l.token, 10, 16)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad SRV Weight", l}
|
||||
}
|
||||
rr.Weight = uint16(i)
|
||||
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next() // zString
|
||||
i, e = strconv.ParseUint(l.token, 10, 16)
|
||||
if e != nil || l.err {
|
||||
i, e2 := strconv.ParseUint(l.token, 10, 16)
|
||||
if e2 != nil || l.err {
|
||||
return &ParseError{"", "bad SRV Port", l}
|
||||
}
|
||||
rr.Port = uint16(i)
|
||||
|
@ -482,8 +482,8 @@ func (rr *NAPTR) parse(c *zlexer, o string) *ParseError {
|
|||
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next() // zString
|
||||
i, e = strconv.ParseUint(l.token, 10, 16)
|
||||
if e != nil || l.err {
|
||||
i, e1 := strconv.ParseUint(l.token, 10, 16)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad NAPTR Preference", l}
|
||||
}
|
||||
rr.Preference = uint16(i)
|
||||
|
@ -581,9 +581,9 @@ func (rr *TALINK) parse(c *zlexer, o string) *ParseError {
|
|||
|
||||
func (rr *LOC) parse(c *zlexer, o string) *ParseError {
|
||||
// Non zero defaults for LOC record, see RFC 1876, Section 3.
|
||||
rr.HorizPre = 165 // 10000
|
||||
rr.VertPre = 162 // 10
|
||||
rr.Size = 18 // 1
|
||||
rr.Size = 0x12 // 1e2 cm (1m)
|
||||
rr.HorizPre = 0x16 // 1e6 cm (10000m)
|
||||
rr.VertPre = 0x13 // 1e3 cm (10m)
|
||||
ok := false
|
||||
|
||||
// North
|
||||
|
@ -600,15 +600,15 @@ func (rr *LOC) parse(c *zlexer, o string) *ParseError {
|
|||
if rr.Latitude, ok = locCheckNorth(l.token, rr.Latitude); ok {
|
||||
goto East
|
||||
}
|
||||
i, e = strconv.ParseUint(l.token, 10, 32)
|
||||
if e != nil || l.err {
|
||||
if i, err := strconv.ParseUint(l.token, 10, 32); err != nil || l.err {
|
||||
return &ParseError{"", "bad LOC Latitude minutes", l}
|
||||
} else {
|
||||
rr.Latitude += 1000 * 60 * uint32(i)
|
||||
}
|
||||
rr.Latitude += 1000 * 60 * uint32(i)
|
||||
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
if i, e := strconv.ParseFloat(l.token, 32); e != nil || l.err {
|
||||
if i, err := strconv.ParseFloat(l.token, 32); err != nil || l.err {
|
||||
return &ParseError{"", "bad LOC Latitude seconds", l}
|
||||
} else {
|
||||
rr.Latitude += uint32(1000 * i)
|
||||
|
@ -626,7 +626,7 @@ East:
|
|||
// East
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
if i, e := strconv.ParseUint(l.token, 10, 32); e != nil || l.err {
|
||||
if i, err := strconv.ParseUint(l.token, 10, 32); err != nil || l.err {
|
||||
return &ParseError{"", "bad LOC Longitude", l}
|
||||
} else {
|
||||
rr.Longitude = 1000 * 60 * 60 * uint32(i)
|
||||
|
@ -637,14 +637,14 @@ East:
|
|||
if rr.Longitude, ok = locCheckEast(l.token, rr.Longitude); ok {
|
||||
goto Altitude
|
||||
}
|
||||
if i, e := strconv.ParseUint(l.token, 10, 32); e != nil || l.err {
|
||||
if i, err := strconv.ParseUint(l.token, 10, 32); err != nil || l.err {
|
||||
return &ParseError{"", "bad LOC Longitude minutes", l}
|
||||
} else {
|
||||
rr.Longitude += 1000 * 60 * uint32(i)
|
||||
}
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
if i, e := strconv.ParseFloat(l.token, 32); e != nil || l.err {
|
||||
if i, err := strconv.ParseFloat(l.token, 32); err != nil || l.err {
|
||||
return &ParseError{"", "bad LOC Longitude seconds", l}
|
||||
} else {
|
||||
rr.Longitude += uint32(1000 * i)
|
||||
|
@ -667,7 +667,7 @@ Altitude:
|
|||
if l.token[len(l.token)-1] == 'M' || l.token[len(l.token)-1] == 'm' {
|
||||
l.token = l.token[0 : len(l.token)-1]
|
||||
}
|
||||
if i, e := strconv.ParseFloat(l.token, 32); e != nil {
|
||||
if i, err := strconv.ParseFloat(l.token, 32); err != nil {
|
||||
return &ParseError{"", "bad LOC Altitude", l}
|
||||
} else {
|
||||
rr.Altitude = uint32(i*100.0 + 10000000.0 + 0.5)
|
||||
|
@ -681,23 +681,23 @@ Altitude:
|
|||
case zString:
|
||||
switch count {
|
||||
case 0: // Size
|
||||
e, m, ok := stringToCm(l.token)
|
||||
exp, m, ok := stringToCm(l.token)
|
||||
if !ok {
|
||||
return &ParseError{"", "bad LOC Size", l}
|
||||
}
|
||||
rr.Size = e&0x0f | m<<4&0xf0
|
||||
rr.Size = exp&0x0f | m<<4&0xf0
|
||||
case 1: // HorizPre
|
||||
e, m, ok := stringToCm(l.token)
|
||||
exp, m, ok := stringToCm(l.token)
|
||||
if !ok {
|
||||
return &ParseError{"", "bad LOC HorizPre", l}
|
||||
}
|
||||
rr.HorizPre = e&0x0f | m<<4&0xf0
|
||||
rr.HorizPre = exp&0x0f | m<<4&0xf0
|
||||
case 2: // VertPre
|
||||
e, m, ok := stringToCm(l.token)
|
||||
exp, m, ok := stringToCm(l.token)
|
||||
if !ok {
|
||||
return &ParseError{"", "bad LOC VertPre", l}
|
||||
}
|
||||
rr.VertPre = e&0x0f | m<<4&0xf0
|
||||
rr.VertPre = exp&0x0f | m<<4&0xf0
|
||||
}
|
||||
count++
|
||||
case zBlank:
|
||||
|
@ -762,7 +762,7 @@ func (rr *CERT) parse(c *zlexer, o string) *ParseError {
|
|||
l, _ := c.Next()
|
||||
if v, ok := StringToCertType[l.token]; ok {
|
||||
rr.Type = v
|
||||
} else if i, e := strconv.ParseUint(l.token, 10, 16); e != nil {
|
||||
} else if i, err := strconv.ParseUint(l.token, 10, 16); err != nil {
|
||||
return &ParseError{"", "bad CERT Type", l}
|
||||
} else {
|
||||
rr.Type = uint16(i)
|
||||
|
@ -778,7 +778,7 @@ func (rr *CERT) parse(c *zlexer, o string) *ParseError {
|
|||
l, _ = c.Next() // zString
|
||||
if v, ok := StringToAlgorithm[l.token]; ok {
|
||||
rr.Algorithm = v
|
||||
} else if i, e := strconv.ParseUint(l.token, 10, 8); e != nil {
|
||||
} else if i, err := strconv.ParseUint(l.token, 10, 8); err != nil {
|
||||
return &ParseError{"", "bad CERT Algorithm", l}
|
||||
} else {
|
||||
rr.Algorithm = uint8(i)
|
||||
|
@ -812,8 +812,8 @@ func (rr *CSYNC) parse(c *zlexer, o string) *ParseError {
|
|||
c.Next() // zBlank
|
||||
|
||||
l, _ = c.Next()
|
||||
j, e = strconv.ParseUint(l.token, 10, 16)
|
||||
if e != nil {
|
||||
j, e1 := strconv.ParseUint(l.token, 10, 16)
|
||||
if e1 != nil {
|
||||
// Serial must be a number
|
||||
return &ParseError{"", "bad CSYNC flags", l}
|
||||
}
|
||||
|
@ -845,9 +845,7 @@ func (rr *CSYNC) parse(c *zlexer, o string) *ParseError {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (rr *SIG) parse(c *zlexer, o string) *ParseError {
|
||||
return rr.RRSIG.parse(c, o)
|
||||
}
|
||||
func (rr *SIG) parse(c *zlexer, o string) *ParseError { return rr.RRSIG.parse(c, o) }
|
||||
|
||||
func (rr *RRSIG) parse(c *zlexer, o string) *ParseError {
|
||||
l, _ := c.Next()
|
||||
|
@ -868,24 +866,24 @@ func (rr *RRSIG) parse(c *zlexer, o string) *ParseError {
|
|||
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, err := strconv.ParseUint(l.token, 10, 8)
|
||||
if err != nil || l.err {
|
||||
i, e := strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
return &ParseError{"", "bad RRSIG Algorithm", l}
|
||||
}
|
||||
rr.Algorithm = uint8(i)
|
||||
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, err = strconv.ParseUint(l.token, 10, 8)
|
||||
if err != nil || l.err {
|
||||
i, e1 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad RRSIG Labels", l}
|
||||
}
|
||||
rr.Labels = uint8(i)
|
||||
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, err = strconv.ParseUint(l.token, 10, 32)
|
||||
if err != nil || l.err {
|
||||
i, e2 := strconv.ParseUint(l.token, 10, 32)
|
||||
if e2 != nil || l.err {
|
||||
return &ParseError{"", "bad RRSIG OrigTtl", l}
|
||||
}
|
||||
rr.OrigTtl = uint32(i)
|
||||
|
@ -918,8 +916,8 @@ func (rr *RRSIG) parse(c *zlexer, o string) *ParseError {
|
|||
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, err = strconv.ParseUint(l.token, 10, 16)
|
||||
if err != nil || l.err {
|
||||
i, e3 := strconv.ParseUint(l.token, 10, 16)
|
||||
if e3 != nil || l.err {
|
||||
return &ParseError{"", "bad RRSIG KeyTag", l}
|
||||
}
|
||||
rr.KeyTag = uint16(i)
|
||||
|
@ -933,9 +931,9 @@ func (rr *RRSIG) parse(c *zlexer, o string) *ParseError {
|
|||
}
|
||||
rr.SignerName = name
|
||||
|
||||
s, e := endingToString(c, "bad RRSIG Signature")
|
||||
if e != nil {
|
||||
return e
|
||||
s, e4 := endingToString(c, "bad RRSIG Signature")
|
||||
if e4 != nil {
|
||||
return e4
|
||||
}
|
||||
rr.Signature = s
|
||||
|
||||
|
@ -985,15 +983,15 @@ func (rr *NSEC3) parse(c *zlexer, o string) *ParseError {
|
|||
rr.Hash = uint8(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, e = strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
i, e1 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad NSEC3 Flags", l}
|
||||
}
|
||||
rr.Flags = uint8(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, e = strconv.ParseUint(l.token, 10, 16)
|
||||
if e != nil || l.err {
|
||||
i, e2 := strconv.ParseUint(l.token, 10, 16)
|
||||
if e2 != nil || l.err {
|
||||
return &ParseError{"", "bad NSEC3 Iterations", l}
|
||||
}
|
||||
rr.Iterations = uint16(i)
|
||||
|
@ -1050,22 +1048,22 @@ func (rr *NSEC3PARAM) parse(c *zlexer, o string) *ParseError {
|
|||
rr.Hash = uint8(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, e = strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
i, e1 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad NSEC3PARAM Flags", l}
|
||||
}
|
||||
rr.Flags = uint8(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, e = strconv.ParseUint(l.token, 10, 16)
|
||||
if e != nil || l.err {
|
||||
i, e2 := strconv.ParseUint(l.token, 10, 16)
|
||||
if e2 != nil || l.err {
|
||||
return &ParseError{"", "bad NSEC3PARAM Iterations", l}
|
||||
}
|
||||
rr.Iterations = uint16(i)
|
||||
c.Next()
|
||||
l, _ = c.Next()
|
||||
if l.token != "-" {
|
||||
rr.SaltLength = uint8(len(l.token))
|
||||
rr.SaltLength = uint8(len(l.token) / 2)
|
||||
rr.Salt = l.token
|
||||
}
|
||||
return slurpRemainder(c)
|
||||
|
@ -1132,15 +1130,15 @@ func (rr *SSHFP) parse(c *zlexer, o string) *ParseError {
|
|||
rr.Algorithm = uint8(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, e = strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
i, e1 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad SSHFP Type", l}
|
||||
}
|
||||
rr.Type = uint8(i)
|
||||
c.Next() // zBlank
|
||||
s, e1 := endingToString(c, "bad SSHFP Fingerprint")
|
||||
if e1 != nil {
|
||||
return e1
|
||||
s, e2 := endingToString(c, "bad SSHFP Fingerprint")
|
||||
if e2 != nil {
|
||||
return e2
|
||||
}
|
||||
rr.FingerPrint = s
|
||||
return nil
|
||||
|
@ -1155,37 +1153,32 @@ func (rr *DNSKEY) parseDNSKEY(c *zlexer, o, typ string) *ParseError {
|
|||
rr.Flags = uint16(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next() // zString
|
||||
i, e = strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
i, e1 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad " + typ + " Protocol", l}
|
||||
}
|
||||
rr.Protocol = uint8(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next() // zString
|
||||
i, e = strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
i, e2 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e2 != nil || l.err {
|
||||
return &ParseError{"", "bad " + typ + " Algorithm", l}
|
||||
}
|
||||
rr.Algorithm = uint8(i)
|
||||
s, e1 := endingToString(c, "bad "+typ+" PublicKey")
|
||||
if e1 != nil {
|
||||
return e1
|
||||
s, e3 := endingToString(c, "bad "+typ+" PublicKey")
|
||||
if e3 != nil {
|
||||
return e3
|
||||
}
|
||||
rr.PublicKey = s
|
||||
return nil
|
||||
}
|
||||
|
||||
func (rr *DNSKEY) parse(c *zlexer, o string) *ParseError {
|
||||
return rr.parseDNSKEY(c, o, "DNSKEY")
|
||||
}
|
||||
|
||||
func (rr *KEY) parse(c *zlexer, o string) *ParseError {
|
||||
return rr.parseDNSKEY(c, o, "KEY")
|
||||
}
|
||||
|
||||
func (rr *CDNSKEY) parse(c *zlexer, o string) *ParseError {
|
||||
return rr.parseDNSKEY(c, o, "CDNSKEY")
|
||||
}
|
||||
func (rr *DNSKEY) parse(c *zlexer, o string) *ParseError { return rr.parseDNSKEY(c, o, "DNSKEY") }
|
||||
func (rr *KEY) parse(c *zlexer, o string) *ParseError { return rr.parseDNSKEY(c, o, "KEY") }
|
||||
func (rr *CDNSKEY) parse(c *zlexer, o string) *ParseError { return rr.parseDNSKEY(c, o, "CDNSKEY") }
|
||||
func (rr *DS) parse(c *zlexer, o string) *ParseError { return rr.parseDS(c, o, "DS") }
|
||||
func (rr *DLV) parse(c *zlexer, o string) *ParseError { return rr.parseDS(c, o, "DLV") }
|
||||
func (rr *CDS) parse(c *zlexer, o string) *ParseError { return rr.parseDS(c, o, "CDS") }
|
||||
|
||||
func (rr *RKEY) parse(c *zlexer, o string) *ParseError {
|
||||
l, _ := c.Next()
|
||||
|
@ -1196,21 +1189,21 @@ func (rr *RKEY) parse(c *zlexer, o string) *ParseError {
|
|||
rr.Flags = uint16(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next() // zString
|
||||
i, e = strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
i, e1 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad RKEY Protocol", l}
|
||||
}
|
||||
rr.Protocol = uint8(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next() // zString
|
||||
i, e = strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
i, e2 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e2 != nil || l.err {
|
||||
return &ParseError{"", "bad RKEY Algorithm", l}
|
||||
}
|
||||
rr.Algorithm = uint8(i)
|
||||
s, e1 := endingToString(c, "bad RKEY PublicKey")
|
||||
if e1 != nil {
|
||||
return e1
|
||||
s, e3 := endingToString(c, "bad RKEY PublicKey")
|
||||
if e3 != nil {
|
||||
return e3
|
||||
}
|
||||
rr.PublicKey = s
|
||||
return nil
|
||||
|
@ -1243,15 +1236,15 @@ func (rr *GPOS) parse(c *zlexer, o string) *ParseError {
|
|||
rr.Longitude = l.token
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
_, e = strconv.ParseFloat(l.token, 64)
|
||||
if e != nil || l.err {
|
||||
_, e1 := strconv.ParseFloat(l.token, 64)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad GPOS Latitude", l}
|
||||
}
|
||||
rr.Latitude = l.token
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
_, e = strconv.ParseFloat(l.token, 64)
|
||||
if e != nil || l.err {
|
||||
_, e2 := strconv.ParseFloat(l.token, 64)
|
||||
if e2 != nil || l.err {
|
||||
return &ParseError{"", "bad GPOS Altitude", l}
|
||||
}
|
||||
rr.Altitude = l.token
|
||||
|
@ -1267,7 +1260,7 @@ func (rr *DS) parseDS(c *zlexer, o, typ string) *ParseError {
|
|||
rr.KeyTag = uint16(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
if i, e = strconv.ParseUint(l.token, 10, 8); e != nil {
|
||||
if i, err := strconv.ParseUint(l.token, 10, 8); err != nil {
|
||||
tokenUpper := strings.ToUpper(l.token)
|
||||
i, ok := StringToAlgorithm[tokenUpper]
|
||||
if !ok || l.err {
|
||||
|
@ -1279,31 +1272,19 @@ func (rr *DS) parseDS(c *zlexer, o, typ string) *ParseError {
|
|||
}
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, e = strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
i, e1 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad " + typ + " DigestType", l}
|
||||
}
|
||||
rr.DigestType = uint8(i)
|
||||
s, e1 := endingToString(c, "bad "+typ+" Digest")
|
||||
if e1 != nil {
|
||||
return e1
|
||||
s, e2 := endingToString(c, "bad "+typ+" Digest")
|
||||
if e2 != nil {
|
||||
return e2
|
||||
}
|
||||
rr.Digest = s
|
||||
return nil
|
||||
}
|
||||
|
||||
func (rr *DS) parse(c *zlexer, o string) *ParseError {
|
||||
return rr.parseDS(c, o, "DS")
|
||||
}
|
||||
|
||||
func (rr *DLV) parse(c *zlexer, o string) *ParseError {
|
||||
return rr.parseDS(c, o, "DLV")
|
||||
}
|
||||
|
||||
func (rr *CDS) parse(c *zlexer, o string) *ParseError {
|
||||
return rr.parseDS(c, o, "CDS")
|
||||
}
|
||||
|
||||
func (rr *TA) parse(c *zlexer, o string) *ParseError {
|
||||
l, _ := c.Next()
|
||||
i, e := strconv.ParseUint(l.token, 10, 16)
|
||||
|
@ -1313,7 +1294,7 @@ func (rr *TA) parse(c *zlexer, o string) *ParseError {
|
|||
rr.KeyTag = uint16(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
if i, e := strconv.ParseUint(l.token, 10, 8); e != nil {
|
||||
if i, err := strconv.ParseUint(l.token, 10, 8); err != nil {
|
||||
tokenUpper := strings.ToUpper(l.token)
|
||||
i, ok := StringToAlgorithm[tokenUpper]
|
||||
if !ok || l.err {
|
||||
|
@ -1325,14 +1306,14 @@ func (rr *TA) parse(c *zlexer, o string) *ParseError {
|
|||
}
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, e = strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
i, e1 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad TA DigestType", l}
|
||||
}
|
||||
rr.DigestType = uint8(i)
|
||||
s, err := endingToString(c, "bad TA Digest")
|
||||
if err != nil {
|
||||
return err
|
||||
s, e2 := endingToString(c, "bad TA Digest")
|
||||
if e2 != nil {
|
||||
return e2
|
||||
}
|
||||
rr.Digest = s
|
||||
return nil
|
||||
|
@ -1347,22 +1328,22 @@ func (rr *TLSA) parse(c *zlexer, o string) *ParseError {
|
|||
rr.Usage = uint8(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, e = strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
i, e1 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad TLSA Selector", l}
|
||||
}
|
||||
rr.Selector = uint8(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, e = strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
i, e2 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e2 != nil || l.err {
|
||||
return &ParseError{"", "bad TLSA MatchingType", l}
|
||||
}
|
||||
rr.MatchingType = uint8(i)
|
||||
// So this needs be e2 (i.e. different than e), because...??t
|
||||
s, e2 := endingToString(c, "bad TLSA Certificate")
|
||||
if e2 != nil {
|
||||
return e2
|
||||
s, e3 := endingToString(c, "bad TLSA Certificate")
|
||||
if e3 != nil {
|
||||
return e3
|
||||
}
|
||||
rr.Certificate = s
|
||||
return nil
|
||||
|
@ -1377,22 +1358,22 @@ func (rr *SMIMEA) parse(c *zlexer, o string) *ParseError {
|
|||
rr.Usage = uint8(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, e = strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
i, e1 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad SMIMEA Selector", l}
|
||||
}
|
||||
rr.Selector = uint8(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, e = strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
i, e2 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e2 != nil || l.err {
|
||||
return &ParseError{"", "bad SMIMEA MatchingType", l}
|
||||
}
|
||||
rr.MatchingType = uint8(i)
|
||||
// So this needs be e2 (i.e. different than e), because...??t
|
||||
s, e2 := endingToString(c, "bad SMIMEA Certificate")
|
||||
if e2 != nil {
|
||||
return e2
|
||||
s, e3 := endingToString(c, "bad SMIMEA Certificate")
|
||||
if e3 != nil {
|
||||
return e3
|
||||
}
|
||||
rr.Certificate = s
|
||||
return nil
|
||||
|
@ -1469,16 +1450,16 @@ func (rr *URI) parse(c *zlexer, o string) *ParseError {
|
|||
rr.Priority = uint16(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next()
|
||||
i, e = strconv.ParseUint(l.token, 10, 16)
|
||||
if e != nil || l.err {
|
||||
i, e1 := strconv.ParseUint(l.token, 10, 16)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad URI Weight", l}
|
||||
}
|
||||
rr.Weight = uint16(i)
|
||||
|
||||
c.Next() // zBlank
|
||||
s, err := endingToTxtSlice(c, "bad URI Target")
|
||||
if err != nil {
|
||||
return err
|
||||
s, e2 := endingToTxtSlice(c, "bad URI Target")
|
||||
if e2 != nil {
|
||||
return e2
|
||||
}
|
||||
if len(s) != 1 {
|
||||
return &ParseError{"", "bad URI Target", l}
|
||||
|
@ -1506,9 +1487,9 @@ func (rr *NID) parse(c *zlexer, o string) *ParseError {
|
|||
rr.Preference = uint16(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next() // zString
|
||||
u, err := stringToNodeID(l)
|
||||
if err != nil || l.err {
|
||||
return err
|
||||
u, e1 := stringToNodeID(l)
|
||||
if e1 != nil || l.err {
|
||||
return e1
|
||||
}
|
||||
rr.NodeID = u
|
||||
return slurpRemainder(c)
|
||||
|
@ -1546,7 +1527,6 @@ func (rr *LP) parse(c *zlexer, o string) *ParseError {
|
|||
return &ParseError{"", "bad LP Fqdn", l}
|
||||
}
|
||||
rr.Fqdn = name
|
||||
|
||||
return slurpRemainder(c)
|
||||
}
|
||||
|
||||
|
@ -1559,9 +1539,9 @@ func (rr *L64) parse(c *zlexer, o string) *ParseError {
|
|||
rr.Preference = uint16(i)
|
||||
c.Next() // zBlank
|
||||
l, _ = c.Next() // zString
|
||||
u, err := stringToNodeID(l)
|
||||
if err != nil || l.err {
|
||||
return err
|
||||
u, e1 := stringToNodeID(l)
|
||||
if e1 != nil || l.err {
|
||||
return e1
|
||||
}
|
||||
rr.Locator64 = u
|
||||
return slurpRemainder(c)
|
||||
|
@ -1624,14 +1604,13 @@ func (rr *PX) parse(c *zlexer, o string) *ParseError {
|
|||
return &ParseError{"", "bad PX Mapx400", l}
|
||||
}
|
||||
rr.Mapx400 = mapx400
|
||||
|
||||
return slurpRemainder(c)
|
||||
}
|
||||
|
||||
func (rr *CAA) parse(c *zlexer, o string) *ParseError {
|
||||
l, _ := c.Next()
|
||||
i, err := strconv.ParseUint(l.token, 10, 8)
|
||||
if err != nil || l.err {
|
||||
i, e := strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
return &ParseError{"", "bad CAA Flag", l}
|
||||
}
|
||||
rr.Flag = uint8(i)
|
||||
|
@ -1644,9 +1623,9 @@ func (rr *CAA) parse(c *zlexer, o string) *ParseError {
|
|||
rr.Tag = l.token
|
||||
|
||||
c.Next() // zBlank
|
||||
s, e := endingToTxtSlice(c, "bad CAA Value")
|
||||
if e != nil {
|
||||
return e
|
||||
s, e1 := endingToTxtSlice(c, "bad CAA Value")
|
||||
if e1 != nil {
|
||||
return e1
|
||||
}
|
||||
if len(s) != 1 {
|
||||
return &ParseError{"", "bad CAA Value", l}
|
||||
|
@ -1667,8 +1646,8 @@ func (rr *TKEY) parse(c *zlexer, o string) *ParseError {
|
|||
|
||||
// Get the key length and key values
|
||||
l, _ = c.Next()
|
||||
i, err := strconv.ParseUint(l.token, 10, 8)
|
||||
if err != nil || l.err {
|
||||
i, e := strconv.ParseUint(l.token, 10, 8)
|
||||
if e != nil || l.err {
|
||||
return &ParseError{"", "bad TKEY key length", l}
|
||||
}
|
||||
rr.KeySize = uint16(i)
|
||||
|
@ -1682,8 +1661,8 @@ func (rr *TKEY) parse(c *zlexer, o string) *ParseError {
|
|||
|
||||
// Get the otherdata length and string data
|
||||
l, _ = c.Next()
|
||||
i, err = strconv.ParseUint(l.token, 10, 8)
|
||||
if err != nil || l.err {
|
||||
i, e1 := strconv.ParseUint(l.token, 10, 8)
|
||||
if e1 != nil || l.err {
|
||||
return &ParseError{"", "bad TKEY otherdata length", l}
|
||||
}
|
||||
rr.OtherLen = uint16(i)
|
||||
|
@ -1693,7 +1672,6 @@ func (rr *TKEY) parse(c *zlexer, o string) *ParseError {
|
|||
return &ParseError{"", "bad TKEY otherday", l}
|
||||
}
|
||||
rr.OtherData = l.token
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -1727,9 +1705,9 @@ func (rr *APL) parse(c *zlexer, o string) *ParseError {
|
|||
family = family[1:]
|
||||
}
|
||||
|
||||
afi, err := strconv.ParseUint(family, 10, 16)
|
||||
if err != nil {
|
||||
return &ParseError{"", "failed to parse APL family: " + err.Error(), l}
|
||||
afi, e := strconv.ParseUint(family, 10, 16)
|
||||
if e != nil {
|
||||
return &ParseError{"", "failed to parse APL family: " + e.Error(), l}
|
||||
}
|
||||
var addrLen int
|
||||
switch afi {
|
||||
|
@ -1741,9 +1719,9 @@ func (rr *APL) parse(c *zlexer, o string) *ParseError {
|
|||
return &ParseError{"", "unrecognized APL family", l}
|
||||
}
|
||||
|
||||
ip, subnet, err := net.ParseCIDR(cidr)
|
||||
if err != nil {
|
||||
return &ParseError{"", "failed to parse APL address: " + err.Error(), l}
|
||||
ip, subnet, e1 := net.ParseCIDR(cidr)
|
||||
if e1 != nil {
|
||||
return &ParseError{"", "failed to parse APL address: " + e1.Error(), l}
|
||||
}
|
||||
if !ip.Equal(subnet.IP) {
|
||||
return &ParseError{"", "extra bits in APL address", l}
|
||||
|
|
|
@ -165,11 +165,11 @@ const (
|
|||
_RD = 1 << 8 // recursion desired
|
||||
_RA = 1 << 7 // recursion available
|
||||
_Z = 1 << 6 // Z
|
||||
_AD = 1 << 5 // authticated data
|
||||
_AD = 1 << 5 // authenticated data
|
||||
_CD = 1 << 4 // checking disabled
|
||||
)
|
||||
|
||||
// Various constants used in the LOC RR, See RFC 1887.
|
||||
// Various constants used in the LOC RR. See RFC 1887.
|
||||
const (
|
||||
LOC_EQUATOR = 1 << 31 // RFC 1876, Section 2.
|
||||
LOC_PRIMEMERIDIAN = 1 << 31 // RFC 1876, Section 2.
|
||||
|
@ -231,7 +231,7 @@ func (q *Question) String() (s string) {
|
|||
return s
|
||||
}
|
||||
|
||||
// ANY is a wildcard record. See RFC 1035, Section 3.2.3. ANY
|
||||
// ANY is a wild card record. See RFC 1035, Section 3.2.3. ANY
|
||||
// is named "*" there.
|
||||
type ANY struct {
|
||||
Hdr RR_Header
|
||||
|
@ -759,8 +759,8 @@ type LOC struct {
|
|||
Altitude uint32
|
||||
}
|
||||
|
||||
// cmToM takes a cm value expressed in RFC1876 SIZE mantissa/exponent
|
||||
// format and returns a string in m (two decimals for the cm)
|
||||
// cmToM takes a cm value expressed in RFC 1876 SIZE mantissa/exponent
|
||||
// format and returns a string in m (two decimals for the cm).
|
||||
func cmToM(m, e uint8) string {
|
||||
if e < 2 {
|
||||
if e == 1 {
|
||||
|
|
|
@ -3,13 +3,13 @@ package dns
|
|||
import "fmt"
|
||||
|
||||
// Version is current version of this library.
|
||||
var Version = V{1, 1, 27}
|
||||
var Version = v{1, 1, 28}
|
||||
|
||||
// V holds the version of this library.
|
||||
type V struct {
|
||||
// v holds the version of this library.
|
||||
type v struct {
|
||||
Major, Minor, Patch int
|
||||
}
|
||||
|
||||
func (v V) String() string {
|
||||
func (v v) String() string {
|
||||
return fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Patch)
|
||||
}
|
||||
|
|
|
@ -114,6 +114,15 @@ var ARM struct {
|
|||
_ CacheLinePad
|
||||
}
|
||||
|
||||
// MIPS64X contains the supported CPU features of the current mips64/mips64le
|
||||
// platforms. If the current platform is not mips64/mips64le or the current
|
||||
// operating system is not Linux then all feature flags are false.
|
||||
var MIPS64X struct {
|
||||
_ CacheLinePad
|
||||
HasMSA bool // MIPS SIMD architecture
|
||||
_ CacheLinePad
|
||||
}
|
||||
|
||||
// PPC64 contains the supported CPU features of the current ppc64/ppc64le platforms.
|
||||
// If the current platform is not ppc64/ppc64le then all feature flags are false.
|
||||
//
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build mips64 mips64le
|
||||
|
||||
package cpu
|
||||
|
||||
// HWCAP bits. These are exposed by the Linux kernel 5.4.
|
||||
const (
|
||||
// CPU features
|
||||
hwcap_MIPS_MSA = 1 << 1
|
||||
)
|
||||
|
||||
func doinit() {
|
||||
// HWCAP feature bits
|
||||
MIPS64X.HasMSA = isSet(hwCap, hwcap_MIPS_MSA)
|
||||
}
|
||||
|
||||
func isSet(hwc uint, value uint) bool {
|
||||
return hwc&value != 0
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build linux,!arm,!arm64,!ppc64,!ppc64le,!s390x
|
||||
// +build linux,!arm,!arm64,!mips64,!mips64le,!ppc64,!ppc64le,!s390x
|
||||
|
||||
package cpu
|
||||
|
||||
|
|
|
@ -149,6 +149,17 @@ To add a constant, add the header that includes it to the appropriate variable.
|
|||
Then, edit the regex (if necessary) to match the desired constant. Avoid making
|
||||
the regex too broad to avoid matching unintended constants.
|
||||
|
||||
### mkmerge.go
|
||||
|
||||
This program is used to extract duplicate const, func, and type declarations
|
||||
from the generated architecture-specific files listed below, and merge these
|
||||
into a common file for each OS.
|
||||
|
||||
The merge is performed in the following steps:
|
||||
1. Construct the set of common code that is idential in all architecture-specific files.
|
||||
2. Write this common code to the merged file.
|
||||
3. Remove the common code from all architecture-specific files.
|
||||
|
||||
|
||||
## Generated files
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -44,7 +44,7 @@ github.com/jedisct1/xsecretbox
|
|||
github.com/k-sone/critbitgo
|
||||
# github.com/kardianos/service v1.0.1-0.20191211031725-3c356ae54c8a
|
||||
github.com/kardianos/service
|
||||
# github.com/miekg/dns v1.1.27
|
||||
# github.com/miekg/dns v1.1.28
|
||||
github.com/miekg/dns
|
||||
# github.com/pkg/errors v0.8.1
|
||||
github.com/pkg/errors
|
||||
|
@ -55,7 +55,7 @@ github.com/powerman/check
|
|||
# github.com/smartystreets/goconvey v1.6.4
|
||||
github.com/smartystreets/goconvey/convey/gotest
|
||||
github.com/smartystreets/goconvey/convey/reporting
|
||||
# golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d
|
||||
# golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4
|
||||
golang.org/x/crypto/blake2b
|
||||
golang.org/x/crypto/curve25519
|
||||
golang.org/x/crypto/ed25519
|
||||
|
@ -65,7 +65,7 @@ golang.org/x/crypto/nacl/box
|
|||
golang.org/x/crypto/nacl/secretbox
|
||||
golang.org/x/crypto/poly1305
|
||||
golang.org/x/crypto/salsa20/salsa
|
||||
# golang.org/x/net v0.0.0-20200226121028-0de0cce0169b
|
||||
# golang.org/x/net v0.0.0-20200301022130-244492dfa37a
|
||||
golang.org/x/net/bpf
|
||||
golang.org/x/net/http/httpguts
|
||||
golang.org/x/net/http2
|
||||
|
@ -77,7 +77,7 @@ golang.org/x/net/internal/socks
|
|||
golang.org/x/net/ipv4
|
||||
golang.org/x/net/ipv6
|
||||
golang.org/x/net/proxy
|
||||
# golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae
|
||||
# golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527
|
||||
golang.org/x/sys/cpu
|
||||
golang.org/x/sys/unix
|
||||
golang.org/x/sys/windows
|
||||
|
|
Loading…
Reference in New Issue