af_netlink.c File Reference

Go to the source code of this file.

Classes

struct  netlink_sock
struct  nl_pid_hash
struct  netlink_table
struct  netlink_broadcast_data
struct  netlink_set_err_data

Defines

#define NLGRPSZ(x)   (ALIGN(x, sizeof(unsigned long) * 8) / 8)
#define NLGRPLONGS(x)   (NLGRPSZ(x)/sizeof(unsigned long))
#define NETLINK_KERNEL_SOCKET   0x1
#define NETLINK_RECV_PKTINFO   0x2

Functions

static struct netlink_socknlk_sk (struct sock *sk)
static int netlink_is_kernel (struct sock *sk)
static DECLARE_WAIT_QUEUE_HEAD (nl_table_wait)
static int netlink_dump (struct sock *sk)
static void netlink_destroy_callback (struct netlink_callback *cb)
static DEFINE_RWLOCK (nl_table_lock)
static ATOMIC_NOTIFIER_HEAD (netlink_chain)
static u32 netlink_group_mask (u32 group)
static struct hlist_head * nl_pid_hashfn (struct nl_pid_hash *hash, u32 pid)
static void netlink_sock_destruct (struct sock *sk)
static void netlink_table_grab (void)
static void netlink_table_ungrab (void)
static void netlink_lock_table (void)
static void netlink_unlock_table (void)
static struct sock * netlink_lookup (struct net *net, int protocol, u32 pid)
static struct hlist_head * nl_pid_hash_zalloc (size_t size)
static void nl_pid_hash_free (struct hlist_head *table, size_t size)
static int nl_pid_hash_rehash (struct nl_pid_hash *hash, int grow)
static int nl_pid_hash_dilute (struct nl_pid_hash *hash, int len)
static void netlink_update_listeners (struct sock *sk)
static int netlink_insert (struct sock *sk, struct net *net, u32 pid)
static void netlink_remove (struct sock *sk)
static int __netlink_create (struct net *net, struct socket *sock, struct mutex *cb_mutex, int protocol)
static int netlink_create (struct net *net, struct socket *sock, int protocol)
static int netlink_release (struct socket *sock)
static int netlink_autobind (struct socket *sock)
static int netlink_capable (struct socket *sock, unsigned int flag)
static void netlink_update_subscriptions (struct sock *sk, unsigned int subscriptions)
static int netlink_realloc_groups (struct sock *sk)
static int netlink_bind (struct socket *sock, struct sockaddr *addr, int addr_len)
static int netlink_connect (struct socket *sock, struct sockaddr *addr, int alen, int flags)
static int netlink_getname (struct socket *sock, struct sockaddr *addr, int *addr_len, int peer)
static void netlink_overrun (struct sock *sk)
static struct sock * netlink_getsockbypid (struct sock *ssk, u32 pid)
struct sock * netlink_getsockbyfilp (struct file *filp)
int netlink_attachskb (struct sock *sk, struct sk_buff *skb, long *timeo, struct sock *ssk)
int netlink_sendskb (struct sock *sk, struct sk_buff *skb)
void netlink_detachskb (struct sock *sk, struct sk_buff *skb)
static struct sk_buff * netlink_trim (struct sk_buff *skb, gfp_t allocation)
static void netlink_rcv_wake (struct sock *sk)
static int netlink_unicast_kernel (struct sock *sk, struct sk_buff *skb)
int netlink_unicast (struct sock *ssk, struct sk_buff *skb, u32 pid, int nonblock)
 EXPORT_SYMBOL (netlink_unicast)
int netlink_has_listeners (struct sock *sk, unsigned int group)
 EXPORT_SYMBOL_GPL (netlink_has_listeners)
static int netlink_broadcast_deliver (struct sock *sk, struct sk_buff *skb)
static int do_one_broadcast (struct sock *sk, struct netlink_broadcast_data *p)
int netlink_broadcast (struct sock *ssk, struct sk_buff *skb, u32 pid, u32 group, gfp_t allocation)
 EXPORT_SYMBOL (netlink_broadcast)
static int do_one_set_err (struct sock *sk, struct netlink_set_err_data *p)

Variables

static struct netlink_tablenl_table
static atomic_t nl_table_users = ATOMIC_INIT(0)
static struct proto_ops netlink_ops
static struct proto netlink_proto


Define Documentation

#define NETLINK_KERNEL_SOCKET   0x1

Definition at line 86 of file af_netlink.c.

#define NETLINK_RECV_PKTINFO   0x2

Definition at line 87 of file af_netlink.c.

#define NLGRPLONGS (  )     (NLGRPSZ(x)/sizeof(unsigned long))

Definition at line 65 of file af_netlink.c.

#define NLGRPSZ (  )     (ALIGN(x, sizeof(unsigned long) * 8) / 8)

Definition at line 64 of file af_netlink.c.


Function Documentation

static int __netlink_create ( struct net *  net,
struct socket *  sock,
struct mutex *  cb_mutex,
int  protocol 
) [static]

Definition at line 394 of file af_netlink.c.

static ATOMIC_NOTIFIER_HEAD ( netlink_chain   )  [static]

static DECLARE_WAIT_QUEUE_HEAD ( nl_table_wait   )  [static]

static DEFINE_RWLOCK ( nl_table_lock   )  [static]

static int do_one_broadcast ( struct sock *  sk,
struct netlink_broadcast_data p 
) [inline, static]

Definition at line 959 of file af_netlink.c.

static int do_one_set_err ( struct sock *  sk,
struct netlink_set_err_data p 
) [inline, static]

Definition at line 1066 of file af_netlink.c.

EXPORT_SYMBOL ( netlink_broadcast   ) 

EXPORT_SYMBOL ( netlink_unicast   ) 

EXPORT_SYMBOL_GPL ( netlink_has_listeners   ) 

int netlink_attachskb ( struct sock *  sk,
struct sk_buff *  skb,
long *  timeo,
struct sock *  ssk 
)

Definition at line 770 of file af_netlink.c.

static int netlink_autobind ( struct socket *  sock  )  [static]

Definition at line 525 of file af_netlink.c.

static int netlink_bind ( struct socket *  sock,
struct sockaddr *  addr,
int  addr_len 
) [static]

Definition at line 617 of file af_netlink.c.

int netlink_broadcast ( struct sock *  ssk,
struct sk_buff *  skb,
u32  pid,
u32  group,
gfp_t  allocation 
)

Definition at line 1013 of file af_netlink.c.

static int netlink_broadcast_deliver ( struct sock *  sk,
struct sk_buff *  skb 
) [inline, static]

Definition at line 932 of file af_netlink.c.

static int netlink_capable ( struct socket *  sock,
unsigned int  flag 
) [inline, static]

Definition at line 566 of file af_netlink.c.

static int netlink_connect ( struct socket *  sock,
struct sockaddr *  addr,
int  alen,
int  flags 
) [static]

Definition at line 663 of file af_netlink.c.

static int netlink_create ( struct net *  net,
struct socket *  sock,
int  protocol 
) [static]

Definition at line 422 of file af_netlink.c.

static void netlink_destroy_callback ( struct netlink_callback *  cb  )  [static]

void netlink_detachskb ( struct sock *  sk,
struct sk_buff *  skb 
)

Definition at line 820 of file af_netlink.c.

static int netlink_dump ( struct sock *  sk  )  [static]

static int netlink_getname ( struct socket *  sock,
struct sockaddr *  addr,
int *  addr_len,
int  peer 
) [static]

Definition at line 696 of file af_netlink.c.

struct sock* netlink_getsockbyfilp ( struct file *  filp  )  [read]

Definition at line 744 of file af_netlink.c.

static struct sock* netlink_getsockbypid ( struct sock *  ssk,
u32  pid 
) [static, read]

Definition at line 725 of file af_netlink.c.

static u32 netlink_group_mask ( u32  group  )  [static]

Definition at line 135 of file af_netlink.c.

int netlink_has_listeners ( struct sock *  sk,
unsigned int  group 
)

Definition at line 913 of file af_netlink.c.

static int netlink_insert ( struct sock *  sk,
struct net *  net,
u32  pid 
) [static]

Definition at line 338 of file af_netlink.c.

static int netlink_is_kernel ( struct sock *  sk  )  [inline, static]

Definition at line 94 of file af_netlink.c.

static void netlink_lock_table ( void   )  [inline, static]

Definition at line 204 of file af_netlink.c.

static struct sock* netlink_lookup ( struct net *  net,
int  protocol,
u32  pid 
) [static, read]

Definition at line 220 of file af_netlink.c.

static void netlink_overrun ( struct sock *  sk  )  [static]

Definition at line 717 of file af_netlink.c.

static void netlink_rcv_wake ( struct sock *  sk  )  [inline, static]

Definition at line 851 of file af_netlink.c.

static int netlink_realloc_groups ( struct sock *  sk  )  [static]

Definition at line 584 of file af_netlink.c.

static int netlink_release ( struct socket *  sock  )  [static]

Definition at line 469 of file af_netlink.c.

static void netlink_remove ( struct sock *  sk  )  [static]

Definition at line 378 of file af_netlink.c.

int netlink_sendskb ( struct sock *  sk,
struct sk_buff *  skb 
)

Definition at line 810 of file af_netlink.c.

static void netlink_sock_destruct ( struct sock *  sk  )  [static]

Definition at line 145 of file af_netlink.c.

static void netlink_table_grab ( void   )  [static]

Definition at line 173 of file af_netlink.c.

static void netlink_table_ungrab ( void   )  [static]

Definition at line 196 of file af_netlink.c.

static struct sk_buff* netlink_trim ( struct sk_buff *  skb,
gfp_t  allocation 
) [static, read]

Definition at line 826 of file af_netlink.c.

int netlink_unicast ( struct sock *  ssk,
struct sk_buff *  skb,
u32  pid,
int  nonblock 
)

Definition at line 877 of file af_netlink.c.

static int netlink_unicast_kernel ( struct sock *  sk,
struct sk_buff *  skb 
) [inline, static]

Definition at line 861 of file af_netlink.c.

static void netlink_unlock_table ( void   )  [inline, static]

Definition at line 214 of file af_netlink.c.

static void netlink_update_listeners ( struct sock *  sk  )  [static]

Definition at line 319 of file af_netlink.c.

static void netlink_update_subscriptions ( struct sock *  sk,
unsigned int  subscriptions 
) [static]

Definition at line 573 of file af_netlink.c.

static int nl_pid_hash_dilute ( struct nl_pid_hash hash,
int  len 
) [inline, static]

Definition at line 301 of file af_netlink.c.

static void nl_pid_hash_free ( struct hlist_head *  table,
size_t  size 
) [inline, static]

Definition at line 252 of file af_netlink.c.

static int nl_pid_hash_rehash ( struct nl_pid_hash hash,
int  grow 
) [static]

Definition at line 260 of file af_netlink.c.

static struct hlist_head* nl_pid_hash_zalloc ( size_t  size  )  [static, read]

Definition at line 242 of file af_netlink.c.

static struct hlist_head* nl_pid_hashfn ( struct nl_pid_hash hash,
u32  pid 
) [static, read]

Definition at line 140 of file af_netlink.c.

static struct netlink_sock* nlk_sk ( struct sock *  sk  )  [static, read]

Definition at line 89 of file af_netlink.c.


Variable Documentation

struct proto_ops netlink_ops [static]

Definition at line 316 of file af_netlink.c.

struct proto netlink_proto [static]

Initial value:

 {
        .name     = "NETLINK",
        .owner    = THIS_MODULE,
        .obj_size = sizeof(struct netlink_sock),
}

Definition at line 388 of file af_netlink.c.

struct netlink_table* nl_table [static]

Definition at line 123 of file af_netlink.c.

atomic_t nl_table_users = ATOMIC_INIT(0) [static]

Definition at line 131 of file af_netlink.c.


Generated on Wed Apr 11 06:39:15 2012 for DDE - The L4 Device Driver Environment by  doxygen 1.5.6