From 77f4dfb3c3b31a66cfa70512a7bd42ce9cf74d19 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Sat, 13 Aug 2016 02:11:23 +0300 Subject: trafgen: man: Add description for 'dinc' and 'drnd' field functions Add explanation about 'drnd' and 'dinc' functions which might be used for proto field functions. Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- trafgen.8 | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/trafgen.8 b/trafgen.8 index c958794..d8ff36f 100644 --- a/trafgen.8 +++ b/trafgen.8 @@ -283,6 +283,49 @@ using following generic syntax: If a field is not specified, then a default value will be used (usually 0). Protocol fields might be set in any order. However, the offset of the fields in the resulting packet is according to the respective protocol. +.sp +Each field might be set with a function which generates field value at runtime by +increment or randomize it. For L3/L4 protocols the checksum is calculated automatically +if the field was changed dynamically by specified function. The following field +functions are supported: +.in +4 +.sp +.B dinc +- increment field value at runtime. By default increment step is '1'. +.B min +and +.B max +parameters are used to increment field only in the specified range, by default original +field value is used. If the field length is greater than 4 then last 4 bytes are +incremented only (useful for MAC and IPv6 addresses): +.in +4 +.sp + = dinc() | dinc(min, max) | dinc(min, max, step) +.in -4 +.sp +.B drnd +- randomize field value at runtime. +.B min +and +.B max +parameters are used to randomize field only in the specified range: +.in +4 +.sp + = drnd() | drnd(min, max) +.in -4 +.sp +Example of using dynamic functions: +.sp +{ +.in +2 + eth(saddr=aa:bb:cc:dd:ee:ff, saddr=dinc()), + ipv4(saddr=dinc()), + udp(sport=dinc(1, 13, 2), dport=drnd(80, 100)) +.in -2 +} + +.in -4 + .sp All required lower layer headers will be filled automatically if they were not specified by the user. The headers will be filled in the order they were -- cgit v1.2.3-54-g00ecf