summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@gmail.com>2015-11-28 08:01:06 +0530
committerSusant Sahani <ssahani@gmail.com>2016-01-19 12:17:54 +0530
commit17af840b1df9ca3664b96bbc2414702b47658049 (patch)
tree09cde8839a7987d9f1330816b2f2293b3d3f1918 /src/libsystemd
parentbcbd1d0cd5a1e6ff068f251c99ed7905223fed67 (diff)
sd-netlink introduce API to add any size and type
Now we dont have any public API that will support any size . sd_netlink_message_append_data will support this.
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-netlink/netlink-message.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-message.c b/src/libsystemd/sd-netlink/netlink-message.c
index 50792bc4a3..b1b3bccc44 100644
--- a/src/libsystemd/sd-netlink/netlink-message.c
+++ b/src/libsystemd/sd-netlink/netlink-message.c
@@ -342,6 +342,19 @@ int sd_netlink_message_append_u32(sd_netlink_message *m, unsigned short type, ui
return 0;
}
+int sd_netlink_message_append_data(sd_netlink_message *m, unsigned short type, const void *data, size_t len) {
+ int r;
+
+ assert_return(m, -EINVAL);
+ assert_return(!m->sealed, -EPERM);
+
+ r = add_rtattr(m, type, &data, len);
+ if (r < 0)
+ return r;
+
+ return 0;
+}
+
int sd_netlink_message_append_in_addr(sd_netlink_message *m, unsigned short type, const struct in_addr *data) {
int r;