trafgen: proto: Add ICMPv4 header generation
commit423bb070d372341aa178849a9479099b95c7d352
authorVadim Kochan <vadim4j@gmail.com>
Tue, 12 Jul 2016 22:01:53 +0000 (13 01:01 +0300)
committerTobias Klauser <tklauser@distanz.ch>
Wed, 13 Jul 2016 07:32:07 +0000 (13 09:32 +0200)
treece5a939c07d84d05ea29be0458f51b2ed02af282
parente6fcf1f0f2c58cf38fad98d1d8b00a3b7ebd3070
trafgen: proto: Add ICMPv4 header generation

Support for generating ICMPv4 headers using the 'icmp4()/icmpv4()'
trafgen generation functions.

Fields supported:

    type      Set type field (default 0: Echo reply)
              Supported keywords: echorequest, echoreply
    code      Set code field (default 0)
    csum      Set checksum field (calculated by default)
    mtu       Set mtu field for destination unreachable (default 0)
    seq       Set sequence field (default 0)
    id        Set identifier field (default 0)
    addr      Set redirect address (default 0.0.0.0)

Example (send ping request):

  { icmpv4(echorequest, seq=1, id=1326) }

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
[tk: squash commits, consistency between functionality and docu]
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
trafgen.8
trafgen_l3.c
trafgen_l4.c
trafgen_l4.h
trafgen_lexer.l
trafgen_parser.y
trafgen_proto.h