1
0
mirror of https://github.com/netsampler/goflow2.git synced 2024-05-06 15:54:52 +00:00

support netflow v9 variable length

This commit is contained in:
lspgn
2022-04-02 10:40:35 -07:00
parent 58f0f97a62
commit 99e086f684

View File

@ -145,7 +145,7 @@ func DecodeTemplateSet(version uint16, payload *bytes.Buffer) ([]TemplateRecord,
func GetTemplateSize(version uint16, template []Field) int {
sum := 0
for _, templateField := range template {
if version == 10 && templateField.Length == 0xffff {
if templateField.Length == 0xffff {
continue
}
@ -161,7 +161,7 @@ func DecodeDataSetUsingFields(version uint16, payload *bytes.Buffer, listFields
for i, templateField := range listFields {
finalLength := int(templateField.Length)
if version == 10 && templateField.Length == 0xffff {
if templateField.Length == 0xffff {
var variableLen8 byte
var variableLen16 uint16
err := utils.BinaryDecoder(payload, &variableLen8)