diff options
author | Joe Stringer <joestringer@nicira.com> | 2015-01-22 01:42:51 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-27 00:45:50 +0100 |
commit | 7b1883cefc288b2725966357edd2d8f321605622 (patch) | |
tree | 37184bcd556879f5ef7e9b52bea2263909082cbe /include/net/genetlink.h | |
parent | openvswitch: Use sw_flow_key_range for key ranges. (diff) | |
download | linux-7b1883cefc288b2725966357edd2d8f321605622.tar.xz linux-7b1883cefc288b2725966357edd2d8f321605622.zip |
genetlink: Add genlmsg_parse() helper function.
The first user will be the next patch.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | include/net/genetlink.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index f24aa83b80b6..d5a9a8b5af37 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h @@ -206,6 +206,23 @@ static inline struct nlmsghdr *genlmsg_nlhdr(void *user_hdr, } /** + * genlmsg_parse - parse attributes of a genetlink message + * @nlh: netlink message header + * @family: genetlink message family + * @tb: destination array with maxtype+1 elements + * @maxtype: maximum attribute type to be expected + * @policy: validation policy + * */ +static inline int genlmsg_parse(const struct nlmsghdr *nlh, + const struct genl_family *family, + struct nlattr *tb[], int maxtype, + const struct nla_policy *policy) +{ + return nlmsg_parse(nlh, family->hdrsize + GENL_HDRLEN, tb, maxtype, + policy); +} + +/** * genl_dump_check_consistent - check if sequence is consistent and advertise if not * @cb: netlink callback structure that stores the sequence number * @user_hdr: user header as returned from genlmsg_put() |