~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/netlink/af_netlink.h

Version: ~ [ linux-5.8-rc3 ] ~ [ linux-5.7.5 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.48 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.129 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.185 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.228 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.228 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef _AF_NETLINK_H
  2 #define _AF_NETLINK_H
  3 
  4 #include <linux/rhashtable.h>
  5 #include <linux/atomic.h>
  6 #include <linux/workqueue.h>
  7 #include <net/sock.h>
  8 
  9 #define NLGRPSZ(x)      (ALIGN(x, sizeof(unsigned long) * 8) / 8)
 10 #define NLGRPLONGS(x)   (NLGRPSZ(x)/sizeof(unsigned long))
 11 
 12 struct netlink_sock {
 13         /* struct sock has to be the first member of netlink_sock */
 14         struct sock             sk;
 15         u32                     portid;
 16         u32                     dst_portid;
 17         u32                     dst_group;
 18         u32                     flags;
 19         u32                     subscriptions;
 20         u32                     ngroups;
 21         unsigned long           *groups;
 22         unsigned long           state;
 23         size_t                  max_recvmsg_len;
 24         wait_queue_head_t       wait;
 25         bool                    bound;
 26         bool                    cb_running;
 27         struct netlink_callback cb;
 28         struct mutex            *cb_mutex;
 29         struct mutex            cb_def_mutex;
 30         void                    (*netlink_rcv)(struct sk_buff *skb);
 31         int                     (*netlink_bind)(struct net *net, int group);
 32         void                    (*netlink_unbind)(struct net *net, int group);
 33         struct module           *module;
 34 
 35         struct rhash_head       node;
 36         struct rcu_head         rcu;
 37         struct work_struct      work;
 38 };
 39 
 40 static inline struct netlink_sock *nlk_sk(struct sock *sk)
 41 {
 42         return container_of(sk, struct netlink_sock, sk);
 43 }
 44 
 45 struct netlink_table {
 46         struct rhashtable       hash;
 47         struct hlist_head       mc_list;
 48         struct listeners __rcu  *listeners;
 49         unsigned int            flags;
 50         unsigned int            groups;
 51         struct mutex            *cb_mutex;
 52         struct module           *module;
 53         int                     (*bind)(struct net *net, int group);
 54         void                    (*unbind)(struct net *net, int group);
 55         bool                    (*compare)(struct net *net, struct sock *sock);
 56         int                     registered;
 57 };
 58 
 59 extern struct netlink_table *nl_table;
 60 extern rwlock_t nl_table_lock;
 61 
 62 #endif
 63 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp