freebsd-dev/sys/net
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
..
altq net: remove stale altq_input reference 2022-09-07 10:03:12 +00:00
route netlink: add netlink support 2022-10-01 14:15:35 +00:00
bpf_buffer.c
bpf_buffer.h
bpf_filter.c bpf(3): Grammar fix for a source code comment 2022-09-04 17:30:05 +02:00
bpf_jitter.c
bpf_jitter.h
bpf_zerocopy.c
bpf_zerocopy.h
bpf.c bpf: Fix BIOCPROMISC locking 2022-08-05 16:26:34 -04:00
bpf.h bpf: Correct a comment 2022-06-20 12:48:13 -04:00
bpfdesc.h bpf: Add an ioctl to set the VLAN Priority on packets sent by bpf 2021-07-26 23:13:31 +02:00
bridgestp.c
bridgestp.h
debugnet_inet.c debugnet: Fix false-positive assertions for dp_state 2021-07-28 16:34:14 -07:00
debugnet_int.h
debugnet.c debugnet: Fix an error handling bug in the DDB command tokenizer 2022-06-16 10:05:10 -04:00
debugnet.h debugnet: Fix a typo in a source code comment 2022-08-07 16:07:01 +02:00
dlt.h net(4): Fix a typo in a source code comment 2022-04-02 14:57:06 +02:00
ethernet.h net(3): Fix a typo in a source code comment 2022-04-02 10:53:40 +02:00
firewire.h
ieee8023ad_lacp.c lacp: Remove racy kassert 2022-06-13 11:32:10 -04:00
ieee8023ad_lacp.h lacp: short timeout erroneously declares link-flapping 2022-04-27 12:41:30 -07:00
ieee_oui.h Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
if_arp.h
if_bridge.c if_clone: migrate some consumers to the new KPI. 2022-09-22 12:30:09 +00:00
if_bridgevar.h net: make if_bridgevar.h self-contained 2021-12-17 12:38:35 +01:00
if_clone.c if_clone: add ifc_link_ifp() / ifc_unlink_ifp() to the KPI 2022-09-24 19:42:42 +00:00
if_clone.h if_clone: add ifc_link_ifp() / ifc_unlink_ifp() to the KPI 2022-09-24 19:42:42 +00:00
if_dead.c Add a switch structure for send tags. 2021-09-14 11:43:41 -07:00
if_disc.c routing: Allow using IPv6 next-hops for IPv4 routes (RFC 5549). 2021-08-22 22:56:08 +00:00
if_dl.h
if_edsc.c
if_enc.c
if_enc.h
if_epair.c if_epair: refactor interface creation and enqueue code. 2022-09-27 13:34:19 +00:00
if_ethersubr.c ether_resolve_addr: eh is only used for INET or INET6. 2022-04-13 16:08:21 -07:00
if_fwsubr.c routing: Allow using IPv6 next-hops for IPv4 routes (RFC 5549). 2021-08-22 22:56:08 +00:00
if_gif.c if_gif: fix vnet shutdown panic 2021-11-08 12:00:00 +01:00
if_gif.h
if_gre.c routing: Allow using IPv6 next-hops for IPv4 routes (RFC 5549). 2021-08-22 22:56:08 +00:00
if_gre.h
if_infiniband.c infiniband_resolve_addr: ih is only used for INET or INET6. 2022-04-13 16:08:21 -07:00
if_ipsec.c Use network epoch to protect local IPv4 addresses hash. 2021-10-22 14:40:53 -07:00
if_ipsec.h
if_lagg.c if_clone: migrate some consumers to the new KPI. 2022-09-22 12:30:09 +00:00
if_lagg.h lagg: fix lagg ifioctl after SIOCSIFCAPNV 2022-07-28 10:39:00 -04:00
if_llatbl.c if_llatbl: Fix a typo in a debug statement 2022-06-04 15:22:09 +02:00
if_llatbl.h netinet6: Fix mbuf leak in NDP 2022-05-31 21:06:14 +00:00
if_llc.h
if_loop.c if_clone: migrate some consumers to the new KPI. 2022-09-22 12:30:09 +00:00
if_me.c Use network epoch to protect local IPv4 addresses hash. 2021-10-22 14:40:53 -07:00
if_media.c
if_media.h
if_mib.c ifnet: make V_if_index static to if.c 2021-12-06 09:32:31 -08:00
if_mib.h
if_ovpn.c if_ovpn: fix address family check when traffic class bits are set 2022-09-26 13:54:20 +02:00
if_ovpn.h ovpn: Introduce OpenVPN DCO support 2022-06-28 11:33:10 +02:00
if_pflog.h pflog: align header to 4 bytes, not 8 2022-02-01 18:17:44 +01:00
if_pfsync.h pf: make if_pfsync.h self-contained 2021-12-17 12:38:35 +01:00
if_stf.c if_clone: migrate some consumers to the new KPI. 2022-09-22 12:30:09 +00:00
if_stf.h if_stf: make if_stf.h self-contained 2021-12-17 12:38:34 +01:00
if_tap.h
if_tun.h
if_tuntap.c if_clone: migrate some consumers to the new KPI. 2022-09-22 12:30:09 +00:00
if_types.h net(3): Fix a typo in a source code comment 2022-04-02 09:41:10 +02:00
if_var.h ifp: add if_setdescr() / if_freedesrt() methods 2022-09-24 19:42:42 +00:00
if_vlan_var.h vlan: deduplicate bpf_setpcp() and pf_ieee8021q_setpcp() 2021-07-26 23:13:31 +02:00
if_vlan.c if_clone: migrate some consumers to the new KPI. 2022-09-22 12:30:09 +00:00
if_vxlan.c if_vxlan(4): Check the size of data available in mbuf before using them 2022-09-30 09:56:15 +02:00
if_vxlan.h
if.c ifp: add if_setdescr() / if_freedesrt() methods 2022-09-24 19:42:42 +00:00
if.h arp: Implement sticky ARP mode for interfaces. 2022-05-27 12:41:30 +00:00
ifdi_if.m
iflib_clone.c Create wrapper for Giant taken for newbus 2021-12-09 17:04:45 -07:00
iflib_private.h
iflib.c Fix unused variable warning in iflib.c 2022-07-21 21:19:39 +02:00
iflib.h iflib: Allow drivers to determine which queue to TX on 2022-01-24 18:22:02 -08:00
ifq.h
infiniband.h
mp_ring.c
mp_ring.h
mppc.h
mppcc.c
mppcd.c
netisr_internal.h
netisr.c netisr(9): Fix a typo in a source code comment 2022-09-03 15:04:15 +02:00
netisr.h
netmap_legacy.h
netmap_user.h netmap: fix refcount bug in netmap allocator 2022-03-06 16:39:16 +00:00
netmap_virt.h
netmap.h
paravirt.h
pfil.c net: add pfil_mbuf_{in,out} 2022-09-08 16:20:43 +00:00
pfil.h net: add pfil_mbuf_{in,out} 2022-09-08 16:20:43 +00:00
pfkeyv2.h
pfvar.h pfsync: replace struct pfsync_pkt with int flags 2022-08-22 23:46:50 +02:00
ppp_defs.h
radix.c net: constantify radix.c functions 2022-08-01 07:32:40 +00:00
radix.h net: constantify radix.c functions 2022-08-01 07:32:40 +00:00
rndis.h
route.c netlink: add netlink support 2022-10-01 14:15:35 +00:00
route.h protosw: retire pr_slowtimo and pr_fasttimo 2022-08-17 11:50:31 -07:00
rss_config.c Revert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816" 2021-12-02 14:45:04 -08:00
rss_config.h
rtsock.c netlink: add netlink support 2022-10-01 14:15:35 +00:00
sff8436.h
sff8472.h
slcompress.c
slcompress.h
toeplitz.c
toeplitz.h
vnet.c ddb: annotate some commands with DB_CMD_MEMSAFE 2022-07-18 22:06:09 +00:00
vnet.h IPv4: experimental changes to allow net 0/8, 240/4, part of 127/8 2022-07-13 09:46:05 -05:00