summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-netlink/netlink-message.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-07-29 20:40:17 +0200
committerTom Gundersen <teg@jklm.no>2015-07-29 20:40:17 +0200
commit1051d049a8a5811135d83a89a430c5be846866ca (patch)
tree2beeaf2cf85d1729da66fc725dc830ad42bcea84 /src/libsystemd/sd-netlink/netlink-message.c
parentc2570b3de2430b06f545e78ff32b97503f81f09f (diff)
parent8b414e52d14d1e6bc02db65d0de9ad8e0c5017da (diff)
Merge pull request #764 from ssahani/vxlan1
networkd: Add VXLAN Netlink attributes
Diffstat (limited to 'src/libsystemd/sd-netlink/netlink-message.c')
-rw-r--r--src/libsystemd/sd-netlink/netlink-message.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-message.c b/src/libsystemd/sd-netlink/netlink-message.c
index b0ed2f2882..3ba62a6be9 100644
--- a/src/libsystemd/sd-netlink/netlink-message.c
+++ b/src/libsystemd/sd-netlink/netlink-message.c
@@ -262,6 +262,24 @@ int sd_netlink_message_append_string(sd_netlink_message *m, unsigned short type,
return 0;
}
+int sd_netlink_message_append_flag(sd_netlink_message *m, unsigned short type) {
+ size_t size;
+ int r;
+
+ assert_return(m, -EINVAL);
+ assert_return(!m->sealed, -EPERM);
+
+ r = message_attribute_has_type(m, &size, type, NETLINK_TYPE_FLAG);
+ if (r < 0)
+ return r;
+
+ r = add_rtattr(m, type, NULL, 0);
+ if (r < 0)
+ return r;
+
+ return 0;
+}
+
int sd_netlink_message_append_u8(sd_netlink_message *m, unsigned short type, uint8_t data) {
int r;