diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-07-03 03:51:22 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-07-03 04:51:57 -0400 |
commit | e0835f8fa56d2d308486f8a34cf1c4480cd27f4e (patch) | |
tree | 8b9e2f60795dbc6e0e0138c8e7c362efecb568e8 /include/linux/mroute.h | |
parent | 03d2f897e9fb3218989baa2139a951ce7f5414bf (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/mroute.h')
-rw-r--r-- | include/linux/mroute.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index df8efd42bf8a..07112ee9293a 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
@@ -144,10 +144,37 @@ static inline int ip_mroute_opt(int opt) | |||
144 | } | 144 | } |
145 | #endif | 145 | #endif |
146 | 146 | ||
147 | #ifdef CONFIG_IP_MROUTE | ||
147 | extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int); | 148 | extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int); |
148 | extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); | 149 | extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); |
149 | extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); | 150 | extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); |
150 | extern int ip_mr_init(void); | 151 | extern int ip_mr_init(void); |
152 | #else | ||
153 | static inline | ||
154 | int ip_mroute_setsockopt(struct sock *sock, | ||
155 | int optname, char __user *optval, int optlen) | ||
156 | { | ||
157 | return -ENOPROTOOPT; | ||
158 | } | ||
159 | |||
160 | static inline | ||
161 | int ip_mroute_getsockopt(struct sock *sock, | ||
162 | int optname, char __user *optval, int __user *optlen) | ||
163 | { | ||
164 | return -ENOPROTOOPT; | ||
165 | } | ||
166 | |||
167 | static inline | ||
168 | int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg) | ||
169 | { | ||
170 | return -ENOIOCTLCMD; | ||
171 | } | ||
172 | |||
173 | static inline int ip_mr_init(void) | ||
174 | { | ||
175 | return 0; | ||
176 | } | ||
177 | #endif | ||
151 | 178 | ||
152 | struct vif_device | 179 | struct vif_device |
153 | { | 180 | { |