path: root/include
diff options
authorPablo Neira Ayuso <>2010-04-30 12:29:17 +0200
committerPablo Neira Ayuso <>2010-04-30 12:29:17 +0200
commitd75ac4598f2f9472dd625d284b912d417b287e1e (patch)
tree7ea83040b33754bc96435d6e1166d5c89a225e6f /include
parentc1a946a824a7b870e06b9eff209ad12d11484d1a (diff)
add helpers to nest attributes
Based on code from Jozsef Kadlecsik and its ipset-5 implementation. Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'include')
1 files changed, 4 insertions, 0 deletions
diff --git a/include/libmnl/libmnl.h b/include/libmnl/libmnl.h
index 95167a3..d4bb7ed 100644
--- a/include/libmnl/libmnl.h
+++ b/include/libmnl/libmnl.h
@@ -85,6 +85,10 @@ extern void mnl_attr_put_u64(struct nlmsghdr *nlh, uint16_t type, uint64_t data)
extern void mnl_attr_put_str(struct nlmsghdr *nlh, uint16_t type, const void *data);
extern void mnl_attr_put_str_null(struct nlmsghdr *nlh, uint16_t type, const void *data);
+/* TLV attribute nesting */
+extern struct nlattr *mnl_attr_nest_start(struct nlmsghdr *nlh, uint16_t type);
+extern void mnl_attr_nest_end(struct nlmsghdr *nlh, struct nlattr *start);
/* TLV validation */
extern int mnl_attr_type_valid(const struct nlattr *attr, uint16_t maxtype);