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
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
Click to show internal directories.
Click to hide internal directories.