netflow

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 13 Imported by: 1

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 Agent

type Agent struct {
	insanelock.RWMutex
	UUID      string
	Addr      string
	Port      int
	FlowTable *flow.Table
	Conn      *net.UDPConn
	UUIDs     flow.UUIDs
}

Agent describes NetFlow agent probe

func NewAgent

func NewAgent(u string, conn *net.UDPConn, addr string, port int, ft *flow.Table, uuids flow.UUIDs) *Agent

NewAgent creates a new NetFlow agent which will populate the given flowtable

func (*Agent) GetTarget

func (nfa *Agent) GetTarget() string

GetTarget returns the current used connection

func (*Agent) Start

func (nfa *Agent) Start()

Start the NetFlow probe agent

func (*Agent) Stop

func (nfa *Agent) Stop()

Stop the NetFlow probe agent

type AgentAllocator

type AgentAllocator struct {
	insanelock.RWMutex
	// contains filtered or unexported fields
}

AgentAllocator describes an NetFlow agent allocator to manage multiple NetFlow agent probe

func NewAgentAllocator

func NewAgentAllocator() (*AgentAllocator, error)

NewAgentAllocator creates a new netflow agent allocator

func (*AgentAllocator) Alloc

func (a *AgentAllocator) Alloc(uuid string, ft *flow.Table, addr *service.Address, uuids flow.UUIDs) (agent *Agent, _ error)

Alloc allocates a new netflow agent

func (*AgentAllocator) Release

func (a *AgentAllocator) Release(uuid string)

Release a netflow agent

func (*AgentAllocator) ReleaseAll

func (a *AgentAllocator) ReleaseAll()

ReleaseAll netflow agents

Jump to

Keyboard shortcuts

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