Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
rtnetlink.c File Reference
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/string.h>
#include <linux/sockios.h>
#include <linux/net.h>
#include <linux/fcntl.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/capability.h>
#include <linux/skbuff.h>
#include <linux/init.h>
#include <linux/security.h>
#include <linux/mutex.h>
#include <linux/if_addr.h>
#include <linux/if_bridge.h>
#include <linux/pci.h>
#include <linux/etherdevice.h>
#include <asm/uaccess.h>
#include <linux/inet.h>
#include <linux/netdevice.h>
#include <net/ip.h>
#include <net/protocol.h>
#include <net/arp.h>
#include <net/route.h>
#include <net/udp.h>
#include <net/sock.h>
#include <net/pkt_sched.h>
#include <net/fib_rules.h>
#include <net/rtnetlink.h>
#include <net/net_namespace.h>

Go to the source code of this file.

Data Structures

struct  rtnl_link
 

Functions

void rtnl_lock (void)
 
 EXPORT_SYMBOL (rtnl_lock)
 
void __rtnl_unlock (void)
 
void rtnl_unlock (void)
 
 EXPORT_SYMBOL (rtnl_unlock)
 
int rtnl_trylock (void)
 
 EXPORT_SYMBOL (rtnl_trylock)
 
int rtnl_is_locked (void)
 
 EXPORT_SYMBOL (rtnl_is_locked)
 
int __rtnl_register (int protocol, int msgtype, rtnl_doit_func doit, rtnl_dumpit_func dumpit, rtnl_calcit_func calcit)
 
 EXPORT_SYMBOL_GPL (__rtnl_register)
 
void rtnl_register (int protocol, int msgtype, rtnl_doit_func doit, rtnl_dumpit_func dumpit, rtnl_calcit_func calcit)
 
 EXPORT_SYMBOL_GPL (rtnl_register)
 
int rtnl_unregister (int protocol, int msgtype)
 
 EXPORT_SYMBOL_GPL (rtnl_unregister)
 
void rtnl_unregister_all (int protocol)
 
 EXPORT_SYMBOL_GPL (rtnl_unregister_all)
 
int __rtnl_link_register (struct rtnl_link_ops *ops)
 
 EXPORT_SYMBOL_GPL (__rtnl_link_register)
 
int rtnl_link_register (struct rtnl_link_ops *ops)
 
 EXPORT_SYMBOL_GPL (rtnl_link_register)
 
void __rtnl_link_unregister (struct rtnl_link_ops *ops)
 
 EXPORT_SYMBOL_GPL (__rtnl_link_unregister)
 
void rtnl_link_unregister (struct rtnl_link_ops *ops)
 
 EXPORT_SYMBOL_GPL (rtnl_link_unregister)
 
int __rtnl_af_register (struct rtnl_af_ops *ops)
 
 EXPORT_SYMBOL_GPL (__rtnl_af_register)
 
int rtnl_af_register (struct rtnl_af_ops *ops)
 
 EXPORT_SYMBOL_GPL (rtnl_af_register)
 
void __rtnl_af_unregister (struct rtnl_af_ops *ops)
 
 EXPORT_SYMBOL_GPL (__rtnl_af_unregister)
 
void rtnl_af_unregister (struct rtnl_af_ops *ops)
 
 EXPORT_SYMBOL_GPL (rtnl_af_unregister)
 
int rtnetlink_send (struct sk_buff *skb, struct net *net, u32 pid, unsigned int group, int echo)
 
int rtnl_unicast (struct sk_buff *skb, struct net *net, u32 pid)
 
 EXPORT_SYMBOL (rtnl_unicast)
 
void rtnl_notify (struct sk_buff *skb, struct net *net, u32 pid, u32 group, struct nlmsghdr *nlh, gfp_t flags)
 
 EXPORT_SYMBOL (rtnl_notify)
 
void rtnl_set_sk_err (struct net *net, u32 group, int error)
 
 EXPORT_SYMBOL (rtnl_set_sk_err)
 
int rtnetlink_put_metrics (struct sk_buff *skb, u32 *metrics)
 
 EXPORT_SYMBOL (rtnetlink_put_metrics)
 
int rtnl_put_cacheinfo (struct sk_buff *skb, struct dst_entry *dst, u32 id, long expires, u32 error)
 
 EXPORT_SYMBOL_GPL (rtnl_put_cacheinfo)
 
 EXPORT_SYMBOL (ifla_policy)
 
struct netrtnl_link_get_net (struct net *src_net, struct nlattr *tb[])
 
 EXPORT_SYMBOL (rtnl_link_get_net)
 
int rtnl_configure_link (struct net_device *dev, const struct ifinfomsg *ifm)
 
 EXPORT_SYMBOL (rtnl_configure_link)
 
struct net_devicertnl_create_link (struct net *src_net, struct net *net, char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[])
 
 EXPORT_SYMBOL (rtnl_create_link)
 
void rtmsg_ifinfo (int type, struct net_device *dev, unsigned int change)
 
int ndo_dflt_fdb_dump (struct sk_buff *skb, struct netlink_callback *cb, struct net_device *dev, int idx)
 
 EXPORT_SYMBOL (ndo_dflt_fdb_dump)
 
void __init rtnetlink_init (void)
 

Variables

struct nla_policy ifla_policy [IFLA_MAX+1]
 

Function Documentation

int __rtnl_af_register ( struct rtnl_af_ops ops)

__rtnl_af_register - Register rtnl_af_ops with rtnetlink. : struct rtnl_af_ops * to register

The caller must hold the rtnl_mutex.

Returns 0 on success or a negative error code.

Definition at line 413 of file rtnetlink.c.

void __rtnl_af_unregister ( struct rtnl_af_ops ops)

__rtnl_af_unregister - Unregister rtnl_af_ops from rtnetlink. : struct rtnl_af_ops * to unregister

The caller must hold the rtnl_mutex.

Definition at line 443 of file rtnetlink.c.

int __rtnl_link_register ( struct rtnl_link_ops ops)

__rtnl_link_register - Register rtnl_link_ops with rtnetlink. : struct rtnl_link_ops * to register

The caller must hold the rtnl_mutex. This function should be used by drivers that create devices during module initialization. It must be called before registering the devices.

Returns 0 on success or a negative error code.

Definition at line 297 of file rtnetlink.c.

void __rtnl_link_unregister ( struct rtnl_link_ops ops)

__rtnl_link_unregister - Unregister rtnl_link_ops from rtnetlink. : struct rtnl_link_ops * to unregister

The caller must hold the rtnl_mutex.

Definition at line 345 of file rtnetlink.c.

int __rtnl_register ( int  protocol,
int  msgtype,
rtnl_doit_func  doit,
rtnl_dumpit_func  dumpit,
rtnl_calcit_func  calcit 
)

Definition at line 182 of file rtnetlink.c.

void __rtnl_unlock ( void  )

Definition at line 71 of file rtnetlink.c.

EXPORT_SYMBOL ( rtnl_lock  )
EXPORT_SYMBOL ( rtnl_unlock  )
EXPORT_SYMBOL ( rtnl_trylock  )
EXPORT_SYMBOL ( rtnl_is_locked  )
EXPORT_SYMBOL ( rtnl_unicast  )
EXPORT_SYMBOL ( rtnl_notify  )
EXPORT_SYMBOL ( rtnl_set_sk_err  )
EXPORT_SYMBOL ( rtnetlink_put_metrics  )
EXPORT_SYMBOL ( ifla_policy  )
EXPORT_SYMBOL ( rtnl_link_get_net  )
EXPORT_SYMBOL ( rtnl_configure_link  )
EXPORT_SYMBOL ( rtnl_create_link  )
EXPORT_SYMBOL ( ndo_dflt_fdb_dump  )
EXPORT_SYMBOL_GPL ( __rtnl_register  )
EXPORT_SYMBOL_GPL ( rtnl_register  )
EXPORT_SYMBOL_GPL ( rtnl_unregister  )
EXPORT_SYMBOL_GPL ( rtnl_unregister_all  )
EXPORT_SYMBOL_GPL ( __rtnl_link_register  )
EXPORT_SYMBOL_GPL ( rtnl_link_register  )
EXPORT_SYMBOL_GPL ( __rtnl_link_unregister  )
EXPORT_SYMBOL_GPL ( rtnl_link_unregister  )
EXPORT_SYMBOL_GPL ( __rtnl_af_register  )
EXPORT_SYMBOL_GPL ( rtnl_af_register  )
EXPORT_SYMBOL_GPL ( __rtnl_af_unregister  )
EXPORT_SYMBOL_GPL ( rtnl_af_unregister  )
EXPORT_SYMBOL_GPL ( rtnl_put_cacheinfo  )
int ndo_dflt_fdb_dump ( struct sk_buff skb,
struct netlink_callback cb,
struct net_device dev,
int  idx 
)

ndo_dflt_fdb_dump - default netdevice operation to dump an FDB table. : netlink message header : netdevice

Default netdevice operation to dump the existing unicast address list. Returns zero on success.

Definition at line 2213 of file rtnetlink.c.

void rtmsg_ifinfo ( int  type,
struct net_device dev,
unsigned int  change 
)

Definition at line 1967 of file rtnetlink.c.

void __init rtnetlink_init ( void  )

Definition at line 2408 of file rtnetlink.c.

int rtnetlink_put_metrics ( struct sk_buff skb,
u32 metrics 
)

Definition at line 587 of file rtnetlink.c.

int rtnetlink_send ( struct sk_buff skb,
struct net net,
u32  pid,
unsigned int  group,
int  echo 
)

Definition at line 544 of file rtnetlink.c.

int rtnl_af_register ( struct rtnl_af_ops ops)

rtnl_af_register - Register rtnl_af_ops with rtnetlink. : struct rtnl_af_ops * to register

Returns 0 on success or a negative error code.

Definition at line 426 of file rtnetlink.c.

void rtnl_af_unregister ( struct rtnl_af_ops ops)

rtnl_af_unregister - Unregister rtnl_af_ops from rtnetlink. : struct rtnl_af_ops * to unregister

Definition at line 453 of file rtnetlink.c.

int rtnl_configure_link ( struct net_device dev,
const struct ifinfomsg ifm 
)

Definition at line 1621 of file rtnetlink.c.

struct net_device* rtnl_create_link ( struct net src_net,
struct net net,
char ifname,
const struct rtnl_link_ops ops,
struct nlattr tb[] 
)
read

Definition at line 1641 of file rtnetlink.c.

int rtnl_is_locked ( void  )

Definition at line 89 of file rtnetlink.c.

struct net* rtnl_link_get_net ( struct net src_net,
struct nlattr tb[] 
)
read

Definition at line 1164 of file rtnetlink.c.

int rtnl_link_register ( struct rtnl_link_ops ops)

rtnl_link_register - Register rtnl_link_ops with rtnetlink. : struct rtnl_link_ops * to register

Returns 0 on success or a negative error code.

Definition at line 316 of file rtnetlink.c.

void rtnl_link_unregister ( struct rtnl_link_ops ops)

rtnl_link_unregister - Unregister rtnl_link_ops from rtnetlink. : struct rtnl_link_ops * to unregister

Definition at line 360 of file rtnetlink.c.

void rtnl_lock ( void  )

Definition at line 65 of file rtnetlink.c.

void rtnl_notify ( struct sk_buff skb,
struct net net,
u32  pid,
u32  group,
struct nlmsghdr nlh,
gfp_t  flags 
)

Definition at line 566 of file rtnetlink.c.

int rtnl_put_cacheinfo ( struct sk_buff skb,
struct dst_entry dst,
u32  id,
long  expires,
u32  error 
)

Definition at line 617 of file rtnetlink.c.

void rtnl_register ( int  protocol,
int  msgtype,
rtnl_doit_func  doit,
rtnl_dumpit_func  dumpit,
rtnl_calcit_func  calcit 
)

rtnl_register - Register a rtnetlink message type

Identical to __rtnl_register() but panics on failure. This is useful as failure of this function is very unlikely, it can only happen due to lack of memory when allocating the chain to store all message handlers for a protocol. Meant for use in init functions where lack of memory implies no sense in continuing.

Definition at line 223 of file rtnetlink.c.

void rtnl_set_sk_err ( struct net net,
u32  group,
int  error 
)

Definition at line 579 of file rtnetlink.c.

int rtnl_trylock ( void  )

Definition at line 83 of file rtnetlink.c.

int rtnl_unicast ( struct sk_buff skb,
struct net net,
u32  pid 
)

Definition at line 558 of file rtnetlink.c.

void rtnl_unlock ( void  )

Definition at line 76 of file rtnetlink.c.

int rtnl_unregister ( int  protocol,
int  msgtype 
)

Definition at line 241 of file rtnetlink.c.

void rtnl_unregister_all ( int  protocol)

Definition at line 265 of file rtnetlink.c.

Variable Documentation

struct nla_policy ifla_policy[IFLA_MAX+1]
Initial value:
= {
[IFLA_IFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ-1 },
[IFLA_ADDRESS] = { .type = NLA_BINARY, .len = MAX_ADDR_LEN },
[IFLA_BROADCAST] = { .type = NLA_BINARY, .len = MAX_ADDR_LEN },
[IFLA_MAP] = { .len = sizeof(struct rtnl_link_ifmap) },
[IFLA_MTU] = { .type = NLA_U32 },
[IFLA_LINK] = { .type = NLA_U32 },
[IFLA_MASTER] = { .type = NLA_U32 },
[IFLA_TXQLEN] = { .type = NLA_U32 },
[IFLA_WEIGHT] = { .type = NLA_U32 },
[IFLA_OPERSTATE] = { .type = NLA_U8 },
[IFLA_LINKMODE] = { .type = NLA_U8 },
[IFLA_LINKINFO] = { .type = NLA_NESTED },
[IFLA_NET_NS_PID] = { .type = NLA_U32 },
[IFLA_NET_NS_FD] = { .type = NLA_U32 },
[IFLA_IFALIAS] = { .type = NLA_STRING, .len = IFALIASZ-1 },
[IFLA_VF_PORTS] = { .type = NLA_NESTED },
[IFLA_PORT_SELF] = { .type = NLA_NESTED },
[IFLA_AF_SPEC] = { .type = NLA_NESTED },
[IFLA_EXT_MASK] = { .type = NLA_U32 },
[IFLA_PROMISCUITY] = { .type = NLA_U32 },
[IFLA_NUM_TX_QUEUES] = { .type = NLA_U32 },
[IFLA_NUM_RX_QUEUES] = { .type = NLA_U32 },
}

Definition at line 1103 of file rtnetlink.c.