genetlink.h (daab7fc734a53fdeaf844b7c03053118ad1769da) | genetlink.h (ff4c92d85c6f2777d2067f8552e7fefb4d1754ae) |
---|---|
1#ifndef __NET_GENERIC_NETLINK_H 2#define __NET_GENERIC_NETLINK_H 3 4#include <linux/genetlink.h> 5#include <net/netlink.h> 6#include <net/net_namespace.h> 7 8/** --- 6 unchanged lines hidden (view full) --- 15 */ 16struct genl_multicast_group { 17 struct genl_family *family; /* private */ 18 struct list_head list; /* private */ 19 char name[GENL_NAMSIZ]; 20 u32 id; 21}; 22 | 1#ifndef __NET_GENERIC_NETLINK_H 2#define __NET_GENERIC_NETLINK_H 3 4#include <linux/genetlink.h> 5#include <net/netlink.h> 6#include <net/net_namespace.h> 7 8/** --- 6 unchanged lines hidden (view full) --- 15 */ 16struct genl_multicast_group { 17 struct genl_family *family; /* private */ 18 struct list_head list; /* private */ 19 char name[GENL_NAMSIZ]; 20 u32 id; 21}; 22 |
23struct genl_ops; 24struct genl_info; 25 |
|
23/** 24 * struct genl_family - generic netlink family 25 * @id: protocol family idenfitier 26 * @hdrsize: length of user specific header in bytes 27 * @name: name of family 28 * @version: protocol version 29 * @maxattr: maximum number of attributes supported 30 * @netnsok: set to true if the family can handle network 31 * namespaces and should be presented in all of them | 26/** 27 * struct genl_family - generic netlink family 28 * @id: protocol family idenfitier 29 * @hdrsize: length of user specific header in bytes 30 * @name: name of family 31 * @version: protocol version 32 * @maxattr: maximum number of attributes supported 33 * @netnsok: set to true if the family can handle network 34 * namespaces and should be presented in all of them |
35 * @pre_doit: called before an operation's doit callback, it may 36 * do additional, common, filtering and return an error 37 * @post_doit: called after an operation's doit callback, it may 38 * undo operations done by pre_doit, for example release locks |
|
32 * @attrbuf: buffer to store parsed attributes 33 * @ops_list: list of all assigned operations 34 * @family_list: family list 35 * @mcast_groups: multicast groups list 36 */ 37struct genl_family { 38 unsigned int id; 39 unsigned int hdrsize; 40 char name[GENL_NAMSIZ]; 41 unsigned int version; 42 unsigned int maxattr; 43 bool netnsok; | 39 * @attrbuf: buffer to store parsed attributes 40 * @ops_list: list of all assigned operations 41 * @family_list: family list 42 * @mcast_groups: multicast groups list 43 */ 44struct genl_family { 45 unsigned int id; 46 unsigned int hdrsize; 47 char name[GENL_NAMSIZ]; 48 unsigned int version; 49 unsigned int maxattr; 50 bool netnsok; |
51 int (*pre_doit)(struct genl_ops *ops, 52 struct sk_buff *skb, 53 struct genl_info *info); 54 void (*post_doit)(struct genl_ops *ops, 55 struct sk_buff *skb, 56 struct genl_info *info); |
|
44 struct nlattr ** attrbuf; /* private */ 45 struct list_head ops_list; /* private */ 46 struct list_head family_list; /* private */ 47 struct list_head mcast_groups; /* private */ 48}; 49 50/** 51 * struct genl_info - receiving information 52 * @snd_seq: sending sequence number 53 * @snd_pid: netlink pid of sender 54 * @nlhdr: netlink message header 55 * @genlhdr: generic netlink message header 56 * @userhdr: user specific header 57 * @attrs: netlink attributes | 57 struct nlattr ** attrbuf; /* private */ 58 struct list_head ops_list; /* private */ 59 struct list_head family_list; /* private */ 60 struct list_head mcast_groups; /* private */ 61}; 62 63/** 64 * struct genl_info - receiving information 65 * @snd_seq: sending sequence number 66 * @snd_pid: netlink pid of sender 67 * @nlhdr: netlink message header 68 * @genlhdr: generic netlink message header 69 * @userhdr: user specific header 70 * @attrs: netlink attributes |
71 * @_net: network namespace 72 * @user_ptr: user pointers |
|
58 */ 59struct genl_info { 60 u32 snd_seq; 61 u32 snd_pid; 62 struct nlmsghdr * nlhdr; 63 struct genlmsghdr * genlhdr; 64 void * userhdr; 65 struct nlattr ** attrs; 66#ifdef CONFIG_NET_NS 67 struct net * _net; 68#endif | 73 */ 74struct genl_info { 75 u32 snd_seq; 76 u32 snd_pid; 77 struct nlmsghdr * nlhdr; 78 struct genlmsghdr * genlhdr; 79 void * userhdr; 80 struct nlattr ** attrs; 81#ifdef CONFIG_NET_NS 82 struct net * _net; 83#endif |
84 void * user_ptr[2]; |
|
69}; 70 71static inline struct net *genl_info_net(struct genl_info *info) 72{ 73 return read_pnet(&info->_net); 74} 75 76static inline void genl_info_net_set(struct genl_info *info, struct net *net) 77{ 78 write_pnet(&info->_net, net); 79} 80 81/** 82 * struct genl_ops - generic netlink operations 83 * @cmd: command identifier | 85}; 86 87static inline struct net *genl_info_net(struct genl_info *info) 88{ 89 return read_pnet(&info->_net); 90} 91 92static inline void genl_info_net_set(struct genl_info *info, struct net *net) 93{ 94 write_pnet(&info->_net, net); 95} 96 97/** 98 * struct genl_ops - generic netlink operations 99 * @cmd: command identifier |
100 * @internal_flags: flags used by the family |
|
84 * @flags: flags 85 * @policy: attribute validation policy 86 * @doit: standard command callback 87 * @dumpit: callback for dumpers 88 * @done: completion callback for dumps 89 * @ops_list: operations list 90 */ 91struct genl_ops { 92 u8 cmd; | 101 * @flags: flags 102 * @policy: attribute validation policy 103 * @doit: standard command callback 104 * @dumpit: callback for dumpers 105 * @done: completion callback for dumps 106 * @ops_list: operations list 107 */ 108struct genl_ops { 109 u8 cmd; |
110 u8 internal_flags; |
|
93 unsigned int flags; 94 const struct nla_policy *policy; 95 int (*doit)(struct sk_buff *skb, 96 struct genl_info *info); 97 int (*dumpit)(struct sk_buff *skb, 98 struct netlink_callback *cb); 99 int (*done)(struct netlink_callback *cb); 100 struct list_head ops_list; --- 191 unchanged lines hidden --- | 111 unsigned int flags; 112 const struct nla_policy *policy; 113 int (*doit)(struct sk_buff *skb, 114 struct genl_info *info); 115 int (*dumpit)(struct sk_buff *skb, 116 struct netlink_callback *cb); 117 int (*done)(struct netlink_callback *cb); 118 struct list_head ops_list; --- 191 unchanged lines hidden --- |