On 2016-01-21 at 00:20:01 +0100, Vadim Kochan <vadi...@gmail.com> wrote: > Add syntax to specify IPv4 header fields: > > { ip(df, mf, frag=100, prot=0x1, ecn=2, dscp=20) } > > Signed-off-by: Vadim Kochan <vadi...@gmail.com> > --- > trafgen_lexer.l | 15 +++++++++++++++ > trafgen_parser.y | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 66 insertions(+) > > diff --git a/trafgen_lexer.l b/trafgen_lexer.l > index 9bbd982..b9bcd10 100644 > --- a/trafgen_lexer.l > +++ b/trafgen_lexer.l > @@ -117,8 +117,23 @@ ip_addr ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+) > "resp"|"reply" { return F_RESP; } > "op" { return F_OPER; } > > +"ihl" { return F_IHL; } > +"ver" { return F_VER; }
Maybe add "version" here as well? > +"ttl" { return F_TTL; } > +"dscp" { return F_DSCP; } > +"ecn" { return F_ECN; } > +"tos" { return F_TOS; } > +"len" { return F_LEN; } "length"? > +"id" { return F_ID; } > +"flags" { return F_FLAGS; } > +"frag" { return F_FRAG; } > +"csum" { return F_CSUM; } > +"df" { return F_DF; } > +"mf" { return F_MF; } > + > "eth" { return P_ETH; } > "arp" { return P_ARP; } > +"ip" { return P_IP4; } I think this should be "ip4" or "ipv4" (or both), in order to be consistent with a possible future extension to support IPv6. -- 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.