aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/genetlink.h
diff options
context:
space:
mode:
authorJoe Stringer <joestringer@nicira.com>2015-01-21 19:42:51 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-26 18:45:50 -0500
commit7b1883cefc288b2725966357edd2d8f321605622 (patch)
tree37184bcd556879f5ef7e9b52bea2263909082cbe /include/net/genetlink.h
parent272c2cf84152eb7fba11407d1649c85eee243e21 (diff)
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 'include/net/genetlink.h')
-rw-r--r--include/net/genetlink.h17
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,
206} 206}
207 207
208/** 208/**
209 * genlmsg_parse - parse attributes of a genetlink message
210 * @nlh: netlink message header
211 * @family: genetlink message family
212 * @tb: destination array with maxtype+1 elements
213 * @maxtype: maximum attribute type to be expected
214 * @policy: validation policy
215 * */
216static inline int genlmsg_parse(const struct nlmsghdr *nlh,
217 const struct genl_family *family,
218 struct nlattr *tb[], int maxtype,
219 const struct nla_policy *policy)
220{
221 return nlmsg_parse(nlh, family->hdrsize + GENL_HDRLEN, tb, maxtype,
222 policy);
223}
224
225/**
209 * genl_dump_check_consistent - check if sequence is consistent and advertise if not 226 * genl_dump_check_consistent - check if sequence is consistent and advertise if not
210 * @cb: netlink callback structure that stores the sequence number 227 * @cb: netlink callback structure that stores the sequence number
211 * @user_hdr: user header as returned from genlmsg_put() 228 * @user_hdr: user header as returned from genlmsg_put()