Documentation ¶
Index ¶
- Constants
- Variables
- type Accounting
- type Flow
- type FlowCollection
- func (c *FlowCollection) Copy() (flowCol *FlowCollection)
- func (c *FlowCollection) Reset()
- func (c *FlowCollection) SetTimestamp(start int64, end int64)
- func (c *FlowCollection) UpdateByFlowCol(fc *FlowCollection)
- func (c *FlowCollection) UpdateL3Inbound(flowFp FlowFingerprint, numBytes int64, numPkts int64)
- func (c *FlowCollection) UpdateL3Outbound(flowFp FlowFingerprint, numBytes int64, numPkts int64)
- func (c *FlowCollection) UpdateL4Inbound(flowFp FlowFingerprint, numBytes int64, numPkts int64)
- func (c *FlowCollection) UpdateL4Outbound(flowFp FlowFingerprint, numBytes int64, numPkts int64)
- type FlowCollectionHistory
- type FlowFingerprint
- type FlowTimestamp
Constants ¶
View Source
const DefaultFlowCollectionHistorySize = 300
View Source
const DefaultFlowDbSize = 2
View Source
const DefaultL3FlowCollectionSize = 300
View Source
const DefaultL4FlowCollectionSize = 600
View Source
const DefaultRotateInterval = 5
View Source
const DefaultStatChannelSize = 16
Variables ¶
View Source
var FlowPool = sync.Pool{ New: func() interface{} { return new(Flow) }, }
Functions ¶
This section is empty.
Types ¶
type Accounting ¶
type Accounting struct { FlowAccd map[string]*FlowCollectionHistory Retention int64 Ch chan *FlowCollection }
var GlobalAcct *Accounting
func NewAccounting ¶
func NewAccounting() (acct *Accounting)
func (*Accounting) AddInterface ¶
func (a *Accounting) AddInterface(ifaceName string)
func (*Accounting) SetRetention ¶
func (a *Accounting) SetRetention(t int64)
func (*Accounting) Start ¶
func (a *Accounting) Start(ctx context.Context)
type FlowCollection ¶
type FlowCollection struct { InterfaceName string FlowTimestamp L3FlowMap map[FlowFingerprint]*Flow L4FlowMap map[FlowFingerprint]*Flow Mu *sync.Mutex }
func NewFlowCollection ¶
func NewFlowCollection(ifaceName string) (flowCol *FlowCollection)
func (*FlowCollection) Copy ¶
func (c *FlowCollection) Copy() (flowCol *FlowCollection)
func (*FlowCollection) Reset ¶
func (c *FlowCollection) Reset()
func (*FlowCollection) SetTimestamp ¶
func (c *FlowCollection) SetTimestamp(start int64, end int64)
func (*FlowCollection) UpdateByFlowCol ¶
func (c *FlowCollection) UpdateByFlowCol(fc *FlowCollection)
func (*FlowCollection) UpdateL3Inbound ¶
func (c *FlowCollection) UpdateL3Inbound(flowFp FlowFingerprint, numBytes int64, numPkts int64)
func (*FlowCollection) UpdateL3Outbound ¶
func (c *FlowCollection) UpdateL3Outbound(flowFp FlowFingerprint, numBytes int64, numPkts int64)
func (*FlowCollection) UpdateL4Inbound ¶
func (c *FlowCollection) UpdateL4Inbound(flowFp FlowFingerprint, numBytes int64, numPkts int64)
func (*FlowCollection) UpdateL4Outbound ¶
func (c *FlowCollection) UpdateL4Outbound(flowFp FlowFingerprint, numBytes int64, numPkts int64)
type FlowCollectionHistory ¶
type FlowCollectionHistory struct { InterfaceName string HistCollection map[FlowTimestamp]*FlowCollection LastTimestamp FlowTimestamp Mu *sync.Mutex }
func NewFlowCollectionHistory ¶
func NewFlowCollectionHistory(ifaceName string) (flowColHist *FlowCollectionHistory)
func (*FlowCollectionHistory) AggregationByDuration ¶
func (h *FlowCollectionHistory) AggregationByDuration(duration int64) (fc *FlowCollection, timestamp *FlowTimestamp)
Assume duration = 5, flow timestamp list is aggregated as below: 10, 11, | 12, 13, 14, 15, 16, | 17, 18, 19, 20, 21, | 22, 23, 24, 25, 26(LastTimestamp.End)
func (*FlowCollectionHistory) Retention ¶
func (h *FlowCollectionHistory) Retention(before int64)
func (*FlowCollectionHistory) SetLastTimestamp ¶
func (h *FlowCollectionHistory) SetLastTimestamp(ts FlowTimestamp)
type FlowFingerprint ¶
type FlowTimestamp ¶
func (*FlowTimestamp) Offset ¶
func (t *FlowTimestamp) Offset(offset int64) (ts FlowTimestamp)
Click to show internal directories.
Click to hide internal directories.