rdata

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2025 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package rdata contains all the rdata elements of all the resource records.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type A

type A struct {
	Addr netip.Addr `dns:"a"`
}

A data. See RFC 1035.

func (A) Len

func (rd A) Len() int

func (A) String added in v0.6.0

func (rd A) String() string

type AAAA

type AAAA struct {
	Addr netip.Addr `dns:"aaaa"`
}

AAAA data. See RFC 3596.

func (AAAA) Len

func (rd AAAA) Len() int

func (AAAA) String added in v0.6.0

func (rd AAAA) String() string

type AFSDB

type AFSDB struct {
	Subtype  uint16
	Hostname string `dns:"domain-name"`
}

AFSDB data. See RFC 1183.

func (AFSDB) Len

func (rd AFSDB) Len() int

func (AFSDB) String added in v0.6.0

func (rd AFSDB) String() string

type CAA

type CAA struct {
	Flag  uint8
	Tag   string
	Value string `dns:"any"` // Value is the character-string encoding of the value field as specified in RFC 1035, Section 5.1.
}

CAA data. See RFC 6844.

func (CAA) Len

func (rd CAA) Len() int

func (CAA) String added in v0.6.0

func (rd CAA) String() string

type CERT

type CERT struct {
	Type        uint16
	KeyTag      uint16
	Algorithm   uint8
	Certificate string `dns:"base64"`
}

CERT data. See RFC 4398.

func (CERT) Len

func (rd CERT) Len() int

func (CERT) String added in v0.6.0

func (rd CERT) String() string

type CNAME

type CNAME struct {
	Target string `dns:"cdomain-name"`
}

CNAME data. See RFC 1034.

func (CNAME) Len

func (rd CNAME) Len() int

func (CNAME) String added in v0.6.0

func (rd CNAME) String() string

type CSYNC

type CSYNC struct {
	Serial     uint32
	Flags      uint16
	TypeBitMap []uint16 `dns:"nsec"`
}

CSYNC data. See RFC 7477.

func (CSYNC) Len

func (rd CSYNC) Len() int

func (CSYNC) String added in v0.6.0

func (rd CSYNC) String() string

type DELEG

type DELEG struct {
	Value []deleg.Info `dns:"infos"`
}

DELEG data. See draft https://datatracker.ietf.org/doc/draft-ietf-deleg/.

func (DELEG) Len

func (rd DELEG) Len() int

func (DELEG) String added in v0.6.0

func (rd DELEG) String() string

type DHCID

type DHCID struct {
	Digest string `dns:"base64"`
}

DHCID data. See RFC 4701.

func (DHCID) Len

func (rd DHCID) Len() int

func (DHCID) String added in v0.6.0

func (rd DHCID) String() string

type DNAME

type DNAME struct {
	Target string `dns:"domain-name"`
}

DNAME data. See RFC 2672.

func (DNAME) Len

func (rd DNAME) Len() int

func (DNAME) String added in v0.6.0

func (rd DNAME) String() string

type DNSKEY

type DNSKEY struct {
	Flags     uint16
	Protocol  uint8
	Algorithm uint8
	PublicKey string `dns:"base64"`
}

DNSKEY data. See RFC 4034 and RFC 3755.

func (DNSKEY) Len

func (rd DNSKEY) Len() int

func (DNSKEY) String added in v0.6.0

func (rd DNSKEY) String() string

type DS

type DS struct {
	KeyTag     uint16
	Algorithm  uint8
	DigestType uint8
	Digest     string `dns:"hex"`
}

DS data. See RFC 4034 and RFC 3658.

func (DS) Len

func (rd DS) Len() int

func (DS) String added in v0.6.0

func (rd DS) String() string

type DSYNC

type DSYNC struct {
	Type   uint16
	Scheme uint8
	Port   uint16
	Target string `dns:"domain-name"`
}

DYNC data. See RFC 9859.

func (DSYNC) Len

func (rd DSYNC) Len() int

func (DSYNC) String added in v0.6.0

func (rd DSYNC) String() string

type EID

type EID struct {
	Endpoint string `dns:"hex"`
}

EID data. See http://ana-3.lcs.mit.edu/~jnc/nimrod/dns.txt.

func (EID) Len

func (rd EID) Len() int

func (EID) String added in v0.6.0

func (rd EID) String() string

type EUI48

type EUI48 struct {
	Address uint64 `dns:"uint48"`
}

func (EUI48) Len

func (rd EUI48) Len() int

func (EUI48) String added in v0.6.0

func (rd EUI48) String() string

type EUI64

type EUI64 struct {
	Address uint64
}

EUI64 data. See RFC 7043.

func (EUI64) Len

func (rd EUI64) Len() int

func (EUI64) String added in v0.6.0

func (rd EUI64) String() string

type GID

type GID struct {
	Gid uint32
}

GID data. Deprecated, IANA-Reserved.

func (GID) Len

func (rd GID) Len() int

func (GID) String added in v0.6.0

func (rd GID) String() string

type GPOS

type GPOS struct {
	Longitude string
	Latitude  string
	Altitude  string
}

GPOS data. See RFC 1712.

func (GPOS) Len

func (rd GPOS) Len() int

func (GPOS) String added in v0.6.0

func (rd GPOS) String() string

type HINFO

type HINFO struct {
	Cpu string
	Os  string
}

HINFO data. See RFC 1034.

func (HINFO) Len

func (rd HINFO) Len() int

func (HINFO) String added in v0.6.0

func (rd HINFO) String() string

type HIP

type HIP struct {
	HitLength          uint8
	PublicKeyAlgorithm uint8
	PublicKeyLength    uint16
	Hit                string   `dns:"size-hex:HitLength"`
	PublicKey          string   `dns:"size-base64:PublicKeyLength"`
	RendezvousServers  []string `dns:"domain-name"`
}

HIP data. See RFC 8005.

func (HIP) Len

func (rd HIP) Len() int

func (HIP) String added in v0.6.0

func (rd HIP) String() string

type IPN

type IPN struct {
	Node uint64
}

IPN data. See https://www.iana.org/assignments/dns-parameters/IPN/ipn-completed-template.

func (IPN) Len

func (rd IPN) Len() int

func (IPN) String added in v0.6.0

func (rd IPN) String() string

type ISDN

type ISDN struct {
	Address    string
	SubAddress string
}

ISDN data. See RFC 1183, Section 3.2.

func (ISDN) Len

func (rd ISDN) Len() int

func (ISDN) String added in v0.6.0

func (rd ISDN) String() string

type KX

type KX struct {
	Preference uint16
	Exchanger  string `dns:"domain-name"`
}

KX data. See RFC 2230.

func (KX) Len

func (rd KX) Len() int

func (KX) String added in v0.6.0

func (rd KX) String() string

type L32

type L32 struct {
	Preference uint16
	Locator32  netip.Addr `dns:"a"`
}

L32 data, See RFC 6742.

func (L32) Len

func (rd L32) Len() int

func (L32) String added in v0.6.0

func (rd L32) String() string

type L64

type L64 struct {
	Preference uint16
	Locator64  uint64
}

L64 data, See RFC 6742.

func (L64) Len

func (rd L64) Len() int

func (L64) String added in v0.6.0

func (rd L64) String() string

type LOC

type LOC struct {
	Version   uint8
	Size      uint8
	HorizPre  uint8
	VertPre   uint8
	Latitude  uint32
	Longitude uint32
	Altitude  uint32
}

LOC data. See RFC 1876.

func (LOC) Len

func (rd LOC) Len() int

func (LOC) String added in v0.6.0

func (rd LOC) String() string

type LP

type LP struct {
	Preference uint16
	Fqdn       string `dns:"domain-name"`
}

LP data. See RFC 6742.

func (LP) Len

func (rd LP) Len() int

func (LP) String added in v0.6.0

func (rd LP) String() string

type MB

type MB struct {
	Mb string `dns:"cdomain-name"`
}

MB data. See RFC 1035.

func (MB) Len

func (rd MB) Len() int

func (MB) String added in v0.6.0

func (rd MB) String() string

type MD

type MD struct {
	Md string `dns:"cdomain-name"`
}

MD data. See RFC 1035.

func (MD) Len

func (rd MD) Len() int

func (MD) String added in v0.6.0

func (rd MD) String() string

type MF

type MF struct {
	Mf string `dns:"cdomain-name"`
}

MF data. See RFC 1035.

func (MF) Len

func (rd MF) Len() int

func (MF) String added in v0.6.0

func (rd MF) String() string

type MG

type MG struct {
	Mg string `dns:"cdomain-name"`
}

MG data. See RFC 1035.

func (MG) Len

func (rd MG) Len() int

func (MG) String added in v0.6.0

func (rd MG) String() string

type MINFO

type MINFO struct {
	Rmail string `dns:"cdomain-name"`
	Email string `dns:"cdomain-name"`
}

MINFO data. See RFC 1035.

func (MINFO) Len

func (rd MINFO) Len() int

func (MINFO) String added in v0.6.0

func (rd MINFO) String() string

type MR

type MR struct {
	Mr string `dns:"cdomain-name"`
}

MR data. See RFC 1035.

func (MR) Len

func (rd MR) Len() int

func (MR) String added in v0.6.0

func (rd MR) String() string

type MX

type MX struct {
	Preference uint16
	Mx         string `dns:"cdomain-name"`
}

MX data. See RFC 1035.

func (MX) Len

func (rd MX) Len() int

func (MX) String added in v0.6.0

func (rd MX) String() string

type NAPTR

type NAPTR struct {
	Order       uint16
	Preference  uint16
	Flags       string
	Service     string
	Regexp      string
	Replacement string `dns:"domain-name"`
}

NAPTR data. See RFC 2915.

func (NAPTR) Len

func (rd NAPTR) Len() int

func (NAPTR) String added in v0.6.0

func (rd NAPTR) String() string

type NID

type NID struct {
	Preference uint16
	NodeID     uint64
}

NID data. See RFC 6742.

func (NID) Len

func (rd NID) Len() int

func (NID) String added in v0.6.0

func (rd NID) String() string

type NIMLOC

type NIMLOC struct {
	Locator string `dns:"hex"`
}

NIMLOC data. See http://ana-3.lcs.mit.edu/~jnc/nimrod/dns.txt.

func (NIMLOC) Len

func (rd NIMLOC) Len() int

func (NIMLOC) String added in v0.6.0

func (rd NIMLOC) String() string

type NINFO

type NINFO struct {
	ZSData []string `dns:"txt"`
}

NINFO data. See https://www.iana.org/assignments/dns-parameters/NINFO/ninfo-completed-template.

func (NINFO) Len

func (rd NINFO) Len() int

func (NINFO) String added in v0.6.0

func (rd NINFO) String() string

type NS

type NS struct {
	Ns string `dns:"cdomain-name"`
}

NS data. See RFC 1035.

func (NS) Len

func (rd NS) Len() int

func (NS) String added in v0.6.0

func (rd NS) String() string

type NSAPPTR

type NSAPPTR struct {
	Ptr string `dns:"domain-name"`
}

NSAPPTR data. See RFC 1348.

func (NSAPPTR) Len

func (rd NSAPPTR) Len() int

func (NSAPPTR) String added in v0.6.0

func (rd NSAPPTR) String() string

type NSEC

type NSEC struct {
	NextDomain string   `dns:"domain-name"`
	TypeBitMap []uint16 `dns:"nsec"`
}

NSEC data. See RFC 4034 and RFC 3755.

func (NSEC) Len

func (rd NSEC) Len() int

func (NSEC) String added in v0.6.0

func (rd NSEC) String() string

type NSEC3

type NSEC3 struct {
	Hash       uint8
	Flags      uint8
	Iterations uint16
	SaltLength uint8
	Salt       string `dns:"size-hex:SaltLength"`
	HashLength uint8
	NextDomain string   `dns:"size-base32:HashLength"`
	TypeBitMap []uint16 `dns:"nsec"`
}

NSEC3 data. See RFC 5155.

func (NSEC3) Len

func (rd NSEC3) Len() int

func (NSEC3) String added in v0.6.0

func (rd NSEC3) String() string

type NSEC3PARAM

type NSEC3PARAM struct {
	Hash       uint8
	Flags      uint8
	Iterations uint16
	SaltLength uint8
	Salt       string `dns:"size-hex:SaltLength"`
}

NSEC3PARAM data. See RFC 5155.

func (NSEC3PARAM) Len

func (rd NSEC3PARAM) Len() int

func (NSEC3PARAM) String added in v0.6.0

func (rd NSEC3PARAM) String() string

type NULL

type NULL struct {
	Null string `dns:"any"`
}

NULL data. See RFC 1035.

func (NULL) Len

func (rd NULL) Len() int

func (NULL) String added in v0.6.0

func (rd NULL) String() string

type OPENPGPKEY

type OPENPGPKEY struct {
	PublicKey string `dns:"base64"`
}

OPENPGPKEY data. See RFC 7929.

func (OPENPGPKEY) Len

func (rd OPENPGPKEY) Len() int

func (OPENPGPKEY) String added in v0.6.0

func (rd OPENPGPKEY) String() string

type PTR

type PTR struct {
	Ptr string `dns:"cdomain-name"`
}

PTR data. See RFC 1035.

func (PTR) Len

func (rd PTR) Len() int

func (PTR) String added in v0.6.0

func (rd PTR) String() string

type PX

type PX struct {
	Preference uint16
	Map822     string `dns:"domain-name"`
	Mapx400    string `dns:"domain-name"`
}

PX data. See RFC 2163.

func (PX) Len

func (rd PX) Len() int

func (PX) String added in v0.6.0

func (rd PX) String() string

type RFC3597

type RFC3597 struct {
	RRType uint16 `dns:"-"` // actual type
	Data   string `dns:"hex"`
}

RFC3597 represents an unknown/generic data. See RFC 3597.

func (RFC3597) Len

func (rd RFC3597) Len() int

func (RFC3597) String added in v0.6.0

func (rd RFC3597) String() string

type RKEY

type RKEY struct {
	Flags     uint16
	Protocol  uint8
	Algorithm uint8
	PublicKey string `dns:"base64"`
}

RKEY data. See https://www.iana.org/assignments/dns-parameters/RKEY/rkey-completed-template.

func (RKEY) Len

func (rd RKEY) Len() int

func (RKEY) String added in v0.6.0

func (rd RKEY) String() string

type RP

type RP struct {
	Mbox string `dns:"domain-name"`
	Txt  string `dns:"domain-name"`
}

RP data. See RFC 1138, Section 2.2.

func (RP) Len

func (rd RP) Len() int

func (RP) String added in v0.6.0

func (rd RP) String() string

type RRSIG

type RRSIG struct {
	TypeCovered uint16
	Algorithm   uint8
	Labels      uint8
	OrigTTL     uint32
	Expiration  uint32
	Inception   uint32
	KeyTag      uint16
	SignerName  string `dns:"domain-name"`
	Signature   string `dns:"base64"`
}

RRSIG data. See RFC 4034 and RFC 3755.

func (RRSIG) Len

func (rd RRSIG) Len() int

func (RRSIG) String added in v0.6.0

func (rd RRSIG) String() string

type RT

type RT struct {
	Preference uint16
	Host       string `dns:"domain-name"` // RFC 3597 prohibits compressing records not defined in RFC 1035.
}

RT data. See RFC 1183, Section 3.3.

func (RT) Len

func (rd RT) Len() int

func (RT) String added in v0.6.0

func (rd RT) String() string

type SMIMEA

type SMIMEA struct {
	Usage        uint8
	Selector     uint8
	MatchingType uint8
	Certificate  string `dns:"hex"`
}

SMIMEA data. See RFC 8162.

func (SMIMEA) Len

func (rd SMIMEA) Len() int

func (SMIMEA) String added in v0.6.0

func (rd SMIMEA) String() string

type SOA

type SOA struct {
	Ns      string `dns:"cdomain-name"`
	Mbox    string `dns:"cdomain-name"`
	Serial  uint32
	Refresh uint32
	Retry   uint32
	Expire  uint32
	Minttl  uint32
}

SOA data. See RFC 1035.

func (SOA) Len

func (rd SOA) Len() int

func (SOA) String added in v0.6.0

func (rd SOA) String() string

type SRV

type SRV struct {
	Priority uint16
	Weight   uint16
	Port     uint16
	Target   string `dns:"domain-name"`
}

SRV data. See RFC 2782.

func (SRV) Len

func (rd SRV) Len() int

func (SRV) String added in v0.6.0

func (rd SRV) String() string

type SSHFP

type SSHFP struct {
	Algorithm   uint8
	Type        uint8
	FingerPrint string `dns:"hex"`
}

SSHFP data. See RFC 4255.

func (SSHFP) Len

func (rd SSHFP) Len() int

func (SSHFP) String added in v0.6.0

func (rd SSHFP) String() string

type SVCB

type SVCB struct {
	Priority uint16      // If zero, Value must be empty or discarded by the user of this library.
	Target   string      `dns:"domain-name"`
	Value    []svcb.Pair `dns:"pairs"`
}

SVCB data. See RFC 9460.

func (SVCB) Len

func (rd SVCB) Len() int

func (SVCB) String added in v0.6.0

func (rd SVCB) String() string

type TA

type TA struct {
	KeyTag     uint16
	Algorithm  uint8
	DigestType uint8
	Digest     string `dns:"hex"`
}

TA data. See http://www.watson.org/~weiler/INI1999-19.pdf.

func (TA) Len

func (rd TA) Len() int

func (TA) String added in v0.6.0

func (rd TA) String() string
type TALINK struct {
	PreviousName string `dns:"domain-name"`
	NextName     string `dns:"domain-name"`
}

TALINK data. See https://www.iana.org/assignments/dns-parameters/TALINK/talink-completed-template.

func (TALINK) Len

func (rd TALINK) Len() int

func (TALINK) String added in v0.6.0

func (rd TALINK) String() string

type TKEY

type TKEY struct {
	Algorithm  string `dns:"domain-name"`
	Inception  uint32
	Expiration uint32
	Mode       uint16
	Error      uint16
	KeySize    uint16
	Key        string `dns:"size-hex:KeySize"`
	OtherLen   uint16
	OtherData  string `dns:"size-hex:OtherLen"`
}

TKEY data. See RFC 2930.

func (TKEY) Len

func (rd TKEY) Len() int

func (TKEY) String added in v0.6.0

func (rd TKEY) String() string

TKEY has no official presentation format, but this will suffice.

type TLSA

type TLSA struct {
	Usage        uint8
	Selector     uint8
	MatchingType uint8
	Certificate  string `dns:"hex"`
}

TLSA data. See RFC 6698.

func (TLSA) Len

func (rd TLSA) Len() int

func (TLSA) String added in v0.6.0

func (rd TLSA) String() string

type TSIG

type TSIG struct {
	Algorithm  string `dns:"domain-name"` // Algorithm is encoded as a name, see HmacSHAXXX contstants.
	TimeSigned uint64 `dns:"uint48"`
	Fudge      uint16
	MACSize    uint16
	MAC        string `dns:"size-hex:MACSize"`
	OrigID     uint16 // OrigID is the original message ID, when creating a TSIG this should be set to the message ID.
	Error      uint16
	OtherLen   uint16
	OtherData  string `dns:"size-hex:OtherLen"`
}

TSIG data.

func (TSIG) Len

func (rd TSIG) Len() int

func (TSIG) String added in v0.6.0

func (rd TSIG) String() string

type TXT

type TXT struct {
	Txt []string `dns:"txt"`
}

TXT data. See RFC 1035.

func (TXT) Len

func (rd TXT) Len() int

func (TXT) String added in v0.6.0

func (rd TXT) String() string

type UID

type UID struct {
	Uid uint32
}

UID data. Deprecated, IANA-Reserved.

func (UID) Len

func (rd UID) Len() int

func (UID) String added in v0.6.0

func (rd UID) String() string

type UINFO

type UINFO struct {
	Uinfo string
}

UINFO data. Deprecated, IANA-Reserved.

func (UINFO) Len

func (rd UINFO) Len() int

func (UINFO) String added in v0.6.0

func (rd UINFO) String() string

type URI

type URI struct {
	Priority uint16
	Weight   uint16
	Target   string `dns:"any"` // Target is to be parsed as a sequence of character encoded octets according to RFC 3986.
}

URI data. See RFC 7553.

func (URI) Len

func (rd URI) Len() int

func (URI) String added in v0.6.0

func (rd URI) String() string

type X25

type X25 struct {
	PSDNAddress string
}

X25 data. See RFC 1183, Section 3.1.

func (X25) Len

func (rd X25) Len() int

func (X25) String added in v0.6.0

func (rd X25) String() string

type ZONEMD

type ZONEMD struct {
	Serial uint32
	Scheme uint8
	Hash   uint8
	Digest string `dns:"hex"`
}

ZONEMD data, RFC 8976.

func (ZONEMD) Len

func (rd ZONEMD) Len() int

func (ZONEMD) String added in v0.6.0

func (rd ZONEMD) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL