Skip to content

Commit

Permalink
edns0 zoneversion
Browse files Browse the repository at this point in the history
Signed-off-by: Miek Gieben <[email protected]>
  • Loading branch information
miekg committed Aug 14, 2024
1 parent 07a2352 commit d99b280
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions edns.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ const (
EDNS0DHU = 0x6 // DS Hash Understood
EDNS0N3U = 0x7 // NSEC3 Hash Understood
EDNS0SUBNET = 0x8 // client-subnet (See RFC 7871)
EDNS0EXPIRE = 0x9 // EDNS0 expire
EDNS0EXPIRE = 0x9 // EDNS0 Expire
EDNS0COOKIE = 0xa // EDNS0 Cookie
EDNS0TCPKEEPALIVE = 0xb // EDNS0 tcp keep alive (See RFC 7828)
EDNS0PADDING = 0xc // EDNS0 padding (See RFC 7830)
EDNS0EDE = 0xf // EDNS0 extended DNS errors (See RFC 8914)
EDNS0TCPKEEPALIVE = 0xb // EDNS0 TCP keep alive (See RFC 7828)
EDNS0PADDING = 0xc // EDNS0 Padding (See RFC 7830)
EDNS0EDE = 0xf // EDNS0 Extended DNS Errors (See RFC 8914)
EDNS0ZONEVERSION = 0x000 // EDNS0 Zone Version (See RFC ...) https://www.ietf.org/archive/id/draft-ietf-dnsop-zoneversion-11.html
EDNS0LOCALSTART = 0xFDE9 // Beginning of range reserved for local/experimental use (See RFC 6891)
EDNS0LOCALEND = 0xFFFE // End of range reserved for local/experimental use (See RFC 6891)
_DO = 1 << 15 // DNSSEC OK
Expand Down Expand Up @@ -59,6 +60,8 @@ func makeDataOpt(code uint16) EDNS0 {
return new(EDNS0_EDE)
case EDNS0ESU:
return &EDNS0_ESU{Code: EDNS0ESU}
case EDNS0ZONEVERSION:
return &EDNS0_ZONEVERSION{Code: EDNS0_ZONEVERSION}

Check failure on line 64 in edns.go

View workflow job for this annotation

GitHub Actions / Build and Test (1.22.x)

cannot use &EDNS0_ZONEVERSION{…} (value of type *EDNS0_ZONEVERSION) as EDNS0 value in return statement: *EDNS0_ZONEVERSION does not implement EDNS0 (missing method Option)

Check failure on line 64 in edns.go

View workflow job for this annotation

GitHub Actions / Build and Test (1.22.x)

EDNS0_ZONEVERSION (type) is not an expression

Check failure on line 64 in edns.go

View workflow job for this annotation

GitHub Actions / Build and Test (1.23.x)

cannot use &EDNS0_ZONEVERSION{…} (value of type *EDNS0_ZONEVERSION) as EDNS0 value in return statement: *EDNS0_ZONEVERSION does not implement EDNS0 (missing method Option)

Check failure on line 64 in edns.go

View workflow job for this annotation

GitHub Actions / Build and Test (1.23.x)

EDNS0_ZONEVERSION (type) is not an expression
default:
e := new(EDNS0_LOCAL)
e.Code = code
Expand Down Expand Up @@ -839,7 +842,7 @@ func (e *EDNS0_EDE) unpack(b []byte) error {
return nil
}

// The EDNS0_ESU option for ENUM Source-URI Extension
// The EDNS0_ESU option for ENUM Source-URI Extension.
type EDNS0_ESU struct {
Code uint16
Uri string
Expand All @@ -854,3 +857,17 @@ func (e *EDNS0_ESU) unpack(b []byte) error {
e.Uri = string(b)
return nil
}

// The EDNS0_ZONEVERSION option is used to returns a unique version for this zone. See RFC xxxx.
type EDNS0_ZONEVERSION struct {
Code uint16 // Always EDNSTCPKEEPALIVE

// Timeout is an idle timeout value for the TCP connection, specified in
// units of 100 milliseconds, encoded in network byte order. If set to 0,
// pack will return a nil slice.
Timeout uint16

// Length is the option's length.
// Deprecated: this field is deprecated and is always equal to 0.
Length uint16
}

0 comments on commit d99b280

Please sign in to comment.