aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mroute6.h
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-07-03 03:51:22 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-07-03 04:51:57 -0400
commite0835f8fa56d2d308486f8a34cf1c4480cd27f4e (patch)
tree8b9e2f60795dbc6e0e0138c8e7c362efecb568e8 /include/linux/mroute6.h
parent03d2f897e9fb3218989baa2139a951ce7f5414bf (diff)
ipv4,ipv6 mroute: Add some helper inline functions to remove ugly ifdefs.
ip{,v6}_mroute_{set,get}sockopt() should not matter by optimization but it would be better not to depend on optimization semantically. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'include/linux/mroute6.h')
-rw-r--r--include/linux/mroute6.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
index 4c4d6f57d5c5..5cf50473a10f 100644
--- a/include/linux/mroute6.h
+++ b/include/linux/mroute6.h
@@ -131,12 +131,44 @@ static inline int ip6_mroute_opt(int opt)
131 131
132struct sock; 132struct sock;
133 133
134#ifdef CONFIG_IPV6_MROUTE
134extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, int); 135extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, int);
135extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); 136extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
136extern int ip6_mr_input(struct sk_buff *skb); 137extern int ip6_mr_input(struct sk_buff *skb);
137extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); 138extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg);
138extern int ip6_mr_init(void); 139extern int ip6_mr_init(void);
139extern void ip6_mr_cleanup(void); 140extern void ip6_mr_cleanup(void);
141#else
142static inline
143int ip6_mroute_setsockopt(struct sock *sock,
144 int optname, char __user *optval, int optlen)
145{
146 return -ENOPROTOOPT;
147}
148
149static inline
150int ip6_mroute_getsockopt(struct sock *sock,
151 int optname, char __user *optval, int __user *optlen)
152{
153 return -ENOPROTOOPT;
154}
155
156static inline
157int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg)
158{
159 return -ENOIOCTLCMD;
160}
161
162static inline int ip6_mr_init(void)
163{
164 return 0;
165}
166
167static inline void ip6_mr_cleanup(void)
168{
169 return;
170}
171#endif
140 172
141struct mif_device 173struct mif_device
142{ 174{