dnsstring

package
v0.6.65 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeNone       uint16 = 0
	TypeA          uint16 = 1
	TypeNS         uint16 = 2
	TypeMD         uint16 = 3
	TypeMF         uint16 = 4
	TypeCNAME      uint16 = 5
	TypeSOA        uint16 = 6
	TypeMB         uint16 = 7
	TypeMG         uint16 = 8
	TypeMR         uint16 = 9
	TypeNULL       uint16 = 10
	TypePTR        uint16 = 12
	TypeHINFO      uint16 = 13
	TypeMINFO      uint16 = 14
	TypeMX         uint16 = 15
	TypeTXT        uint16 = 16
	TypeRP         uint16 = 17
	TypeAFSDB      uint16 = 18
	TypeX25        uint16 = 19
	TypeISDN       uint16 = 20
	TypeRT         uint16 = 21
	TypeNSAPPTR    uint16 = 23
	TypeSIG        uint16 = 24
	TypeKEY        uint16 = 25
	TypePX         uint16 = 26
	TypeGPOS       uint16 = 27
	TypeAAAA       uint16 = 28
	TypeLOC        uint16 = 29
	TypeNXT        uint16 = 30
	TypeEID        uint16 = 31
	TypeNIMLOC     uint16 = 32
	TypeSRV        uint16 = 33
	TypeATMA       uint16 = 34
	TypeNAPTR      uint16 = 35
	TypeKX         uint16 = 36
	TypeCERT       uint16 = 37
	TypeDNAME      uint16 = 39
	TypeOPT        uint16 = 41
	TypeAPL        uint16 = 42 // Not implemented.
	TypeDS         uint16 = 43
	TypeSSHFP      uint16 = 44
	TypeIPSECKEY   uint16 = 45 // Not implemented.
	TypeRRSIG      uint16 = 46
	TypeNSEC       uint16 = 47
	TypeDNSKEY     uint16 = 48
	TypeDHCID      uint16 = 49
	TypeNSEC3      uint16 = 50
	TypeNSEC3PARAM uint16 = 51
	TypeTLSA       uint16 = 52
	TypeSMIMEA     uint16 = 53
	TypeHIP        uint16 = 55
	TypeNINFO      uint16 = 56
	TypeRKEY       uint16 = 57
	TypeTALINK     uint16 = 58
	TypeCDS        uint16 = 59
	TypeCDNSKEY    uint16 = 60
	TypeOPENPGPKEY uint16 = 61
	TypeCSYNC      uint16 = 62
	TypeZONEMD     uint16 = 63
	TypeSVCB       uint16 = 64
	TypeHTTPS      uint16 = 65
	TypeDSYNC      uint16 = 66
	TypeSPF        uint16 = 99
	TypeUINFO      uint16 = 100
	TypeUID        uint16 = 101
	TypeGID        uint16 = 102
	TypeUNSPEC     uint16 = 103
	TypeNID        uint16 = 104
	TypeL32        uint16 = 105
	TypeL64        uint16 = 106
	TypeLP         uint16 = 107
	TypeEUI48      uint16 = 108
	TypeEUI64      uint16 = 109
	TypeNXNAME     uint16 = 128
	TypeURI        uint16 = 256
	TypeCAA        uint16 = 257
	TypeAVC        uint16 = 258
	TypeAMTRELAY   uint16 = 260 // Not implemented.
	TypeRESINFO    uint16 = 261
	TypeWALLET     uint16 = 262
	TypeCLA        uint16 = 263
	TypeIPN        uint16 = 264

	TypeTKEY uint16 = 249
	TypeTSIG uint16 = 250

	// Valid question types only.
	TypeIXFR  uint16 = 251
	TypeAXFR  uint16 = 252
	TypeMAILB uint16 = 253
	TypeMAILA uint16 = 254
	TypeANY   uint16 = 255

	TypeTA         uint16 = 32768
	TypeDLV        uint16 = 32769
	TypeDELEG      uint16 = 65432 // Provisional type code.
	TypeDELEGPARAM uint16 = 65433 // Provisional type code.
	TypeReserved   uint16 = 65535
)

Wire constants and supported types.

View Source
const (
	LOCEquator       = 1 << 31 // RFC 1876, Section 2.
	LOCPrimemeridian = 1 << 31 // RFC 1876, Section 2.
	LOCHours         = 60 * 1000
	LOCDegrees       = 60 * LOCHours
	LOCAltitudebase  = 100000
)

Various constants used in the LOC RR. See RFC 1876.

View Source
const (
	RSAMD5 uint8
	DH
	DSA

	RSASHA1
	DSANSEC3SHA1
	RSASHA1NSEC3SHA1
	RSASHA256

	RSASHA512

	ECCGOST
	ECDSAP256SHA256
	ECDSAP384SHA384
	ED25519
	ED448
	INDIRECT   uint8 = 252
	PRIVATEDNS uint8 = 253 // Private (experimental keys)
	PRIVATEOID uint8 = 254
)

DNSSEC encryption algorithm codes.

View Source
const (
	CertPKIX = 1 + iota
	CertSPKI
	CertPGP
	CertIPIX
	CertISPKI
	CertIPGP
	CertACPKIX
	CertIACPKIX
	CertURI = 253
	CertOID = 254
)

Different Certificate Types, see RFC 4398, Section 2.1.

Variables

View Source
var AlgorithmToString = map[uint8]string{
	RSAMD5:           "RSAMD5",
	DH:               "DH",
	DSA:              "DSA",
	RSASHA1:          "RSASHA1",
	DSANSEC3SHA1:     "DSA-NSEC3-SHA1",
	RSASHA1NSEC3SHA1: "RSASHA1-NSEC3-SHA1",
	RSASHA256:        "RSASHA256",
	RSASHA512:        "RSASHA512",
	ECCGOST:          "ECC-GOST",
	ECDSAP256SHA256:  "ECDSAP256SHA256",
	ECDSAP384SHA384:  "ECDSAP384SHA384",
	ED25519:          "ED25519",
	ED448:            "ED448",
	INDIRECT:         "INDIRECT",
	PRIVATEDNS:       "PRIVATEDNS",
	PRIVATEOID:       "PRIVATEOID",
}

AlgorithmToString is a map of algorithm IDs to algorithm names.

View Source
var CertTypeToString = map[uint16]string{
	CertPKIX:    "PKIX",
	CertSPKI:    "SPKI",
	CertPGP:     "PGP",
	CertIPIX:    "IPIX",
	CertISPKI:   "ISPKI",
	CertIPGP:    "IPGP",
	CertACPKIX:  "ACPKIX",
	CertIACPKIX: "IACPKIX",
	CertURI:     "URI",
	CertOID:     "OID",
}

CertTypeToString converts the Cert Type to its string representation. See RFC 4398 and RFC 6944.

View Source
var TypeToString = map[uint16]string{
	TypeNULL:       "NULL",
	TypeNXNAME:     "NXNAME",
	TypeCNAME:      "CNAME",
	TypeHINFO:      "HINFO",
	TypeMB:         "MB",
	TypeMG:         "MG",
	TypeMINFO:      "MINFO",
	TypeMR:         "MR",
	TypeMF:         "MF",
	TypeMD:         "MD",
	TypeMX:         "MX",
	TypeAFSDB:      "AFSDB",
	TypeX25:        "X25",
	TypeISDN:       "ISDN",
	TypeRT:         "RT",
	TypeNS:         "NS",
	TypePTR:        "PTR",
	TypeRP:         "RP",
	TypeSOA:        "SOA",
	TypeTXT:        "TXT",
	TypeSPF:        "SPF",
	TypeAVC:        "AVC",
	TypeWALLET:     "WALLET",
	TypeCLA:        "CLA",
	TypeIPN:        "IPN",
	TypeSRV:        "SRV",
	TypeNAPTR:      "NAPTR",
	TypeCERT:       "CERT",
	TypeDNAME:      "DNAME",
	TypeA:          "A",
	TypeAAAA:       "AAAA",
	TypePX:         "PX",
	TypeGPOS:       "GPOS",
	TypeLOC:        "LOC",
	TypeSIG:        "SIG",
	TypeRRSIG:      "RRSIG",
	TypeNXT:        "NXT",
	TypeNSEC:       "NSEC",
	TypeDLV:        "DLV",
	TypeCDS:        "CDS",
	TypeDS:         "DS",
	TypeKX:         "KX",
	TypeTA:         "TA",
	TypeTALINK:     "TALINK",
	TypeSSHFP:      "SSHFP",
	TypeKEY:        "KEY",
	TypeCDNSKEY:    "CDNSKEY",
	TypeDNSKEY:     "DNSKEY",
	TypeRKEY:       "RKEY",
	TypeNSEC3:      "NSEC3",
	TypeNSEC3PARAM: "NSEC3PARAM",
	TypeTKEY:       "TKEY",
	TypeURI:        "URI",
	TypeDHCID:      "DHCID",
	TypeTLSA:       "TLSA",
	TypeSMIMEA:     "SMIMEA",
	TypeHIP:        "HIP",
	TypeNINFO:      "NINFO",
	TypeNID:        "NID",
	TypeL32:        "L32",
	TypeL64:        "L64",
	TypeLP:         "LP",
	TypeEUI48:      "EUI48",
	TypeEUI64:      "EUI64",
	TypeCAA:        "CAA",
	TypeUID:        "UID",
	TypeGID:        "GID",
	TypeUINFO:      "UINFO",
	TypeEID:        "EID",
	TypeNIMLOC:     "NIMLOC",
	TypeOPENPGPKEY: "OPENPGPKEY",
	TypeCSYNC:      "CSYNC",
	TypeZONEMD:     "ZONEMD",
	TypeOPT:        "OPT",
	TypeRESINFO:    "RESINFO",
	TypeSVCB:       "SVCB",
	TypeHTTPS:      "HTTPS",
	TypeDELEG:      "DELEG",
	TypeDELEGPARAM: "DELEGPARAM",
	TypeDSYNC:      "DSYNC",
	TypeANY:        "ANY",
	TypeAXFR:       "AXFR",
	TypeIXFR:       "IXFR",
	TypeTSIG:       "TSIG",
	TypeNSAPPTR:    "NSAP-PTR",
}

TypeToString is a map of strings for each RR type.

Functions

func AtoiUint8 added in v0.6.44

func AtoiUint8(s string) (uint8, error)

func AtoiUint16 added in v0.6.44

func AtoiUint16(s string) (uint16, error)

func AtoiUint32 added in v0.6.44

func AtoiUint32(s string) (uint32, error)

func ToTime added in v0.6.47

func ToTime(s string) (int64, error)

Types

type Reader added in v0.6.41

type Reader struct {
	// contains filtered or unexported fields
}

Reader wraps a string and guarantees the stream ends with a '\n'. If the string already ends with a newline, it behaves identically to strings.NewReader. Otherwise it appends exactly one '\n' at EOF.

func NewReader added in v0.6.41

func NewReader(s string) *Reader

NewReader returns a Reader for s.

func (*Reader) Read added in v0.6.41

func (r *Reader) Read(p []byte) (int, error)

Read implements io.Reader.

Jump to

Keyboard shortcuts

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