Commit eabe4a9a authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

test: update-limit: make conn and flow limit outputs differ

parent 0f8a97fd
......@@ -75,12 +75,15 @@ for _, name in ipairs{'A', 'B', 'C', 'D'} do
table.insert(res, {['update-limit']=name})
end
for _, measure in ipairs{'conn', 'flow'} do
function add_update_limit(name, measure)
for _, addr in ipairs{'src', 'dest'} do
table.insert(
res, {['update-limit']={name='A', measure=measure, addr=addr}}
res, {['update-limit']={name=name, measure=measure, addr=addr}}
)
end
end
add_update_limit('A', 'conn')
add_update_limit('B', 'flow')
print(json.encode{filter=res})
......@@ -35442,23 +35442,23 @@ Filter 2522 {"update-limit":{"addr":"dest","measure":"co
inet6/filter/INPUT -m recent --name user:A --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
inet6/filter/OUTPUT -m recent --name user:A --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
Filter 2523 {"update-limit":{"addr":"src","measure":"flow","name":"A"}}
Filter 2523 {"update-limit":{"addr":"src","measure":"flow","name":"B"}}
(filter-limit)
inet/filter/FORWARD -m recent --name user:A --rsource --mask 255.255.255.255 --set
inet/filter/INPUT -m recent --name user:A --rsource --mask 255.255.255.255 --set
inet/filter/OUTPUT -m recent --name user:A --rsource --mask 255.255.255.255 --set
inet6/filter/FORWARD -m recent --name user:A --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
inet6/filter/INPUT -m recent --name user:A --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
inet6/filter/OUTPUT -m recent --name user:A --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
inet/filter/FORWARD -m recent --name user:B --rsource --mask 255.255.255.255 --set
inet/filter/INPUT -m recent --name user:B --rsource --mask 255.255.255.255 --set
inet/filter/OUTPUT -m recent --name user:B --rsource --mask 255.255.255.255 --set
inet6/filter/FORWARD -m recent --name user:B --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
inet6/filter/INPUT -m recent --name user:B --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
inet6/filter/OUTPUT -m recent --name user:B --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
Filter 2524 {"update-limit":{"addr":"dest","measure":"flow","name":"A"}}
Filter 2524 {"update-limit":{"addr":"dest","measure":"flow","name":"B"}}
(filter-limit)
inet/filter/FORWARD -m recent --name user:A --rdest --mask 255.255.255.255 --set
inet/filter/INPUT -m recent --name user:A --rdest --mask 255.255.255.255 --set
inet/filter/OUTPUT -m recent --name user:A --rdest --mask 255.255.255.255 --set
inet6/filter/FORWARD -m recent --name user:A --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
inet6/filter/INPUT -m recent --name user:A --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
inet6/filter/OUTPUT -m recent --name user:A --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
inet/filter/FORWARD -m recent --name user:B --rdest --mask 255.255.255.255 --set
inet/filter/INPUT -m recent --name user:B --rdest --mask 255.255.255.255 --set
inet/filter/OUTPUT -m recent --name user:B --rdest --mask 255.255.255.255 --set
inet6/filter/FORWARD -m recent --name user:B --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
inet6/filter/INPUT -m recent --name user:B --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
inet6/filter/OUTPUT -m recent --name user:B --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
Filter 2525 {}
(log)
......@@ -39785,8 +39785,8 @@ hash:net family inet
:logdrop-999 - [0:0]
:logpass-0 - [0:0]
:logpass-1 - [0:0]
-A FORWARD -m recent --name user:A --rdest --mask 255.255.255.255 --set
-A FORWARD -m recent --name user:A --rsource --mask 255.255.255.255 --set
-A FORWARD -m recent --name user:B --rdest --mask 255.255.255.255 --set
-A FORWARD -m recent --name user:B --rsource --mask 255.255.255.255 --set
-A FORWARD -j limit-1886
-A FORWARD -j limit-1885
-A FORWARD -j limit-1884
......@@ -41445,8 +41445,8 @@ hash:net family inet
-A FORWARD -m policy --dir in --pol ipsec -o eth5 -j ACCEPT
-A FORWARD -m policy --dir in --pol ipsec -m policy --dir out --pol ipsec -j ACCEPT
-A FORWARD -p icmp -j icmp-routing
-A INPUT -m recent --name user:A --rdest --mask 255.255.255.255 --set
-A INPUT -m recent --name user:A --rsource --mask 255.255.255.255 --set
-A INPUT -m recent --name user:B --rdest --mask 255.255.255.255 --set
-A INPUT -m recent --name user:B --rsource --mask 255.255.255.255 --set
-A INPUT -j limit-1886
-A INPUT -j limit-1885
-A INPUT -j limit-1884
......@@ -43059,8 +43059,8 @@ hash:net family inet
-A INPUT -i eth0 -j ACCEPT
-A INPUT -j ACCEPT
-A INPUT -p icmp -j icmp-routing
-A OUTPUT -m recent --name user:A --rdest --mask 255.255.255.255 --set
-A OUTPUT -m recent --name user:A --rsource --mask 255.255.255.255 --set
-A OUTPUT -m recent --name user:B --rdest --mask 255.255.255.255 --set
-A OUTPUT -m recent --name user:B --rsource --mask 255.255.255.255 --set
-A OUTPUT -j limit-1886
-A OUTPUT -j limit-1885
-A OUTPUT -j limit-1884
......@@ -58304,8 +58304,8 @@ COMMIT
:logdrop-998 - [0:0]
:logdrop-999 - [0:0]
:logpass-0 - [0:0]
-A FORWARD -m recent --name user:A --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A FORWARD -m recent --name user:A --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A FORWARD -m recent --name user:B --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A FORWARD -m recent --name user:B --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A FORWARD -j limit-1886
-A FORWARD -j limit-1885
-A FORWARD -j limit-1884
......@@ -59939,8 +59939,8 @@ COMMIT
-A FORWARD -m policy --dir in --pol ipsec -o eth5 -j ACCEPT
-A FORWARD -m policy --dir in --pol ipsec -m policy --dir out --pol ipsec -j ACCEPT
-A FORWARD -p icmpv6 -j icmp-routing
-A INPUT -m recent --name user:A --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A INPUT -m recent --name user:A --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A INPUT -m recent --name user:B --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A INPUT -m recent --name user:B --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A INPUT -j limit-1886
-A INPUT -j limit-1885
-A INPUT -j limit-1884
......@@ -61552,8 +61552,8 @@ COMMIT
-A INPUT -i eth0 -j ACCEPT
-A INPUT -j ACCEPT
-A INPUT -p icmpv6 -j ACCEPT
-A OUTPUT -m recent --name user:A --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A OUTPUT -m recent --name user:A --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A OUTPUT -m recent --name user:B --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A OUTPUT -m recent --name user:B --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A OUTPUT -j limit-1886
-A OUTPUT -j limit-1885
-A OUTPUT -j limit-1884
......@@ -3801,8 +3801,8 @@
:logdrop-999 - [0:0]
:logpass-0 - [0:0]
:logpass-1 - [0:0]
-A FORWARD -m recent --name user:A --rdest --mask 255.255.255.255 --set
-A FORWARD -m recent --name user:A --rsource --mask 255.255.255.255 --set
-A FORWARD -m recent --name user:B --rdest --mask 255.255.255.255 --set
-A FORWARD -m recent --name user:B --rsource --mask 255.255.255.255 --set
-A FORWARD -j limit-1886
-A FORWARD -j limit-1885
-A FORWARD -j limit-1884
......@@ -5461,8 +5461,8 @@
-A FORWARD -m policy --dir in --pol ipsec -o eth5 -j ACCEPT
-A FORWARD -m policy --dir in --pol ipsec -m policy --dir out --pol ipsec -j ACCEPT
-A FORWARD -p icmp -j icmp-routing
-A INPUT -m recent --name user:A --rdest --mask 255.255.255.255 --set
-A INPUT -m recent --name user:A --rsource --mask 255.255.255.255 --set
-A INPUT -m recent --name user:B --rdest --mask 255.255.255.255 --set
-A INPUT -m recent --name user:B --rsource --mask 255.255.255.255 --set
-A INPUT -j limit-1886
-A INPUT -j limit-1885
-A INPUT -j limit-1884
......@@ -7075,8 +7075,8 @@
-A INPUT -i eth0 -j ACCEPT
-A INPUT -j ACCEPT
-A INPUT -p icmp -j icmp-routing
-A OUTPUT -m recent --name user:A --rdest --mask 255.255.255.255 --set
-A OUTPUT -m recent --name user:A --rsource --mask 255.255.255.255 --set
-A OUTPUT -m recent --name user:B --rdest --mask 255.255.255.255 --set
-A OUTPUT -m recent --name user:B --rsource --mask 255.255.255.255 --set
-A OUTPUT -j limit-1886
-A OUTPUT -j limit-1885
-A OUTPUT -j limit-1884
......
......@@ -3800,8 +3800,8 @@
:logdrop-998 - [0:0]
:logdrop-999 - [0:0]
:logpass-0 - [0:0]
-A FORWARD -m recent --name user:A --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A FORWARD -m recent --name user:A --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A FORWARD -m recent --name user:B --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A FORWARD -m recent --name user:B --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A FORWARD -j limit-1886
-A FORWARD -j limit-1885
-A FORWARD -j limit-1884
......@@ -5435,8 +5435,8 @@
-A FORWARD -m policy --dir in --pol ipsec -o eth5 -j ACCEPT
-A FORWARD -m policy --dir in --pol ipsec -m policy --dir out --pol ipsec -j ACCEPT
-A FORWARD -p icmpv6 -j icmp-routing
-A INPUT -m recent --name user:A --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A INPUT -m recent --name user:A --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A INPUT -m recent --name user:B --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A INPUT -m recent --name user:B --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A INPUT -j limit-1886
-A INPUT -j limit-1885
-A INPUT -j limit-1884
......@@ -7048,8 +7048,8 @@
-A INPUT -i eth0 -j ACCEPT
-A INPUT -j ACCEPT
-A INPUT -p icmpv6 -j ACCEPT
-A OUTPUT -m recent --name user:A --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A OUTPUT -m recent --name user:A --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A OUTPUT -m recent --name user:B --rdest --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A OUTPUT -m recent --name user:B --rsource --mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff --set
-A OUTPUT -j limit-1886
-A OUTPUT -j limit-1885
-A OUTPUT -j limit-1884
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment