edns

package
v0.0.0-...-5abfbfe Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeLLQ  uint16 = 1 // Long-Lived Queries [RFC 8764]
	CodeUL   uint16 = 2 // Update Leases (Draft)
	CodeNSID uint16 = 3 // Name Server Identifier [RFC 5001]

	CodeDAU          uint16 = 5
	CodeDHU          uint16 = 6
	CodeN3U          uint16 = 7
	CodeECS          uint16 = 8
	CodeEXPIRE       uint16 = 9
	CodeCOOKIE       uint16 = 10 // Cookies [RFC 7873]
	CodeTCPKEEPALIVE uint16 = 11
	CodePADDING      uint16 = 12
	CodeCHAIN        uint16 = 13
	CodeKEYTAG       uint16 = 14
	CodeEDE          uint16 = 15
	CodeCLIENTTAG    uint16 = 16
	CodeSERVERTAG    uint16 = 17

	CodeUMBRELLAIDENT uint16 = 20292

	CodeDEVICEID uint16 = 26946
)

Variables

View Source
var (
	ErrNoSuchOption = errors.New("no such option")
)

Functions

This section is empty.

Types

type Cookie struct {
	Client string
	Server string
}

func (*Cookie) Code

func (o *Cookie) Code() uint16

Code returns the option code

func (*Cookie) Len

func (o *Cookie) Len() uint16

Len returns the option length

func (*Cookie) Pack

func (o *Cookie) Pack(buf []byte, offset int) (int, error)

Pack packs the option data

func (*Cookie) String

func (o *Cookie) String() string

func (*Cookie) Unpack

func (o *Cookie) Unpack(data []byte, offset int, length uint16) (int, error)

Unpack unpacks the option data

type DAU

type DAU struct {
	Algorithms []uint16
}

DNSSEC Algorithm Understood See https://datatracker.ietf.org/doc/html/rfc6975#section-3

func (*DAU) Code

func (o *DAU) Code() uint16

Code returns the option code

func (*DAU) Len

func (o *DAU) Len() uint16

Len returns the option length

func (*DAU) Pack

func (o *DAU) Pack(buf []byte, offset int) (int, error)

Pack packs the option data

func (*DAU) String

func (o *DAU) String() string

func (*DAU) Unpack

func (o *DAU) Unpack(data []byte, offset int, length uint16) (int, error)

Unpack unpacks the option data

type DHU

type DHU struct {
	Algorithms []uint16
}

DS Hash Understood See https://datatracker.ietf.org/doc/html/rfc6975#section-3

func (*DHU) Code

func (o *DHU) Code() uint16

Code returns the option code

func (*DHU) Len

func (o *DHU) Len() uint16

Len returns the option length

func (*DHU) Pack

func (o *DHU) Pack(buf []byte, offset int) (int, error)

Pack packs the option data

func (*DHU) String

func (o *DHU) String() string

func (*DHU) Unpack

func (o *DHU) Unpack(data []byte, offset int, length uint16) (int, error)

Unpack unpacks the option data

type N3U

type N3U struct {
	Algorithms []uint16
}

NSEC3 Hash Understood See https://datatracker.ietf.org/doc/html/rfc6975#section-3

func (*N3U) Code

func (o *N3U) Code() uint16

Code returns the option code

func (*N3U) Len

func (o *N3U) Len() uint16

Len returns the option length

func (*N3U) Pack

func (o *N3U) Pack(buf []byte, offset int) (int, error)

Pack packs the option data

func (*N3U) String

func (o *N3U) String() string

func (*N3U) Unpack

func (o *N3U) Unpack(data []byte, offset int, length uint16) (int, error)

Unpack unpacks the option data

type NSID

type NSID struct {
	ID string
}

func (*NSID) Code

func (o *NSID) Code() uint16

Code returns the option code

func (*NSID) Len

func (o *NSID) Len() uint16

Len returns the option length

func (*NSID) Pack

func (o *NSID) Pack(buf []byte, offset int) (int, error)

Pack packs the option data

func (*NSID) String

func (o *NSID) String() string

func (*NSID) Unpack

func (o *NSID) Unpack(data []byte, offset int, length uint16) (int, error)

Unpack unpacks the option data

type Option

type Option interface {
	// Code returns the option code
	Code() uint16

	// Len returns the option length
	Len() uint16

	// Unpack unpacks the option data
	Unpack([]byte, int, uint16) (int, error)

	// Pack packs the option data
	Pack([]byte, int) (int, error)
}

func New

func New(code uint16) (Option, error)

Jump to

Keyboard shortcuts

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