remoteenforcer

package
v1.0.67 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2017 License: GPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LaunchRemoteEnforcer

func LaunchRemoteEnforcer(service enforcer.PacketProcessor) error

LaunchRemoteEnforcer launches a remote enforcer

Types

type CollectorImpl

type CollectorImpl struct {
	Flows map[string]*collector.FlowRecord
	sync.Mutex
}

CollectorImpl : This is a local implementation for the collector interface It has a flow entries cache which contains unique flows that are reported back to the controller/launcher process

func NewCollector

func NewCollector() *CollectorImpl

NewCollector creates a new remote collector for statistics

func (*CollectorImpl) CollectContainerEvent

func (c *CollectorImpl) CollectContainerEvent(record *collector.ContainerRecord)

CollectContainerEvent exported This event should not be expected here in the enforcer process inside a particular container context

func (*CollectorImpl) CollectFlowEvent

func (c *CollectorImpl) CollectFlowEvent(record *collector.FlowRecord)

CollectFlowEvent collects a new flow event and adds it to a local list it shares with SendStats

type Server

type Server struct {
	Enforcer   enforcer.PolicyEnforcer
	Supervisor supervisor.Supervisor
	Service    enforcer.PacketProcessor
	// contains filtered or unexported fields
}

Server : This is the structure for maintaining state required by the remote enforcer. It is cache of variables passed by th controller to the remote enforcer and other handles required by the remote enforcer to talk to the external processes

func NewServer

func NewServer(service enforcer.PacketProcessor, rpchdl rpcwrapper.RPCServer, rpcchan string, secret string, stats Stats) (*Server, error)

NewServer starts a new server

func (*Server) Enforce

func (s *Server) Enforce(req rpcwrapper.Request, resp *rpcwrapper.Response) error

Enforce this method calls the enforce method on the enforcer created during initenforcer

func (*Server) EnforcerExit

func (s *Server) EnforcerExit(req rpcwrapper.Request, resp *rpcwrapper.Response) error

EnforcerExit this method is called when we received a killrpocess message from the controller This allows a graceful exit of the enforcer

func (*Server) InitEnforcer

func (s *Server) InitEnforcer(req rpcwrapper.Request, resp *rpcwrapper.Response) error

InitEnforcer is a function called from the controller using RPC. It intializes data structure required by the remote enforcer

func (*Server) InitSupervisor

func (s *Server) InitSupervisor(req rpcwrapper.Request, resp *rpcwrapper.Response) error

InitSupervisor is a function called from the controller over RPC. It initializes data structure required by the supervisor

func (*Server) Supervise

func (s *Server) Supervise(req rpcwrapper.Request, resp *rpcwrapper.Response) error

Supervise This method calls the supervisor method on the supervisor created during initsupervisor

func (*Server) Unenforce

func (s *Server) Unenforce(req rpcwrapper.Request, resp *rpcwrapper.Response) error

Unenforce this method calls the unenforce method on the enforcer created from initenforcer

func (*Server) Unsupervise

func (s *Server) Unsupervise(req rpcwrapper.Request, resp *rpcwrapper.Response) error

Unsupervise This method calls the unsupervise method on the supervisor created during initsupervisor

type Stats added in v1.0.30

type Stats interface {
	SendStats()
	ConnectStatsClient() error
	Stop()
}

Stats interface which implements StatsClient struct

func NewStatsClient

func NewStatsClient() (Stats, error)

NewStatsClient initializes a new stats client

type StatsClient

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

StatsClient This is the struct for storing state for the rpc client which reports flow stats back to the controller process

func (*StatsClient) ConnectStatsClient added in v1.0.30

func (s *StatsClient) ConnectStatsClient() error

ConnectStatsClient This is an private function called by the remoteenforcer to connect back to the controller over a stats channel

func (*StatsClient) SendStats

func (s *StatsClient) SendStats()

SendStats async function which makes a rpc call to send stats every STATS_INTERVAL

func (*StatsClient) Stop

func (s *StatsClient) Stop()

Stop stops the stats client at clean up

Directories

Path Synopsis
Automatically generated by MockGen.
Automatically generated by MockGen.

Jump to

Keyboard shortcuts

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