Skip to content

Commit b3a4f4f

Browse files
committed
firewall-util: introduce fw_ctx_get_reply_callback_count()
1 parent 4256379 commit b3a4f4f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/shared/firewall-util.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "firewall-util.h"
99
#include "firewall-util-private.h"
1010
#include "log.h"
11+
#include "netlink-util.h"
1112
#include "string-table.h"
1213

1314
static const char * const firewall_backend_table[_FW_BACKEND_MAX] = {
@@ -90,6 +91,13 @@ FirewallContext *fw_ctx_free(FirewallContext *ctx) {
9091
return mfree(ctx);
9192
}
9293

94+
size_t fw_ctx_get_reply_callback_count(FirewallContext *ctx) {
95+
if (!ctx || !ctx->nfnl)
96+
return 0;
97+
98+
return netlink_get_reply_callback_count(ctx->nfnl);
99+
}
100+
93101
int fw_add_masquerade(
94102
FirewallContext **ctx,
95103
bool add,

src/shared/firewall-util.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ FirewallContext *fw_ctx_free(FirewallContext *ctx);
1515

1616
DEFINE_TRIVIAL_CLEANUP_FUNC(FirewallContext *, fw_ctx_free);
1717

18+
size_t fw_ctx_get_reply_callback_count(FirewallContext *ctx);
19+
1820
int fw_add_masquerade(
1921
FirewallContext **ctx,
2022
bool add,

0 commit comments

Comments
 (0)