Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
netlink.h File Reference
#include <linux/capability.h>
#include <linux/skbuff.h>
#include <linux/export.h>
#include <net/scm.h>
#include <uapi/linux/netlink.h>

Go to the source code of this file.

Data Structures

struct  netlink_skb_parms
 
struct  netlink_kernel_cfg
 
struct  netlink_callback
 
struct  netlink_notify
 
struct  netlink_dump_control
 

Macros

#define NETLINK_CB(skb)   (*(struct netlink_skb_parms*)&((skb)->cb))
 
#define NETLINK_CREDS(skb)   (&NETLINK_CB((skb)).creds)
 
#define NL_CFG_F_NONROOT_RECV   (1 << 0)
 
#define NL_CFG_F_NONROOT_SEND   (1 << 1)
 
#define NLMSG_GOODSIZE   SKB_WITH_OVERHEAD(PAGE_SIZE)
 
#define NLMSG_DEFAULT_SIZE   (NLMSG_GOODSIZE - NLMSG_HDRLEN)
 

Functions

void netlink_table_grab (void)
 
void netlink_table_ungrab (void)
 
struct sock__netlink_kernel_create (struct net *net, int unit, struct module *module, struct netlink_kernel_cfg *cfg)
 
void netlink_kernel_release (struct sock *sk)
 
int __netlink_change_ngroups (struct sock *sk, unsigned int groups)
 
int netlink_change_ngroups (struct sock *sk, unsigned int groups)
 
void __netlink_clear_multicast_users (struct sock *sk, unsigned int group)
 
void netlink_clear_multicast_users (struct sock *sk, unsigned int group)
 
void netlink_ack (struct sk_buff *in_skb, struct nlmsghdr *nlh, int err)
 
int netlink_has_listeners (struct sock *sk, unsigned int group)
 
int netlink_unicast (struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock)
 
int netlink_broadcast (struct sock *ssk, struct sk_buff *skb, __u32 portid, __u32 group, gfp_t allocation)
 
int netlink_broadcast_filtered (struct sock *ssk, struct sk_buff *skb, __u32 portid, __u32 group, gfp_t allocation, int(*filter)(struct sock *dsk, struct sk_buff *skb, void *data), void *filter_data)
 
int netlink_set_err (struct sock *ssk, __u32 portid, __u32 group, int code)
 
int netlink_register_notifier (struct notifier_block *nb)
 
int netlink_unregister_notifier (struct notifier_block *nb)
 
struct socknetlink_getsockbyfilp (struct file *filp)
 
int netlink_attachskb (struct sock *sk, struct sk_buff *skb, long *timeo, struct sock *ssk)
 
void netlink_detachskb (struct sock *sk, struct sk_buff *skb)
 
int netlink_sendskb (struct sock *sk, struct sk_buff *skb)
 
struct nlmsghdr__nlmsg_put (struct sk_buff *skb, u32 portid, u32 seq, int type, int len, int flags)
 
int __netlink_dump_start (struct sock *ssk, struct sk_buff *skb, const struct nlmsghdr *nlh, struct netlink_dump_control *control)
 

Macro Definition Documentation

#define NETLINK_CB (   skb)    (*(struct netlink_skb_parms*)&((skb)->cb))

Definition at line 25 of file netlink.h.

#define NETLINK_CREDS (   skb)    (&NETLINK_CB((skb)).creds)

Definition at line 26 of file netlink.h.

#define NL_CFG_F_NONROOT_RECV   (1 << 0)

Definition at line 32 of file netlink.h.

#define NL_CFG_F_NONROOT_SEND   (1 << 1)

Definition at line 33 of file netlink.h.

#define NLMSG_DEFAULT_SIZE   (NLMSG_GOODSIZE - NLMSG_HDRLEN)

Definition at line 90 of file netlink.h.

#define NLMSG_GOODSIZE   SKB_WITH_OVERHEAD(PAGE_SIZE)

Definition at line 85 of file netlink.h.

Function Documentation

int __netlink_change_ngroups ( struct sock sk,
unsigned int  groups 
)
void __netlink_clear_multicast_users ( struct sock sk,
unsigned int  group 
)
int __netlink_dump_start ( struct sock ssk,
struct sk_buff skb,
const struct nlmsghdr nlh,
struct netlink_dump_control control 
)
struct sock* __netlink_kernel_create ( struct net net,
int  unit,
struct module module,
struct netlink_kernel_cfg cfg 
)
read
struct nlmsghdr* __nlmsg_put ( struct sk_buff skb,
u32  portid,
u32  seq,
int  type,
int  len,
int  flags 
)
read
void netlink_ack ( struct sk_buff in_skb,
struct nlmsghdr nlh,
int  err 
)
int netlink_attachskb ( struct sock sk,
struct sk_buff skb,
long timeo,
struct sock ssk 
)

Definition at line 833 of file af_netlink.c.

int netlink_broadcast ( struct sock ssk,
struct sk_buff skb,
__u32  portid,
__u32  group,
gfp_t  allocation 
)

Definition at line 1146 of file af_netlink.c.

int netlink_broadcast_filtered ( struct sock ssk,
struct sk_buff skb,
__u32  portid,
__u32  group,
gfp_t  allocation,
int(*)(struct sock *dsk, struct sk_buff *skb, void *data filter,
void filter_data 
)

Definition at line 1094 of file af_netlink.c.

int netlink_change_ngroups ( struct sock sk,
unsigned int  groups 
)
void netlink_clear_multicast_users ( struct sock sk,
unsigned int  group 
)
void netlink_detachskb ( struct sock sk,
struct sk_buff skb 
)

Definition at line 890 of file af_netlink.c.

struct sock* netlink_getsockbyfilp ( struct file filp)
read

Definition at line 807 of file af_netlink.c.

int netlink_has_listeners ( struct sock sk,
unsigned int  group 
)

Definition at line 986 of file af_netlink.c.

void netlink_kernel_release ( struct sock sk)
int netlink_register_notifier ( struct notifier_block nb)
int netlink_sendskb ( struct sock sk,
struct sk_buff skb 
)

Definition at line 882 of file af_netlink.c.

int netlink_set_err ( struct sock ssk,
__u32  portid,
__u32  group,
int  code 
)
void netlink_table_grab ( void  )

Definition at line 197 of file af_netlink.c.

void netlink_table_ungrab ( void  )

Definition at line 222 of file af_netlink.c.

int netlink_unicast ( struct sock ssk,
struct sk_buff skb,
__u32  portid,
int  nonblock 
)

Definition at line 950 of file af_netlink.c.

int netlink_unregister_notifier ( struct notifier_block nb)