6 #define NLGRPSZ(x) (ALIGN(x, sizeof(unsigned long) * 8) / 8)
7 #define NLGRPLONGS(x) (NLGRPSZ(x)/sizeof(unsigned long))
10 /* struct sock has to be the first member of netlink_sock */
18 unsigned long *groups;
20 wait_queue_head_t wait;
21 struct netlink_callback *cb;
22 struct mutex *cb_mutex;
23 struct mutex cb_def_mutex;
24 void (*netlink_rcv)(struct sk_buff *skb);
25 void (*netlink_bind)(int group);
26 struct module *module;
29 static inline struct netlink_sock *nlk_sk(struct sock *sk)
31 return container_of(sk, struct netlink_sock, sk);
34 struct nl_portid_hash {
35 struct hlist_head *table;
36 unsigned long rehash_time;
42 unsigned int max_shift;
47 struct netlink_table {
48 struct nl_portid_hash hash;
49 struct hlist_head mc_list;
50 struct listeners __rcu *listeners;
53 struct mutex *cb_mutex;
54 struct module *module;
55 void (*bind)(int group);
59 extern struct netlink_table *nl_table;
60 extern rwlock_t nl_table_lock;