diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2020-10-26 16:22:13 +0100 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2020-10-28 14:44:43 +0100 |
commit | 4fc8a29a7e06debb65f4e2651a03804beb41f781 (patch) | |
tree | 86209a9c7d55c72cbd7d08f4e3cb874c53277ba8 /src/libsystemd/sd-netlink/netlink-util.h | |
parent | Merge pull request #17471 from keszybz/man-update-fedora-version (diff) | |
download | systemd-4fc8a29a7e06debb65f4e2651a03804beb41f781.tar.xz systemd-4fc8a29a7e06debb65f4e2651a03804beb41f781.zip |
sd-netlink: introduce netlink_message_{read,append}_hw_addr
Hardware addresses come in various shapes and sizes, these new functions
and accomapying data structures account for that instead of hard-coding
a hardware address to the 6 bytes of an ethernet MAC.
Diffstat (limited to '')
-rw-r--r-- | src/libsystemd/sd-netlink/netlink-util.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-util.h b/src/libsystemd/sd-netlink/netlink-util.h index 2768d5fdc4..8f6c06af6e 100644 --- a/src/libsystemd/sd-netlink/netlink-util.h +++ b/src/libsystemd/sd-netlink/netlink-util.h @@ -5,6 +5,7 @@ #include "sd-netlink.h" +#include "ether-addr-util.h" #include "in-addr-util.h" #include "ordered-set.h" #include "socket-util.h" @@ -100,9 +101,11 @@ int rtnl_log_create_error(int r); userdata, description); \ }) +int netlink_message_append_hw_addr(sd_netlink_message *m, unsigned short type, const hw_addr_data *data); int netlink_message_append_in_addr_union(sd_netlink_message *m, unsigned short type, int family, const union in_addr_union *data); int netlink_message_append_sockaddr_union(sd_netlink_message *m, unsigned short type, const union sockaddr_union *data); +int netlink_message_read_hw_addr(sd_netlink_message *m, unsigned short type, hw_addr_data *data); int netlink_message_read_in_addr_union(sd_netlink_message *m, unsigned short type, int family, union in_addr_union *data); void rtattr_append_attribute_internal(struct rtattr *rta, unsigned short type, const void *data, size_t data_length); |