diff options
author | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2022-12-03 17:10:50 +0000 |
---|---|---|
committer | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2022-12-09 11:20:07 +0000 |
commit | 1bcd230f9508b3c917f26be4b905e4b5141decea (patch) | |
tree | 57c7ffb469b0972e3ed6cdb48cc4d42d7e82c482 /sys/net/route/route_ctl.h | |
parent | 0ca90ed42a495074392a8316ae58a9bbf4eda01a (diff) | |
download | src-1bcd230f9508b3c917f26be4b905e4b5141decea.tar.gz src-1bcd230f9508b3c917f26be4b905e4b5141decea.zip |
netlink: add interface notification on link status / flags change.
* Add link-state change notifications by subscribing to ifnet_link_event.
In the Linux netlink model, link state is reported in 2 places: first is
the IFLA_OPERSTATE, which stores state per RFC2863.
The second is an IFF_LOWER_UP interface flag. As many applications rely
on the latter, reserve 1 bit from if_flags, named as IFF_NETLINK_1.
This flag is mapped to IFF_LOWER_UP in the netlink headers. This is done
to avoid making applications think this flag is actually
supported / presented in non-netlink outputs.
* Add flag change notifications, by hooking into rt_ifmsg().
In the netlink model, notification should include the bitmask for the
change flags. Update rt_ifmsg() to include such bitmask.
Differential Revision: https://reviews.freebsd.org/D37597
Diffstat (limited to 'sys/net/route/route_ctl.h')
-rw-r--r-- | sys/net/route/route_ctl.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/net/route/route_ctl.h b/sys/net/route/route_ctl.h index d150da6264d4..e8560e681ddb 100644 --- a/sys/net/route/route_ctl.h +++ b/sys/net/route/route_ctl.h @@ -191,8 +191,10 @@ void rib_notify(struct rib_head *rnh, enum rib_subscription_type type, /* Event bridge */ typedef void route_event_f(uint32_t fibnum, const struct rib_cmd_info *rc); +typedef void ifmsg_event_f(struct ifnet *ifp, int if_flags_mask); struct rtbridge{ route_event_f *route_f; + ifmsg_event_f *ifmsg_f; }; extern struct rtbridge *rtsock_callback_p; extern struct rtbridge *netlink_callback_p; |