/* * IP Virtual Server * data structure and functionality definitions */#ifndef _NET_IP_VS_H#define _NET_IP_VS_H#include<linux/ip_vs.h> /* definitions shared with userland */#include<asm/types.h> /* for __uXX types */#include<linux/sysctl.h> /* for ctl_path */#include<linux/list.h> /* for struct list_head */#include<linux/spinlock.h> /* for struct rwlock_t */#include<linux/atomic.h> /* for struct atomic_t */#include<linux/compiler.h>#include<linux/timer.h>#include<net/checksum.h>#include<linux/netfilter.h> /* for union nf_inet_addr */#include<linux/ip.h>#include<linux/ipv6.h> /* for struct ipv6hdr */#include<net/ipv6.h> /* for ipv6_addr_copy */#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)#include<net/netfilter/nf_conntrack.h>#endif#include<net/net_namespace.h> /* Netw namespace *//* * Generic access of ipvs struct */staticinlinestructnetns_ipvs*net_ipvs(structnet*net){returnnet->ipvs;}/* * Get net ptr from skb in traffic cases * use skb_sknet when call is from userland (ioctl or netlink) */staticinlinestructnet*skb_net(conststructsk_buff*skb){#ifdef CONFIG_NET_NS#ifdef CONFIG_IP_VS_DEBUG/* * This is used for debug only. * Start with the most likely hit * End with BUG */if(likely(skb->dev&&skb->dev->nd_net))returndev_net(skb->dev);if(skb_dst(skb)&&skb_dst(skb)->dev)returndev_net(skb_dst(skb)->dev);WARN(skb->sk,"Maybe skb_sknet should be used in %s() at line:%d\n",__func__,__LINE__);if(likely(skb->sk&&skb->sk->sk_net))returnsock_net(skb->sk);pr_err("There is no net ptr to find in the skb in %s() line:%d\n