#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/capability.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/sockios.h>
#include <linux/icmp.h>
#include <linux/if.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/net.h>
#include <linux/in6.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/icmpv6.h>
#include <linux/init.h>
#include <linux/route.h>
#include <linux/rtnetlink.h>
#include <linux/netfilter_ipv6.h>
#include <linux/slab.h>
#include <linux/hash.h>
#include <linux/etherdevice.h>
#include <linux/uaccess.h>
#include <linux/atomic.h>
#include <net/icmp.h>
#include <net/ip.h>
#include <net/ip_tunnels.h>
#include <net/ipv6.h>
#include <net/ip6_route.h>
#include <net/addrconf.h>
#include <net/ip6_tunnel.h>
#include <net/xfrm.h>
#include <net/dsfield.h>
#include <net/inet_ecn.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
#include <net/dst_metadata.h>
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS_RTNL_LINK(…) …;
MODULE_ALIAS_NETDEV(…) …;
#define IP6_TUNNEL_HASH_SIZE_SHIFT …
#define IP6_TUNNEL_HASH_SIZE …
static bool log_ecn_error = …;
module_param(log_ecn_error, bool, 0644);
MODULE_PARM_DESC(…) …;
static u32 HASH(const struct in6_addr *addr1, const struct in6_addr *addr2)
{ … }
static int ip6_tnl_dev_init(struct net_device *dev);
static void ip6_tnl_dev_setup(struct net_device *dev);
static struct rtnl_link_ops ip6_link_ops __read_mostly;
static unsigned int ip6_tnl_net_id __read_mostly;
struct ip6_tnl_net { … };
static inline int ip6_tnl_mpls_supported(void)
{ … }
#define for_each_ip6_tunnel_rcu(start) …
static struct ip6_tnl *
ip6_tnl_lookup(struct net *net, int link,
const struct in6_addr *remote, const struct in6_addr *local)
{ … }
static struct ip6_tnl __rcu **
ip6_tnl_bucket(struct ip6_tnl_net *ip6n, const struct __ip6_tnl_parm *p)
{ … }
static void
ip6_tnl_link(struct ip6_tnl_net *ip6n, struct ip6_tnl *t)
{ … }
static void
ip6_tnl_unlink(struct ip6_tnl_net *ip6n, struct ip6_tnl *t)
{ … }
static void ip6_dev_free(struct net_device *dev)
{ … }
static int ip6_tnl_create2(struct net_device *dev)
{ … }
static struct ip6_tnl *ip6_tnl_create(struct net *net, struct __ip6_tnl_parm *p)
{ … }
static struct ip6_tnl *ip6_tnl_locate(struct net *net,
struct __ip6_tnl_parm *p, int create)
{ … }
static void
ip6_tnl_dev_uninit(struct net_device *dev)
{ … }
__u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw)
{ … }
EXPORT_SYMBOL(…);
static int
ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt,
u8 *type, u8 *code, int *msg, __u32 *info, int offset)
{ … }
static int
ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
u8 type, u8 code, int offset, __be32 info)
{ … }
static int
ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
u8 type, u8 code, int offset, __be32 info)
{ … }
static int
mplsip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
u8 type, u8 code, int offset, __be32 info)
{ … }
static int ip4ip6_dscp_ecn_decapsulate(const struct ip6_tnl *t,
const struct ipv6hdr *ipv6h,
struct sk_buff *skb)
{ … }
static int ip6ip6_dscp_ecn_decapsulate(const struct ip6_tnl *t,
const struct ipv6hdr *ipv6h,
struct sk_buff *skb)
{ … }
static inline int mplsip6_dscp_ecn_decapsulate(const struct ip6_tnl *t,
const struct ipv6hdr *ipv6h,
struct sk_buff *skb)
{ … }
__u32 ip6_tnl_get_cap(struct ip6_tnl *t,
const struct in6_addr *laddr,
const struct in6_addr *raddr)
{ … }
EXPORT_SYMBOL(…);
int ip6_tnl_rcv_ctl(struct ip6_tnl *t,
const struct in6_addr *laddr,
const struct in6_addr *raddr)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __ip6_tnl_rcv(struct ip6_tnl *tunnel, struct sk_buff *skb,
const struct tnl_ptk_info *tpi,
struct metadata_dst *tun_dst,
int (*dscp_ecn_decapsulate)(const struct ip6_tnl *t,
const struct ipv6hdr *ipv6h,
struct sk_buff *skb),
bool log_ecn_err)
{ … }
int ip6_tnl_rcv(struct ip6_tnl *t, struct sk_buff *skb,
const struct tnl_ptk_info *tpi,
struct metadata_dst *tun_dst,
bool log_ecn_err)
{ … }
EXPORT_SYMBOL(…);
static const struct tnl_ptk_info tpi_v6 = …;
static const struct tnl_ptk_info tpi_v4 = …;
static const struct tnl_ptk_info tpi_mpls = …;
static int ipxip6_rcv(struct sk_buff *skb, u8 ipproto,
const struct tnl_ptk_info *tpi,
int (*dscp_ecn_decapsulate)(const struct ip6_tnl *t,
const struct ipv6hdr *ipv6h,
struct sk_buff *skb))
{ … }
static int ip4ip6_rcv(struct sk_buff *skb)
{ … }
static int ip6ip6_rcv(struct sk_buff *skb)
{ … }
static int mplsip6_rcv(struct sk_buff *skb)
{ … }
struct ipv6_tel_txoption { … };
static void init_tel_txopt(struct ipv6_tel_txoption *opt, __u8 encap_limit)
{ … }
static inline bool
ip6_tnl_addr_conflict(const struct ip6_tnl *t, const struct ipv6hdr *hdr)
{ … }
int ip6_tnl_xmit_ctl(struct ip6_tnl *t,
const struct in6_addr *laddr,
const struct in6_addr *raddr)
{ … }
EXPORT_SYMBOL_GPL(…);
int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield,
struct flowi6 *fl6, int encap_limit, __u32 *pmtu,
__u8 proto)
{ … }
EXPORT_SYMBOL(…);
static inline int
ipxip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev,
u8 protocol)
{ … }
static netdev_tx_t
ip6_tnl_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ … }
static void ip6_tnl_link_config(struct ip6_tnl *t)
{ … }
static void
ip6_tnl_change(struct ip6_tnl *t, const struct __ip6_tnl_parm *p)
{ … }
static void ip6_tnl_update(struct ip6_tnl *t, struct __ip6_tnl_parm *p)
{ … }
static void ip6_tnl0_update(struct ip6_tnl *t, struct __ip6_tnl_parm *p)
{ … }
static void
ip6_tnl_parm_from_user(struct __ip6_tnl_parm *p, const struct ip6_tnl_parm *u)
{ … }
static void
ip6_tnl_parm_to_user(struct ip6_tnl_parm *u, const struct __ip6_tnl_parm *p)
{ … }
static int
ip6_tnl_siocdevprivate(struct net_device *dev, struct ifreq *ifr,
void __user *data, int cmd)
{ … }
int ip6_tnl_change_mtu(struct net_device *dev, int new_mtu)
{ … }
EXPORT_SYMBOL(…);
int ip6_tnl_get_iflink(const struct net_device *dev)
{ … }
EXPORT_SYMBOL(…);
int ip6_tnl_encap_add_ops(const struct ip6_tnl_encap_ops *ops,
unsigned int num)
{ … }
EXPORT_SYMBOL(…);
int ip6_tnl_encap_del_ops(const struct ip6_tnl_encap_ops *ops,
unsigned int num)
{ … }
EXPORT_SYMBOL(…);
int ip6_tnl_encap_setup(struct ip6_tnl *t,
struct ip_tunnel_encap *ipencap)
{ … }
EXPORT_SYMBOL_GPL(…);
static const struct net_device_ops ip6_tnl_netdev_ops = …;
#define IPXIPX_FEATURES …
static void ip6_tnl_dev_setup(struct net_device *dev)
{ … }
static inline int
ip6_tnl_dev_init_gen(struct net_device *dev)
{ … }
static int ip6_tnl_dev_init(struct net_device *dev)
{ … }
static int __net_init ip6_fb_tnl_dev_init(struct net_device *dev)
{ … }
static int ip6_tnl_validate(struct nlattr *tb[], struct nlattr *data[],
struct netlink_ext_ack *extack)
{ … }
static void ip6_tnl_netlink_parms(struct nlattr *data[],
struct __ip6_tnl_parm *parms)
{ … }
static int ip6_tnl_newlink(struct net *src_net, struct net_device *dev,
struct nlattr *tb[], struct nlattr *data[],
struct netlink_ext_ack *extack)
{ … }
static int ip6_tnl_changelink(struct net_device *dev, struct nlattr *tb[],
struct nlattr *data[],
struct netlink_ext_ack *extack)
{ … }
static void ip6_tnl_dellink(struct net_device *dev, struct list_head *head)
{ … }
static size_t ip6_tnl_get_size(const struct net_device *dev)
{ … }
static int ip6_tnl_fill_info(struct sk_buff *skb, const struct net_device *dev)
{ … }
struct net *ip6_tnl_get_link_net(const struct net_device *dev)
{ … }
EXPORT_SYMBOL(…);
static const struct nla_policy ip6_tnl_policy[IFLA_IPTUN_MAX + 1] = …;
static struct rtnl_link_ops ip6_link_ops __read_mostly = …;
static struct xfrm6_tunnel ip4ip6_handler __read_mostly = …;
static struct xfrm6_tunnel ip6ip6_handler __read_mostly = …;
static struct xfrm6_tunnel mplsip6_handler __read_mostly = …;
static void __net_exit ip6_tnl_destroy_tunnels(struct net *net, struct list_head *list)
{ … }
static int __net_init ip6_tnl_init_net(struct net *net)
{ … }
static void __net_exit ip6_tnl_exit_batch_rtnl(struct list_head *net_list,
struct list_head *dev_to_kill)
{ … }
static struct pernet_operations ip6_tnl_net_ops = …;
static int __init ip6_tunnel_init(void)
{ … }
static void __exit ip6_tunnel_cleanup(void)
{ … }
module_init(…) …;
module_exit(ip6_tunnel_cleanup);