diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-07-03 16:51:22 +0900 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-07-03 17:51:57 +0900 |
commit | e0835f8fa56d2d308486f8a34cf1c4480cd27f4e (patch) | |
tree | 8b9e2f60795dbc6e0e0138c8e7c362efecb568e8 /include/linux/mroute6.h | |
parent | 03d2f897e9fb3218989baa2139a951ce7f5414bf (diff) | |
download | op-kernel-dev-e0835f8fa56d2d308486f8a34cf1c4480cd27f4e.zip op-kernel-dev-e0835f8fa56d2d308486f8a34cf1c4480cd27f4e.tar.gz |
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.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index 4c4d6f5..5cf5047 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h @@ -131,12 +131,44 @@ static inline int ip6_mroute_opt(int opt) struct sock; +#ifdef CONFIG_IPV6_MROUTE extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, int); extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); extern int ip6_mr_input(struct sk_buff *skb); extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); extern int ip6_mr_init(void); extern void ip6_mr_cleanup(void); +#else +static inline +int ip6_mroute_setsockopt(struct sock *sock, + int optname, char __user *optval, int optlen) +{ + return -ENOPROTOOPT; +} + +static inline +int ip6_mroute_getsockopt(struct sock *sock, + int optname, char __user *optval, int __user *optlen) +{ + return -ENOPROTOOPT; +} + +static inline +int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg) +{ + return -ENOIOCTLCMD; +} + +static inline int ip6_mr_init(void) +{ + return 0; +} + +static inline void ip6_mr_cleanup(void) +{ + return; +} +#endif struct mif_device { |