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

Function decodeExtendedURLRecord

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

Source from the content-addressed store, hash-verified

1351}
1352
1353func decodeExtendedURLRecord(data *[]byte) (SFlowExtendedURLRecord, error) {
1354 eur := SFlowExtendedURLRecord{}
1355 var fdf SFlowFlowDataFormat
1356 var urlLen uint32
1357 var urlLenWithPad int
1358 var hostLen uint32
1359 var hostLenWithPad int
1360 var urlBytes []byte
1361 var hostBytes []byte
1362
1363 *data, fdf = (*data)[4:], SFlowFlowDataFormat(binary.BigEndian.Uint32((*data)[:4]))
1364 eur.EnterpriseID, eur.Format = fdf.decode()
1365 *data, eur.FlowDataLength = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
1366 *data, eur.Direction = (*data)[4:], SFlowURLDirection(binary.BigEndian.Uint32((*data)[:4]))
1367 *data, urlLen = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
1368 urlLenWithPad = int(urlLen + ((4 - urlLen) % 4))
1369 *data, urlBytes = (*data)[urlLenWithPad:], (*data)[:urlLenWithPad]
1370 eur.URL = string(urlBytes[:urlLen])
1371 *data, hostLen = (*data)[4:], binary.BigEndian.Uint32((*data)[:4])
1372 hostLenWithPad = int(hostLen + ((4 - hostLen) % 4))
1373 *data, hostBytes = (*data)[hostLenWithPad:], (*data)[:hostLenWithPad]
1374 eur.Host = string(hostBytes[:hostLen])
1375 return eur, nil
1376}
1377
1378// **************************************************
1379// Extended User Flow Record

Callers 1

decodeFlowSampleFunction · 0.85

Calls 3

decodeMethod · 0.95
SFlowFlowDataFormatTypeAlias · 0.85
SFlowURLDirectionTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…