Blame view
include/linux/rtnetlink.h
4.46 KB
b24413180 License cleanup: ... |
1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
1da177e4c Linux-2.6.12-rc2 |
2 3 |
#ifndef __LINUX_RTNETLINK_H #define __LINUX_RTNETLINK_H |
1da177e4c Linux-2.6.12-rc2 |
4 |
|
6756ae4b4 [NET]: Convert RT... |
5 |
#include <linux/mutex.h> |
3b42a96dc net: rtnetlink.h ... |
6 |
#include <linux/netdevice.h> |
200b916f3 rtnetlink: wait f... |
7 |
#include <linux/wait.h> |
6f99528e9 net: core: netlin... |
8 |
#include <linux/refcount.h> |
607ca46e9 UAPI: (Scripted) ... |
9 |
#include <uapi/linux/rtnetlink.h> |
1da177e4c Linux-2.6.12-rc2 |
10 |
|
97c53cacf [NET]: Make rtnet... |
11 12 |
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... |
13 14 |
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... |
15 |
extern void rtnl_set_sk_err(struct net *net, u32 group, int error); |
1da177e4c Linux-2.6.12-rc2 |
16 |
extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); |
e3703b3de [RTNETLINK]: Add ... |
17 |
extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, |
87a50699c rtnetlink: Remove... |
18 |
u32 id, long expires, u32 error); |
1da177e4c Linux-2.6.12-rc2 |
19 |
|
7f2940540 net: fix rtnl not... |
20 |
void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change, gfp_t flags); |
6621dd29e dev: advertise th... |
21 |
void rtmsg_ifinfo_newnet(int type, struct net_device *dev, unsigned int change, |
38e01b305 dev: advertise th... |
22 |
gfp_t flags, int *new_nsid, int new_ifindex); |
395eea6cc rtnetlink: delay ... |
23 |
struct sk_buff *rtmsg_ifinfo_build_skb(int type, struct net_device *dev, |
3d3ea5af5 rtnl: Add support... |
24 |
unsigned change, u32 event, |
38e01b305 dev: advertise th... |
25 26 |
gfp_t flags, int *new_nsid, int new_ifindex); |
395eea6cc rtnetlink: delay ... |
27 28 |
void rtmsg_ifinfo_send(struct sk_buff *skb, struct net_device *dev, gfp_t flags); |
1da177e4c Linux-2.6.12-rc2 |
29 |
|
6756ae4b4 [NET]: Convert RT... |
30 |
/* RTNL is used as a global lock for all changes to network configuration */ |
1da177e4c Linux-2.6.12-rc2 |
31 |
extern void rtnl_lock(void); |
1da177e4c Linux-2.6.12-rc2 |
32 |
extern void rtnl_unlock(void); |
6756ae4b4 [NET]: Convert RT... |
33 |
extern int rtnl_trylock(void); |
c9c1014b2 [RTNETLINK]: Fix ... |
34 |
extern int rtnl_is_locked(void); |
79ffdfc65 net: Add rtnl_loc... |
35 |
extern int rtnl_lock_killable(void); |
6f99528e9 net: core: netlin... |
36 |
extern bool refcount_dec_and_rtnl_lock(refcount_t *r); |
200b916f3 rtnetlink: wait f... |
37 38 |
extern wait_queue_head_t netdev_unregistering_wq; |
4420bf21f net: Rename net_s... |
39 |
extern struct rw_semaphore pernet_ops_rwsem; |
f0b07bb15 net: Introduce ne... |
40 |
extern struct rw_semaphore net_rwsem; |
200b916f3 rtnetlink: wait f... |
41 |
|
a898def29 net: Add checking... |
42 |
#ifdef CONFIG_PROVE_LOCKING |
0cbf33437 net/core: lockdep... |
43 |
extern bool lockdep_rtnl_is_held(void); |
85328240c net: allow netdev... |
44 |
#else |
0cbf33437 net/core: lockdep... |
45 |
static inline bool lockdep_rtnl_is_held(void) |
85328240c net: allow netdev... |
46 |
{ |
0cbf33437 net/core: lockdep... |
47 |
return true; |
85328240c net: allow netdev... |
48 |
} |
a898def29 net: Add checking... |
49 |
#endif /* #ifdef CONFIG_PROVE_LOCKING */ |
6756ae4b4 [NET]: Convert RT... |
50 |
|
a6e0fc851 net: introduce rc... |
51 52 53 54 55 |
/** * 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... |
56 |
* or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference() |
a6e0fc851 net: introduce rc... |
57 58 |
*/ #define rcu_dereference_rtnl(p) \ |
d8bf4ca9c rcu: treewide: Do... |
59 |
rcu_dereference_check(p, lockdep_rtnl_is_held()) |
a6e0fc851 net: introduce rc... |
60 |
|
7dff59efb net: add rtnl_der... |
61 |
/** |
331b72922 net: sched: RCU c... |
62 63 64 65 66 67 68 69 70 71 |
* 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... |
72 |
* rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL |
7dff59efb net: add rtnl_der... |
73 74 |
* @p: The pointer to read, prior to dereferencing * |
29fa060ea net: relax rtnl_d... |
75 |
* Return the value of the specified RCU-protected pointer, but omit |
1ba9c5e6c rtnetlink: Update... |
76 |
* the READ_ONCE(), because caller holds RTNL. |
7dff59efb net: add rtnl_der... |
77 78 |
*/ #define rtnl_dereference(p) \ |
29fa060ea net: relax rtnl_d... |
79 |
rcu_dereference_protected(p, lockdep_rtnl_is_held()) |
7dff59efb net: add rtnl_der... |
80 |
|
24824a09e net: dynamic ingr... |
81 82 83 84 |
static inline struct netdev_queue *dev_ingress_queue(struct net_device *dev) { return rtnl_dereference(dev->ingress_queue); } |
3a7d0d07a net: sched: exten... |
85 86 87 88 |
static inline struct netdev_queue *dev_ingress_queue_rcu(struct net_device *dev) { return rcu_dereference(dev->ingress_queue); } |
4577139b2 net: use jump lab... |
89 |
struct netdev_queue *dev_ingress_queue_create(struct net_device *dev); |
1cf51900f net: add CONFIG_N... |
90 |
#ifdef CONFIG_NET_INGRESS |
4577139b2 net: use jump lab... |
91 92 |
void net_inc_ingress_queue(void); void net_dec_ingress_queue(void); |
4577139b2 net: use jump lab... |
93 |
#endif |
24824a09e net: dynamic ingr... |
94 |
|
1f211a1b9 net, sched: add c... |
95 96 97 98 |
#ifdef CONFIG_NET_EGRESS void net_inc_egress_queue(void); void net_dec_egress_queue(void); #endif |
1b5c5493e net_sched: add th... |
99 100 101 |
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 |
102 |
|
66364bdf3 rtnetlink: Replac... |
103 104 105 106 |
#define ASSERT_RTNL() \ WARN_ONCE(!rtnl_is_locked(), \ "RTNL: assertion failed at %s (%d) ", __FILE__, __LINE__) |
1da177e4c Linux-2.6.12-rc2 |
107 |
|
77162022a net: add generic ... |
108 109 110 |
extern int ndo_dflt_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, struct net_device *dev, |
5d5eacb34 bridge: fdb dumpi... |
111 |
struct net_device *filter_dev, |
d297653dd rtnetlink: fdb du... |
112 |
int *idx); |
090096bf3 net: generic fdb ... |
113 114 115 116 |
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 ... |
117 118 |
u16 vid, u16 flags); |
090096bf3 net: generic fdb ... |
119 120 121 |
extern int ndo_dflt_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, |
f6f6424ba net: make vid as ... |
122 123 |
const unsigned char *addr, u16 vid); |
815cccbf1 ixgbe: add setlin... |
124 125 |
extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, |
2c3c031c8 bridge: add brpor... |
126 |
struct net_device *dev, u16 mode, |
7d4f8d871 switchdev; add VL... |
127 128 129 130 131 |
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 |
132 |
#endif /* __LINUX_RTNETLINK_H */ |