config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

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

	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 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"`
}

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 Loader

type Loader struct {
	// SessionPoliciesFile is the file name of the session policies. Must be set.
	SessionPoliciesFile string
	// RoutingPolicyFile is the file name of the routing policy. Must be set.
	RoutingPolicyFile string
	// Publisher is used to publish new loaded configs.
	Publisher Publisher
	// Trigger is used to trigger loading.
	Trigger <-chan struct{}
	// SessionPolicyParser is used to parse session policies.
	SessionPolicyParser control.SessionPolicyParser
	// Logger is used to log errors, if nil nothing is logged.
	Logger log.Logger
	// contains filtered or unexported fields
}

Loader can be used to load gateway configurations from files. It waits on triggers.

func (*Loader) Close

func (l *Loader) Close() error

Close shuts down this loader.

func (*Loader) Run

func (l *Loader) Run() error

Run waits on trigger signals, and publishes the newly loaded files on the trigger. This blocks until the Loader is closed.

type Publisher

type Publisher interface {
	Publish(control.SessionPolicies, *routing.Policy)
}

Publisher publishes new configurations.

type Tunnel

type Tunnel struct {
	config.NoDefaulter

	// Name is the name of TUN device to create.
	Name string `toml:"name,omitempty"`
	// RoutingTableID is the ID of the routing table used in the gateway.
	RoutingTableID int `toml:"routing_table_id,omitempty"`
	// SrcIPv4 is the source address int to put into the routing table.
	SrcIPv4 net.IP `toml:"src_ipv4,omitempty"`
	// SrcIPv6 is the source address int 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
Package mock_config is a generated GoMock package.
Package mock_config is a generated GoMock package.

Jump to

Keyboard shortcuts

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