include/linux/mroute6.h
changeset 2 d1f6d8b6f81c
parent 0 aa628870c1d3
equal deleted inserted replaced
1:0056487c491e 2:d1f6d8b6f81c
   115 
   115 
   116 #ifdef __KERNEL__
   116 #ifdef __KERNEL__
   117 
   117 
   118 #include <linux/pim.h>
   118 #include <linux/pim.h>
   119 #include <linux/skbuff.h>	/* for struct sk_buff_head */
   119 #include <linux/skbuff.h>	/* for struct sk_buff_head */
       
   120 #include <net/net_namespace.h>
   120 
   121 
   121 #ifdef CONFIG_IPV6_MROUTE
   122 #ifdef CONFIG_IPV6_MROUTE
   122 static inline int ip6_mroute_opt(int opt)
   123 static inline int ip6_mroute_opt(int opt)
   123 {
   124 {
   124 	return (opt >= MRT6_BASE) && (opt <= MRT6_BASE + 10);
   125 	return (opt >= MRT6_BASE) && (opt <= MRT6_BASE + 10);
   185 #define VIFF_STATIC 0x8000
   186 #define VIFF_STATIC 0x8000
   186 
   187 
   187 struct mfc6_cache
   188 struct mfc6_cache
   188 {
   189 {
   189 	struct mfc6_cache *next;		/* Next entry on cache line 	*/
   190 	struct mfc6_cache *next;		/* Next entry on cache line 	*/
       
   191 #ifdef CONFIG_NET_NS
       
   192 	struct net *mfc6_net;
       
   193 #endif
   190 	struct in6_addr mf6c_mcastgrp;			/* Group the entry belongs to 	*/
   194 	struct in6_addr mf6c_mcastgrp;			/* Group the entry belongs to 	*/
   191 	struct in6_addr mf6c_origin;			/* Source of packet 		*/
   195 	struct in6_addr mf6c_origin;			/* Source of packet 		*/
   192 	mifi_t mf6c_parent;			/* Source interface		*/
   196 	mifi_t mf6c_parent;			/* Source interface		*/
   193 	int mfc_flags;				/* Flags on line		*/
   197 	int mfc_flags;				/* Flags on line		*/
   194 
   198 
   207 			unsigned char ttls[MAXMIFS];	/* TTL thresholds		*/
   211 			unsigned char ttls[MAXMIFS];	/* TTL thresholds		*/
   208 		} res;
   212 		} res;
   209 	} mfc_un;
   213 	} mfc_un;
   210 };
   214 };
   211 
   215 
       
   216 static inline
       
   217 struct net *mfc6_net(const struct mfc6_cache *mfc)
       
   218 {
       
   219 	return read_pnet(&mfc->mfc6_net);
       
   220 }
       
   221 
       
   222 static inline
       
   223 void mfc6_net_set(struct mfc6_cache *mfc, struct net *net)
       
   224 {
       
   225 	write_pnet(&mfc->mfc6_net, hold_net(net));
       
   226 }
       
   227 
   212 #define MFC_STATIC		1
   228 #define MFC_STATIC		1
   213 #define MFC_NOTIFY		2
   229 #define MFC_NOTIFY		2
   214 
   230 
   215 #define MFC6_LINES		64
   231 #define MFC6_LINES		64
   216 
   232 
   227 
   243 
   228 #endif
   244 #endif
   229 
   245 
   230 #ifdef __KERNEL__
   246 #ifdef __KERNEL__
   231 struct rtmsg;
   247 struct rtmsg;
   232 extern int ip6mr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait);
   248 extern int ip6mr_get_route(struct net *net, struct sk_buff *skb,
       
   249 			   struct rtmsg *rtm, int nowait);
   233 
   250 
   234 #ifdef CONFIG_IPV6_MROUTE
   251 #ifdef CONFIG_IPV6_MROUTE
   235 extern struct sock *mroute6_socket;
   252 static inline struct sock *mroute6_socket(struct net *net)
       
   253 {
       
   254 	return net->ipv6.mroute6_sk;
       
   255 }
   236 extern int ip6mr_sk_done(struct sock *sk);
   256 extern int ip6mr_sk_done(struct sock *sk);
   237 #else
   257 #else
   238 #define mroute6_socket NULL
   258 static inline struct sock *mroute6_socket(struct net *net) { return NULL; }
   239 static inline int ip6mr_sk_done(struct sock *sk) { return 0; }
   259 static inline int ip6mr_sk_done(struct sock *sk) { return 0; }
   240 #endif
   260 #endif
   241 #endif
   261 #endif
   242 
   262 
   243 /*
   263 /*