title: Netflow record can't get octets (jnca)
body: <p>I'm using <a href="https://sourceforge.net/projects/jnca/" rel="noreferrer">jnca</a> library to collect NetFlow records sent by a router. The version of the NetFlow record sent by the router is version 9.</p>
  <p>When the NetFlow packet is observed from the Wireshark the flow sets with the template id 263 contains the data about initiator octets and responder octets which can be used to determine the number of bytes associated with a flow.
  <a href="https://i.stack.imgur.com/aYwGh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/aYwGh.png" alt="wireshark record" /></a></p>
  
  <p>But the problem is these values cannot be obtained by the jcna. It shows always zero for the octets.</p>
  <pre><code>currOffset = t.getTypeOffset(FieldDefinition.InBYTES_32);
  currLen = t.getTypeLen(FieldDefinition.InBYTES_32);
  if (currOffset &gt;= 0 &amp;&amp; currLen &gt; 0) {
      dOctets = Util.to_number(buf, off + currOffset, currLen) * t.getSamplingRate();
  }
  </code></pre>
  <p>This is the code segment which is used to get the dOctets. This returns zero even for the template ID 263.</p>
  <p>But when it's calculated with respect to the NetFlow template id 263 it gives the correct data. (gives the initiator octets and to get responder octet 46 should be replaced with 50 as the length of the particular record is 4 bytes)</p>
  <pre><code>dOctets = Util.to_number(buf, off + 46, 4)
  </code></pre>
  <p>46 is where the Initiator Octets record lies in that particular NetFlow packet.(got using the Wireshark record.)</p>
  <p>Is it a problem with jnca? Hopefully, somebody who's familiar with jcna can give me some help on this.</p>