table: Avoid segmentation fault when printing an empty cell in JSON format.
[sliver-openvswitch.git] / lib / netlink.h
index b7a87c6..7eced42 100644 (file)
@@ -184,6 +184,11 @@ struct nl_policy
     bool optional;
 };
 
+#define NL_POLICY_FOR(TYPE) \
+    .type = NL_A_UNSPEC, .min_len = sizeof(TYPE), .max_len = sizeof(TYPE)
+
+bool nl_attr_validate(const struct nlattr *, const struct nl_policy *);
+
 bool nl_policy_parse(const struct ofpbuf *, size_t offset,
                      const struct nl_policy[],
                      struct nlattr *[], size_t n_attrs);