summaryrefslogtreecommitdiffstats
path: root/src/shared/firewall-util.h
diff options
context:
space:
mode:
authorTopi Miettinen <toiwoton@gmail.com>2022-09-03 11:14:24 +0200
committerTopi Miettinen <toiwoton@gmail.com>2023-08-23 18:53:13 +0200
commit940965803ebb1cd6e417304141ea8650914c342e (patch)
treec363c64228cbcf569bb1f82cf84bddef1c6ce82a /src/shared/firewall-util.h
parentman/systemd: avoid duplicate variable name (diff)
downloadsystemd-940965803ebb1cd6e417304141ea8650914c342e.tar.xz
systemd-940965803ebb1cd6e417304141ea8650914c342e.zip
shared/firewall-util: parametrize table and set names
Parametrize table and set names for fw_nftables_add_masquerade_internal, rename to nft_set_element_op_iprange to reflect more general usage. Export and use nfproto_is_valid(). Remove also unused and obsolete NFPROTO_DECNET.
Diffstat (limited to 'src/shared/firewall-util.h')
-rw-r--r--src/shared/firewall-util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shared/firewall-util.h b/src/shared/firewall-util.h
index 7725a5e58d..d0e78beba8 100644
--- a/src/shared/firewall-util.h
+++ b/src/shared/firewall-util.h
@@ -29,3 +29,13 @@ int fw_add_local_dnat(
const union in_addr_union *remote,
uint16_t remote_port,
const union in_addr_union *previous_remote);
+
+int nft_set_element_modify_iprange(
+ FirewallContext *ctx,
+ bool add,
+ int nfproto,
+ int af,
+ const char *table,
+ const char *set,
+ const union in_addr_union *source,
+ unsigned int source_prefixlen);