<div dir="ltr"><div><div><div><div><div><div><div>I&#39;m looking to develop a new TCP-based protocol parser using binpac. Getting the &#39;cannot handle incremental input&#39; error from binpac. But I don&#39;t understand exactly why I&#39;m seeing it. It happens whenever I use &quot;flowunit = &quot; instead of &quot;datagram = &quot;. I&#39;m literally changing one line from the skeleton produced by the binpac quickstarter.<br></div>Here&#39;s what I&#39;m doing. Creating this as a plugin, so I start with init-plugin:<br><br></div><div style="margin-left:40px">bro-aux/plugin-support/init-plugin $SRC/analyzer/fob Bro_Fob fob<br><br></div>Next I run the binpac quickstart:<br></div><div style="margin-left:40px">cd ~/src/binpac_quickstart<br>./start.py fob &quot;FOB Protocol&quot; $SRC/analyzer/fob --tcp --plugin --buffered<br></div><br></div>If I now configure and make, everything works fine:<br></div><div style="margin-left:40px">cd $SRC/analyzer/fob<br>./configure --bro-dist=$BRO_SRC<br>make<br><br></div>But if I edit src/fob.pac to uncomment the &quot;flowunit =&quot; line (and comment out the datagram line), I get this error from binpac:<br><div style="margin-left:40px">src/fob-protocol.pac:18: error : cannot handle incremental input<br></div><br></div><div>Thinking it had something to do with the definition of FOB_PDU there (&quot;data: bytestring &amp;restofdata;&quot;), I removed that line so that my PDU definition is nothing but:<br><br><div style="margin-left:40px">type FOB_PDU(is_orig: bool) = record {<br>        foo: uint32;<br>} &amp;byteorder=bigendian;<br></div><br></div><div>But I still get the error. I&#39;ve tried the same thing with current master branch, and with v2.4.1 and an older version I&#39;m using and I get the same result in each case.<br><br></div><div>If I remove all fields from the PDU, it compiles, but that&#39;s not very useful. ;)<br></div><div><br></div><div>I know the flowunit feature works. I see it in other analyzers in the source tree. Seems like I must be missing something simple in the .pac files. But I can&#39;t figure it out from inspection.<br><br>Anybody know what&#39;s the trick?<br><br></div><div>Thanks!<br></div><div>Jeff<br><br></div></div></div>