Documentation ¶
Index ¶
- Constants
- type ExportBivariateClusterFormat
- type ExportBivariateFormat
- type ExportUnivariateClusterFormat
- type ExportUnivariateFormat
- type IntMetric
- type IntMetricBivariate
- func (imb *IntMetricBivariate) AddValue(protocol Protocol, clusterIndex int, values ...[]int)
- func (imb *IntMetricBivariate) Export(protocolKey ProtocolKeyType, clusterIndex int) *ExportBivariateFormat
- func (imb *IntMetricBivariate) ExportClusters(protocolKey ProtocolKeyType) *ExportBivariateClusterFormat
- func (imb *IntMetricBivariate) GetProtocols() []Protocol
- func (imb *IntMetricBivariate) GetStatistics(verbose bool) string
- type IntMetricUnivariate
- func (imu *IntMetricUnivariate) AddValue(protocol Protocol, clusterIndex int, values ...int)
- func (imu *IntMetricUnivariate) Export(protocolKey ProtocolKeyType, clusterIndex int) *ExportUnivariateFormat
- func (imu *IntMetricUnivariate) ExportClusters(protocolKey ProtocolKeyType) *ExportUnivariateClusterFormat
- func (imu *IntMetricUnivariate) GetProtocols() []Protocol
- func (imu *IntMetricUnivariate) GetStatistics(verbose bool) string
- type MetricReconstructedPacketsSize
- func (mrp *MetricReconstructedPacketsSize) Export(protocolKey ProtocolKeyType) *ExportUnivariateFormat
- func (mrp *MetricReconstructedPacketsSize) GetProtocols() []Protocol
- func (mrp *MetricReconstructedPacketsSize) Name() string
- func (mrp *MetricReconstructedPacketsSize) PrintStatistic(verbose bool)
- type MetricReconstructedPacketsSpeed
- func (mrp *MetricReconstructedPacketsSpeed) Export(protocolKey ProtocolKeyType) *ExportUnivariateFormat
- func (mrp *MetricReconstructedPacketsSpeed) GetProtocols() []Protocol
- func (mrp *MetricReconstructedPacketsSpeed) Name() string
- func (mrp *MetricReconstructedPacketsSpeed) PrintStatistic(verbose bool)
- type Protocol
- type ProtocolKeyType
- type ReqResIdentifier
- func (rri *ReqResIdentifier) OnTCPFlush(protocol Protocol, flow *flows.TCPFlow) (reqRes []*RequestResponse, dropFlow bool)
- func (rri *ReqResIdentifier) OnUDPFlush(protocol Protocol, flow *flows.UDPFlow) (reqRes []*RequestResponse, dropFlow bool)
- func (rri *ReqResIdentifier) PrintStatistic(verbose bool)
- type RequestResponse
Constants ¶
const DefaultClusterIndex = 0
DefaultClusterIndex is used whenever a metric does not support clustering, or no clustering is used
const MAXRWIN uint16 = utils.MaxUint16
Maximal distance between two ACK responses. If higher, the packets are most likely out of order
const MAXWindow uint32 = uint32(MAXRWIN) * 16384 // Max Rwin * Max TCP WINDOW Scale Option (2^14)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExportBivariateClusterFormat ¶
type ExportBivariateClusterFormat struct {
Clusters map[int]*ExportBivariateFormat
}
type ExportBivariateFormat ¶
type ExportBivariateFormat struct {
Variable map[int]*ExportUnivariateFormat
}
type ExportUnivariateClusterFormat ¶
type ExportUnivariateClusterFormat struct {
Clusters map[int]*ExportUnivariateFormat
}
type ExportUnivariateFormat ¶
type ExportUnivariateFormat struct {
Values [][]int // List of [value, counter] tuples
}
type IntMetric ¶
type IntMetric struct {
// contains filtered or unexported fields
}
func (*IntMetric) AddValue ¶
AddValue adds one or multiple values to the Metric. It will scale all values to the configured resolution
func (*IntMetric) Export ¶
func (im *IntMetric) Export(protocolKey ProtocolKeyType) int
Export the metrics as (value, count) tuples
func (*IntMetric) GetProtocols ¶
Export the Protocols
func (*IntMetric) GetStatistics ¶
GetStatistics returns a string with the most important informations. Use fmt.Print() to print it
type IntMetricBivariate ¶
type IntMetricBivariate struct {
// contains filtered or unexported fields
}
func NewIntMetricBivariate ¶
func NewIntMetricBivariate(resolution int, logScaling, variableLogScaling bool) IntMetricBivariate
NewIntMetricBivariate creates a new bivariate Integer Metric
func (*IntMetricBivariate) AddValue ¶
func (imb *IntMetricBivariate) AddValue(protocol Protocol, clusterIndex int, values ...[]int)
AddValue adds one or multiple values to the Metric. It will scale all values to the configured resolution It expects that each value is a tuple with [variable, value].
func (*IntMetricBivariate) Export ¶
func (imb *IntMetricBivariate) Export(protocolKey ProtocolKeyType, clusterIndex int) *ExportBivariateFormat
Export the metrics for one cluster
func (*IntMetricBivariate) ExportClusters ¶
func (imb *IntMetricBivariate) ExportClusters(protocolKey ProtocolKeyType) *ExportBivariateClusterFormat
func (*IntMetricBivariate) GetProtocols ¶
func (imb *IntMetricBivariate) GetProtocols() []Protocol
Export the Protocols
func (*IntMetricBivariate) GetStatistics ¶
func (imb *IntMetricBivariate) GetStatistics(verbose bool) string
GetStatistics returns a string with the most important informations. Use fmt.Print() to print it
type IntMetricUnivariate ¶
type IntMetricUnivariate struct {
// contains filtered or unexported fields
}
func NewIntMetricUnivariate ¶
func NewIntMetricUnivariate(resolution int, logScaling bool) IntMetricUnivariate
NewIntMetric creates a new Univariate Integer Metrics
func (*IntMetricUnivariate) AddValue ¶
func (imu *IntMetricUnivariate) AddValue(protocol Protocol, clusterIndex int, values ...int)
AddValue adds one or multiple values to the Metric. It will scale all values to the configured resolution
func (*IntMetricUnivariate) Export ¶
func (imu *IntMetricUnivariate) Export(protocolKey ProtocolKeyType, clusterIndex int) *ExportUnivariateFormat
Export the metrics for one cluster
func (*IntMetricUnivariate) ExportClusters ¶
func (imu *IntMetricUnivariate) ExportClusters(protocolKey ProtocolKeyType) *ExportUnivariateClusterFormat
func (*IntMetricUnivariate) GetProtocols ¶
func (imu *IntMetricUnivariate) GetProtocols() []Protocol
Export the Protocols
func (*IntMetricUnivariate) GetStatistics ¶
func (imu *IntMetricUnivariate) GetStatistics(verbose bool) string
GetStatistics returns a string with the most important information. Use fmt.Print() to print it
type MetricReconstructedPacketsSize ¶
type MetricReconstructedPacketsSize struct {
// contains filtered or unexported fields
}
func NewMetricReconstructedPacketsSize ¶
func NewMetricReconstructedPacketsSize() *MetricReconstructedPacketsSize
func (*MetricReconstructedPacketsSize) Export ¶
func (mrp *MetricReconstructedPacketsSize) Export(protocolKey ProtocolKeyType) *ExportUnivariateFormat
Export returns the metric data per Protocol
func (*MetricReconstructedPacketsSize) GetProtocols ¶
func (mrp *MetricReconstructedPacketsSize) GetProtocols() []Protocol
Export the stored protocols
func (*MetricReconstructedPacketsSize) Name ¶
func (mrp *MetricReconstructedPacketsSize) Name() string
Name of the Metric
func (*MetricReconstructedPacketsSize) PrintStatistic ¶
func (mrp *MetricReconstructedPacketsSize) PrintStatistic(verbose bool)
PrintStatistic prints some statistic to the console
type MetricReconstructedPacketsSpeed ¶
type MetricReconstructedPacketsSpeed struct {
// contains filtered or unexported fields
}
func NewMetricReconstructedPacketsSpeed ¶
func NewMetricReconstructedPacketsSpeed() *MetricReconstructedPacketsSpeed
func (*MetricReconstructedPacketsSpeed) Export ¶
func (mrp *MetricReconstructedPacketsSpeed) Export(protocolKey ProtocolKeyType) *ExportUnivariateFormat
Export returns the metric data per Protocol
func (*MetricReconstructedPacketsSpeed) GetProtocols ¶
func (mrp *MetricReconstructedPacketsSpeed) GetProtocols() []Protocol
Export the stored protocols
func (*MetricReconstructedPacketsSpeed) Name ¶
func (mrp *MetricReconstructedPacketsSpeed) Name() string
Name of the Metric
func (*MetricReconstructedPacketsSpeed) PrintStatistic ¶
func (mrp *MetricReconstructedPacketsSpeed) PrintStatistic(verbose bool)
PrintStatistic prints some statistic to the console
type Protocol ¶
type Protocol struct { Protocol uint8 Port uint16 ProtocolKey ProtocolKeyType }
Protocol identifies a network protocol based on its Transport Protocol and Server Port
func GetProtocol ¶
func (Protocol) GetProtocolString ¶
type ProtocolKeyType ¶
type ProtocolKeyType uint64
ProtocolKeyType is the hashed interpretation of an application protocol (TCP/UDP + Port)
func GetProtocolKey ¶
func GetProtocolKey(protocolString string) ProtocolKeyType
type ReqResIdentifier ¶
type ReqResIdentifier struct { DropUnidirectionalFlows bool ReconstructTCPResponse bool // contains filtered or unexported fields }
func NewReqResIdentifier ¶
func NewReqResIdentifier(dropUnidirectionalFlows, reconstructTCPResponse bool, statisticReconstructionSpeed *MetricReconstructedPacketsSpeed, statisticReconstructionSize *MetricReconstructedPacketsSize) *ReqResIdentifier
func (*ReqResIdentifier) OnTCPFlush ¶
func (rri *ReqResIdentifier) OnTCPFlush(protocol Protocol, flow *flows.TCPFlow) (reqRes []*RequestResponse, dropFlow bool)
onFlush Identifies the request response pairs per flow. If it is a UDP Flow, tcpPacket is nil.
func (*ReqResIdentifier) OnUDPFlush ¶
func (rri *ReqResIdentifier) OnUDPFlush(protocol Protocol, flow *flows.UDPFlow) (reqRes []*RequestResponse, dropFlow bool)
onFlush Identifies the request response pairs per flow. If it is a UDP Flow, tcpPacket is nil.
func (*ReqResIdentifier) PrintStatistic ¶
func (rri *ReqResIdentifier) PrintStatistic(verbose bool)