unknown dns as type

This commit is contained in:
Miek Gieben 2011-02-21 15:19:52 +01:00
parent 1743555d07
commit f082cd36ca
4 changed files with 32 additions and 2 deletions

View File

@ -18,7 +18,8 @@ GOFILES=\
nsec3.go\
resolver.go\
config.go\
server.go
rfc3597.go\
server.go \
# y.go\
include $(GOROOT)/src/Make.pkg

1
TODO
View File

@ -6,6 +6,7 @@ Todo:
* Test impl of nameserver, with a small zone, 1 KSK and online signing
* NSEC and nsec3 closest encloser helper functions
* Tsig generation for replies (request MAC)
* unknown records
* pack/Unpack smaller. EDNS 'n stuff can be folded in
Longer term:

13
rfc3597.go Normal file
View File

@ -0,0 +1,13 @@
package dns
// Unknown Resource Records
import "strconv"
func unknownClass(class int) string {
return "CLASS" + strconv.Itoa(class)
}
func unknownType(t int) string {
return "TYPE" + strconv.Itoa(t)
}

View File

@ -533,7 +533,6 @@ func (rr *RR_TA) String() string {
" " + strings.ToUpper(rr.Digest)
}
type RR_TALINK struct {
Hdr RR_Header
PreviousName string "domain"
@ -673,6 +672,22 @@ func (rr *RR_TKEY) String() string {
return ""
}
// Unknown RR representation
type RR_RFC3597 struct {
Hdr RR_Header
Rdata string "hex"
}
func (rr *RR_RFC3597) Header() *RR_Header {
return &rr.Hdr
}
func (rr *RR_RFC3597) String() string {
s := rr.Hdr.String()
s += "\\# " + strconv.Itoa(len(rr.Rdata)/2) + " " + rr.Rdata
return s
}
// Translate the RRSIG's incep. and expir. time to the correct date.
// Taking into account serial arithmetic (RFC 1982)
func timeToDate(t uint32) string {