sflow

package
v0.0.0-...-5b448de Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAgentAlreadyAllocated error agent already allocated for this uuid
	ErrAgentAlreadyAllocated = errors.New("agent already allocated for this uuid")
)

Functions

This section is empty.

Types

type SFlowAgent

type SFlowAgent struct {
	sync.RWMutex
	UUID      string
	Addr      string
	Port      int
	FlowTable *flow.Table
	Conn      *net.UDPConn
	BPFFilter string
}

SFlowAgent describes SFlow agent probe

func NewSFlowAgent

func NewSFlowAgent(u string, a *common.ServiceAddress, ft *flow.Table, bpfFilter string) *SFlowAgent

NewSFlowAgent creates a new probe agent and populate the flowtable

func (*SFlowAgent) GetTarget

func (sfa *SFlowAgent) GetTarget() string

GetTarget returns the current used connection

func (*SFlowAgent) Start

func (sfa *SFlowAgent) Start()

Start the SFlow probe agent

func (*SFlowAgent) Stop

func (sfa *SFlowAgent) Stop()

Stop the SFlow probe agent

type SFlowAgentAllocator

type SFlowAgentAllocator struct {
	sync.RWMutex

	Addr string
	// contains filtered or unexported fields
}

SFlowAgentAllocator describes an SFlow agent allocator to manage multiple SFlow agent probe

func NewSFlowAgentAllocator

func NewSFlowAgentAllocator() (*SFlowAgentAllocator, error)

NewSFlowAgentAllocator creates a new SFlow probes agent allocator

func (*SFlowAgentAllocator) Alloc

func (a *SFlowAgentAllocator) Alloc(uuid string, ft *flow.Table, bpfFilter string, addr *common.ServiceAddress) (agent *SFlowAgent, _ error)

Alloc allocate a new probe

func (*SFlowAgentAllocator) Release

func (a *SFlowAgentAllocator) Release(uuid string)

Release a probe agent

func (*SFlowAgentAllocator) ReleaseAll

func (a *SFlowAgentAllocator) ReleaseAll()

ReleaseAll probes agent

Jump to

Keyboard shortcuts

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