Add short note about field offset syntax with an example.

Signed-off-by: Vadim Kochan <vadi...@gmail.com>
---
 trafgen.8 | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/trafgen.8 b/trafgen.8
index 62716bb..c58d429 100644
--- a/trafgen.8
+++ b/trafgen.8
@@ -329,6 +329,31 @@ Example of using dynamic functions:
 .in -4
 
 .sp
+Field might be set with a value/function at a specific offset within a field:
+.sp
+.in +4
+<field>[<index>] | <field>[<index>:<length>]
+.sp
+.in +4
+<index> - relative field's offset with range 0..<field.len> - 1
+.sp
+<length> - length/size of the value which will be set - 1,2 or 4 bytes 
(default: 1).
+.in -4
+.sp
+The <index> starts from the 1st field's byte in the network order.
+.sp
+Example of using field offset:
+.sp
+{
+.in +2
+    eth(saddr=aa:bb:cc:dd:ee:ff, saddr[0]=dinc()),
+    ipv4(saddr[0:2]=drnd()),
+    udp(),
+.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
 specified. Each header will be filled with some mimimum required set of fields.
-- 
2.10.2

-- 
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.

Reply via email to