Documentation ¶
Index ¶
- func ConvertNetFlowDataSet(version uint16, baseTime uint32, uptime uint32, record []netflow.DataField, ...) *flowmessage.FlowMessage
- func ConvertNetFlowLegacyRecord(baseTime uint32, uptime uint32, record netflowlegacy.RecordsNetFlowV5) *flowmessage.FlowMessage
- func DecodeNumber(b []byte, out interface{}) error
- func DecodeNumberLE(b []byte, out interface{}) error
- func DecodeUNumber(b []byte, out interface{}) error
- func DecodeUNumberLE(b []byte, out interface{}) error
- func GetBytes(d []byte, offset int, length int) []byte
- func GetSFlowFlowSamples(packet *sflow.Packet) []interface{}
- func IsInt(k reflect.Kind) bool
- func IsUInt(k reflect.Kind) bool
- func MapCustom(flowMessage *flowmessage.FlowMessage, v []byte, destination string, ...)
- func MapCustomNetFlow(flowMessage *flowmessage.FlowMessage, df netflow.DataField, ...)
- func NetFlowLookFor(dataFields []netflow.DataField, typeId uint16) (bool, interface{})
- func NetFlowPopulate(dataFields []netflow.DataField, typeId uint16, addr interface{}) bool
- func ParseEthernetHeader(flowMessage *flowmessage.FlowMessage, data []byte, config *SFlowMapper)
- func ParseSampledHeader(flowMessage *flowmessage.FlowMessage, sampledHeader *sflow.SampledHeader) error
- func ParseSampledHeaderConfig(flowMessage *flowmessage.FlowMessage, sampledHeader *sflow.SampledHeader, ...) error
- func ProcessMessageNetFlow(msgDec interface{}, samplingRateSys SamplingRateSystem) ([]*flowmessage.FlowMessage, error)
- func ProcessMessageNetFlowConfig(msgDec interface{}, samplingRateSys SamplingRateSystem, ...) ([]*flowmessage.FlowMessage, error)
- func ProcessMessageNetFlowLegacy(msgDec interface{}) ([]*flowmessage.FlowMessage, error)
- func ProcessMessageSFlow(msgDec interface{}) ([]*flowmessage.FlowMessage, error)
- func ProcessMessageSFlowConfig(msgDec interface{}, config *ProducerConfigMapped) ([]*flowmessage.FlowMessage, error)
- func SearchNetFlowDataSets(version uint16, baseTime uint32, uptime uint32, ...) []*flowmessage.FlowMessage
- func SearchNetFlowDataSetsRecords(version uint16, baseTime uint32, uptime uint32, ...) []*flowmessage.FlowMessage
- func SearchNetFlowLegacyRecords(baseTime uint32, uptime uint32, dataRecords []netflowlegacy.RecordsNetFlowV5) []*flowmessage.FlowMessage
- func SearchNetFlowOptionDataSets(dataFlowSet []netflow.OptionsDataFlowSet) (uint32, bool)
- func SearchSFlowSamples(samples []interface{}) []*flowmessage.FlowMessage
- func SearchSFlowSamplesConfig(samples []interface{}, config *SFlowMapper) []*flowmessage.FlowMessage
- func SplitIPFIXSets(packetIPFIX netflow.IPFIXPacket) ([]netflow.DataFlowSet, []netflow.TemplateFlowSet, ...)
- func SplitNetFlowSets(packetNFv9 netflow.NFv9Packet) ([]netflow.DataFlowSet, []netflow.TemplateFlowSet, ...)
- func WriteDecoded(o int64, out interface{}) error
- func WriteUDecoded(o uint64, out interface{}) error
- type DataMap
- type DataMapLayer
- type EndianType
- type IPFIXProducerConfig
- type NetFlowMapField
- type NetFlowMapper
- type NetFlowV9ProducerConfig
- type ProducerConfig
- type ProducerConfigMapped
- type SFlowMapField
- type SFlowMapper
- type SFlowProducerConfig
- type SamplingRateSystem
- type SingleSamplingRateSystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertNetFlowDataSet ¶
func ConvertNetFlowDataSet(version uint16, baseTime uint32, uptime uint32, record []netflow.DataField, mapperNetFlow *NetFlowMapper, mapperSFlow *SFlowMapper) *flowmessage.FlowMessage
func ConvertNetFlowLegacyRecord ¶
func ConvertNetFlowLegacyRecord(baseTime uint32, uptime uint32, record netflowlegacy.RecordsNetFlowV5) *flowmessage.FlowMessage
func DecodeNumber ¶
func DecodeNumberLE ¶ added in v1.2.0
func DecodeUNumber ¶
func DecodeUNumberLE ¶ added in v1.2.0
func GetSFlowFlowSamples ¶
func MapCustom ¶
func MapCustom(flowMessage *flowmessage.FlowMessage, v []byte, destination string, endianness EndianType)
func MapCustomNetFlow ¶
func MapCustomNetFlow(flowMessage *flowmessage.FlowMessage, df netflow.DataField, mapper *NetFlowMapper)
func NetFlowLookFor ¶
func NetFlowPopulate ¶
func ParseEthernetHeader ¶
func ParseEthernetHeader(flowMessage *flowmessage.FlowMessage, data []byte, config *SFlowMapper)
func ParseSampledHeader ¶
func ParseSampledHeader(flowMessage *flowmessage.FlowMessage, sampledHeader *sflow.SampledHeader) error
func ParseSampledHeaderConfig ¶
func ParseSampledHeaderConfig(flowMessage *flowmessage.FlowMessage, sampledHeader *sflow.SampledHeader, config *SFlowMapper) error
func ProcessMessageNetFlow ¶
func ProcessMessageNetFlow(msgDec interface{}, samplingRateSys SamplingRateSystem) ([]*flowmessage.FlowMessage, error)
func ProcessMessageNetFlowConfig ¶
func ProcessMessageNetFlowConfig(msgDec interface{}, samplingRateSys SamplingRateSystem, config *ProducerConfigMapped) ([]*flowmessage.FlowMessage, error)
Convert a NetFlow datastructure to a FlowMessage protobuf Does not put sampling rate
func ProcessMessageNetFlowLegacy ¶
func ProcessMessageNetFlowLegacy(msgDec interface{}) ([]*flowmessage.FlowMessage, error)
func ProcessMessageSFlow ¶
func ProcessMessageSFlow(msgDec interface{}) ([]*flowmessage.FlowMessage, error)
func ProcessMessageSFlowConfig ¶
func ProcessMessageSFlowConfig(msgDec interface{}, config *ProducerConfigMapped) ([]*flowmessage.FlowMessage, error)
func SearchNetFlowDataSets ¶
func SearchNetFlowDataSets(version uint16, baseTime uint32, uptime uint32, dataFlowSet []netflow.DataFlowSet, mapperNetFlow *NetFlowMapper, mapperSFlow *SFlowMapper) []*flowmessage.FlowMessage
func SearchNetFlowDataSetsRecords ¶
func SearchNetFlowDataSetsRecords(version uint16, baseTime uint32, uptime uint32, dataRecords []netflow.DataRecord, mapperNetFlow *NetFlowMapper, mapperSFlow *SFlowMapper) []*flowmessage.FlowMessage
func SearchNetFlowLegacyRecords ¶
func SearchNetFlowLegacyRecords(baseTime uint32, uptime uint32, dataRecords []netflowlegacy.RecordsNetFlowV5) []*flowmessage.FlowMessage
func SearchNetFlowOptionDataSets ¶
func SearchNetFlowOptionDataSets(dataFlowSet []netflow.OptionsDataFlowSet) (uint32, bool)
func SearchSFlowSamples ¶
func SearchSFlowSamples(samples []interface{}) []*flowmessage.FlowMessage
func SearchSFlowSamplesConfig ¶
func SearchSFlowSamplesConfig(samples []interface{}, config *SFlowMapper) []*flowmessage.FlowMessage
func SplitIPFIXSets ¶
func SplitIPFIXSets(packetIPFIX netflow.IPFIXPacket) ([]netflow.DataFlowSet, []netflow.TemplateFlowSet, []netflow.IPFIXOptionsTemplateFlowSet, []netflow.OptionsDataFlowSet)
func SplitNetFlowSets ¶
func SplitNetFlowSets(packetNFv9 netflow.NFv9Packet) ([]netflow.DataFlowSet, []netflow.TemplateFlowSet, []netflow.NFv9OptionsTemplateFlowSet, []netflow.OptionsDataFlowSet)
func WriteDecoded ¶ added in v1.2.0
func WriteUDecoded ¶ added in v1.2.0
Types ¶
type DataMap ¶
type DataMap struct { Destination string Endian EndianType }
type DataMapLayer ¶
type DataMapLayer struct { Offset int Length int Destination string Endian EndianType }
func GetSFlowConfigLayer ¶
func GetSFlowConfigLayer(m *SFlowMapper, layer int) []DataMapLayer
type EndianType ¶ added in v1.2.0
type EndianType string
var ( BigEndian EndianType = "big" LittleEndian EndianType = "little" )
type IPFIXProducerConfig ¶
type IPFIXProducerConfig struct {
Mapping []NetFlowMapField `json:"mapping"`
}
type NetFlowMapField ¶
type NetFlowMapField struct { PenProvided bool `json:"penprovided" yaml:"penprovided"` Type uint16 `json:"field" yaml:"field"` Pen uint32 `json:"pen" yaml:"pen"` Destination string `json:"destination" yaml:"destination"` Endian EndianType `json:"endianness" yaml:"endianness"` }
type NetFlowMapper ¶
type NetFlowMapper struct {
// contains filtered or unexported fields
}
func MapFieldsNetFlow ¶
func MapFieldsNetFlow(fields []NetFlowMapField) *NetFlowMapper
type NetFlowV9ProducerConfig ¶
type NetFlowV9ProducerConfig struct {
Mapping []NetFlowMapField `json:"mapping"`
}
type ProducerConfig ¶
type ProducerConfig struct { IPFIX IPFIXProducerConfig `json:"ipfix"` NetFlowV9 NetFlowV9ProducerConfig `json:"netflowv9"` SFlow SFlowProducerConfig `json:"sflow"` // also used for IPFIX data frames }
type ProducerConfigMapped ¶
type ProducerConfigMapped struct { IPFIX *NetFlowMapper `json:"ipfix"` NetFlowV9 *NetFlowMapper `json:"netflowv9"` SFlow *SFlowMapper `json:"sflow"` }
func NewProducerConfigMapped ¶
func NewProducerConfigMapped(config *ProducerConfig) *ProducerConfigMapped
type SFlowMapField ¶
type SFlowMapField struct { Layer int `json:"layer"` Offset int `json:"offset"` // offset in bits Length int `json:"length"` // length in bits Destination string `json:"destination" yaml:"destination"` Endian EndianType `json:"endianness" yaml:"endianness"` }
type SFlowMapper ¶
type SFlowMapper struct {
// contains filtered or unexported fields
}
func MapFieldsSFlow ¶
func MapFieldsSFlow(fields []SFlowMapField) *SFlowMapper
type SFlowProducerConfig ¶
type SFlowProducerConfig struct {
Mapping []SFlowMapField `json:"mapping"`
}
type SamplingRateSystem ¶
type SamplingRateSystem interface { GetSamplingRate(version uint16, obsDomainId uint32) (uint32, error) AddSamplingRate(version uint16, obsDomainId uint32, samplingRate uint32) }
func CreateSamplingSystem ¶
func CreateSamplingSystem() SamplingRateSystem
type SingleSamplingRateSystem ¶
type SingleSamplingRateSystem struct {
Sampling uint32
}
func (*SingleSamplingRateSystem) AddSamplingRate ¶
func (s *SingleSamplingRateSystem) AddSamplingRate(version uint16, obsDomainId uint32, samplingRate uint32)
func (*SingleSamplingRateSystem) GetSamplingRate ¶
func (s *SingleSamplingRateSystem) GetSamplingRate(version uint16, obsDomainId uint32) (uint32, error)
Click to show internal directories.
Click to hide internal directories.