aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/inetdevice.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-29 06:54:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-29 06:54:01 -0500
commit0ba6c33bcddc64a54b5f1c25a696c4767dc76292 (patch)
tree62e616f97a4762d8e75bf732e4827af2d15d52c5 /include/linux/inetdevice.h
parent21af0297c7e56024a5ccc4d8ad2a590f9ec371ba (diff)
parent85040bcb4643cba578839e953f25e2d1965d83d0 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.25
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.25: (1470 commits) [IPV6] ADDRLABEL: Fix double free on label deletion. [PPP]: Sparse warning fixes. [IPV4] fib_trie: remove unneeded NULL check [IPV4] fib_trie: More whitespace cleanup. [NET_SCHED]: Use nla_policy for attribute validation in ematches [NET_SCHED]: Use nla_policy for attribute validation in actions [NET_SCHED]: Use nla_policy for attribute validation in classifiers [NET_SCHED]: Use nla_policy for attribute validation in packet schedulers [NET_SCHED]: sch_api: introduce constant for rate table size [NET_SCHED]: Use typeful attribute parsing helpers [NET_SCHED]: Use typeful attribute construction helpers [NET_SCHED]: Use NLA_PUT_STRING for string dumping [NET_SCHED]: Use nla_nest_start/nla_nest_end [NET_SCHED]: Propagate nla_parse return value [NET_SCHED]: act_api: use PTR_ERR in tcf_action_init/tcf_action_get [NET_SCHED]: act_api: use nlmsg_parse [NET_SCHED]: act_api: fix netlink API conversion bug [NET_SCHED]: sch_netem: use nla_parse_nested_compat [NET_SCHED]: sch_atm: fix format string warning [NETNS]: Add namespace for ICMP replying code. ...
Diffstat (limited to 'include/linux/inetdevice.h')
-rw-r--r--include/linux/inetdevice.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index d83fee2dc643..8d9eaaebded7 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -44,7 +44,8 @@ struct in_device
44}; 44};
45 45
46#define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1]) 46#define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1])
47#define IPV4_DEVCONF_ALL(attr) IPV4_DEVCONF(ipv4_devconf, attr) 47#define IPV4_DEVCONF_ALL(net, attr) \
48 IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr)
48 49
49static inline int ipv4_devconf_get(struct in_device *in_dev, int index) 50static inline int ipv4_devconf_get(struct in_device *in_dev, int index)
50{ 51{
@@ -71,16 +72,17 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
71 ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) 72 ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val))
72 73
73#define IN_DEV_ANDCONF(in_dev, attr) \ 74#define IN_DEV_ANDCONF(in_dev, attr) \
74 (IPV4_DEVCONF_ALL(attr) && IN_DEV_CONF_GET((in_dev), attr)) 75 (IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr) && \
76 IN_DEV_CONF_GET((in_dev), attr))
75#define IN_DEV_ORCONF(in_dev, attr) \ 77#define IN_DEV_ORCONF(in_dev, attr) \
76 (IPV4_DEVCONF_ALL(attr) || IN_DEV_CONF_GET((in_dev), attr)) 78 (IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr) || \
79 IN_DEV_CONF_GET((in_dev), attr))
77#define IN_DEV_MAXCONF(in_dev, attr) \ 80#define IN_DEV_MAXCONF(in_dev, attr) \
78 (max(IPV4_DEVCONF_ALL(attr), IN_DEV_CONF_GET((in_dev), attr))) 81 (max(IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr), \
82 IN_DEV_CONF_GET((in_dev), attr)))
79 83
80#define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) 84#define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING)
81#define IN_DEV_MFORWARD(in_dev) (IPV4_DEVCONF_ALL(MC_FORWARDING) && \ 85#define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING)
82 IPV4_DEVCONF((in_dev)->cnf, \
83 MC_FORWARDING))
84#define IN_DEV_RPFILTER(in_dev) IN_DEV_ANDCONF((in_dev), RP_FILTER) 86#define IN_DEV_RPFILTER(in_dev) IN_DEV_ANDCONF((in_dev), RP_FILTER)
85#define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ 87#define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \
86 ACCEPT_SOURCE_ROUTE) 88 ACCEPT_SOURCE_ROUTE)
@@ -127,15 +129,14 @@ struct in_ifaddr
127extern int register_inetaddr_notifier(struct notifier_block *nb); 129extern int register_inetaddr_notifier(struct notifier_block *nb);
128extern int unregister_inetaddr_notifier(struct notifier_block *nb); 130extern int unregister_inetaddr_notifier(struct notifier_block *nb);
129 131
130extern struct net_device *ip_dev_find(__be32 addr); 132extern struct net_device *ip_dev_find(struct net *net, __be32 addr);
131extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); 133extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b);
132extern int devinet_ioctl(unsigned int cmd, void __user *); 134extern int devinet_ioctl(unsigned int cmd, void __user *);
133extern void devinet_init(void); 135extern void devinet_init(void);
134extern struct in_device *inetdev_by_index(int); 136extern struct in_device *inetdev_by_index(struct net *, int);
135extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); 137extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope);
136extern __be32 inet_confirm_addr(const struct net_device *dev, __be32 dst, __be32 local, int scope); 138extern __be32 inet_confirm_addr(struct in_device *in_dev, __be32 dst, __be32 local, int scope);
137extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask); 139extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask);
138extern void inet_forward_change(void);
139 140
140static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) 141static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
141{ 142{