Subject: | IPFIX options templates encoded incorrectly |
Patch attached.
Given the following example option template definition
{
SetId => 3,
TemplateId => 302,
FieldCount => 5,
ScopeCount => 3,
Template => [
{ Length => 4, Id => 130 }, # exporterIPv4Address
{ Length => 4, Id => 42 }, # exportedFlowRecordTotalCount
{ Length => 4, Id => 41 }, # exportedMessageTotalCount
{ Length => 4, Id => 8 }, # sourceIPv4Address
{ Length => 4, Id => 2 }, # packetDeltaCount
],
}
The FieldCount should be packed in the PDU as 5 not 2 (5 - 3)
RFC 5101
3.4.2.2. Options Template Record Format
[ snip ]
Field Count
Number of all fields in this Options Template Record, including the
Scope Fields.
Scope Field Count
Number of scope fields in this Options Template Record. The Scope
Fields are normal Fields except that they are interpreted as scope at
the Collector. The Scope Field Count MUST NOT be zero.
Subject: | Flow.patch |
*** Flow.orig 2008-12-03 22:26:15.000000000 -0500
--- Flow.pm 2010-06-02 16:43:58.611321965 -0400
***************
*** 674,680 ****
pack(
"nnn",
$TemplateRef->{TemplateId},
! ($#{$TemplateRef->{Template}}+1-$ScopeCount),
$ScopeCount,
) ;
}
--- 674,680 ----
pack(
"nnn",
$TemplateRef->{TemplateId},
! ($#{$TemplateRef->{Template}}+1), # -$ScopeCount
$ScopeCount,
) ;
}