Skip to content

Commit

Permalink
Merge branch 'current' into circinus_shoretel
Browse files Browse the repository at this point in the history
  • Loading branch information
bk2zsto committed Jul 28, 2024
2 parents fbae683 + 358aaa1 commit b8c3196
Show file tree
Hide file tree
Showing 24 changed files with 781 additions and 204 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <include/generic-disable-node.xml.i>
#include <include/firewall/dscp.xml.i>
#include <include/firewall/fragment.xml.i>
#include <include/firewall/match-ipsec.xml.i>
#include <include/firewall/limit.xml.i>
#include <include/firewall/log.xml.i>
#include <include/firewall/log-options.xml.i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <include/firewall/limit.xml.i>
#include <include/firewall/log.xml.i>
#include <include/firewall/log-options.xml.i>
#include <include/firewall/match-ipsec.xml.i>
#include <include/firewall/protocol.xml.i>
#include <include/firewall/nft-queue.xml.i>
#include <include/firewall/recent.xml.i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <include/firewall/limit.xml.i>
#include <include/firewall/log.xml.i>
#include <include/firewall/log-options.xml.i>
#include <include/firewall/match-ipsec.xml.i>
#include <include/firewall/protocol.xml.i>
#include <include/firewall/nft-queue.xml.i>
#include <include/firewall/recent.xml.i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<children>
#include <include/firewall/common-rule-ipv4.xml.i>
#include <include/firewall/inbound-interface.xml.i>
#include <include/firewall/match-ipsec.xml.i>
#include <include/firewall/match-ipsec-in.xml.i>
</children>
</tagNode>
</children>
Expand Down
2 changes: 2 additions & 0 deletions interface-definitions/include/firewall/ipv4-hook-output.xml.i
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
</properties>
<children>
#include <include/firewall/common-rule-ipv4.xml.i>
#include <include/firewall/match-ipsec-out.xml.i>
#include <include/firewall/outbound-interface.xml.i>
</children>
</tagNode>
Expand Down Expand Up @@ -53,6 +54,7 @@
</properties>
<children>
#include <include/firewall/common-rule-ipv4-raw.xml.i>
#include <include/firewall/match-ipsec-out.xml.i>
#include <include/firewall/outbound-interface.xml.i>
</children>
</tagNode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
</properties>
<children>
#include <include/firewall/common-rule-ipv4-raw.xml.i>
#include <include/firewall/match-ipsec-in.xml.i>
#include <include/firewall/inbound-interface.xml.i>
<leafNode name="jump-target">
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<children>
#include <include/firewall/common-rule-ipv6.xml.i>
#include <include/firewall/inbound-interface.xml.i>
#include <include/firewall/match-ipsec.xml.i>
#include <include/firewall/match-ipsec-in.xml.i>
</children>
</tagNode>
</children>
Expand Down
2 changes: 2 additions & 0 deletions interface-definitions/include/firewall/ipv6-hook-output.xml.i
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
</properties>
<children>
#include <include/firewall/common-rule-ipv6.xml.i>
#include <include/firewall/match-ipsec-out.xml.i>
#include <include/firewall/outbound-interface.xml.i>
</children>
</tagNode>
Expand Down Expand Up @@ -53,6 +54,7 @@
</properties>
<children>
#include <include/firewall/common-rule-ipv6-raw.xml.i>
#include <include/firewall/match-ipsec-out.xml.i>
#include <include/firewall/outbound-interface.xml.i>
</children>
</tagNode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
</properties>
<children>
#include <include/firewall/common-rule-ipv6-raw.xml.i>
#include <include/firewall/match-ipsec-in.xml.i>
#include <include/firewall/inbound-interface.xml.i>
<leafNode name="jump-target">
<properties>
Expand Down
21 changes: 21 additions & 0 deletions interface-definitions/include/firewall/match-ipsec-in.xml.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- include start from firewall/match-ipsec-in.xml.i -->
<node name="ipsec">
<properties>
<help>Inbound IPsec packets</help>
</properties>
<children>
<leafNode name="match-ipsec-in">
<properties>
<help>Inbound traffic that was IPsec encapsulated</help>
<valueless/>
</properties>
</leafNode>
<leafNode name="match-none-in">
<properties>
<help>Inbound traffic that was not IPsec encapsulated</help>
<valueless/>
</properties>
</leafNode>
</children>
</node>
<!-- include end -->
21 changes: 21 additions & 0 deletions interface-definitions/include/firewall/match-ipsec-out.xml.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- include start from firewall/match-ipsec-out.xml.i -->
<node name="ipsec">
<properties>
<help>Outbound IPsec packets</help>
</properties>
<children>
<leafNode name="match-ipsec-out">
<properties>
<help>Outbound traffic to be IPsec encapsulated</help>
<valueless/>
</properties>
</leafNode>
<leafNode name="match-none-out">
<properties>
<help>Outbound traffic that will not be IPsec encapsulated</help>
<valueless/>
</properties>
</leafNode>
</children>
</node>
<!-- include end -->
22 changes: 17 additions & 5 deletions interface-definitions/include/firewall/match-ipsec.xml.i
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
<!-- include start from firewall/match-ipsec.xml.i -->
<node name="ipsec">
<properties>
<help>Inbound IPsec packets</help>
<help>IPsec encapsulated packets</help>
</properties>
<children>
<leafNode name="match-ipsec">
<leafNode name="match-ipsec-in">
<properties>
<help>Inbound IPsec packets</help>
<help>Inbound traffic that was IPsec encapsulated</help>
<valueless/>
</properties>
</leafNode>
<leafNode name="match-none">
<leafNode name="match-none-in">
<properties>
<help>Inbound non-IPsec packets</help>
<help>Inbound traffic that was not IPsec encapsulated</help>
<valueless/>
</properties>
</leafNode>
<leafNode name="match-ipsec-out">
<properties>
<help>Outbound traffic to be IPsec encapsulated</help>
<valueless/>
</properties>
</leafNode>
<leafNode name="match-none-out">
<properties>
<help>Outbound traffic that will not be IPsec encapsulated</help>
<valueless/>
</properties>
</leafNode>
</children>
</node>
<!-- include end -->
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- include start from include/version/firewall-version.xml.i -->
<syntaxVersion component='firewall' version='16'></syntaxVersion>
<syntaxVersion component='firewall' version='17'></syntaxVersion>
<!-- include end -->
8 changes: 6 additions & 2 deletions python/vyos/firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,14 @@ def parse_rule(rule_conf, hook, fw_name, rule_id, ip_name):
output.append(f'ip{def_suffix} dscp != {{{negated_dscp_str}}}')

if 'ipsec' in rule_conf:
if 'match_ipsec' in rule_conf['ipsec']:
if 'match_ipsec_in' in rule_conf['ipsec']:
output.append('meta ipsec == 1')
if 'match_none' in rule_conf['ipsec']:
if 'match_none_in' in rule_conf['ipsec']:
output.append('meta ipsec == 0')
if 'match_ipsec_out' in rule_conf['ipsec']:
output.append('rt ipsec exists')
if 'match_none_out' in rule_conf['ipsec']:
output.append('rt ipsec missing')

if 'fragment' in rule_conf:
# Checking for fragmentation after priority -400 is not possible,
Expand Down
Loading

0 comments on commit b8c3196

Please sign in to comment.