From 82ace47a7256fd39d370a6442e0649f75961b831 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Thu, 10 Nov 2005 02:25:53 +0100 Subject: [NETLINK]: Generic netlink receive queue processor Introduces netlink_run_queue() to handle the receive queue of a netlink socket in a generic way. Processes as much as there was in the queue upon entry and invokes a callback function for each netlink message found. The callback function may refuse a message by returning a negative error code but setting the error pointer to 0 in which case netlink_run_queue() will return with a qlen != 0. Signed-off-by: Thomas Graf Signed-off-by: David S. Miller --- include/net/netlink.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/net') diff --git a/include/net/netlink.h b/include/net/netlink.h index c99e22d..640c26a 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h @@ -183,6 +183,12 @@ struct nla_policy { u16 minlen; }; +extern void netlink_run_queue(struct sock *sk, unsigned int *qlen, + int (*cb)(struct sk_buff *, + struct nlmsghdr *, int *)); +extern void netlink_queue_skip(struct nlmsghdr *nlh, + struct sk_buff *skb); + extern int nla_validate(struct nlattr *head, int len, int maxtype, struct nla_policy *policy); extern int nla_parse(struct nlattr *tb[], int maxtype, -- cgit v1.1