config

package
v0.0.0-...-dfd0594 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 10 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server6 *ServerConfig
	Server4 *ServerConfig
	// contains filtered or unexported fields
}

Config holds the DHCPv6/v4 server configuration

func Load

func Load(pathOverride string) (*Config, error)

Load reads a configuration file and returns a Config object, or an error if any.

func New

func New() *Config

New returns a new initialized instance of a Config object

type ConfigError

type ConfigError struct {
	// contains filtered or unexported fields
}

ConfigError is an error type returned upon configuration errors.

func ConfigErrorFromError

func ConfigErrorFromError(err error) *ConfigError

ConfigErrorFromError returns a ConfigError from the given error object.

func ConfigErrorFromString

func ConfigErrorFromString(format string, args ...interface{}) *ConfigError

ConfigErrorFromString returns a ConfigError from the given error string.

func (ConfigError) Error

func (ce ConfigError) Error() string

type PluginConfig

type PluginConfig struct {
	Name string
	Args []string
}

PluginConfig holds the configuration of a plugin

type ServerConfig

type ServerConfig struct {
	Addresses []net.UDPAddr
	Plugins   []PluginConfig
}

ServerConfig holds a server configuration that is specific to either the DHCPv6 server or the DHCPv4 server.

Notes

Bugs

  • listen specifications of the form `[ip6]%iface:port` or `[ip6]%iface` are not supported, even though they are the default format of the `ss` utility in linux. Use `[ip6%iface]:port` instead

  • When listening on link-local multicast addresses without binding to a specific interface, new interfaces coming up after the server starts will not be taken into account.

Jump to

Keyboard shortcuts

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