Add the NAPTR record
This commit is contained in:
parent
bccabeaeda
commit
2decd91cb4
6
dns.go
6
dns.go
|
@ -7,7 +7,9 @@
|
|||
// Supported RFCs and features include:
|
||||
// * 1982 - Serial Arithmetic
|
||||
// * 1034/1035
|
||||
// * 1876 - LOC record (incomplete)
|
||||
// * 2671 - EDNS
|
||||
// * 2915 - NAPTR record (incomplete)
|
||||
// * 3225 - DO bit (DNSSEC OK)
|
||||
// * 4033/4034/4035 - DNSSEC + validation functions
|
||||
// * 5011 - NSID
|
||||
|
@ -16,7 +18,9 @@
|
|||
//
|
||||
package dns
|
||||
|
||||
import ( "strconv")
|
||||
import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
const Year68 = 2 << (32 - 1)
|
||||
|
||||
|
|
1
msg.go
1
msg.go
|
@ -49,6 +49,7 @@ var Rr_str = map[uint16]string{
|
|||
TypeSOA: "SOA",
|
||||
TypeTXT: "TXT",
|
||||
TypeSRV: "SRV",
|
||||
TypeNAPTR: "NAPTR",
|
||||
TypeA: "A",
|
||||
TypeAAAA: "AAAA",
|
||||
TypeOPT: "OPT",
|
||||
|
|
20
types.go
20
types.go
|
@ -41,6 +41,7 @@ const (
|
|||
TypeTXT = 16
|
||||
TypeAAAA = 28
|
||||
TypeSRV = 33
|
||||
TypeNAPTR = 35
|
||||
|
||||
// EDNS
|
||||
TypeOPT = 41
|
||||
|
@ -289,6 +290,24 @@ func (rr *RR_SRV) String() string {
|
|||
strconv.Itoa(int(rr.Port)) + " " + rr.Target
|
||||
}
|
||||
|
||||
type RR_NAPTR struct {
|
||||
Hdr RR_Header
|
||||
Order uint16
|
||||
Preference uint16
|
||||
Flags string
|
||||
Service string
|
||||
Regexp string
|
||||
Replacement string
|
||||
}
|
||||
|
||||
func (rr *RR_NAPTR) Header() *RR_Header {
|
||||
return &rr.Hdr
|
||||
}
|
||||
|
||||
func (rr *RR_NAPTR) String() string {
|
||||
return rr.Hdr.String() + "TODO"
|
||||
}
|
||||
|
||||
type RR_A struct {
|
||||
Hdr RR_Header
|
||||
A net.IP "A"
|
||||
|
@ -464,6 +483,7 @@ var rr_mk = map[int]func() RR{
|
|||
TypeSOA: func() RR { return new(RR_SOA) },
|
||||
TypeTXT: func() RR { return new(RR_TXT) },
|
||||
TypeSRV: func() RR { return new(RR_SRV) },
|
||||
TypeNAPTR: func() RR { return new(RR_NAPTR) },
|
||||
TypeA: func() RR { return new(RR_A) },
|
||||
TypeAAAA: func() RR { return new(RR_AAAA) },
|
||||
TypeOPT: func() RR { return new(RR_OPT) },
|
||||
|
|
Loading…
Reference in New Issue