Revert "Seperate read and write statistics of in_flight requests"
[safe/jmp/linux-2.6] / include / linux / mroute.h
index de4decf..0d45b4e 100644 (file)
@@ -6,7 +6,6 @@
 #ifdef __KERNEL__
 #include <linux/in.h>
 #endif
-#include <linux/pim.h>
 
 /*
  *     Based on the MROUTING 3.5 defines primarily to keep
@@ -130,6 +129,7 @@ struct igmpmsg
  */
 
 #ifdef __KERNEL__
+#include <linux/pim.h>
 #include <net/sock.h>
 
 #ifdef CONFIG_IP_MROUTE
@@ -144,11 +144,37 @@ static inline int ip_mroute_opt(int opt)
 }
 #endif
 
+#ifdef CONFIG_IP_MROUTE
 extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int);
 extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
 extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg);
-extern void ip_mr_init(void);
+extern int ip_mr_init(void);
+#else
+static inline
+int ip_mroute_setsockopt(struct sock *sock,
+                        int optname, char __user *optval, int optlen)
+{
+       return -ENOPROTOOPT;
+}
 
+static inline
+int ip_mroute_getsockopt(struct sock *sock,
+                        int optname, char __user *optval, int __user *optlen)
+{
+       return -ENOPROTOOPT;
+}
+
+static inline
+int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg)
+{
+       return -ENOIOCTLCMD;
+}
+
+static inline int ip_mr_init(void)
+{
+       return 0;
+}
+#endif
 
 struct vif_device
 {
@@ -167,6 +193,9 @@ struct vif_device
 struct mfc_cache 
 {
        struct mfc_cache *next;                 /* Next entry on cache line     */
+#ifdef CONFIG_NET_NS
+       struct net *mfc_net;
+#endif
        __be32 mfc_mcastgrp;                    /* Group the entry belongs to   */
        __be32 mfc_origin;                      /* Source of packet             */
        vifi_t mfc_parent;                      /* Source interface             */
@@ -189,6 +218,18 @@ struct mfc_cache
        } mfc_un;
 };
 
+static inline
+struct net *mfc_net(const struct mfc_cache *mfc)
+{
+       return read_pnet(&mfc->mfc_net);
+}
+
+static inline
+void mfc_net_set(struct mfc_cache *mfc, struct net *net)
+{
+       write_pnet(&mfc->mfc_net, hold_net(net));
+}
+
 #define MFC_STATIC             1
 #define MFC_NOTIFY             2
 
@@ -215,7 +256,8 @@ struct mfc_cache
 
 #ifdef __KERNEL__
 struct rtmsg;
-extern int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait);
+extern int ipmr_get_route(struct net *net, struct sk_buff *skb,
+                         struct rtmsg *rtm, int nowait);
 #endif
 
 #endif