Documentation ¶
Overview ¶
Package plugin implements CoreRAD plugins.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaptivePortal ¶ added in v0.3.2
type CaptivePortal struct {
Portal *ndp.CaptivePortal
}
CaptivePortal configures a NDP Captive Portal option.
func NewCaptivePortal ¶ added in v0.3.2
func NewCaptivePortal(uri string) (*CaptivePortal, error)
NewCaptivePortal creates a CaptivePortal from a string.
func UnrestrictedPortal ¶ added in v1.1.2
func UnrestrictedPortal() *CaptivePortal
UnrestrictedPortal creates a CaptivePortal which advertises itself as unrestricted.
func (*CaptivePortal) Apply ¶ added in v0.3.2
func (cp *CaptivePortal) Apply(ra *ndp.RouterAdvertisement) error
Apply implements Plugin.
func (*CaptivePortal) Name ¶ added in v0.3.2
func (*CaptivePortal) Name() string
Name implements Plugin.
func (*CaptivePortal) Prepare ¶ added in v0.3.2
func (*CaptivePortal) Prepare(_ *net.Interface) error
Prepare implements Plugin.
func (*CaptivePortal) String ¶ added in v0.3.2
func (cp *CaptivePortal) String() string
String implements Plugin.
type DNSSL ¶
DNSSL configures a NDP DNS Search List option.
type LLA ¶ added in v0.1.9
type LLA struct {
Addr net.HardwareAddr
}
LLA configures a NDP Source Link Layer Address option.
func (*LLA) Apply ¶ added in v0.1.9
func (l *LLA) Apply(ra *ndp.RouterAdvertisement) error
Apply implements Plugin.
type PREF64 ¶ added in v1.3.0
PREF64 configures a NDP PREF64 option, used to communicate prefixes to clients for NAT64.
func NewPREF64 ¶ added in v1.3.0
NewPREF64 computes PREF64 plugin values given a prefix and router advertisement max interval value.
func (*PREF64) Apply ¶ added in v1.3.0
func (p *PREF64) Apply(ra *ndp.RouterAdvertisement) error
Apply implements Plugin.
type Plugin ¶
type Plugin interface { // Name is the string name of the plugin. Name() string // String is the string representation of the plugin's configuration. String() string // Prepare prepares a Plugin for use with the specified network interface. Prepare(ifi *net.Interface) error // Apply applies Plugin data to the input RA. Apply(ra *ndp.RouterAdvertisement) error }
A Plugin specifies a CoreRAD plugin's configuration.
type Prefix ¶
type Prefix struct { // Whether or not this Prefix should automatically infer and apply the // appropriate IPv6 prefixes to the configuration. Auto bool // Parameters from configuration. Prefix netip.Prefix OnLink bool Autonomous bool ValidLifetime time.Duration PreferredLifetime time.Duration // Whether or not this prefix will be treated as deprecated when the Prefix // is applied, and the time used to calculate the expiration time. Epoch time.Time Deprecated bool // Functions which can be swapped for tests. TimeNow func() time.Time Addrs func() ([]system.IP, error) }
A Prefix configures a NDP Prefix Information option.
func (*Prefix) Apply ¶
func (p *Prefix) Apply(ra *ndp.RouterAdvertisement) error
Apply implements Plugin.
type RDNSS ¶
type RDNSS struct { // Whether or not this RDNSS should automatically infer and apply the // appropriate IPv6 DNS server address to the configuration. Auto bool // Parameters from configuration. Lifetime time.Duration Servers []netip.Addr // Functions which can be swapped for tests. Addrs func() ([]system.IP, error) }
RDNSS configures a NDP Recursive DNS Servers option.
func (*RDNSS) Apply ¶
func (r *RDNSS) Apply(ra *ndp.RouterAdvertisement) error
Apply implements Plugin.
type Route ¶ added in v0.2.1
type Route struct { // Whether or not this Route should automatically infer and apply the // appropriate IPv6 loopback interface routes to the configuration. Auto bool // Parameters from configuration. Prefix netip.Prefix Preference ndp.Preference Lifetime time.Duration // Whether or not this route will be treated as deprecated when the Route // is applied, and the time used to calculate the expiration time. Epoch time.Time Deprecated bool // Functions which can be swapped for tests. TimeNow func() time.Time Routes func() ([]system.Route, error) }
A Route configures a NDP Route Information option.
func (*Route) Apply ¶ added in v0.2.1
func (r *Route) Apply(ra *ndp.RouterAdvertisement) error
Apply implements Plugin.