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

Function decodeExtendedUserFlow

layers/sflow.go:1669–1693  ·  view source on GitHub ↗
(data *[]byte)

Source from the content-addressed store, hash-verified

1667)
1668
1669func decodeExtendedUserFlow(data *[]byte) (SFlowExtendedUserFlow, error) {
1670 eu := SFlowExtendedUserFlow{}
1671 var fdf SFlowFlowDataFormat
1672 var srcUserLen uint32
1673 var srcUserLenWithPad int
1674 var srcUserBytes []byte
1675 var dstUserLen uint32
1676 var dstUserLenWithPad int
1677 var dstUserBytes []byte
1678
1679 *data, fdf = (*data)[4:], SFlowFlowDataFormat(binary.BigEndian.Uint32((*data)[:4]))
1680 eu.EnterpriseID, eu.Format = fdf.decode()
1681 *data, eu.FlowDataLength = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
1682 *data, eu.SourceCharSet = (*data)[4:], SFlowCharSet(binary.BigEndian.Uint32((*data)[:4]))
1683 *data, srcUserLen = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
1684 srcUserLenWithPad = int(srcUserLen + ((4 - srcUserLen) % 4))
1685 *data, srcUserBytes = (*data)[srcUserLenWithPad:], (*data)[:srcUserLenWithPad]
1686 eu.SourceUserID = string(srcUserBytes[:srcUserLen])
1687 *data, eu.DestinationCharSet = (*data)[4:], SFlowCharSet(binary.BigEndian.Uint32((*data)[:4]))
1688 *data, dstUserLen = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
1689 dstUserLenWithPad = int(dstUserLen + ((4 - dstUserLen) % 4))
1690 *data, dstUserBytes = (*data)[dstUserLenWithPad:], (*data)[:dstUserLenWithPad]
1691 eu.DestinationUserID = string(dstUserBytes[:dstUserLen])
1692 return eu, nil
1693}
1694
1695// **************************************************
1696// Packet IP version 4 Record

Callers 1

decodeFlowSampleFunction · 0.85

Calls 3

decodeMethod · 0.95
SFlowFlowDataFormatTypeAlias · 0.85
SFlowCharSetTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…