options

package
v0.0.0-...-15d0a17 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HostToNetByte

func HostToNetByte(i uint8) []byte

func HostToNetLong

func HostToNetLong(i uint32) []byte

func HostToNetShort

func HostToNetShort(i uint16) []byte

func ValidateSvcParams

func ValidateSvcParams(s string) error

Types

type DHCPOption

type DHCPOption struct {
	V6              bool       `yaml:"-"`
	ServicePriority uint16     `yaml:"svc_prio"`
	ADN             string     `yaml:"adn"`
	Addresses       []net.IP   `yaml:"addresses"`
	ServiceParams   SVCBRecord `yaml:"svc_params"`
}

DHCPOption is for V6 or V4 DNR Options

func (*DHCPOption) Serialize

func (d *DHCPOption) Serialize() ([]byte, error)

func (*DHCPOption) Validate

func (d *DHCPOption) Validate() error

type DHCPOptions

type DHCPOptions struct {
	DHCPOptions []*DHCPOption `yaml:"dhcp_options""`
	V6          bool          `yaml:"v6"`
}

func (*DHCPOptions) Serialize

func (d *DHCPOptions) Serialize() ([]byte, error)

func (*DHCPOptions) Validate

func (d *DHCPOptions) Validate() error

type RAOption

type RAOption struct {
	ServicePriority uint16   `yaml:"svc_prio"`
	Lifetime        uint32   `yaml:"lifetime"`
	ADN             string   `yaml:"adn"`
	Addresses       []net.IP `yaml:"addresses"`
	ServiceParams   string   `yaml:"svc_params" validate:"empty=false"`
}

RAOption is for V6 addresses

func (*RAOption) Serialize

func (d *RAOption) Serialize() ([]byte, error)

func (*RAOption) Validate

func (d *RAOption) Validate() error

type RAOptions

type RAOptions struct {
	RAOptions []*RAOption `yaml:"ra_options"`
}

func (*RAOptions) Serialize

func (d *RAOptions) Serialize() ([]byte, error)

func (*RAOptions) Validate

func (d *RAOptions) Validate() error

type SVCBRecord

type SVCBRecord struct {
	Record *SVCB
}

SVCBRecord holds a SVCB RR not ServiceParams because the dns library doesn't have an API capable of packing SvcParams directly. So we parse SVCB, pack it, and calculate an offset to get the SvcParams when Serializing

func (*SVCBRecord) Serialize

func (d *SVCBRecord) Serialize() ([]byte, error)

func (*SVCBRecord) UnmarshalText

func (d *SVCBRecord) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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