From 2dc2df575bc4de60759a272f5e6880326501a7ef Mon Sep 17 00:00:00 2001 From: Nicolas Fort Date: Thu, 16 Nov 2023 15:37:56 +0000 Subject: T4072: firewall: backport bridge firewall to sagitta --- .../include/firewall/action-l2.xml.i | 37 +++++++++++++++++++ .../include/firewall/action.xml.i | 8 +++-- .../include/firewall/bridge-custom-name.xml.i | 39 ++++++++++++++++++++ .../include/firewall/bridge-hook-forward.xml.i | 34 ++++++++++++++++++ .../include/firewall/common-rule-bridge.xml.i | 34 ++++++++++++++++++ .../include/firewall/common-rule-inet.xml.i | 7 +--- .../include/firewall/default-action-bridge.xml.i | 34 ++++++++++++++++++ .../include/firewall/default-action.xml.i | 10 ++++-- .../include/firewall/match-vlan.xml.i | 41 ++++++++++++++++++++++ 9 files changed, 233 insertions(+), 11 deletions(-) create mode 100644 interface-definitions/include/firewall/action-l2.xml.i create mode 100644 interface-definitions/include/firewall/bridge-custom-name.xml.i create mode 100644 interface-definitions/include/firewall/bridge-hook-forward.xml.i create mode 100644 interface-definitions/include/firewall/common-rule-bridge.xml.i create mode 100644 interface-definitions/include/firewall/default-action-bridge.xml.i create mode 100644 interface-definitions/include/firewall/match-vlan.xml.i (limited to 'interface-definitions/include') diff --git a/interface-definitions/include/firewall/action-l2.xml.i b/interface-definitions/include/firewall/action-l2.xml.i new file mode 100644 index 000000000..43fd211b4 --- /dev/null +++ b/interface-definitions/include/firewall/action-l2.xml.i @@ -0,0 +1,37 @@ + + + + Rule action + + accept continue jump return drop queue + + + accept + Accept matching entries + + + continue + Continue parsing next rule + + + jump + Jump to another chain + + + return + Return from the current chain and continue at the next rule of the last chain + + + drop + Drop matching entries + + + queue + Enqueue packet to userspace + + + (accept|continue|jump|return|drop|queue) + + + + \ No newline at end of file diff --git a/interface-definitions/include/firewall/action.xml.i b/interface-definitions/include/firewall/action.xml.i index 7c6e33839..9391a7bee 100644 --- a/interface-definitions/include/firewall/action.xml.i +++ b/interface-definitions/include/firewall/action.xml.i @@ -3,12 +3,16 @@ Rule action - accept jump reject return drop queue + accept continue jump reject return drop queue accept Accept matching entries + + continue + Continue parsing next rule + jump Jump to another chain @@ -30,7 +34,7 @@ Enqueue packet to userspace - (accept|jump|reject|return|drop|queue) + (accept|continue|jump|reject|return|drop|queue) diff --git a/interface-definitions/include/firewall/bridge-custom-name.xml.i b/interface-definitions/include/firewall/bridge-custom-name.xml.i new file mode 100644 index 000000000..a85fd5a19 --- /dev/null +++ b/interface-definitions/include/firewall/bridge-custom-name.xml.i @@ -0,0 +1,39 @@ + + + + Bridge custom firewall + + [a-zA-Z0-9][\w\-\.]* + + + + #include + #include + #include + + + Set jump target. Action jump must be defined in default-action to use this setting + + firewall bridge name + + + + + + Bridge Firewall forward filter rule number + + u32:1-999999 + Number for this firewall rule + + + + + Firewall rule number must be between 1 and 999999 + + + #include + + + + + \ No newline at end of file diff --git a/interface-definitions/include/firewall/bridge-hook-forward.xml.i b/interface-definitions/include/firewall/bridge-hook-forward.xml.i new file mode 100644 index 000000000..23d757070 --- /dev/null +++ b/interface-definitions/include/firewall/bridge-hook-forward.xml.i @@ -0,0 +1,34 @@ + + + + Bridge forward firewall + + + + + Bridge firewall forward filter + + + #include + #include + + + Bridge Firewall forward filter rule number + + u32:1-999999 + Number for this firewall rule + + + + + Firewall rule number must be between 1 and 999999 + + + #include + + + + + + + \ No newline at end of file diff --git a/interface-definitions/include/firewall/common-rule-bridge.xml.i b/interface-definitions/include/firewall/common-rule-bridge.xml.i new file mode 100644 index 000000000..ebf95a111 --- /dev/null +++ b/interface-definitions/include/firewall/common-rule-bridge.xml.i @@ -0,0 +1,34 @@ + +#include +#include + + + Destination parameters + + + #include + + +#include + + + Set jump target. Action jump must be defined to use this setting + + firewall bridge name + + + +#include +#include + + + Source parameters + + + #include + + +#include +#include +#include + \ No newline at end of file diff --git a/interface-definitions/include/firewall/common-rule-inet.xml.i b/interface-definitions/include/firewall/common-rule-inet.xml.i index 52721ecc4..030adfe7c 100644 --- a/interface-definitions/include/firewall/common-rule-inet.xml.i +++ b/interface-definitions/include/firewall/common-rule-inet.xml.i @@ -7,12 +7,7 @@ #include #include #include - - - Option to disable firewall rule - - - +#include IP fragment match diff --git a/interface-definitions/include/firewall/default-action-bridge.xml.i b/interface-definitions/include/firewall/default-action-bridge.xml.i new file mode 100644 index 000000000..577165976 --- /dev/null +++ b/interface-definitions/include/firewall/default-action-bridge.xml.i @@ -0,0 +1,34 @@ + + + + Default action for rule-set + + drop jump return accept continue + + + drop + Drop if no prior rules are hit + + + jump + Jump to another chain if no prior rules are hit + + + return + Return from the current chain and continue at the next rule of the last chain + + + accept + Accept if no prior rules are hit + + + continue + Continue parsing next rule + + + (drop|jump|return|accept|continue) + + + drop + + \ No newline at end of file diff --git a/interface-definitions/include/firewall/default-action.xml.i b/interface-definitions/include/firewall/default-action.xml.i index 80efaf335..6a49d800e 100644 --- a/interface-definitions/include/firewall/default-action.xml.i +++ b/interface-definitions/include/firewall/default-action.xml.i @@ -1,9 +1,9 @@ - Default-action for rule-set + Default action for rule-set - drop jump reject return accept + drop jump reject return accept continue drop @@ -25,8 +25,12 @@ accept Accept if no prior rules are hit + + continue + Continue parsing next rule + - (drop|jump|reject|return|accept) + (drop|jump|reject|return|accept|continue) drop diff --git a/interface-definitions/include/firewall/match-vlan.xml.i b/interface-definitions/include/firewall/match-vlan.xml.i new file mode 100644 index 000000000..d0820f7d8 --- /dev/null +++ b/interface-definitions/include/firewall/match-vlan.xml.i @@ -0,0 +1,41 @@ + + + + VLAN parameters + + + + + VLAN id + + u32:0-4096 + VLAN id + + + <start-end> + VLAN id range to match + + + + + + + + + VLAN priority(pcp) + + u32:0-7 + VLAN priority + + + <start-end> + VLAN priority range to match + + + + + + + + + \ No newline at end of file -- cgit v1.2.3