aboutsummaryrefslogtreecommitdiff
path: root/sys/netgraph/ng_bridge.h
diff options
context:
space:
mode:
authorLutz Donnerhacke <donner@FreeBSD.org>2021-05-04 20:14:59 +0000
committerLutz Donnerhacke <donner@FreeBSD.org>2021-05-04 20:14:59 +0000
commitb1bd44732d8332930dc6a17092f47a201caff1ef (patch)
treeb6b1426216d9e40ba12a1cc8b004529c93d6eb2c /sys/netgraph/ng_bridge.h
parent36be84b96699310e0020e194f81fe8e4a6c3f787 (diff)
downloadsrc-b1bd44732d8332930dc6a17092f47a201caff1ef.tar.gz
src-b1bd44732d8332930dc6a17092f47a201caff1ef.zip
netgraph/ng_bridge: learn MACs via control message
Add a new control message to move ethernet addresses to a given link in ng_bridge(4). Send this message instead of doing the work directly. This decouples the read-only activity from the modification under a more strict writer lock. Decoupling the work is a prerequisite for multithreaded operation. Approved by: manpages (bcr), kp (earlier version) MFC: 3 weeks Differential Revision: https://reviews.freebsd.org/D28516
Diffstat (limited to 'sys/netgraph/ng_bridge.h')
-rw-r--r--sys/netgraph/ng_bridge.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/netgraph/ng_bridge.h b/sys/netgraph/ng_bridge.h
index 03541deceacd..12717d16ac7a 100644
--- a/sys/netgraph/ng_bridge.h
+++ b/sys/netgraph/ng_bridge.h
@@ -140,6 +140,16 @@ struct ng_bridge_host_ary {
{ NULL } \
}
+struct ng_bridge_move_host {
+ u_char addr[ETHER_ADDR_LEN]; /* ethernet address */
+ char hook[NG_HOOKSIZ]; /* link where addr can be found */
+};
+/* Keep this in sync with the above structure definition */
+#define NG_BRIDGE_MOVE_HOST_TYPE_INFO(entype) { \
+ { "addr", (entype) }, \
+ { "hook", &ng_parse_hookbuf_type }, \
+}
+
/* Netgraph control messages */
enum {
NGM_BRIDGE_SET_CONFIG = 1, /* set node configuration */
@@ -150,6 +160,7 @@ enum {
NGM_BRIDGE_GETCLR_STATS, /* atomically get & clear link stats */
NGM_BRIDGE_GET_TABLE, /* get link table */
NGM_BRIDGE_SET_PERSISTENT, /* set persistent mode */
+ NGM_BRIDGE_MOVE_HOST, /* move a host to a link */
};
#endif /* _NETGRAPH_NG_BRIDGE_H_ */