On 2015-06-30 at 12:31:50 +0200, Vadim Kochan <vadi...@gmail.com> wrote: > On Tue, Jun 30, 2015 at 11:41:04AM +0200, Daniel Borkmann wrote: > > On 06/29/2015 02:58 AM, Vadim Kochan wrote: > > >Hi, > > > > > >This is the 1-st "try" version of how I see the protocol generation API > > >for the > > >trafgen util as mz replacement (at least for better performance). > > > > > >I am sending this just because to get your feedback about conceptual idea, > > >and as soon as I got some basic working version I decided to share the > > >code just to get know if I am moving in the right direction. > > > > > >Added high-level command line protocol packet building intreface, > > >which allows to specify protocol parameters to build the header and > > >payload. > > > > > >Each protocol is represented by proto_gen struct which is responsible > > >only for providing field info (size, data) by name to trafgen's > > >low level packet generation layer. > > > > > >All packet generation routine is performed by the generic code in > > >trafgen.c which parses the command line, obtains proto name, param=value > > >list and calls the specific protocol handler to get protocol field info > > >by name, so the TX routine remains the same. > > > > > >The command line syntax looks like: > > > > > > trafgen/trafgen --dev lo eth da = AA:BB:CC:DD:EE:FF > > > sa=11:22:33:44:55:66, arp op=rep tip=192.168.1.1 -n 1 > > > > > >so the first is proto name and after there are param value pairs which > > >are separated by space, in case if there are multiple protocols > > >specified - their should be separated by "," after last param value of > > >the previous protocol. > > > > > >I think the picture will be more clear after adding IP protocol with > > >checksum > > >handling. > > > > First of all, thanks for working on this, Vadim! I like seeing something > > like > > this integrated after we've resolved all outstanding issues. I'll certainly > > make trafgen also easier to use. > > > > Before digging into the very details, I have a couple of high-level > > comments/ > > thoughts. All the manual string parsing you are doing, isn't it easier to > > just > > extend the flex/bison files with the related protocol information? > Did you mean to declare just proto names within parser or also proto fields ?
Both, if possible. That way you can also easily reuse structures and can capture thinks like ordering of fields more easily. -- You received this message because you are subscribed to the Google Groups "netsniff-ng" group. To unsubscribe from this group and stop receiving emails from it, send an email to netsniff-ng+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.