MCPcopy Index your code
hub / github.com/google/gopacket / decodeExtendedSwitchFlowRecord

Function decodeExtendedSwitchFlowRecord

layers/sflow.go:1107–1119  ·  view source on GitHub ↗

Extended switch records have the following structure: 0 15 31 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | 20 bit Interprise (0) |12 bit format | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | record length

(data *[]byte)

Source from the content-addressed store, hash-verified

1105// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
1106
1107func decodeExtendedSwitchFlowRecord(data *[]byte) (SFlowExtendedSwitchFlowRecord, error) {
1108 es := SFlowExtendedSwitchFlowRecord{}
1109 var fdf SFlowFlowDataFormat
1110
1111 *data, fdf = (*data)[4:], SFlowFlowDataFormat(binary.BigEndian.Uint32((*data)[:4]))
1112 es.EnterpriseID, es.Format = fdf.decode()
1113 *data, es.FlowDataLength = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
1114 *data, es.IncomingVLAN = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
1115 *data, es.IncomingVLANPriority = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
1116 *data, es.OutgoingVLAN = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
1117 *data, es.OutgoingVLANPriority = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
1118 return es, nil
1119}
1120
1121// SFlowExtendedRouterFlowRecord gives additional information
1122// about the layer 3 routing information used to forward

Callers 1

decodeFlowSampleFunction · 0.85

Calls 2

decodeMethod · 0.95
SFlowFlowDataFormatTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…