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

Function decodeExtendedRouterFlowRecord

layers/sflow.go:1149–1162  ·  view source on GitHub ↗

Extended router 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

1147// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
1148
1149func decodeExtendedRouterFlowRecord(data *[]byte) (SFlowExtendedRouterFlowRecord, error) {
1150 er := SFlowExtendedRouterFlowRecord{}
1151 var fdf SFlowFlowDataFormat
1152 var extendedRouterAddressType SFlowIPType
1153
1154 *data, fdf = (*data)[4:], SFlowFlowDataFormat(binary.BigEndian.Uint32((*data)[:4]))
1155 er.EnterpriseID, er.Format = fdf.decode()
1156 *data, er.FlowDataLength = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
1157 *data, extendedRouterAddressType = (*data)[4:], SFlowIPType(binary.BigEndian.Uint32((*data)[:4]))
1158 *data, er.NextHop = (*data)[extendedRouterAddressType.Length():], (*data)[:extendedRouterAddressType.Length()]
1159 *data, er.NextHopSourceMask = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
1160 *data, er.NextHopDestinationMask = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
1161 return er, nil
1162}
1163
1164// SFlowExtendedGatewayFlowRecord describes information treasured by
1165// nework engineers everywhere: AS path information listing which

Callers 1

decodeFlowSampleFunction · 0.85

Calls 4

decodeMethod · 0.95
LengthMethod · 0.95
SFlowFlowDataFormatTypeAlias · 0.85
SFlowIPTypeTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…