firewall-util: introduce fw_ctx_get_reply_callback_count()

This commit is contained in:
Yu Watanabe
2023-12-01 14:36:30 +09:00
parent 4256379d99
commit b3a4f4f06d
2 changed files with 10 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
#include "firewall-util.h"
#include "firewall-util-private.h"
#include "log.h"
#include "netlink-util.h"
#include "string-table.h"
static const char * const firewall_backend_table[_FW_BACKEND_MAX] = {
@@ -90,6 +91,13 @@ FirewallContext *fw_ctx_free(FirewallContext *ctx) {
return mfree(ctx);
}
size_t fw_ctx_get_reply_callback_count(FirewallContext *ctx) {
if (!ctx || !ctx->nfnl)
return 0;
return netlink_get_reply_callback_count(ctx->nfnl);
}
int fw_add_masquerade(
FirewallContext **ctx,
bool add,

View File

@@ -15,6 +15,8 @@ FirewallContext *fw_ctx_free(FirewallContext *ctx);
DEFINE_TRIVIAL_CLEANUP_FUNC(FirewallContext *, fw_ctx_free);
size_t fw_ctx_get_reply_callback_count(FirewallContext *ctx);
int fw_add_masquerade(
FirewallContext **ctx,
bool add,