version 1.3, 2022/07/11 21:26:34
|
version 1.4, 2022/08/13 18:08:19
|
Line 1
|
Line 1
|
diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c |
diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c |
index 4612b32c139..2cb25981d17 100644 | index 4612b32c139..af552f20aa7 100644 |
--- a/sys/netinet/libalias/alias_db.c |
--- a/sys/netinet/libalias/alias_db.c |
+++ b/sys/netinet/libalias/alias_db.c |
+++ b/sys/netinet/libalias/alias_db.c |
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); |
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); |
Line 10 index 4612b32c139..2cb25981d17 100644
|
Line 10 index 4612b32c139..2cb25981d17 100644
|
#else |
#else |
#include "alias.h" |
#include "alias.h" |
#include "alias_local.h" |
#include "alias_local.h" |
@@ -63,6 +64,17 @@ __FBSDID("$FreeBSD$"); | @@ -63,6 +64,21 @@ __FBSDID("$FreeBSD$"); |
|
|
#include "alias_db.h" |
#include "alias_db.h" |
|
|
+#ifndef V_hook_alias |
+#ifndef V_hook_alias |
+typedef int (*ipfw_hook_t)(const void *arg); | +typedef int (*ipfw_hook_t)(const void *arg, const void *extdata); |
+/* callback hooks for notify on update of internal states and aliases */ |
+/* callback hooks for notify on update of internal states and aliases */ |
+VNET_DECLARE(ipfw_hook_t, hook_state); |
+VNET_DECLARE(ipfw_hook_t, hook_state); |
+#define V_hook_state VNET(hook_state) |
+#define V_hook_state VNET(hook_state) |
+VNET_DECLARE(ipfw_hook_t, hook_alias); |
+VNET_DECLARE(ipfw_hook_t, hook_alias); |
+#define V_hook_alias VNET(hook_alias) |
+#define V_hook_alias VNET(hook_alias) |
|
+VNET_DECLARE(ipfw_hook_t, sync_state); |
|
+#define V_sync_state VNET(sync_state) |
|
+VNET_DECLARE(ipfw_hook_t, sync_alias); |
|
+#define V_sync_alias VNET(sync_alias) |
+#endif |
+#endif |
+ |
+ |
+VNET_DEFINE(ipfw_hook_t, hook_alias) = NULL; |
+VNET_DEFINE(ipfw_hook_t, hook_alias) = NULL; |
Line 28 index 4612b32c139..2cb25981d17 100644
|
Line 32 index 4612b32c139..2cb25981d17 100644
|
static LIST_HEAD(, libalias) instancehead = LIST_HEAD_INITIALIZER(instancehead); |
static LIST_HEAD(, libalias) instancehead = LIST_HEAD_INITIALIZER(instancehead); |
int LibAliasTime; |
int LibAliasTime; |
|
|
@@ -708,6 +720,9 @@ AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, | @@ -708,6 +724,10 @@ AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, |
if (la->packetAliasMode & PKT_ALIAS_LOG) |
if (la->packetAliasMode & PKT_ALIAS_LOG) |
ShowAliasStats(la); |
ShowAliasStats(la); |
|
|
|
+#ifdef IPFW_INTERNAL |
+ if (lnk && V_hook_alias) |
+ if (lnk && V_hook_alias) |
+ V_hook_alias(lnk); | + V_hook_alias(lnk, NULL); |
+ | +#endif |
return (lnk); |
return (lnk); |
} |
} |
|
|