aboutsummaryrefslogtreecommitdiff
path: root/sys/netgraph/ng_bridge.h
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2020-01-05 19:14:16 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2020-01-05 19:14:16 +0000
commitaeaef7d59703c707d0f4c11c8e28ec4cf596a33a (patch)
tree654ab905a7b154fb94b812033590c12c3d0aa5a7 /sys/netgraph/ng_bridge.h
parentdd8a62f058e4b5536307fcac6ae70453a8662de8 (diff)
downloadsrc-aeaef7d59703c707d0f4c11c8e28ec4cf596a33a.tar.gz
src-aeaef7d59703c707d0f4c11c8e28ec4cf596a33a.zip
netgraph/ng_bridge: Reestablish old ABI
In order to be able to merge r353026 bring back support for the old cookie API for a transition period in 12.x releases (and possibly 13) before the old API can be removed again entirely. Suggested by: julian Submitted by: Lutz Donnerhacke (lutz donnerhacke.de) PR: 240787 Reviewed by: julian MFC after: 2 weeks X-MFC with: r353026 Differential Revision: https://reviews.freebsd.org/D21961
Notes
Notes: svn path=/head/; revision=356386
Diffstat (limited to 'sys/netgraph/ng_bridge.h')
-rw-r--r--sys/netgraph/ng_bridge.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/sys/netgraph/ng_bridge.h b/sys/netgraph/ng_bridge.h
index fa11bec9a26b..fa4736370e92 100644
--- a/sys/netgraph/ng_bridge.h
+++ b/sys/netgraph/ng_bridge.h
@@ -43,10 +43,24 @@
#ifndef _NETGRAPH_NG_BRIDGE_H_
#define _NETGRAPH_NG_BRIDGE_H_
+/*
+ * Support the older ABI based on fixed size tables.
+ * ABI is deprecated, to be removed in releases > 12
+ * Please note: There is no API support!
+ * You canno create new messages using the old API but messages conforming the
+ * old ABI are understood.
+ */
+#define NGM_BRIDGE_TABLE_ABI
+
/* Node type name and magic cookie */
#define NG_BRIDGE_NODE_TYPE "bridge"
#define NGM_BRIDGE_COOKIE 1569321993
+#ifdef NGM_BRIDGE_TABLE_ABI
+#define NGM_BRIDGE_COOKIE_TBL 967239368
+#define NG_BRIDGE_MAX_LINKS 32
+#endif /* NGM_BRIDGE_TABLE_ABI */
+
/* Hook names */
#define NG_BRIDGE_HOOK_LINK_PREFIX "link" /* append decimal integer */
#define NG_BRIDGE_HOOK_LINK_FMT "link%d" /* for use with printf(3) */
@@ -59,6 +73,13 @@ struct ng_bridge_config {
u_int32_t minStableAge; /* min time for a stable host */
};
+#ifdef NGM_BRIDGE_TABLE_ABI
+struct ng_bridge_config_tbl {
+ u_char ipfw[NG_BRIDGE_MAX_LINKS];
+ struct ng_bridge_config cfg;
+};
+#endif /* NGM_BRIDGE_TABLE_ABI */
+
/* Keep this in sync with the above structure definition */
#define NG_BRIDGE_CONFIG_TYPE_INFO { \
{ "debugLevel", &ng_parse_uint8_type }, \
@@ -115,6 +136,15 @@ struct ng_bridge_host {
u_int16_t staleness; /* seconds ago host last heard from */
};
+#ifdef NGM_BRIDGE_TABLE_ABI
+struct ng_bridge_host_tbl {
+ u_char addr[6]; /* ethernet address */
+ u_int16_t linkNum; /* link where addr can be found */
+ u_int16_t age; /* seconds ago entry was created */
+ u_int16_t staleness; /* seconds ago host last heard from */
+};
+#endif /* NGM_BRIDGE_TABLE_ABI */
+
/* external representation of the host */
struct ng_bridge_hostent {
u_char addr[6]; /* ethernet address */
@@ -145,6 +175,19 @@ struct ng_bridge_host_ary {
{ NULL } \
}
+#ifdef NGM_BRIDGE_TABLE_ABI
+struct ng_bridge_hostent_tbl {
+ u_char addr[6]; /* ethernet address */
+ u_int16_t linkNum; /* link where addr can be found */
+ u_int16_t age; /* seconds ago entry was created */
+ u_int16_t staleness; /* seconds ago host last heard from */
+};
+struct ng_bridge_host_tbl_ary {
+ u_int32_t numHosts;
+ struct ng_bridge_hostent_tbl hosts[];
+};
+#endif /* NGM_BRIDGE_TABLE_ABI */
+
/* Netgraph control messages */
enum {
NGM_BRIDGE_SET_CONFIG = 1, /* set node configuration */