NetworkManager/src/libnm-platform
Thomas Haller f96fbc8ebe
platform/netlink: combine nl_socket_alloc() and nl_connect()
Create and use new nl_socket_new().

nl_socket_alloc() really does nothing but allocating the struct and
initializing the fd to -1. In all cases, we want to call nl_connect()
right after.

Combine the two. Then we also cannot  have a "struct nl_sock" without a
valid fd. This means several error checks can be dropped.

Note that former nl_connect() did several things at once. Maybe, for
more flexibility one would need to tweak what should be done there.
For now that is not necessary. In any case, if we need more flexibility,
then we would control what nl_connect() (now nl_socket_new()) does, and not
the split between nl_socket_alloc() and nl_connect().
2022-06-17 19:40:20 +02:00
..
tests platform/netlink: combine nl_socket_alloc() and nl_connect() 2022-06-17 19:40:20 +02:00
wifi wifi: ignore disabled frequencies 2022-03-14 08:50:28 +01:00
wpan format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
meson.build platform: rename "nmp-route-manager.h" to "nmp-rules-manager.h" 2022-02-09 19:13:03 +01:00
nm-linux-platform.c platform/netlink: combine nl_socket_alloc() and nl_connect() 2022-06-17 19:40:20 +02:00
nm-linux-platform.h platform: allow disabling caching of tc objects 2021-09-20 13:27:16 +02:00
nm-netlink.c platform/netlink: combine nl_socket_alloc() and nl_connect() 2022-06-17 19:40:20 +02:00
nm-netlink.h platform/netlink: combine nl_socket_alloc() and nl_connect() 2022-06-17 19:40:20 +02:00
nm-platform-private.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-platform-utils.c platform: make "now" timestamp an in/out parameter to nmp_utils_lifetime_get() 2022-04-08 15:59:48 +02:00
nm-platform-utils.h platform: make "now" timestamp an in/out parameter to nmp_utils_lifetime_get() 2022-04-08 15:59:48 +02:00
nm-platform.c platform: drop redundant check for plen in nm_platform_ip4_address_generate_device_route() 2022-05-24 10:53:59 +02:00
nm-platform.h platform: avoid struct alignment issue for NMPlatformIP4Address 2022-05-19 16:11:34 +02:00
nmp-base.h platform: make NMPlatformVTableAddress struct smaller and pack NMPObjectType 2022-04-08 15:59:48 +02:00
nmp-netns.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nmp-netns.h build: move "shared/nm-platform" to "src/libnm-platform" 2021-02-24 12:48:17 +01:00
nmp-object.c all: use "NM_UTILS_TO_STRING_BUFFER_SIZE" macro 2022-04-08 15:59:49 +02:00
nmp-object.h l3cfg: drop NM_L3_CFG_COMMIT_TYPE_ASSUME and assume_config_once 2022-04-28 10:48:56 +02:00
nmp-route-manager.c all: avoid using global string buffer for to-string methods 2022-04-08 15:59:49 +02:00
nmp-route-manager.h platform: improve way to prune dirty route-manager entries 2022-02-09 19:13:05 +01:00
README.md platform: support IPv6 mulitpath routes and fix cache inconsistency 2022-02-16 09:59:49 +01:00

libnm-platform

A static helper library that provides NMPlatform and other utils. This is NetworkManager's internal netlink library, but also contains helpers for sysfs, ethtool and other kernel APIs.

NMPlaform is also a cache of objects of the netlink API: NMPCache and NMPObject. These objects are used throughout NetworkManager also for generally tracking information about these types. For example, NMPlatformIP4Address (the public part of a certain type of NMPObject) is not only used to track platform addresses from netlink in the cache, but to track information about IPv4 addresses in general.

This depends on the following helper libraries