rules

package
v0.0.3-cli Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enforcer

type Enforcer struct {
	Logger lager.Logger
	// contains filtered or unexported fields
}

func NewEnforcer

func NewEnforcer(logger lager.Logger, timestamper TimeStamper, ipt IPTables) *Enforcer

func (*Enforcer) Enforce

func (e *Enforcer) Enforce(chainPrefix string, rules []Rule) error

type GenericRule

type GenericRule struct {
	Properties []string
}

func (GenericRule) Enforce

func (r GenericRule) Enforce(chain string, iptables IPTables, logger lager.Logger) error

type IPTables

type IPTables interface {
	Exists(table, chain string, rulespec ...string) (bool, error)
	Insert(table, chain string, pos int, rulespec ...string) error
	AppendUnique(table, chain string, rulespec ...string) error
	Delete(table, chain string, rulespec ...string) error
	List(table, chain string) ([]string, error)
	NewChain(table, chain string) error
	ClearChain(table, chain string) error
	DeleteChain(table, chain string) error
}

type Rule

type Rule interface {
	Enforce(string, IPTables, lager.Logger) error
}

type RuleEnforcer

type RuleEnforcer interface {
	Enforce(chain string, r []Rule) error
}

type TimeStamper

type TimeStamper interface {
	CurrentTime() int
}

type Timestamper

type Timestamper struct{}

func (Timestamper) CurrentTime

func (_ Timestamper) CurrentTime() int

type Updater

type Updater struct {
	Logger lager.Logger

	VNI          int
	LocalSubnet  string
	RuleEnforcer RuleEnforcer
	// contains filtered or unexported fields
}

func New

func New(logger lager.Logger, storeReader storeReader, policyClient policyClient, vni int, localSubnet string, ruleEnforcer RuleEnforcer) *Updater

func (*Updater) DefaultRules

func (u *Updater) DefaultRules() []Rule

func (*Updater) Rules

func (u *Updater) Rules() ([]Rule, error)

func (*Updater) Update

func (u *Updater) Update() error

Jump to

Keyboard shortcuts

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