This commit is contained in:
Miek Gieben 2012-06-01 18:29:07 +02:00
parent 9503a0a265
commit b2f459b7fa
3 changed files with 29 additions and 3 deletions

View File

@ -11,9 +11,10 @@
* Speed, we can always go faster. A simple reflect server now hits 35/45K qps
* go test; only works correct on my machine
* privatekey.Precompute() when signing?
* RRs: WKS (1183)
## Examples to add
* Nameserver, with a small zone, 1 KSK and online signing;
* Recursor - ala FunkenSturm?
WKS: net.LookupPort("tcp", service")

View File

@ -229,7 +229,9 @@ func (e *EDNS0_SUBNET) Pack() ([]byte, error) {
}
func (e *EDNS0_SUBNET) Unpack(b []byte) {
// TODO: length of b (overflow)
if len(b) < 8 {
return
}
e.Family, _ = unpackUint16(b, 0)
e.SourceNetmask = b[2]
e.SourceScope = b[3]
@ -249,7 +251,9 @@ func (e *EDNS0_SUBNET) Unpack(b []byte) {
}
func (e *EDNS0_SUBNET) String() (s string) {
if e.Address.To4() != nil {
if e.Address == nil {
s = "<nil>"
} else if e.Address.To4() != nil {
s = e.Address.String()
} else {
s = "[" + e.Address.String() + "]"

View File

@ -1150,6 +1150,26 @@ func (rr *RR_HIP) Len() int {
return l
}
type RR_WKS struct {
Hdr RR_Header
Address net.IP `dns:"a"`
Protocol uint8
Bitmap []uint16 `dns:"wks"`
}
func (rr *RR_WKS) Header() *RR_Header {
return &rr.Hdr
}
func (rr *RR_WKS) String() string {
return rr.Hdr.String() +
" " + rr.Address.String()
}
func (rr *RR_WKS) Len() int {
return rr.Hdr.Len() + net.IPv4len + 1
}
// TimeToDate translates the RRSIG's incep. and expir. times to the
// string representation used when printing the record.
// It takes serial arithmetic (RFC 1982) into account.
@ -1224,6 +1244,7 @@ var rr_mk = map[uint16]func() RR{
TypeNAPTR: func() RR { return new(RR_NAPTR) },
TypeDNAME: func() RR { return new(RR_DNAME) },
TypeA: func() RR { return new(RR_A) },
TypeWKS: func() RR { return new(RR_WKS) },
TypeAAAA: func() RR { return new(RR_AAAA) },
TypeLOC: func() RR { return new(RR_LOC) },
TypeOPT: func() RR { return new(RR_OPT) },