summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-rtnl/rtnl-message.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd/sd-rtnl/rtnl-message.c')
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-message.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index dd3a8fb1d2..fca1ff667a 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -876,6 +876,51 @@ int sd_rtnl_message_read_u32(sd_rtnl_message *m, unsigned short type, uint32_t *
return 0;
}
+int sd_rtnl_message_read_ether_addr(sd_rtnl_message *m, unsigned short type, struct ether_addr *data) {
+ int r;
+ void *attr_data;
+
+ assert_return(data, -EINVAL);
+
+ r = rtnl_message_read_internal(m, type, &attr_data);
+ if(r < 0)
+ return r;
+
+ memcpy(data, attr_data, sizeof(struct ether_addr));
+
+ return 0;
+}
+
+int sd_rtnl_message_read_in_addr(sd_rtnl_message *m, unsigned short type, struct in_addr *data) {
+ int r;
+ void *attr_data;
+
+ assert_return(data, -EINVAL);
+
+ r = rtnl_message_read_internal(m, type, &attr_data);
+ if(r < 0)
+ return r;
+
+ memcpy(data, attr_data, sizeof(struct in_addr));
+
+ return 0;
+}
+
+int sd_rtnl_message_read_in6_addr(sd_rtnl_message *m, unsigned short type, struct in6_addr *data) {
+ int r;
+ void *attr_data;
+
+ assert_return(data, -EINVAL);
+
+ r = rtnl_message_read_internal(m, type, &attr_data);
+ if(r < 0)
+ return r;
+
+ memcpy(data, attr_data, sizeof(struct in6_addr));
+
+ return 0;
+}
+
int sd_rtnl_message_exit_container(sd_rtnl_message *m) {
assert_return(m, -EINVAL);
assert_return(m->sealed, -EINVAL);