diff options
author | Thomas Graf <tgraf@suug.ch> | 2005-11-09 20:25:53 -0500 |
---|---|---|
committer | Thomas Graf <tgr@axs.localdomain> | 2005-11-09 20:26:40 -0500 |
commit | 82ace47a7256fd39d370a6442e0649f75961b831 (patch) | |
tree | 261fafd7cb6b8b7bf023fa26cba1636ae2ec2f79 /include | |
parent | a8f74b228826eef1cbe04a05647d61e896f5fd63 (diff) |
[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 <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/netlink.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h index c99e22db9632..640c26a90cf1 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -183,6 +183,12 @@ struct nla_policy { | |||
183 | u16 minlen; | 183 | u16 minlen; |
184 | }; | 184 | }; |
185 | 185 | ||
186 | extern void netlink_run_queue(struct sock *sk, unsigned int *qlen, | ||
187 | int (*cb)(struct sk_buff *, | ||
188 | struct nlmsghdr *, int *)); | ||
189 | extern void netlink_queue_skip(struct nlmsghdr *nlh, | ||
190 | struct sk_buff *skb); | ||
191 | |||
186 | extern int nla_validate(struct nlattr *head, int len, int maxtype, | 192 | extern int nla_validate(struct nlattr *head, int len, int maxtype, |
187 | struct nla_policy *policy); | 193 | struct nla_policy *policy); |
188 | extern int nla_parse(struct nlattr *tb[], int maxtype, | 194 | extern int nla_parse(struct nlattr *tb[], int maxtype, |