sessionrules

package
v2.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GlobalTableCheck

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

LocalTableCheck allows to check the content of the global table.

func (*GlobalTableCheck) HasRule

func (gtc *GlobalTableCheck) HasRule(lclIP string, lclPort uint16, rmtIP string, rmtPort uint16, proto string, action string) bool

HasRule returns <true> if the given rule is present in the table.

func (*GlobalTableCheck) NumOfRules

func (gtc *GlobalTableCheck) NumOfRules() int

NumOfRules returns the number of rules in the table.

type LocalTableCheck

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

LocalTableCheck allows to check the content of a local table.

func (*LocalTableCheck) HasRule

func (ltc *LocalTableCheck) HasRule(lclIP string, lclPort uint16, rmtIP string, rmtPort uint16, proto string, action string) bool

HasRule returns <true> if the given rule is present in the table.

func (*LocalTableCheck) NumOfRules

func (ltc *LocalTableCheck) NumOfRules() int

NumOfRules returns the number of rules in the table.

type MockSessionRules

type MockSessionRules struct {
	Log logging.Logger
	// contains filtered or unexported fields
}

MockSessionRules simulates session rules from VPPTCP stack. The installed rules are only stored locally and can be queried for testing purposes.

func NewMockSessionRules

func NewMockSessionRules(log logging.Logger, tagPrefix string) *MockSessionRules

NewMockSessionRules is a constructor for MockSessionRules. Create only one in the entire test suite. Clear state between tests using the Clear() method.

func (*MockSessionRules) Clear

func (msr *MockSessionRules) Clear()

Clear clears the state of the mocked session.

func (*MockSessionRules) GetErrCount

func (msr *MockSessionRules) GetErrCount() int

GetErrCount returns the number of errors that have occurred so far.

func (*MockSessionRules) GetReqCount

func (msr *MockSessionRules) GetReqCount() int

GetReqCount returns the number of requests that have been received so far.

func (*MockSessionRules) GlobalTable

func (msr *MockSessionRules) GlobalTable() *GlobalTableCheck

GlobalTable allows to access checks for the global table.

func (*MockSessionRules) LocalTable

func (msr *MockSessionRules) LocalTable(nsIndex uint32) *LocalTableCheck

LocalTable allows to access checks for a local table.

func (*MockSessionRules) NewVPPChan

func (msr *MockSessionRules) NewVPPChan() govppapi.Channel

NewVPPChan creates a new mock VPP channel.

type SessionRules

type SessionRules []*vpptcprule.SessionRule

SessionRules is a list of session rules.

Jump to

Keyboard shortcuts

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