Skip to content

Commit

Permalink
nftables: Change target from newnftables to nftables in sample policies.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 638674484
  • Loading branch information
ivucica authored and Capirca Team committed May 30, 2024
1 parent 95c7301 commit ff639f7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
4 changes: 2 additions & 2 deletions policies/pol/sample_nftables-mixed-multiple-headers-combo.pol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ term multi-proto-term {

header {
comment:: "Noverbose + custom priority policy example"
target:: newnftables mixed INPUT 400
target:: nftables mixed INPUT 400
}

term test-tcp-icmp {
Expand All @@ -31,7 +31,7 @@ term test-tcp-icmp {

header {
comment:: "Noverbose + custom priority policy example"
target:: newnftables mixed OUTPUT
target:: nftables mixed OUTPUT
}

term test-icmp {
Expand Down
29 changes: 13 additions & 16 deletions policies/pol/sample_nftables.pol
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,9 @@ term default-accept {
action:: accept
}

# TODO: move test-icmp-type-ip4-reject below, once targets have been changed
# from newnftables to nftables in a followup commit. Use of nftables means the
# terms do not show up in generated files.
term test-icmp-type-ip4-reject {
comment:: "IPv4 icmp-type - test reject action"
icmp-type:: router-advertisement
protocol:: icmp
action:: reject
}

header {
comment:: "Inbound traffic nftables policy example"
target:: newnftables inet INPUT
target:: nftables inet INPUT
}

term allow-anything {
Expand All @@ -33,7 +23,7 @@ term allow-anything {

header {
comment:: "2 Inbound traffic nftables policy example"
target:: newnftables inet INPUT ACCEPT
target:: nftables inet INPUT ACCEPT
}

term allow-anything {
Expand All @@ -42,7 +32,7 @@ term allow-anything {

header {
comment:: "Outbound dual-stack traffic nftables policy example"
target:: newnftables mixed OUTPUT
target:: nftables mixed OUTPUT
}

term default-deny {
Expand Down Expand Up @@ -72,7 +62,7 @@ term source-address-term {

header {
comment:: "Outbound IPv6 traffic nftables policy example"
target:: newnftables inet6 OUTPUT
target:: nftables inet6 OUTPUT
}

term default-deny {
Expand All @@ -81,7 +71,7 @@ term default-deny {

header {
comment:: "Priority outbound IPv6"
target:: newnftables inet6 OUTPUT 100
target:: nftables inet6 OUTPUT 100
}

term awesome-term {
Expand All @@ -103,7 +93,7 @@ term awesome-term3 {

header {
comment:: "This policy expected to test every combination of REQUIRED keywords."
target:: newnftables inet INPUT
target:: nftables inet INPUT
}

term test-icmp {
Expand All @@ -120,6 +110,13 @@ term test-icmp-type-ip4 {
action:: accept
}

term test-icmp-type-ip4-reject {
comment:: "IPv4 icmp-type - test reject action"
icmp-type:: router-advertisement
protocol:: icmp
action:: reject
}

term test-icmp-type-ip6 {
comment:: "IPv6 icmp-type test"
icmp-type:: multicast-listener-done router-solicit router-advertisement
Expand Down

0 comments on commit ff639f7

Please sign in to comment.