linux/net/ipv4/ip_vti.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *	Linux NET3: IP/IP protocol decoder modified to support
 *		    virtual tunnel interface
 *
 *	Authors:
 *		Saurabh Mohan ([email protected]) 05/07/2012
 */

/*
   This version of net/ipv4/ip_vti.c is cloned of net/ipv4/ipip.c

   For comments look at net/ipv4/ip_gre.c --ANK
 */


#include <linux/capability.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/uaccess.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/in.h>
#include <linux/tcp.h>
#include <linux/udp.h>
#include <linux/if_arp.h>
#include <linux/init.h>
#include <linux/netfilter_ipv4.h>
#include <linux/if_ether.h>
#include <linux/icmpv6.h>

#include <net/sock.h>
#include <net/ip.h>
#include <net/icmp.h>
#include <net/ip_tunnels.h>
#include <net/inet_ecn.h>
#include <net/xfrm.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>

static struct rtnl_link_ops vti_link_ops __read_mostly;

static unsigned int vti_net_id __read_mostly;
static int vti_tunnel_init(struct net_device *dev);

static int vti_input(struct sk_buff *skb, int nexthdr, __be32 spi,
		     int encap_type, bool update_skb_dev)
{}

static int vti_input_proto(struct sk_buff *skb, int nexthdr, __be32 spi,
			   int encap_type)
{}

static int vti_rcv(struct sk_buff *skb, __be32 spi, bool update_skb_dev)
{}

static int vti_rcv_proto(struct sk_buff *skb)
{}

static int vti_rcv_cb(struct sk_buff *skb, int err)
{}

static bool vti_state_check(const struct xfrm_state *x, __be32 dst, __be32 src)
{}

static netdev_tx_t vti_xmit(struct sk_buff *skb, struct net_device *dev,
			    struct flowi *fl)
{}

/* This function assumes it is being called from dev_queue_xmit()
 * and that skb is filled properly by that function.
 */
static netdev_tx_t vti_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
{}

static int vti4_err(struct sk_buff *skb, u32 info)
{}

static int
vti_tunnel_ctl(struct net_device *dev, struct ip_tunnel_parm_kern *p, int cmd)
{}

static const struct net_device_ops vti_netdev_ops =;

static void vti_tunnel_setup(struct net_device *dev)
{}

static int vti_tunnel_init(struct net_device *dev)
{}

static void __net_init vti_fb_tunnel_init(struct net_device *dev)
{}

static struct xfrm4_protocol vti_esp4_protocol __read_mostly =;

static struct xfrm4_protocol vti_ah4_protocol __read_mostly =;

static struct xfrm4_protocol vti_ipcomp4_protocol __read_mostly =;

#if IS_ENABLED(CONFIG_INET_XFRM_TUNNEL)
static int vti_rcv_tunnel(struct sk_buff *skb)
{}

static struct xfrm_tunnel vti_ipip_handler __read_mostly =;

#if IS_ENABLED(CONFIG_IPV6)
static struct xfrm_tunnel vti_ipip6_handler __read_mostly =;
#endif
#endif

static int __net_init vti_init_net(struct net *net)
{}

static void __net_exit vti_exit_batch_rtnl(struct list_head *list_net,
					   struct list_head *dev_to_kill)
{}

static struct pernet_operations vti_net_ops =;

static int vti_tunnel_validate(struct nlattr *tb[], struct nlattr *data[],
			       struct netlink_ext_ack *extack)
{}

static void vti_netlink_parms(struct nlattr *data[],
			      struct ip_tunnel_parm_kern *parms,
			      __u32 *fwmark)
{}

static int vti_newlink(struct net *src_net, struct net_device *dev,
		       struct nlattr *tb[], struct nlattr *data[],
		       struct netlink_ext_ack *extack)
{}

static int vti_changelink(struct net_device *dev, struct nlattr *tb[],
			  struct nlattr *data[],
			  struct netlink_ext_ack *extack)
{}

static size_t vti_get_size(const struct net_device *dev)
{}

static int vti_fill_info(struct sk_buff *skb, const struct net_device *dev)
{}

static const struct nla_policy vti_policy[IFLA_VTI_MAX + 1] =;

static struct rtnl_link_ops vti_link_ops __read_mostly =;

static int __init vti_init(void)
{}

static void __exit vti_fini(void)
{}

module_init();
module_exit(vti_fini);
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS_RTNL_LINK();
MODULE_ALIAS_NETDEV();