freebsd-dev/sys/net/route
Alexander V. Chernikov 7e5bf68495 netlink: add netlink support
Netlinks is a communication protocol currently used in Linux kernel to modify,
 read and subscribe for nearly all networking state. Interfaces, addresses, routes,
 firewall, fibs, vnets, etc are controlled via netlink.
It is async, TLV-based protocol, providing 1-1 and 1-many communications.

The current implementation supports the subset of NETLINK_ROUTE
family. To be more specific, the following is supported:
* Dumps:
 - routes
 - nexthops / nexthop groups
 - interfaces
 - interface addresses
 - neighbors (arp/ndp)
* Notifications:
 - interface arrival/departure
 - interface address arrival/departure
 - route addition/deletion
* Modifications:
 - adding/deleting routes
 - adding/deleting nexthops/nexthops groups
 - adding/deleting neghbors
 - adding/deleting interfaces (basic support only)
* Rtsock interaction
 - route events are bridged both ways

The implementation also supports the NETLINK_GENERIC family framework.

Implementation notes:
Netlink is implemented via loadable/unloadable kernel module,
 not touching many kernel parts.
Each netlink socket uses dedicated taskqueue to support async operations
 that can sleep, such as interface creation. All message processing is
 performed within these taskqueues.

Compatibility:
Most of the Netlink data models specified above maps to FreeBSD concepts
 nicely. Unmodified ip(8) binary correctly works with
interfaces, addresses, routes, nexthops and nexthop groups. Some
software such as net/bird require header-only modifications to compile
and work with FreeBSD netlink.

Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D36002
MFC after:	2 months
2022-10-01 14:15:35 +00:00
..
fib_algo.c fib_algo: set vnet when destroying algo instance 2022-08-06 12:51:22 +00:00
fib_algo.h Fib algo: extend KPI by allowing algo to set datapath pointers. 2021-04-18 16:12:12 +01:00
nhgrp_ctl.c routing: constantify nh/nhg argument in <nhop|nhgrp>_get_origin(). 2022-09-08 10:21:25 +00:00
nhgrp_var.h routing: add abitity to set the protocol that installed route/nexthop. 2022-09-08 09:18:32 +00:00
nhgrp.c routing: improve multiline debug 2022-08-29 15:14:49 +00:00
nhop_ctl.c routing: constantify nh/nhg argument in <nhop|nhgrp>_get_origin(). 2022-09-08 10:21:25 +00:00
nhop_utils.c Remove unused nhop_ref_any() function. 2020-09-20 21:32:52 +00:00
nhop_utils.h routing: extend nhop(9) kpi 2022-08-29 14:46:03 +00:00
nhop_var.h routing: add abitity to set the protocol that installed route/nexthop. 2022-09-08 09:18:32 +00:00
nhop.c routing: remove duplicate error message after 5c23343b8c. 2022-08-04 09:53:58 +00:00
nhop.h routing: constantify nh/nhg argument in <nhop|nhgrp>_get_origin(). 2022-09-08 10:21:25 +00:00
route_ctl.c routing: add abitity to set the protocol that installed route/nexthop. 2022-09-08 09:18:32 +00:00
route_ctl.h netlink: add netlink support 2022-10-01 14:15:35 +00:00
route_ddb.c ddb: use _FLAGS command macros where appropriate 2022-07-05 11:56:55 -03:00
route_debug.h routing: allow logging framework to be used outside of the subsystem 2022-09-05 10:44:27 +00:00
route_helpers.c routing: constantify @rc in rib_decompose_notification(). 2022-08-29 18:12:24 +00:00
route_ifaddrs.c Revert "routing: install prefix and loopback routes using new nhop-based KPI." 2022-08-29 16:20:42 +00:00
route_rtentry.c routing: extend nhop(9) kpi 2022-08-29 14:46:03 +00:00
route_subscription.c routing: move rtentry and subscription code out of route_ctl.c 2022-08-10 18:56:01 +00:00
route_tables.c domains: use queue(9) SLIST for linked list of domains 2022-08-29 19:15:01 -07:00
route_temporal.c routing: move route expiration time to its nexthop 2022-08-01 07:26:53 +00:00
route_var.h routing: extend nhop(9) kpi 2022-08-29 14:46:03 +00:00