summaryrefslogtreecommitdiff
path: root/python/vyos/template.py
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2022-09-20 14:19:23 +0200
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2022-09-21 20:53:49 +0200
commit448d4f6db9cf6dfceffccf988301e5f4d04c9afa (patch)
tree8cdb965b4cabfcdf02c53e7046833d0cd5610df0 /python/vyos/template.py
parente9c233d65cfffccca131afb4cfb0bcaae0836c39 (diff)
downloadvyos-1x-448d4f6db9cf6dfceffccf988301e5f4d04c9afa.tar.gz
vyos-1x-448d4f6db9cf6dfceffccf988301e5f4d04c9afa.zip
nat: T4605: Refactor NAT to use python module for parsing rules
* Rename table to vyos_nat * Refactor tests to use `verify_nftables` format
Diffstat (limited to 'python/vyos/template.py')
-rw-r--r--python/vyos/template.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py
index 0e79994f5..d9ff98d2e 100644
--- a/python/vyos/template.py
+++ b/python/vyos/template.py
@@ -616,6 +616,11 @@ def nft_nested_group(out_list, includes, groups, key):
add_includes(name)
return out_list
+@register_filter('nat_rule')
+def nat_rule(rule_conf, rule_id, nat_type, ipv6=False):
+ from vyos.nat import parse_nat_rule
+ return parse_nat_rule(rule_conf, rule_id, nat_type, ipv6)
+
@register_filter('range_to_regex')
def range_to_regex(num_range):
from vyos.range_regex import range_to_regex