config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package config provides configuration file support for the corerad server.

Index

Constants

View Source
const Minimal = `` /* 451-byte string literal not displayed */

Minimal is the minimal configuration file for CoreRAD.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// User-specified.
	Interfaces []Interface
	Debug      Debug
}

Config specifies the configuration for CoreRAD.

func Parse

func Parse(r io.Reader, epoch time.Time) (*Config, error)

Parse parses a Config in TOML format from an io.Reader and verifies that the configuration is valid. If the epoch is not zero, it is used to calculate deprecation times for certain parameters.

type Debug

type Debug struct {
	Address    string `toml:"address"`
	Prometheus bool   `toml:"prometheus"`
	PProf      bool   `toml:"pprof"`
}

Debug provides configuration for debugging and observability.

type Interface

type Interface struct {
	Name                           string
	Monitor, Advertise, Verbose    bool
	MinInterval, MaxInterval       time.Duration
	Managed, OtherConfig           bool
	ReachableTime, RetransmitTimer time.Duration
	HopLimit                       uint8
	DefaultLifetime                time.Duration
	UnicastOnly                    bool
	Preference                     ndp.Preference
	Plugins                        []plugin.Plugin
}

An Interface provides configuration for an individual interface.

func (Interface) RouterAdvertisement added in v0.2.4

func (ifi Interface) RouterAdvertisement(forwarding bool) (*ndp.RouterAdvertisement, []Misconfiguration, error)

RouterAdvertisement generates an IPv6 NDP router advertisement for this interface. Input parameters are used to tune parts of the RA, per the NDP RFCs. Any conflicting configurations will be reported as Misconfiguration values.

type Misconfiguration added in v0.3.4

type Misconfiguration int

A Misconfiguration indicates that the user configuration conflicts with the generated router advertisement in some way, and thus should be reported to the user.

const (
	InterfaceNotForwarding Misconfiguration
)

Possible Misconfiguration values.

Jump to

Keyboard shortcuts

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