sflow

package
Version: v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: BSD-3-Clause Imports: 3 Imported by: 28

Documentation

Index

Constants

View Source
const (
	FORMAT_EXT_SWITCH  = 1001
	FORMAT_EXT_ROUTER  = 1002
	FORMAT_EXT_GATEWAY = 1003
	FORMAT_RAW_PKT     = 1
	FORMAT_ETH         = 2
	FORMAT_IPV4        = 3
	FORMAT_IPV6        = 4
)

Variables

This section is empty.

Functions

func DecodeIP

func DecodeIP(payload *bytes.Buffer) (uint32, []byte, error)

func DecodeMessage

func DecodeMessage(payload *bytes.Buffer) (interface{}, error)

func DecodeSample

func DecodeSample(header *SampleHeader, payload *bytes.Buffer) (interface{}, error)

Types

type CounterRecord

type CounterRecord struct {
	Header RecordHeader
	Data   interface{}
}

func DecodeCounterRecord

func DecodeCounterRecord(header *RecordHeader, payload *bytes.Buffer) (CounterRecord, error)

type CounterSample

type CounterSample struct {
	Header SampleHeader

	CounterRecordsCount uint32
	Records             []CounterRecord
}

type ErrorDataFormat

type ErrorDataFormat struct {
	// contains filtered or unexported fields
}

func NewErrorDataFormat

func NewErrorDataFormat(dataformat uint32) *ErrorDataFormat

func (*ErrorDataFormat) Error

func (e *ErrorDataFormat) Error() string

type ErrorDecodingSFlow

type ErrorDecodingSFlow struct {
	// contains filtered or unexported fields
}

func NewErrorDecodingSFlow

func NewErrorDecodingSFlow(msg string) *ErrorDecodingSFlow

func (*ErrorDecodingSFlow) Error

func (e *ErrorDecodingSFlow) Error() string

type ErrorIPVersion

type ErrorIPVersion struct {
	// contains filtered or unexported fields
}

func NewErrorIPVersion

func NewErrorIPVersion(version uint32) *ErrorIPVersion

func (*ErrorIPVersion) Error

func (e *ErrorIPVersion) Error() string

type ErrorVersion

type ErrorVersion struct {
	// contains filtered or unexported fields
}

func NewErrorVersion

func NewErrorVersion(version uint32) *ErrorVersion

func (*ErrorVersion) Error

func (e *ErrorVersion) Error() string

type EthernetCounters

type EthernetCounters struct {
	Dot3StatsAlignmentErrors           uint32
	Dot3StatsFCSErrors                 uint32
	Dot3StatsSingleCollisionFrames     uint32
	Dot3StatsMultipleCollisionFrames   uint32
	Dot3StatsSQETestErrors             uint32
	Dot3StatsDeferredTransmissions     uint32
	Dot3StatsLateCollisions            uint32
	Dot3StatsExcessiveCollisions       uint32
	Dot3StatsInternalMacTransmitErrors uint32
	Dot3StatsCarrierSenseErrors        uint32
	Dot3StatsFrameTooLongs             uint32
	Dot3StatsInternalMacReceiveErrors  uint32
	Dot3StatsSymbolErrors              uint32
}

type ExpandedFlowSample

type ExpandedFlowSample struct {
	Header SampleHeader

	SamplingRate     uint32
	SamplePool       uint32
	Drops            uint32
	InputIfFormat    uint32
	InputIfValue     uint32
	OutputIfFormat   uint32
	OutputIfValue    uint32
	FlowRecordsCount uint32
	Records          []FlowRecord
}

type ExtendedGateway

type ExtendedGateway struct {
	NextHopIPVersion  uint32
	NextHop           []byte
	AS                uint32
	SrcAS             uint32
	SrcPeerAS         uint32
	ASDestinations    uint32
	ASPathType        uint32
	ASPathLength      uint32
	ASPath            []uint32
	CommunitiesLength uint32
	Communities       []uint32
	LocalPref         uint32
}

type ExtendedRouter

type ExtendedRouter struct {
	NextHopIPVersion uint32
	NextHop          []byte
	SrcMaskLen       uint32
	DstMaskLen       uint32
}

type ExtendedSwitch

type ExtendedSwitch struct {
	SrcVlan     uint32
	SrcPriority uint32
	DstVlan     uint32
	DstPriority uint32
}

type FlowRecord

type FlowRecord struct {
	Header RecordHeader
	Data   interface{}
}

func DecodeFlowRecord

func DecodeFlowRecord(header *RecordHeader, payload *bytes.Buffer) (FlowRecord, error)

type FlowSample

type FlowSample struct {
	Header SampleHeader

	SamplingRate     uint32
	SamplePool       uint32
	Drops            uint32
	Input            uint32
	Output           uint32
	FlowRecordsCount uint32
	Records          []FlowRecord
}

type IfCounters

type IfCounters struct {
	IfIndex            uint32
	IfType             uint32
	IfSpeed            uint64
	IfDirection        uint32
	IfStatus           uint32
	IfInOctets         uint64
	IfInUcastPkts      uint32
	IfInMulticastPkts  uint32
	IfInBroadcastPkts  uint32
	IfInDiscards       uint32
	IfInErrors         uint32
	IfInUnknownProtos  uint32
	IfOutOctets        uint64
	IfOutUcastPkts     uint32
	IfOutMulticastPkts uint32
	IfOutBroadcastPkts uint32
	IfOutDiscards      uint32
	IfOutErrors        uint32
	IfPromiscuousMode  uint32
}

type Packet

type Packet struct {
	Version        uint32
	IPVersion      uint32
	AgentIP        []byte
	SubAgentId     uint32
	SequenceNumber uint32
	Uptime         uint32
	SamplesCount   uint32
	Samples        []interface{}
}

type RecordHeader

type RecordHeader struct {
	DataFormat uint32
	Length     uint32
}

type SampleHeader

type SampleHeader struct {
	Format uint32
	Length uint32

	SampleSequenceNumber uint32
	SourceIdType         uint32
	SourceIdValue        uint32
}

type SampledEthernet

type SampledEthernet struct {
	Length  uint32
	SrcMac  []byte
	DstMac  []byte
	EthType uint32
}

type SampledHeader

type SampledHeader struct {
	Protocol       uint32
	FrameLength    uint32
	Stripped       uint32
	OriginalLength uint32
	HeaderData     []byte
}

type SampledIP_Base

type SampledIP_Base struct {
	Length   uint32
	Protocol uint32
	SrcIP    []byte
	DstIP    []byte
	SrcPort  uint32
	DstPort  uint32
	TcpFlags uint32
}

type SampledIPv4

type SampledIPv4 struct {
	Base SampledIP_Base
	Tos  uint32
}

type SampledIPv6

type SampledIPv6 struct {
	Base     SampledIP_Base
	Priority uint32
}

Jump to

Keyboard shortcuts

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