netlink: Expose version of nl_attr_find for key and len.
authorJesse Gross <jesse@nicira.com>
Fri, 23 Sep 2011 18:53:12 +0000 (11:53 -0700)
committerJesse Gross <jesse@nicira.com>
Fri, 23 Sep 2011 22:27:49 +0000 (15:27 -0700)
Many of our functions pass around a pointer to Netlink attributes
and a length.  This exposes the version of nl_attr_find that takes
that format so it can be used by callers outside the Netlink library.

lib/netlink.c
lib/netlink.h

index ec35849..b4de3ed 100644 (file)
@@ -615,7 +615,7 @@ nl_parse_nested(const struct nlattr *nla, const struct nl_policy policy[],
     return nl_policy_parse(&buf, 0, policy, attrs, n_attrs);
 }
 
-static const struct nlattr *
+const struct nlattr *
 nl_attr_find__(const struct nlattr *attrs, size_t size, uint16_t type)
 {
     const struct nlattr *nla;
index 0bd2c41..2206339 100644 (file)
@@ -160,5 +160,7 @@ bool nl_parse_nested(const struct nlattr *, const struct nl_policy[],
 const struct nlattr *nl_attr_find(const struct ofpbuf *, size_t hdr_len,
                                   uint16_t type);
 const struct nlattr *nl_attr_find_nested(const struct nlattr *, uint16_t type);
+const struct nlattr *nl_attr_find__(const struct nlattr *attrs, size_t size,
+                                    uint16_t type);
 
 #endif /* netlink.h */