Add X25 Resource Record
This commit is contained in:
parent
35744e52f8
commit
f6896bea4f
2
msg.go
2
msg.go
|
@ -100,6 +100,8 @@ var Rr_str = map[uint16]string{
|
|||
TypeWKS: "WKS",
|
||||
TypeNS: "NS",
|
||||
TypeNULL: "NULL",
|
||||
TypeAFSDB: "AFSDB",
|
||||
TypeX25: "X25",
|
||||
TypePTR: "PTR",
|
||||
TypeRT: "RT",
|
||||
TypeSOA: "SOA",
|
||||
|
|
23
types.go
23
types.go
|
@ -37,6 +37,7 @@ const (
|
|||
TypeTXT uint16 = 16
|
||||
TypeRP uint16 = 17
|
||||
TypeAFSDB uint16 = 18
|
||||
TypeX25 uint16 = 19
|
||||
TypeRT uint16 = 21
|
||||
TypeSIG uint16 = 24
|
||||
TypeKEY uint16 = 25
|
||||
|
@ -414,6 +415,27 @@ func (rr *RR_AFSDB) Copy() RR {
|
|||
return &RR_AFSDB{*rr.Hdr.CopyHeader(), rr.Subtype, rr.Hostname}
|
||||
}
|
||||
|
||||
type RR_X25 struct {
|
||||
Hdr RR_Header
|
||||
PSDNAddress string
|
||||
}
|
||||
|
||||
func (rr *RR_X25) Header() *RR_Header {
|
||||
return &rr.Hdr
|
||||
}
|
||||
|
||||
func (rr *RR_X25) String() string {
|
||||
return rr.Hdr.String() + rr.PSDNAddress
|
||||
}
|
||||
|
||||
func (rr *RR_X25) Len() int {
|
||||
return rr.Hdr.Len() + len(rr.PSDNAddress)
|
||||
}
|
||||
|
||||
func (rr *RR_X25) Copy() RR {
|
||||
return &RR_X25{*rr.Hdr.CopyHeader(), rr.PSDNAddress}
|
||||
}
|
||||
|
||||
type RR_RT struct {
|
||||
Hdr RR_Header
|
||||
Preference uint16
|
||||
|
@ -1536,6 +1558,7 @@ var rr_mk = map[uint16]func() RR{
|
|||
TypeMINFO: func() RR { return new(RR_MINFO) },
|
||||
TypeRP: func() RR { return new(RR_RP) },
|
||||
TypeAFSDB: func() RR { return new(RR_AFSDB) },
|
||||
TypeX25: func() RR { return new(RR_X25) },
|
||||
TypeMR: func() RR { return new(RR_MR) },
|
||||
TypeMX: func() RR { return new(RR_MX) },
|
||||
TypeNS: func() RR { return new(RR_NS) },
|
||||
|
|
12
zscan_rr.go
12
zscan_rr.go
|
@ -46,6 +46,9 @@ func setRR(h RR_Header, c chan lex, o, f string) (RR, *ParseError) {
|
|||
case TypeAFSDB:
|
||||
r, e = setAFSDB(h, c, o, f)
|
||||
goto Slurp
|
||||
case TypeX25:
|
||||
r, e = setX25(h,c, f)
|
||||
goto Slurp
|
||||
case TypeMX:
|
||||
r, e = setMX(h, c, o, f)
|
||||
goto Slurp
|
||||
|
@ -465,6 +468,15 @@ func setAFSDB(h RR_Header, c chan lex, o, f string) (RR, *ParseError) {
|
|||
return rr, nil
|
||||
}
|
||||
|
||||
func setX25(h RR_Header, c chan lex, f string) (RR, *ParseError) {
|
||||
rr := new(RR_X25)
|
||||
rr.Hdr = h
|
||||
|
||||
l := <-c
|
||||
rr.PSDNAddress = l.token
|
||||
return rr, nil
|
||||
}
|
||||
|
||||
func setKX(h RR_Header, c chan lex, o, f string) (RR, *ParseError) {
|
||||
rr := new(RR_KX)
|
||||
rr.Hdr = h
|
||||
|
|
Loading…
Reference in New Issue