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
21 lines
504 B
Makefile
21 lines
504 B
Makefile
.PATH: ${SRCTOP}/sys/netlink
|
|
KMOD= netlink
|
|
|
|
SRCS = netlink_module.c netlink_domain.c netlink_io.c \
|
|
netlink_message_writer.c netlink_generic.c \
|
|
netlink_route.c route/iface.c route/iface_drivers.c route/neigh.c \
|
|
route/nexthop.c route/rt.c
|
|
SRCS+= opt_inet.h opt_inet6.h opt_route.h opt_netlink.h
|
|
|
|
CFLAGS+= -DNETLINK_MODULE
|
|
|
|
EXPORT_SYMS=
|
|
EXPORT_SYMS+= nlmsg_get_chain_writer
|
|
EXPORT_SYMS+= nlmsg_refill_buffer
|
|
EXPORT_SYMS+= nlmsg_end
|
|
EXPORT_SYMS+= nlmsg_flush
|
|
|
|
EXPORT_SYMS= YES
|
|
|
|
.include <bsd.kmod.mk>
|