Extend field expression with the following syntax: <field>[<index>] | <field>[<index>:<length>]
which allows to specify value or function at specified offset relative to the field's offset within a header. The trick to implement this was to use copies of proto_field instances in the packet_dyn->fields array which allows to specify different functions for the same field and with different offsets. It was needed to change IPv6 address rule parsing to more strict rule to allow parse <field>[<index>:<len>] syntax. v2: Change commit messages and man file that field offset expression is used with function expression, and added validation for it in trafgen parser. Vadim Kochan (7): trafgen: parser: Rename field_expr -> field_value_expr rule trafgen: proto: Change __proto_field_set_bytes(...) to take field trafgen: proto: Rename proto_field_xxx -> proto_hdr_field_xxx trafgen: proto: Add proto field only setters/getters trafgen: parser: Parse IPv6 address by strict match pattern trafgen: parser: Allow to set function at field offset man: trafgen: Add short description about field offset using trafgen.8 | 25 ++++++ trafgen_l2.c | 44 +++++------ trafgen_l3.c | 24 +++--- trafgen_l4.c | 28 +++---- trafgen_lexer.l | 51 +++++++++++- trafgen_parser.y | 236 ++++++++++++++++++++++++++++++++++++------------------- trafgen_proto.c | 217 +++++++++++++++++++++++++++++++------------------- trafgen_proto.h | 64 +++++++++------ 8 files changed, 450 insertions(+), 239 deletions(-) -- 2.10.2 -- 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.