* License as published by the Free Software Foundation version 2.1
* of the License.
*
- * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
+ * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch>
*/
#ifndef NETLINK_ATTR_H_
extern int nla_nest_end(struct nl_msg *, struct nlattr *);
extern int nla_parse_nested(struct nlattr **, int, struct nlattr *,
struct nla_policy *);
+extern int nla_is_nested(struct nlattr *);
/**
* @name Attribute Construction (Exception Based)
* License as published by the Free Software Foundation version 2.1
* of the License.
*
- * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
+ * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch>
*/
#include <netlink-private/netlink.h>
return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy);
}
+/**
+ * Return true if attribute has NLA_F_NESTED flag set
+ * @arg attr Netlink attribute
+ *
+ * @return True if attribute has NLA_F_NESTED flag set, oterhwise False.
+ */
+int nla_is_nested(struct nlattr *attr)
+{
+ return !!(nla_type(attr) & NLA_F_NESTED);
+}
+
/** @} */
/** @} */