From 423bb070d372341aa178849a9479099b95c7d352 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Wed, 13 Jul 2016 01:01:53 +0300 Subject: 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 [tk: squash commits, consistency between functionality and docu] Signed-off-by: Tobias Klauser --- trafgen.8 | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'trafgen.8') diff --git a/trafgen.8 b/trafgen.8 index b011276..c958794 100644 --- a/trafgen.8 +++ b/trafgen.8 @@ -498,6 +498,46 @@ By default, if the lower level header is Ethernet, its EtherType field is set to By default, if the lower level header is Ethernet, its EtherType field is set to 0x86DD (IPv6). +.I ICMPv4 +: +.B icmp4|icmpv4(type=, code=, echorequest, echoreply, +.B csum=, mtu=, seq=, id=, addr=) +.sp +.in +4 +.B type +- Message type (default: 0 - Echo reply) +.sp +.B code +- Message code (default: 0) +.sp +.B echorequest +- ICMPv4 echo (ping) request (type: 8, code: 0) +.sp +.B echoreply +- ICMPv4 echo (ping) reply (type: 0, code: 0) +.sp +.B csum +- Checksum of ICMPv4 header and payload (calculated by default) +.sp +.B mtu +- Next-hop MTU field used in 'Datagram is too big' message type (default; 0) +.sp +.B seq +- Sequence number used in Echo/Timestamp/Address mask messages (default: 0) +.sp +.B id +- Identifier used in Echo/Timestamp/Address mask messages (default: 0) +.sp +.B addr +- IPv4 address used in Redirect messages (default: 0.0.0.0) +.sp +.in -4 +Example ICMP echo request (ping): +.in +4 +.sp +{ icmpv4(echorequest, seq=1, id=1326) } +.in -4 + .I ICMPv6 : .B icmp6|icmpv6(type=, echorequest, echoreply, code=, -- cgit v1.2.3-54-g00ecf