diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-06-12 21:51:50 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-06-30 10:35:26 +0200 |
commit | 84e1001541151da71bae2137e2a1c254b5a3b89f (patch) | |
tree | 464c7eeb7932d1cb378a1aaeb9691a95f4e24bae /src/libsystemd/sd-netlink/netlink-socket.c | |
parent | test-lib*-sym: print symbols names in addition to addresses (diff) | |
download | systemd-84e1001541151da71bae2137e2a1c254b5a3b89f.tar.xz systemd-84e1001541151da71bae2137e2a1c254b5a3b89f.zip |
libsystemd: export sd-netlink
It was added originally in 65f568bbeb9b8c70200e44c19a797df3a0bfd485. The API is
has stabilized pretty much, and generally follows the usual style for
libsystemd. We've held it as a public-but-private library for almost 10 years,
let's export it.
sd_netlink_sendv() and sd_nfnl_nft_*() are excluded.
libsystemd.so seems to grow by 12k.
Diffstat (limited to 'src/libsystemd/sd-netlink/netlink-socket.c')
-rw-r--r-- | src/libsystemd/sd-netlink/netlink-socket.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-socket.c b/src/libsystemd/sd-netlink/netlink-socket.c index 7197cb4daa..70f5b85a54 100644 --- a/src/libsystemd/sd-netlink/netlink-socket.c +++ b/src/libsystemd/sd-netlink/netlink-socket.c @@ -17,16 +17,6 @@ #include "socket-util.h" #include "util.h" -int socket_open(int family) { - int fd; - - fd = socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, family); - if (fd < 0) - return -errno; - - return fd_move_above_stdio(fd); -} - static int broadcast_groups_get(sd_netlink *nl) { _cleanup_free_ uint32_t *groups = NULL; socklen_t len = 0, old_len; @@ -192,32 +182,6 @@ int socket_write_message(sd_netlink *nl, sd_netlink_message *m) { return k; } -int socket_writev_message(sd_netlink *nl, sd_netlink_message **m, size_t msgcount) { - _cleanup_free_ struct iovec *iovs = NULL; - ssize_t k; - - assert(nl); - assert(m); - assert(msgcount > 0); - - iovs = new(struct iovec, msgcount); - if (!iovs) - return -ENOMEM; - - for (size_t i = 0; i < msgcount; i++) { - assert(m[i]->hdr); - assert(m[i]->hdr->nlmsg_len > 0); - - iovs[i] = IOVEC_MAKE(m[i]->hdr, m[i]->hdr->nlmsg_len); - } - - k = writev(nl->fd, iovs, msgcount); - if (k < 0) - return -errno; - - return k; -} - static int socket_recv_message(int fd, struct iovec *iov, uint32_t *ret_mcast_group, bool peek) { union sockaddr_union sender; CMSG_BUFFER_TYPE(CMSG_SPACE(sizeof(struct nl_pktinfo))) control; |