config

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCtrlAddr  = ":30256"
	DefaultDataAddr  = ":30056"
	DefaultProbeAddr = ":30856"

	DefaultTunnelName           = "sig"
	DefaultTunnelRoutingTableID = 11
)

Defaults.

View Source
const (
	// FIXME(lukedirtwalker): cleanup traffic policy and use "session.policy"
	// instead.
	DefaultSessionPoliciesFile = "/share/conf/traffic.policy"
)

Default file paths

Variables

This section is empty.

Functions

func DefaultAddress

func DefaultAddress(input string, defaultPort int) string

DefaultAddress determines the default address. If port is not specified, or is zero, it is set to the default port. If the input is garbage, the output is garbage as well.

Types

type Config

type Config struct {
	Features env.Features `toml:"features,omitempty"`
	Logging  log.Config   `toml:"log,omitempty"`
	Metrics  env.Metrics  `toml:"metrics,omitempty"`
	API      api.Config   `toml:"api,omitempty"`
	Daemon   env.Daemon   `toml:"sciond_connection,omitempty"`
	Gateway  Gateway      `toml:"gateway,omitempty"`
	Tunnel   Tunnel       `toml:"tunnel,omitempty"`
}

func (*Config) InitDefaults

func (cfg *Config) InitDefaults()

func (*Config) Sample

func (cfg *Config) Sample(dst io.Writer, path config.Path, _ config.CtxMap)

func (*Config) Validate

func (cfg *Config) Validate() error

type Gateway

type Gateway struct {
	config.NoDefaulter

	// ID of the SIG.
	ID string `toml:"id,omitempty"`
	// TrafficPolicy is the file path of the traffic policy file.
	TrafficPolicy string `toml:"traffic_policy_file,omitempty"`
	// IPRoutingPolicy is the file path of the IP routing policy file.
	IPRoutingPolicy string `toml:"ip_routing_policy_file,omitempty"`
	// Control plane address, for prefix discovery.
	CtrlAddr string `toml:"ctrl_addr,omitempty"`
	// Data plane address, for frames.
	DataAddr string `toml:"data_addr,omitempty"`
	// Probe address, for probing paths.
	ProbeAddr string `toml:"probe_addr,omitempty"`
}

Gateway holds the gateway specific configuration.

func (*Gateway) ConfigName

func (cfg *Gateway) ConfigName() string

func (*Gateway) Sample

func (cfg *Gateway) Sample(dst io.Writer, path config.Path, ctx config.CtxMap)

func (*Gateway) Validate

func (cfg *Gateway) Validate() error

type Tunnel

type Tunnel struct {
	config.NoDefaulter

	// Name is the name of TUN device to create.
	Name string `toml:"name,omitempty"`
	// SrcIPv4 is the source address to put into the routing table.
	SrcIPv4 net.IP `toml:"src_ipv4,omitempty"`
	// SrcIPv6 is the source address to put into the routing table.
	SrcIPv6 net.IP `toml:"src_ipv6,omitempty"`
}

Tunnel holds the tunneling configuration.

func (*Tunnel) ConfigName

func (cfg *Tunnel) ConfigName() string

func (*Tunnel) Sample

func (cfg *Tunnel) Sample(dst io.Writer, path config.Path, ctx config.CtxMap)

func (*Tunnel) Validate

func (cfg *Tunnel) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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