File: map.t.payload.ip

package info (click to toggle)
nftables 1.1.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,384 kB
  • sloc: ansic: 50,901; sh: 20,277; yacc: 5,861; python: 1,746; lex: 1,367; makefile: 392
file content (19 lines) | stat: -rw-r--r-- 701 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# mark set ip saddr map { 10.2.3.2 : 0x0000002a, 10.2.3.1 : 0x00000017}
__map%d test-ip4 b
__map%d test-ip4 0
	element 0203020a  : 0000002a 0 [end]	element 0103020a  : 00000017 0 [end]
ip test-ip4 input 
  [ payload load 4b @ network header + 12 => reg 1 ]
  [ lookup reg 1 set __map%d dreg 1 ]
  [ meta set mark with reg 1 ]

# mark set ip hdrlength map { 5 : 0x00000017, 4 : 0x00000001}
__map%d test-ip4 b
__map%d test-ip4 0
	element 00000005  : 00000017 0 [end]	element 00000004  : 00000001 0 [end]
ip test-ip4 input 
  [ payload load 1b @ network header + 0 => reg 1 ]
  [ bitwise reg 1 = ( reg 1 & 0x0000000f ) ^ 0x00000000 ]
  [ lookup reg 1 set __map%d dreg 1 ]
  [ meta set mark with reg 1 ]