aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netlink.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2012-06-29 02:15:21 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-29 19:46:02 -0400
commita31f2d17b331db970259e875b7223d3aba7e3821 (patch)
tree0d10021be81446ab360f4240b0d16729f518387f /include/linux/netlink.h
parentdd7f36ba3ce17d4fe85987d83efd5901b0935816 (diff)
netlink: add netlink_kernel_cfg parameter to netlink_kernel_create
This patch adds the following structure: struct netlink_kernel_cfg { unsigned int groups; void (*input)(struct sk_buff *skb); struct mutex *cb_mutex; }; That can be passed to netlink_kernel_create to set optional configurations for netlink kernel sockets. I've populated this structure by looking for NULL and zero parameters at the existing code. The remaining parameters that always need to be set are still left in the original interface. That includes optional parameters for the netlink socket creation. This allows easy extensibility of this interface in the future. This patch also adapts all callers to use this new interface. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netlink.h')
-rw-r--r--include/linux/netlink.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index ed33f0901bc..6085e4919cb 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -174,11 +174,16 @@ struct netlink_skb_parms {
174extern void netlink_table_grab(void); 174extern void netlink_table_grab(void);
175extern void netlink_table_ungrab(void); 175extern void netlink_table_ungrab(void);
176 176
177extern struct sock *netlink_kernel_create(struct net *net, 177/* optional Netlink kernel configuration parameters */
178 int unit,unsigned int groups, 178struct netlink_kernel_cfg {
179 void (*input)(struct sk_buff *skb), 179 unsigned int groups;
180 struct mutex *cb_mutex, 180 void (*input)(struct sk_buff *skb);
181 struct module *module); 181 struct mutex *cb_mutex;
182};
183
184extern struct sock *netlink_kernel_create(struct net *net, int unit,
185 struct module *module,
186 struct netlink_kernel_cfg *cfg);
182extern void netlink_kernel_release(struct sock *sk); 187extern void netlink_kernel_release(struct sock *sk);
183extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); 188extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
184extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); 189extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);