19e43c16 | 27-Mar-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
netlink: add netlink KPI to the kernel by default
This change does the following:
Base Netlink KPIs (ability to register the family, parse and/or write a Netlink message) are always present in the
netlink: add netlink KPI to the kernel by default
This change does the following:
Base Netlink KPIs (ability to register the family, parse and/or write a Netlink message) are always present in the kernel. Specifically, * Implementation of genetlink family/group registration/removal, some base accessors (netlink_generic_kpi.c, 260 LoC) are compiled in unconditionally. * Basic TLV parser functions (netlink_message_parser.c, 507 LoC) are compiled in unconditionally. * Glue functions (netlink<>rtsock), malloc/core sysctl definitions (netlink_glue.c, 259 LoC) are compiled in unconditionally. * The rest of the KPI _functions_ are defined in the netlink_glue.c, but their implementation calls a pointer to either the stub function or the actual function, depending on whether the module is loaded or not.
This approach allows to have only 1k LoC out of ~3.7k LoC (current sys/netlink implementation) in the kernel, which will not grow further. It also allows for the generic netlink kernel customers to load successfully without requiring Netlink module and operate correctly once Netlink module is loaded.
Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D39269
show more ...
|
595d23f7 | 09-Mar-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
netlink: add snl(3) default parsers for routes and links.
This change adds the "default" parsers of _all_ route/link attributes exported by the kernel. It removes the need to declare similar parser
netlink: add snl(3) default parsers for routes and links.
This change adds the "default" parsers of _all_ route/link attributes exported by the kernel. It removes the need to declare similar parsers in the userland applications, simplifying their logic.
Differential Revision: https://reviews.freebsd.org/D38979 MFC after: 2 weeks
show more ...
|
90d62512 | 09-Mar-2023 |
Alexander V. Chernikov <melifaro@FreeBSD.org> |
netlink: add rtsock-compatible header to use with netlink snl(3).
Some routing socket defines (`RTM_` and `RTA_` ones) clash with the ones used by the the Netlink. As some rtsock definitions like i
netlink: add rtsock-compatible header to use with netlink snl(3).
Some routing socket defines (`RTM_` and `RTA_` ones) clash with the ones used by the the Netlink. As some rtsock definitions like interface flags or route flags are used in both netlink and rtsock, provide a convenient way to include those without running into the define collision.
Differential Revision: https://reviews.freebsd.org/D38982 MFC after: 2 weeks
show more ...
|