diff mbox series

[3/6] netlink: Add l_netlink_message_append_string

Message ID 20240823161553.479576-3-denkenz@gmail.com (mailing list archive)
State New
Headers show
Series [1/6] netlink: Add l_netlink_iter | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success

Commit Message

Denis Kenzior Aug. 23, 2024, 4:15 p.m. UTC
---
 ell/netlink.h | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/ell/netlink.h b/ell/netlink.h
index f09d42043675..b51748195ca6 100644
--- a/ell/netlink.h
+++ b/ell/netlink.h
@@ -10,6 +10,7 @@ 
 
 #include <stdbool.h>
 #include <stdint.h>
+#include <string.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -119,6 +120,14 @@  static inline int l_netlink_message_append_mac(struct l_netlink_message *message
 	return l_netlink_message_append(message, type, mac, 6);
 }
 
+static inline int l_netlink_message_append_string(
+					struct l_netlink_message *message,
+					uint16_t type,
+					const char *str)
+{
+	return l_netlink_message_append(message, type, str, strlen(str) + 1);
+}
+
 struct l_netlink_attr {
 	const struct nlattr *data;
 	uint32_t len;