diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-08-12 01:41:42 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-08-12 01:54:40 +0200 |
commit | ee8c45689526ca973407cbb77bce7b96a062c40b (patch) | |
tree | 789e44a352ce3a0a5a88af6339117e8deaff0950 /src/libsystemd/sd-rtnl/rtnl-message.c | |
parent | 1cb5d1f31909c731d93568eb4838cb86e033d783 (diff) |
networkd: add minimal client tool "networkd" to query network status
In the long run this should become a full fledged client to networkd
(but not before networkd learns bus support). For now, just pull
interesting data out of networkd, udev, and rtnl and present it to the
user, in a simple but useful output.
Diffstat (limited to 'src/libsystemd/sd-rtnl/rtnl-message.c')
-rw-r--r-- | src/libsystemd/sd-rtnl/rtnl-message.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c index c50d0ea982..1f596ca10c 100644 --- a/src/libsystemd/sd-rtnl/rtnl-message.c +++ b/src/libsystemd/sd-rtnl/rtnl-message.c @@ -465,6 +465,21 @@ int sd_rtnl_message_link_get_flags(sd_rtnl_message *m, unsigned *flags) { return 0; } +int sd_rtnl_message_link_get_type(sd_rtnl_message *m, unsigned *type) { + struct ifinfomsg *ifi; + + assert_return(m, -EINVAL); + assert_return(m->hdr, -EINVAL); + assert_return(rtnl_message_type_is_link(m->hdr->nlmsg_type), -EINVAL); + assert_return(type, -EINVAL); + + ifi = NLMSG_DATA(m->hdr); + + *type = ifi->ifi_type; + + return 0; +} + /* If successful the updated message will be correctly aligned, if unsuccessful the old message is untouched. */ static int add_rtattr(sd_rtnl_message *m, unsigned short type, const void *data, size_t data_length) { |