summaryrefslogtreecommitdiff
path: root/trafgen_l3.c
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2016-07-13 01:01:53 +0300
committerTobias Klauser <tklauser@distanz.ch>2016-07-13 09:32:07 +0200
commit423bb070d372341aa178849a9479099b95c7d352 (patch)
treece5a939c07d84d05ea29be0458f51b2ed02af282 /trafgen_l3.c
parente6fcf1f0f2c58cf38fad98d1d8b00a3b7ebd3070 (diff)
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>
Diffstat (limited to 'trafgen_l3.c')
-rw-r--r--trafgen_l3.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/trafgen_l3.c b/trafgen_l3.c
index cbdbe6c..ae3f136 100644
--- a/trafgen_l3.c
+++ b/trafgen_l3.c
@@ -69,6 +69,9 @@ static void ipv4_set_next_proto(struct proto_hdr *hdr, enum proto_id pid)
case PROTO_IP4:
ip_proto = IPPROTO_IPIP;
break;
+ case PROTO_ICMP4:
+ ip_proto = IPPROTO_ICMP;
+ break;
case PROTO_UDP:
ip_proto = IPPROTO_UDP;
break;