config

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2018 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MasqueradeConfigSet = Set{
	false,
	"Masquerade",
	nil,
}
View Source
var PolicyRoutingConfigSet = Set{
	false,
	"PolicyRouting",
	nil,
}

Functions

This section is empty.

Types

type Config

type Config interface {
	Ensure(enabled bool) error
}

type IPRouteConfig

type IPRouteConfig struct {
	Route    netlink.Route
	RouteAdd RouteAdder
	RouteDel RouteDeler
}

func (IPRouteConfig) Ensure

func (r IPRouteConfig) Ensure(enabled bool) error

type IPRuleConfig

type IPRuleConfig struct {
	Rule     netlink.Rule
	RuleAdd  RuleAdder
	RuleDel  RuleDeler
	RuleList RuleLister
}

func (IPRuleConfig) Ensure

func (r IPRuleConfig) Ensure(enabled bool) error

type IPTabler added in v0.1.3

type IPTabler interface {
	NewChain(table, chain string) error
	ClearChain(table, chain string) error
	DeleteChain(table, chain string) error
	AppendUnique(table, chain string, rulespec ...string) error
	Delete(table, chain string, rulespec ...string) error
}

type IPTablesChainSpec added in v0.1.2

type IPTablesChainSpec struct {
	TableName, ChainName string
	IsDefaultChain       bool // Is a System default chain, if yes, we won't delete it.
	IPT                  IPTabler
}

type IPTablesRuleConfig

type IPTablesRuleConfig struct {
	Spec      IPTablesChainSpec
	RuleSpecs []IPTablesRuleSpec
	IPT       IPTabler
}

func (IPTablesRuleConfig) Ensure

func (r IPTablesRuleConfig) Ensure(enabled bool) error

type IPTablesRuleSpec added in v0.1.2

type IPTablesRuleSpec []string

type RouteAdder added in v0.1.3

type RouteAdder func(route *netlink.Route) error

type RouteDeler added in v0.1.3

type RouteDeler func(route *netlink.Route) error

type RuleAdder added in v0.1.3

type RuleAdder func(rule *netlink.Rule) error

type RuleDeler added in v0.1.3

type RuleDeler func(rule *netlink.Rule) error

type RuleLister added in v0.1.3

type RuleLister func(family int) ([]netlink.Rule, error)

type Set added in v0.1.2

type Set struct {
	Enabled     bool
	FeatureName string
	Configs     []Config
}

type SysctlConfig

type SysctlConfig struct {
	Key, Value, DefaultValue string
	SysctlFunc               Sysctler
}

func (SysctlConfig) Ensure

func (s SysctlConfig) Ensure(enabled bool) error

type Sysctler added in v0.1.3

type Sysctler func(name string, params ...string) (string, error)

Jump to

Keyboard shortcuts

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