parent
9af5c1f8a8
commit
a71489b611
|
@ -114,6 +114,7 @@ Example programs can be found in the `github.com/miekg/exdns` repository.
|
||||||
* 6891 - EDNS0 update
|
* 6891 - EDNS0 update
|
||||||
* 6895 - DNS IANA considerations
|
* 6895 - DNS IANA considerations
|
||||||
* 7043 - EUI48/EUI64 records
|
* 7043 - EUI48/EUI64 records
|
||||||
|
* 7314 - DNS (EDNS) EXPIRE Option
|
||||||
* xxxx - URI record (draft)
|
* xxxx - URI record (draft)
|
||||||
* xxxx - EDNS0 DNS Update Lease (draft)
|
* xxxx - EDNS0 DNS Update Lease (draft)
|
||||||
* xxxx - Algorithm-Signal (draft)
|
* xxxx - Algorithm-Signal (draft)
|
||||||
|
@ -129,7 +130,7 @@ Example programs can be found in the `github.com/miekg/exdns` repository.
|
||||||
|
|
||||||
* Support for on-the-fly-signing or check how to do it;
|
* Support for on-the-fly-signing or check how to do it;
|
||||||
* Ratelimiting? server side (RRL);
|
* Ratelimiting? server side (RRL);
|
||||||
* Make a srv.Stop() that stops the server;
|
* Make a srv.Shutdown() that stops the server;
|
||||||
* privatekey.Precompute() when signing?
|
* privatekey.Precompute() when signing?
|
||||||
* Last remaining RRs: APL, ATMA, A6, KEY, SIG and NXT;
|
* Last remaining RRs: APL, ATMA, A6, KEY, SIG and NXT;
|
||||||
* CAA parsing is broken;
|
* CAA parsing is broken;
|
||||||
|
|
32
edns.go
32
edns.go
|
@ -46,7 +46,7 @@ const (
|
||||||
EDNS0N3U = 0x7 // NSEC3 Hash Understood
|
EDNS0N3U = 0x7 // NSEC3 Hash Understood
|
||||||
EDNS0SUBNET = 0x8 // client-subnet (RFC6891)
|
EDNS0SUBNET = 0x8 // client-subnet (RFC6891)
|
||||||
EDNS0EXPIRE = 0x9 // EDNS0 expire
|
EDNS0EXPIRE = 0x9 // EDNS0 expire
|
||||||
EDNS0SUBNETDRAFT = 0x50fa // client-subnet draft: http://tools.ietf.org/html/draft-vandergaast-edns-client-subnet-01
|
EDNS0SUBNETDRAFT = 0x50fa // Don't use! Use EDNS0SUBNET
|
||||||
_DO = 1 << 7 // dnssec ok
|
_DO = 1 << 7 // dnssec ok
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -335,6 +335,9 @@ type EDNS0_UL struct {
|
||||||
Lease uint32
|
Lease uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (e *EDNS0_UL) Option() uint16 { return EDNS0UL }
|
||||||
|
func (e *EDNS0_UL) String() string { return strconv.FormatUint(uint64(e.Lease), 10) }
|
||||||
|
|
||||||
// Copied: http://golang.org/src/pkg/net/dnsmsg.go
|
// Copied: http://golang.org/src/pkg/net/dnsmsg.go
|
||||||
func (e *EDNS0_UL) pack() ([]byte, error) {
|
func (e *EDNS0_UL) pack() ([]byte, error) {
|
||||||
b := make([]byte, 4)
|
b := make([]byte, 4)
|
||||||
|
@ -345,7 +348,6 @@ func (e *EDNS0_UL) pack() ([]byte, error) {
|
||||||
return b, nil
|
return b, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *EDNS0_UL) Option() uint16 { return EDNS0UL }
|
|
||||||
func (e *EDNS0_UL) unpack(b []byte) error {
|
func (e *EDNS0_UL) unpack(b []byte) error {
|
||||||
if len(b) < 4 {
|
if len(b) < 4 {
|
||||||
return ErrBuf
|
return ErrBuf
|
||||||
|
@ -353,7 +355,6 @@ func (e *EDNS0_UL) unpack(b []byte) error {
|
||||||
e.Lease = uint32(b[0])<<24 | uint32(b[1])<<16 | uint32(b[2])<<8 | uint32(b[3])
|
e.Lease = uint32(b[0])<<24 | uint32(b[1])<<16 | uint32(b[2])<<8 | uint32(b[3])
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (e *EDNS0_UL) String() string { return strconv.FormatUint(uint64(e.Lease), 10) }
|
|
||||||
|
|
||||||
// Long Lived Queries: http://tools.ietf.org/html/draft-sekar-dns-llq-01
|
// Long Lived Queries: http://tools.ietf.org/html/draft-sekar-dns-llq-01
|
||||||
// Implemented for completeness, as the EDNS0 type code is assigned.
|
// Implemented for completeness, as the EDNS0 type code is assigned.
|
||||||
|
@ -471,3 +472,28 @@ func (e *EDNS0_N3U) String() string {
|
||||||
}
|
}
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type EDNS0_EXPIRE struct {
|
||||||
|
Code uint16 // Always EDNS0EXPIRE
|
||||||
|
Expire uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EDNS0_EXPIRE) Option() uint16 { return EDNS0EXPIRE }
|
||||||
|
func (e *EDNS0_EXPIRE) String() string { return strconv.FormatUint(uint64(e.Expire), 10) }
|
||||||
|
|
||||||
|
func (e *EDNS0_EXPIRE) pack() ([]byte, error) {
|
||||||
|
b := make([]byte, 4)
|
||||||
|
b[0] = byte(e.Expire >> 24)
|
||||||
|
b[1] = byte(e.Expire >> 16)
|
||||||
|
b[2] = byte(e.Expire >> 8)
|
||||||
|
b[3] = byte(e.Expire)
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EDNS0_EXPIRE) unpack(b []byte) error {
|
||||||
|
if len(b) < 4 {
|
||||||
|
return ErrBuf
|
||||||
|
}
|
||||||
|
e.Expire = uint32(b[0])<<24 | uint32(b[1])<<16 | uint32(b[2])<<8 | uint32(b[3])
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue