deleg

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package deleg deals with all the intricacies of the DELEG RR. All the sub-types ([Infos]) used in the RR are defined here. As DELEG is derived from the [dns.SVCB] RR so there are a lot of similarities.

Index

Constants

View Source
const (
	KeyReserved uint16 = 0

	KeyServerIP4 uint16 = iota + 1
	KeyServerIP6
	KeyServerName
	KeyIncludeName
)

Keys as defined in the DELEG draft.

Variables

This section is empty.

Functions

func InfoToKey added in v0.1.11

func InfoToKey(i Info) uint16

InfoToKey is the reverse of KeyToInfo.

func KeyToInfo added in v0.1.11

func KeyToInfo(k uint16) func() Info

KeyToInfo convert the key value to a Info.

func KeyToString

func KeyToString(k uint16) string

KeyToString return the string representation for k. For KeyReserved the empty string is returned. For unknown keys "key"+value is returned, see section 2.1 of RFC 9460.

func Pack added in v0.1.11

func Pack(i Info, msg []byte, off int) (int, error)

Pack converts an info to wire-format. Only exported to make it available to the dns packer.

func Parse added in v0.1.11

func Parse(i Info, b string) error

func StringToKey

func StringToKey(s string) uint16

StringtoKey is the reverse of KeyToString and takes keyXXXX into account.

func Unpack added in v0.1.11

func Unpack(i Info, data *cryptobyte.String) error

Unpack converts wire-format to an info. Only exported to make it available to the dns unpacker.

Types

type Info added in v0.1.11

type Info interface {
	String() string // String returns the string representation of the value.
	Len() int       // Len returns the length of value in the wire format.
	Copy() Info     // Copy returns a deep copy of the Info.
}

Info defines a key=value pair for the DELEG/DELEGI RR type. A DELEG RR can have multiple infos appended to it. The numerical key code is derived from the type, see InfoToKey.

type SERVERIP4

type SERVERIP4 struct {
	IPs []net.IP
}

SERVERIP4 info adds IPv4 addresses to the DELEG RR.

func (*SERVERIP4) Copy added in v0.1.11

func (s *SERVERIP4) Copy() Info

func (*SERVERIP4) Len

func (s *SERVERIP4) Len() int

func (*SERVERIP4) String

func (s *SERVERIP4) String() string

type SERVERIP6

type SERVERIP6 struct {
	IPs []net.IP
}

SERVERIP6 info adds IPv6 addresses to the DELEG RR.

func (*SERVERIP6) Copy added in v0.1.11

func (s *SERVERIP6) Copy() Info

func (*SERVERIP6) Len

func (s *SERVERIP6) Len() int

func (*SERVERIP6) String

func (s *SERVERIP6) String() string

Jump to

Keyboard shortcuts

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