mirror of
https://github.com/miekg/dns.git
synced 2025-08-12 04:26:58 +02:00
Add LP record
This commit is contained in:
parent
a509e3af80
commit
e2bc22cb43
26
types.go
26
types.go
@ -1445,6 +1445,30 @@ func (rr *RR_L64) Copy() RR {
|
|||||||
return &RR_L64{*rr.Hdr.CopyHeader(), rr.Preference, rr.Locator64}
|
return &RR_L64{*rr.Hdr.CopyHeader(), rr.Preference, rr.Locator64}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type RR_LP struct {
|
||||||
|
Hdr RR_Header
|
||||||
|
Preference uint16
|
||||||
|
Fqdn string `dns:"domain-name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rr *RR_LP) Header() *RR_Header {
|
||||||
|
return &rr.Hdr
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rr *RR_LP) String() string {
|
||||||
|
s := rr.Hdr.String() + strconv.Itoa(int(rr.Preference)) +
|
||||||
|
" " + rr.Fqdn
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rr *RR_LP) Len() int {
|
||||||
|
return rr.Hdr.Len() + 2 + len(rr.Fqdn) + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rr *RR_LP) Copy() RR {
|
||||||
|
return &RR_LP{*rr.Hdr.CopyHeader(), rr.Preference, rr.Fqdn}
|
||||||
|
}
|
||||||
|
|
||||||
// TimeToString translates the RRSIG's incep. and expir. times to the
|
// TimeToString translates the RRSIG's incep. and expir. times to the
|
||||||
// string representation used when printing the record.
|
// string representation used when printing the record.
|
||||||
// It takes serial arithmetic (RFC 1982) into account.
|
// It takes serial arithmetic (RFC 1982) into account.
|
||||||
@ -1546,5 +1570,5 @@ var rr_mk = map[uint16]func() RR{
|
|||||||
TypeNID: func() RR { return new(RR_NID) },
|
TypeNID: func() RR { return new(RR_NID) },
|
||||||
TypeL32: func() RR { return new(RR_L32) },
|
TypeL32: func() RR { return new(RR_L32) },
|
||||||
TypeL64: func() RR { return new(RR_L64) },
|
TypeL64: func() RR { return new(RR_L64) },
|
||||||
// TypeLP: func() RR { return new(RR_LP) },
|
TypeLP: func() RR { return new(RR_LP) },
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user