mirror of
https://github.com/netsampler/goflow2.git
synced 2024-05-06 15:54:52 +00:00
Merge pull request #77 from netsampler/bug/netflowv9-variable
support netflow v9 variable length
This commit is contained in:
@ -145,7 +145,7 @@ func DecodeTemplateSet(version uint16, payload *bytes.Buffer) ([]TemplateRecord,
|
|||||||
func GetTemplateSize(version uint16, template []Field) int {
|
func GetTemplateSize(version uint16, template []Field) int {
|
||||||
sum := 0
|
sum := 0
|
||||||
for _, templateField := range template {
|
for _, templateField := range template {
|
||||||
if version == 10 && templateField.Length == 0xffff {
|
if templateField.Length == 0xffff {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +161,7 @@ func DecodeDataSetUsingFields(version uint16, payload *bytes.Buffer, listFields
|
|||||||
for i, templateField := range listFields {
|
for i, templateField := range listFields {
|
||||||
|
|
||||||
finalLength := int(templateField.Length)
|
finalLength := int(templateField.Length)
|
||||||
if version == 10 && templateField.Length == 0xffff {
|
if templateField.Length == 0xffff {
|
||||||
var variableLen8 byte
|
var variableLen8 byte
|
||||||
var variableLen16 uint16
|
var variableLen16 uint16
|
||||||
err := utils.BinaryDecoder(payload, &variableLen8)
|
err := utils.BinaryDecoder(payload, &variableLen8)
|
||||||
|
Reference in New Issue
Block a user