Documentation
¶
Index ¶
- Constants
- func DecodeIP(payload *bytes.Buffer) (uint32, []byte, error)
- func DecodeMessage(payload *bytes.Buffer, packetV5 *Packet) error
- func DecodeMessageVersion(payload *bytes.Buffer, packetV5 *Packet) error
- func DecodeSample(header *SampleHeader, payload *bytes.Buffer) (interface{}, error)
- type CounterRecord
- type CounterSample
- type DecoderError
- type EthernetCounters
- type ExpandedFlowSample
- type ExtendedGateway
- type ExtendedRouter
- type ExtendedSwitch
- type FlowError
- type FlowRecord
- type FlowSample
- type IfCounters
- type Packet
- type RawRecord
- type RecordError
- type RecordHeader
- type SampleHeader
- type SampledEthernet
- type SampledHeader
- type SampledIPBase
- type SampledIPv4
- type SampledIPv6
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 DecodeMessageVersion ¶
func DecodeSample ¶
func DecodeSample(header *SampleHeader, payload *bytes.Buffer) (interface{}, error)
Types ¶
type CounterRecord ¶
type CounterRecord struct {
Header RecordHeader `json:"header"`
Data interface{} `json:"data"`
}
func DecodeCounterRecord ¶
func DecodeCounterRecord(header *RecordHeader, payload *bytes.Buffer) (CounterRecord, error)
type CounterSample ¶
type CounterSample struct {
Header SampleHeader `json:"header"`
CounterRecordsCount uint32 `json:"counter-records-count"`
Records []CounterRecord `json:"records"`
}
type DecoderError ¶
type DecoderError struct {
Err error
}
func (*DecoderError) Error ¶
func (e *DecoderError) Error() string
func (*DecoderError) Unwrap ¶
func (e *DecoderError) Unwrap() error
type EthernetCounters ¶
type EthernetCounters struct {
Dot3StatsAlignmentErrors uint32 `json:"dot3-stats-aligment-errors"`
Dot3StatsFCSErrors uint32 `json:"dot3-stats-fcse-errors"`
Dot3StatsSingleCollisionFrames uint32 `json:"dot3-stats-single-collision-frames"`
Dot3StatsMultipleCollisionFrames uint32 `json:"dot3-stats-multiple-collision-frames"`
Dot3StatsSQETestErrors uint32 `json:"dot3-stats-seq-test-errors"`
Dot3StatsDeferredTransmissions uint32 `json:"dot3-stats-deferred-transmissions"`
Dot3StatsLateCollisions uint32 `json:"dot3-stats-late-collisions"`
Dot3StatsExcessiveCollisions uint32 `json:"dot3-stats-excessive-collisions"`
Dot3StatsInternalMacTransmitErrors uint32 `json:"dot3-stats-internal-mac-transmit-errors"`
Dot3StatsCarrierSenseErrors uint32 `json:"dot3-stats-carrier-sense-errors"`
Dot3StatsFrameTooLongs uint32 `json:"dot3-stats-frame-too-longs"`
Dot3StatsInternalMacReceiveErrors uint32 `json:"dot3-stats-internal-mac-receive-errors"`
Dot3StatsSymbolErrors uint32 `json:"dot3-stats-symbol-errors"`
}
type ExpandedFlowSample ¶
type ExpandedFlowSample struct {
Header SampleHeader `json:"header"`
SamplingRate uint32 `json:"sampling-rate"`
SamplePool uint32 `json:"sample-pool"`
Drops uint32 `json:"drops"`
InputIfFormat uint32 `json:"input-if-format"`
InputIfValue uint32 `json:"input-if-value"`
OutputIfFormat uint32 `json:"output-if-format"`
OutputIfValue uint32 `json:"output-if-value"`
FlowRecordsCount uint32 `json:"flow-records-count"`
Records []FlowRecord `json:"records"`
}
type ExtendedGateway ¶
type ExtendedGateway struct {
NextHopIPVersion uint32 `json:"next-hop-ip-version"`
NextHop utils.IPAddress `json:"next-hop"`
AS uint32 `json:"as"`
SrcAS uint32 `json:"src-as"`
SrcPeerAS uint32 `json:"src-peer-as"`
ASDestinations uint32 `json:"as-destinations"`
ASPathType uint32 `json:"as-path-type"`
ASPathLength uint32 `json:"as-path-length"`
ASPath []uint32 `json:"as-path"`
CommunitiesLength uint32 `json:"communities-length"`
Communities []uint32 `json:"communities"`
LocalPref uint32 `json:"local-pref"`
}
type ExtendedRouter ¶
type ExtendedSwitch ¶
type FlowRecord ¶
type FlowRecord struct {
Header RecordHeader `json:"header"`
Data interface{} `json:"data"`
}
func DecodeFlowRecord ¶
func DecodeFlowRecord(header *RecordHeader, payload *bytes.Buffer) (FlowRecord, error)
type FlowSample ¶
type FlowSample struct {
Header SampleHeader `json:"header"`
SamplingRate uint32 `json:"sampling-rate"`
SamplePool uint32 `json:"sample-pool"`
Drops uint32 `json:"drops"`
Input uint32 `json:"input"`
Output uint32 `json:"output"`
FlowRecordsCount uint32 `json:"flow-records-count"`
Records []FlowRecord `json:"records"`
}
type IfCounters ¶
type IfCounters struct {
IfIndex uint32 `json:"if-index"`
IfType uint32 `json:"if-type"`
IfSpeed uint64 `json:"if-speed"`
IfDirection uint32 `json:"if-direction"`
IfStatus uint32 `json:"if-status"`
IfInOctets uint64 `json:"if-in-octets"`
IfInUcastPkts uint32 `json:"if-in-ucast-pkts"`
IfInMulticastPkts uint32 `json:"if-in-multicast-pkts"`
IfInBroadcastPkts uint32 `json:"if-in-broadcast-pkts"`
IfInDiscards uint32 `json:"if-in-discards"`
IfInErrors uint32 `json:"if-in-errors"`
IfInUnknownProtos uint32 `json:"if-in-unknown-protos"`
IfOutOctets uint64 `json:"if-out-octets"`
IfOutUcastPkts uint32 `json:"if-out-ucast-pkts"`
IfOutMulticastPkts uint32 `json:"if-out-multicast-pkts"`
IfOutBroadcastPkts uint32 `json:"if-out-broadcast-pkts"`
IfOutDiscards uint32 `json:"if-out-discards"`
IfOutErrors uint32 `json:"if-out-errors"`
IfPromiscuousMode uint32 `json:"if-promiscuous-mode"`
}
type Packet ¶
type Packet struct {
Version uint32 `json:"version"`
IPVersion uint32 `json:"ip-version"`
AgentIP utils.IPAddress `json:"agent-ip"`
SubAgentId uint32 `json:"sub-agent-id"`
SequenceNumber uint32 `json:"sequence-number"`
Uptime uint32 `json:"uptime"`
SamplesCount uint32 `json:"samples-count"`
Samples []interface{} `json:"samples"`
}
func (*Packet) MarshalJSON ¶
func (*Packet) MarshalText ¶
type RecordError ¶
func (*RecordError) Error ¶
func (e *RecordError) Error() string
func (*RecordError) Unwrap ¶
func (e *RecordError) Unwrap() error
type RecordHeader ¶
type SampleHeader ¶
type SampledEthernet ¶
type SampledEthernet struct {
Length uint32 `json:"length"`
SrcMac utils.MacAddress `json:"src-mac"`
DstMac utils.MacAddress `json:"dst-mac"`
EthType uint32 `json:"eth-type"`
}
type SampledHeader ¶
type SampledIPBase ¶
type SampledIPv4 ¶
type SampledIPv4 struct {
SampledIPBase
Tos uint32 `json:"tos"`
}
type SampledIPv6 ¶
type SampledIPv6 struct {
SampledIPBase
Priority uint32 `json:"priority"`
}
Click to show internal directories.
Click to hide internal directories.