examples: move them to contrib, since they don't belong here
[netsniff-ng.git] / contrib / examples / trafgen / trafgen.txf
blob8b52eaccc348eaee919906fc1229f72923e88f79
1 # each '{...}' defines a packet
3 # Classic style, byte-wise
4 { 0x00, 0x01, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x04,
5   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
6   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
7   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
8   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
9   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
10   0xff, 0xff, 0xff, 0xff }
12 # Usage of fill macro, fills 60 bytes with 0xff
13 { 0x00, 0x01, 0x03, fill(0xff, 60) /* fill 60 bytes with ff */, 0x04 }
15 # Usage of rnd macro, fills 60 bytes with rnd values during compile time
16 { 0x00, 0x01, 0x03, rnd(60), 0x04 }
18 # Usage of bitvectors (width: 8)
19 { 0x00, 0b00110011, 0b10101010, rnd(60), 0x04 }
21 # Usage of seqinc macro, generates a sequence of 64 incr. bytes starting 0x00
22 { seqinc(0x00, 64) }
24 # Usage of seqdec macro, generates a sequence of 64 2-decr. bytes starting 0xff
25 { seqdec(0xff, 64, 2) }
27 # Mixture between hex and decimal and ascii
28 { 0x00, 1, 2, 0x4, fill(123, 60), f, o, o, b, a, r }
30 # Mixture between comma and space as delimiter (not in macros allowed)
31 { 0x00, 0x01, 0x03 fill(0xff, 60) 0x04 }
33 # Usage of ddec macro, decrements a byte _during_ runtime
34 { ddec(255, 0), 0x01, 0x03, fill(0xff, 60) }
36 # Usage of dinc macro, increments a byte _during_ runtime with stepping of 2
37 { dinc(0, 255, 2), 0x01, 0x03, fill(0xff, 60) }
39 # Usage of drnd macro, generates one random byte _during_ runtime
40 { rnd(64) drnd() }
42 # Usage of drnd macro, generates 64 random bytes _during_ runtime
43 { drnd(64) }
45 # Usage of ethernet header macro
46 #{ ether(src[ff:ff:ff:ff:ff:ff], dst[ff:ff:ff:ff:ff:ff], type[0x800]), rnd(50)}
48 # Mixture of several types
50 #  ether(src[ff:ff:ff:ff:ff:ff], dst[ff:ff:ff:ff:ff:ff], type[0x800])
51 #  rnd(50) 0xff 0xaa s c h n u b b e l fill(0xaa, 10)
54 # Usage of ethernet header macro, incomplete (unspecified fields will be random!)
55 #{ ether(dst[ff:ff:ff:ff:ff:ff], type[0x800]), rnd(50)}
57 # Usage of several macros
58 #{ ether(dst[ff:ff:ff:ff:ff:ff], type[0x800]) ipv4(dst[255.255.255.255]) }