@@ -40,7 +40,6 @@ struct genl_info;
40
40
* generic netlink family is removed while there are still open
41
41
* sockets.
42
42
* @attrbuf: buffer to store parsed attributes (private)
43
- * @family_list: family list (private)
44
43
* @mcgrps: multicast groups used by this family
45
44
* @n_mcgrps: number of multicast groups
46
45
* @mcgrp_offset: starting number of multicast group IDs in this family
@@ -70,11 +69,10 @@ struct genl_family {
70
69
unsigned int n_ops ;
71
70
unsigned int n_mcgrps ;
72
71
unsigned int mcgrp_offset ; /* private */
73
- struct list_head family_list ; /* private */
74
72
struct module * module ;
75
73
};
76
74
77
- struct nlattr * * genl_family_attrbuf (struct genl_family * family );
75
+ struct nlattr * * genl_family_attrbuf (const struct genl_family * family );
78
76
79
77
/**
80
78
* struct genl_info - receiving information
@@ -134,12 +132,12 @@ struct genl_ops {
134
132
};
135
133
136
134
int genl_register_family (struct genl_family * family );
137
- int genl_unregister_family (struct genl_family * family );
138
- void genl_notify (struct genl_family * family , struct sk_buff * skb ,
135
+ int genl_unregister_family (const struct genl_family * family );
136
+ void genl_notify (const struct genl_family * family , struct sk_buff * skb ,
139
137
struct genl_info * info , u32 group , gfp_t flags );
140
138
141
139
void * genlmsg_put (struct sk_buff * skb , u32 portid , u32 seq ,
142
- struct genl_family * family , int flags , u8 cmd );
140
+ const struct genl_family * family , int flags , u8 cmd );
143
141
144
142
/**
145
143
* genlmsg_nlhdr - Obtain netlink header from user specified header
@@ -148,8 +146,8 @@ void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq,
148
146
*
149
147
* Returns pointer to netlink header.
150
148
*/
151
- static inline struct nlmsghdr * genlmsg_nlhdr ( void * user_hdr ,
152
- struct genl_family * family )
149
+ static inline struct nlmsghdr *
150
+ genlmsg_nlhdr ( void * user_hdr , const struct genl_family * family )
153
151
{
154
152
return (struct nlmsghdr * )((char * )user_hdr -
155
153
family -> hdrsize -
@@ -185,7 +183,7 @@ static inline int genlmsg_parse(const struct nlmsghdr *nlh,
185
183
*/
186
184
static inline void genl_dump_check_consistent (struct netlink_callback * cb ,
187
185
void * user_hdr ,
188
- struct genl_family * family )
186
+ const struct genl_family * family )
189
187
{
190
188
nl_dump_check_consistent (cb , genlmsg_nlhdr (user_hdr , family ));
191
189
}
@@ -202,7 +200,7 @@ static inline void genl_dump_check_consistent(struct netlink_callback *cb,
202
200
*/
203
201
static inline void * genlmsg_put_reply (struct sk_buff * skb ,
204
202
struct genl_info * info ,
205
- struct genl_family * family ,
203
+ const struct genl_family * family ,
206
204
int flags , u8 cmd )
207
205
{
208
206
return genlmsg_put (skb , info -> snd_portid , info -> snd_seq , family ,
@@ -239,7 +237,7 @@ static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr)
239
237
* @group: offset of multicast group in groups array
240
238
* @flags: allocation flags
241
239
*/
242
- static inline int genlmsg_multicast_netns (struct genl_family * family ,
240
+ static inline int genlmsg_multicast_netns (const struct genl_family * family ,
243
241
struct net * net , struct sk_buff * skb ,
244
242
u32 portid , unsigned int group , gfp_t flags )
245
243
{
@@ -257,7 +255,7 @@ static inline int genlmsg_multicast_netns(struct genl_family *family,
257
255
* @group: offset of multicast group in groups array
258
256
* @flags: allocation flags
259
257
*/
260
- static inline int genlmsg_multicast (struct genl_family * family ,
258
+ static inline int genlmsg_multicast (const struct genl_family * family ,
261
259
struct sk_buff * skb , u32 portid ,
262
260
unsigned int group , gfp_t flags )
263
261
{
@@ -275,7 +273,7 @@ static inline int genlmsg_multicast(struct genl_family *family,
275
273
*
276
274
* This function must hold the RTNL or rcu_read_lock().
277
275
*/
278
- int genlmsg_multicast_allns (struct genl_family * family ,
276
+ int genlmsg_multicast_allns (const struct genl_family * family ,
279
277
struct sk_buff * skb , u32 portid ,
280
278
unsigned int group , gfp_t flags );
281
279
@@ -359,16 +357,17 @@ static inline struct sk_buff *genlmsg_new(size_t payload, gfp_t flags)
359
357
* This function returns the number of broadcast listeners that have set the
360
358
* NETLINK_RECV_NO_ENOBUFS socket option.
361
359
*/
362
- static inline int genl_set_err (struct genl_family * family , struct net * net ,
363
- u32 portid , u32 group , int code )
360
+ static inline int genl_set_err (const struct genl_family * family ,
361
+ struct net * net , u32 portid ,
362
+ u32 group , int code )
364
363
{
365
364
if (WARN_ON_ONCE (group >= family -> n_mcgrps ))
366
365
return - EINVAL ;
367
366
group = family -> mcgrp_offset + group ;
368
367
return netlink_set_err (net -> genl_sock , portid , group , code );
369
368
}
370
369
371
- static inline int genl_has_listeners (struct genl_family * family ,
370
+ static inline int genl_has_listeners (const struct genl_family * family ,
372
371
struct net * net , unsigned int group )
373
372
{
374
373
if (WARN_ON_ONCE (group >= family -> n_mcgrps ))
0 commit comments