aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/inetdevice.h
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /include/linux/inetdevice.h
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'include/linux/inetdevice.h')
-rw-r--r--include/linux/inetdevice.h52
1 files changed, 41 insertions, 11 deletions
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index ad27c7da8798..2be1a1a2beb9 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -10,15 +10,43 @@
10#include <linux/timer.h> 10#include <linux/timer.h>
11#include <linux/sysctl.h> 11#include <linux/sysctl.h>
12 12
13struct ipv4_devconf 13enum
14{ 14{
15 IPV4_DEVCONF_FORWARDING=1,
16 IPV4_DEVCONF_MC_FORWARDING,
17 IPV4_DEVCONF_PROXY_ARP,
18 IPV4_DEVCONF_ACCEPT_REDIRECTS,
19 IPV4_DEVCONF_SECURE_REDIRECTS,
20 IPV4_DEVCONF_SEND_REDIRECTS,
21 IPV4_DEVCONF_SHARED_MEDIA,
22 IPV4_DEVCONF_RP_FILTER,
23 IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE,
24 IPV4_DEVCONF_BOOTP_RELAY,
25 IPV4_DEVCONF_LOG_MARTIANS,
26 IPV4_DEVCONF_TAG,
27 IPV4_DEVCONF_ARPFILTER,
28 IPV4_DEVCONF_MEDIUM_ID,
29 IPV4_DEVCONF_NOXFRM,
30 IPV4_DEVCONF_NOPOLICY,
31 IPV4_DEVCONF_FORCE_IGMP_VERSION,
32 IPV4_DEVCONF_ARP_ANNOUNCE,
33 IPV4_DEVCONF_ARP_IGNORE,
34 IPV4_DEVCONF_PROMOTE_SECONDARIES,
35 IPV4_DEVCONF_ARP_ACCEPT,
36 IPV4_DEVCONF_ARP_NOTIFY,
37 IPV4_DEVCONF_ACCEPT_LOCAL,
38 IPV4_DEVCONF_SRC_VMARK,
39 IPV4_DEVCONF_PROXY_ARP_PVLAN,
40 __IPV4_DEVCONF_MAX
41};
42
43struct ipv4_devconf {
15 void *sysctl; 44 void *sysctl;
16 int data[__NET_IPV4_CONF_MAX - 1]; 45 int data[__IPV4_DEVCONF_MAX - 1];
17 DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1); 46 DECLARE_BITMAP(state, __IPV4_DEVCONF_MAX - 1);
18}; 47};
19 48
20struct in_device 49struct in_device {
21{
22 struct net_device *dev; 50 struct net_device *dev;
23 atomic_t refcnt; 51 atomic_t refcnt;
24 int dead; 52 int dead;
@@ -42,7 +70,7 @@ struct in_device
42 struct rcu_head rcu_head; 70 struct rcu_head rcu_head;
43}; 71};
44 72
45#define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1]) 73#define IPV4_DEVCONF(cnf, attr) ((cnf).data[IPV4_DEVCONF_ ## attr - 1])
46#define IPV4_DEVCONF_ALL(net, attr) \ 74#define IPV4_DEVCONF_ALL(net, attr) \
47 IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr) 75 IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr)
48 76
@@ -62,13 +90,13 @@ static inline void ipv4_devconf_set(struct in_device *in_dev, int index,
62 90
63static inline void ipv4_devconf_setall(struct in_device *in_dev) 91static inline void ipv4_devconf_setall(struct in_device *in_dev)
64{ 92{
65 bitmap_fill(in_dev->cnf.state, __NET_IPV4_CONF_MAX - 1); 93 bitmap_fill(in_dev->cnf.state, __IPV4_DEVCONF_MAX - 1);
66} 94}
67 95
68#define IN_DEV_CONF_GET(in_dev, attr) \ 96#define IN_DEV_CONF_GET(in_dev, attr) \
69 ipv4_devconf_get((in_dev), NET_IPV4_CONF_ ## attr) 97 ipv4_devconf_get((in_dev), IPV4_DEVCONF_ ## attr)
70#define IN_DEV_CONF_SET(in_dev, attr, val) \ 98#define IN_DEV_CONF_SET(in_dev, attr, val) \
71 ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) 99 ipv4_devconf_set((in_dev), IPV4_DEVCONF_ ## attr, (val))
72 100
73#define IN_DEV_ANDCONF(in_dev, attr) \ 101#define IN_DEV_ANDCONF(in_dev, attr) \
74 (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \ 102 (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \
@@ -83,12 +111,15 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
83#define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) 111#define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING)
84#define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) 112#define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING)
85#define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) 113#define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER)
114#define IN_DEV_SRC_VMARK(in_dev) IN_DEV_ORCONF((in_dev), SRC_VMARK)
86#define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ 115#define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \
87 ACCEPT_SOURCE_ROUTE) 116 ACCEPT_SOURCE_ROUTE)
117#define IN_DEV_ACCEPT_LOCAL(in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_LOCAL)
88#define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY) 118#define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY)
89 119
90#define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS) 120#define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS)
91#define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP) 121#define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP)
122#define IN_DEV_PROXY_ARP_PVLAN(in_dev) IN_DEV_CONF_GET(in_dev, PROXY_ARP_PVLAN)
92#define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA) 123#define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA)
93#define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS) 124#define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS)
94#define IN_DEV_SEC_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), \ 125#define IN_DEV_SEC_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), \
@@ -110,8 +141,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
110#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE) 141#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE)
111#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY) 142#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY)
112 143
113struct in_ifaddr 144struct in_ifaddr {
114{
115 struct in_ifaddr *ifa_next; 145 struct in_ifaddr *ifa_next;
116 struct in_device *ifa_dev; 146 struct in_device *ifa_dev;
117 struct rcu_head rcu_head; 147 struct rcu_head rcu_head;