<font size="4"><font face="times new roman,serif">HI, <br><br>when I am writing a flowunit for dnp3 protocol, I find a weird situation. Here is the record type for the flowunit: <br><br>type Dnp3_Test = record {<br>        start: uint16;<br>

        len: uint8;<br>        ctrl: uint8;<br>        dest_addr: uint16;<br>        src_addr: uint16;<br>        rest: bytestring &amp;restofdata;<br><br>} &amp;byteorder = bigendian<br>  &amp;length= (8 + len -5 - 1)<br>

;<br>  <br>I am writing this type for step by step debug. There is no compiling and linking error. But when you parse the traffic dump by this protocol analyzer, binpac will generate following exception<br><br>1217561494.208541 weird: binpac exception: out_of_bound: Dnp3_Test:src_addr: 8 &gt; 3<br>

<br>8 is the size of all data before &quot;rest&quot; the bytestring, and 3 is the size of data &quot;start&quot; and &quot;len&quot;. &quot;len&quot; is used to define the &amp;length of this record. It seems that after &quot;len&quot;, you can not define extra data, such as &quot;ctrl&quot;,  &quot;dest_addr&quot; and doing this will generate the above exception. However, if you change the type of all data after &quot;len&quot; into bytestring, then the exception will not happen.  But I still want to keep those data as the &quot;uint8&quot;. Any suggestion to solve this problem?<br>

<br>Best,<br><br>Hui<br> <br><br></font></font><br clear="all"><br>-- <br>Hui Lin<br>Research Assistant<br>DEPEND Research Group, ECE Department<br>University of Illinois at Urbana-Champaign<br><a href="mailto:hlin33@illinois.edu" target="_blank">hlin33@illinois.edu</a><br>