Blame view
include/linux/rtnetlink.h
4.05 KB
1da177e4c Linux-2.6.12-rc2 |
1 2 |
#ifndef __LINUX_RTNETLINK_H #define __LINUX_RTNETLINK_H |
1da177e4c Linux-2.6.12-rc2 |
3 |
|
6756ae4b4 [NET]: Convert RT... |
4 |
#include <linux/mutex.h> |
3b42a96dc net: rtnetlink.h ... |
5 |
#include <linux/netdevice.h> |
200b916f3 rtnetlink: wait f... |
6 |
#include <linux/wait.h> |
607ca46e9 UAPI: (Scripted) ... |
7 |
#include <uapi/linux/rtnetlink.h> |
1da177e4c Linux-2.6.12-rc2 |
8 |
|
97c53cacf [NET]: Make rtnet... |
9 10 |
extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); |
1ce85fe40 netlink: change n... |
11 12 |
extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group, struct nlmsghdr *nlh, gfp_t flags); |
97c53cacf [NET]: Make rtnet... |
13 |
extern void rtnl_set_sk_err(struct net *net, u32 group, int error); |
1da177e4c Linux-2.6.12-rc2 |
14 |
extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); |
e3703b3de [RTNETLINK]: Add ... |
15 |
extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, |
87a50699c rtnetlink: Remove... |
16 |
u32 id, long expires, u32 error); |
1da177e4c Linux-2.6.12-rc2 |
17 |
|
7f2940540 net: fix rtnl not... |
18 |
void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change, gfp_t flags); |
395eea6cc rtnetlink: delay ... |
19 20 21 22 |
struct sk_buff *rtmsg_ifinfo_build_skb(int type, struct net_device *dev, unsigned change, gfp_t flags); void rtmsg_ifinfo_send(struct sk_buff *skb, struct net_device *dev, gfp_t flags); |
1da177e4c Linux-2.6.12-rc2 |
23 |
|
6756ae4b4 [NET]: Convert RT... |
24 |
/* RTNL is used as a global lock for all changes to network configuration */ |
1da177e4c Linux-2.6.12-rc2 |
25 |
extern void rtnl_lock(void); |
1da177e4c Linux-2.6.12-rc2 |
26 |
extern void rtnl_unlock(void); |
6756ae4b4 [NET]: Convert RT... |
27 |
extern int rtnl_trylock(void); |
c9c1014b2 [RTNETLINK]: Fix ... |
28 |
extern int rtnl_is_locked(void); |
200b916f3 rtnetlink: wait f... |
29 30 31 |
extern wait_queue_head_t netdev_unregistering_wq; extern struct mutex net_mutex; |
a898def29 net: Add checking... |
32 |
#ifdef CONFIG_PROVE_LOCKING |
0cbf33437 net/core: lockdep... |
33 |
extern bool lockdep_rtnl_is_held(void); |
85328240c net: allow netdev... |
34 |
#else |
0cbf33437 net/core: lockdep... |
35 |
static inline bool lockdep_rtnl_is_held(void) |
85328240c net: allow netdev... |
36 |
{ |
0cbf33437 net/core: lockdep... |
37 |
return true; |
85328240c net: allow netdev... |
38 |
} |
a898def29 net: Add checking... |
39 |
#endif /* #ifdef CONFIG_PROVE_LOCKING */ |
6756ae4b4 [NET]: Convert RT... |
40 |
|
a6e0fc851 net: introduce rc... |
41 42 43 44 45 |
/** * rcu_dereference_rtnl - rcu_dereference with debug checking * @p: The pointer to read, prior to dereferencing * * Do an rcu_dereference(p), but check caller either holds rcu_read_lock() |
29fa060ea net: relax rtnl_d... |
46 |
* or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference() |
a6e0fc851 net: introduce rc... |
47 48 |
*/ #define rcu_dereference_rtnl(p) \ |
d8bf4ca9c rcu: treewide: Do... |
49 |
rcu_dereference_check(p, lockdep_rtnl_is_held()) |
a6e0fc851 net: introduce rc... |
50 |
|
7dff59efb net: add rtnl_der... |
51 |
/** |
331b72922 net: sched: RCU c... |
52 53 54 55 56 57 58 59 60 61 |
* rcu_dereference_bh_rtnl - rcu_dereference_bh with debug checking * @p: The pointer to read, prior to dereference * * Do an rcu_dereference_bh(p), but check caller either holds rcu_read_lock_bh() * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference_bh() */ #define rcu_dereference_bh_rtnl(p) \ rcu_dereference_bh_check(p, lockdep_rtnl_is_held()) /** |
29fa060ea net: relax rtnl_d... |
62 |
* rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL |
7dff59efb net: add rtnl_der... |
63 64 |
* @p: The pointer to read, prior to dereferencing * |
29fa060ea net: relax rtnl_d... |
65 66 67 |
* Return the value of the specified RCU-protected pointer, but omit * both the smp_read_barrier_depends() and the ACCESS_ONCE(), because * caller holds RTNL. |
7dff59efb net: add rtnl_der... |
68 69 |
*/ #define rtnl_dereference(p) \ |
29fa060ea net: relax rtnl_d... |
70 |
rcu_dereference_protected(p, lockdep_rtnl_is_held()) |
7dff59efb net: add rtnl_der... |
71 |
|
24824a09e net: dynamic ingr... |
72 73 74 75 |
static inline struct netdev_queue *dev_ingress_queue(struct net_device *dev) { return rtnl_dereference(dev->ingress_queue); } |
4577139b2 net: use jump lab... |
76 |
struct netdev_queue *dev_ingress_queue_create(struct net_device *dev); |
1cf51900f net: add CONFIG_N... |
77 |
#ifdef CONFIG_NET_INGRESS |
4577139b2 net: use jump lab... |
78 79 |
void net_inc_ingress_queue(void); void net_dec_ingress_queue(void); |
4577139b2 net: use jump lab... |
80 |
#endif |
24824a09e net: dynamic ingr... |
81 |
|
1f211a1b9 net, sched: add c... |
82 83 84 85 |
#ifdef CONFIG_NET_EGRESS void net_inc_egress_queue(void); void net_dec_egress_queue(void); #endif |
1b5c5493e net_sched: add th... |
86 87 88 |
void rtnetlink_init(void); void __rtnl_unlock(void); void rtnl_kfree_skbs(struct sk_buff *head, struct sk_buff *tail); |
1da177e4c Linux-2.6.12-rc2 |
89 90 |
#define ASSERT_RTNL() do { \ |
c9c1014b2 [RTNETLINK]: Fix ... |
91 |
if (unlikely(!rtnl_is_locked())) { \ |
1da177e4c Linux-2.6.12-rc2 |
92 93 94 95 96 97 |
printk(KERN_ERR "RTNL: assertion failed at %s (%d) ", \ __FILE__, __LINE__); \ dump_stack(); \ } \ } while(0) |
77162022a net: add generic ... |
98 99 100 |
extern int ndo_dflt_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, struct net_device *dev, |
5d5eacb34 bridge: fdb dumpi... |
101 |
struct net_device *filter_dev, |
d297653dd rtnetlink: fdb du... |
102 |
int *idx); |
090096bf3 net: generic fdb ... |
103 104 105 106 |
extern int ndo_dflt_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, const unsigned char *addr, |
f6f6424ba net: make vid as ... |
107 108 |
u16 vid, u16 flags); |
090096bf3 net: generic fdb ... |
109 110 111 |
extern int ndo_dflt_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, |
f6f6424ba net: make vid as ... |
112 113 |
const unsigned char *addr, u16 vid); |
815cccbf1 ixgbe: add setlin... |
114 115 |
extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, |
2c3c031c8 bridge: add brpor... |
116 |
struct net_device *dev, u16 mode, |
7d4f8d871 switchdev; add VL... |
117 118 119 120 121 |
u32 flags, u32 mask, int nlflags, u32 filter_mask, int (*vlan_fill)(struct sk_buff *skb, struct net_device *dev, u32 filter_mask)); |
1da177e4c Linux-2.6.12-rc2 |
122 |
#endif /* __LINUX_RTNETLINK_H */ |