2021-05-05 22:39:28 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2004 - 2016 Red Hat, Inc.
|
|
|
|
|
* Copyright (C) 2005 - 2008 Novell, Inc.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __NM_FIREWALL_UTILS_H__
|
|
|
|
|
#define __NM_FIREWALL_UTILS_H__
|
|
|
|
|
|
2021-05-06 16:50:25 +02:00
|
|
|
typedef enum {
|
|
|
|
|
NM_FIREWALL_BACKEND_UNKNOWN,
|
2021-05-12 12:02:33 +02:00
|
|
|
NM_FIREWALL_BACKEND_NONE,
|
2021-05-06 16:50:25 +02:00
|
|
|
NM_FIREWALL_BACKEND_IPTABLES,
|
|
|
|
|
NM_FIREWALL_BACKEND_NFTABLES,
|
|
|
|
|
} NMFirewallBackend;
|
|
|
|
|
|
|
|
|
|
NMFirewallBackend nm_firewall_utils_get_backend(void);
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-05-05 22:28:31 +02:00
|
|
|
typedef struct _NMFirewallConfig NMFirewallConfig;
|
2021-05-05 22:07:55 +02:00
|
|
|
|
2022-09-13 19:24:50 +02:00
|
|
|
NMFirewallConfig *nm_firewall_config_new_shared(const char *ip_iface, in_addr_t addr, guint8 plen);
|
2021-05-05 22:07:55 +02:00
|
|
|
|
2021-05-05 22:28:31 +02:00
|
|
|
void nm_firewall_config_free(NMFirewallConfig *self);
|
2021-05-05 22:07:55 +02:00
|
|
|
|
2025-03-25 14:00:53 +01:00
|
|
|
void nm_firewall_config_set_wg_rule(const char *ifname,
|
|
|
|
|
NMSettingIPConfig *ip_config,
|
|
|
|
|
int fwmark,
|
|
|
|
|
gboolean up);
|
2025-03-11 11:33:55 +01:00
|
|
|
|
2022-09-13 20:18:35 +02:00
|
|
|
void nm_firewall_config_apply_sync(NMFirewallConfig *self, gboolean up);
|
2021-05-05 22:07:55 +02:00
|
|
|
|
2022-09-15 08:56:19 +02:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void nm_firewall_nft_call(GBytes *stdin_buf,
|
|
|
|
|
GCancellable *cancellable,
|
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
|
gpointer callback_user_data);
|
|
|
|
|
|
|
|
|
|
gboolean nm_firewall_nft_call_finish(GAsyncResult *result, GError **error);
|
|
|
|
|
|
2022-09-13 20:17:20 +02:00
|
|
|
GBytes *nm_firewall_nft_stdio_mlag(gboolean up,
|
|
|
|
|
const char *bond_ifname,
|
|
|
|
|
const char *const *bond_ifnames_down,
|
|
|
|
|
const char *const *active_members,
|
2023-05-10 07:44:52 +02:00
|
|
|
const char *const *previous_members,
|
|
|
|
|
gboolean with_counters);
|
2022-09-13 20:17:20 +02:00
|
|
|
|
2021-05-05 22:39:28 +02:00
|
|
|
#endif /* __NM_FIREWALL_UTILS_H__ */
|