#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_link.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/uaccess.h>
#include <linux/atomic.h>
#include <net/gso.h>
#include <net/icmp.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <net/ip6_route.h>
#include <net/ip_tunnels.h>
#include <net/addrconf.h>
#include <net/xfrm.h>
#include <net/net_namespace.h>
#include <net/dst_metadata.h>
#include <net/netns/generic.h>
#include <linux/etherdevice.h>
static int xfrmi_dev_init(struct net_device *dev);
static void xfrmi_dev_setup(struct net_device *dev);
static struct rtnl_link_ops xfrmi_link_ops __read_mostly;
static unsigned int xfrmi_net_id __read_mostly;
static const struct net_device_ops xfrmi_netdev_ops;
#define XFRMI_HASH_BITS …
#define XFRMI_HASH_SIZE …
struct xfrmi_net { … };
static const struct nla_policy xfrm_lwt_policy[LWT_XFRM_MAX + 1] = …;
static void xfrmi_destroy_state(struct lwtunnel_state *lwt)
{ … }
static int xfrmi_build_state(struct net *net, struct nlattr *nla,
unsigned int family, const void *cfg,
struct lwtunnel_state **ts,
struct netlink_ext_ack *extack)
{ … }
static int xfrmi_fill_encap_info(struct sk_buff *skb,
struct lwtunnel_state *lwt)
{ … }
static int xfrmi_encap_nlsize(struct lwtunnel_state *lwtstate)
{ … }
static int xfrmi_encap_cmp(struct lwtunnel_state *a, struct lwtunnel_state *b)
{ … }
static const struct lwtunnel_encap_ops xfrmi_encap_ops = …;
#define for_each_xfrmi_rcu(start, xi) …
static u32 xfrmi_hash(u32 if_id)
{ … }
static struct xfrm_if *xfrmi_lookup(struct net *net, struct xfrm_state *x)
{ … }
static bool xfrmi_decode_session(struct sk_buff *skb,
unsigned short family,
struct xfrm_if_decode_session_result *res)
{ … }
static void xfrmi_link(struct xfrmi_net *xfrmn, struct xfrm_if *xi)
{ … }
static void xfrmi_unlink(struct xfrmi_net *xfrmn, struct xfrm_if *xi)
{ … }
static void xfrmi_dev_free(struct net_device *dev)
{ … }
static int xfrmi_create(struct net_device *dev)
{ … }
static struct xfrm_if *xfrmi_locate(struct net *net, struct xfrm_if_parms *p)
{ … }
static void xfrmi_dev_uninit(struct net_device *dev)
{ … }
static void xfrmi_scrub_packet(struct sk_buff *skb, bool xnet)
{ … }
static int xfrmi_input(struct sk_buff *skb, int nexthdr, __be32 spi,
int encap_type, unsigned short family)
{ … }
static int xfrmi4_rcv(struct sk_buff *skb)
{ … }
static int xfrmi6_rcv(struct sk_buff *skb)
{ … }
static int xfrmi4_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
{ … }
static int xfrmi6_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
{ … }
static int xfrmi_rcv_cb(struct sk_buff *skb, int err)
{ … }
static int
xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
{ … }
static netdev_tx_t xfrmi_xmit(struct sk_buff *skb, struct net_device *dev)
{ … }
static int xfrmi4_err(struct sk_buff *skb, u32 info)
{ … }
static int xfrmi6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
u8 type, u8 code, int offset, __be32 info)
{ … }
static int xfrmi_change(struct xfrm_if *xi, const struct xfrm_if_parms *p)
{ … }
static int xfrmi_update(struct xfrm_if *xi, struct xfrm_if_parms *p)
{ … }
static int xfrmi_get_iflink(const struct net_device *dev)
{ … }
static const struct net_device_ops xfrmi_netdev_ops = …;
static void xfrmi_dev_setup(struct net_device *dev)
{ … }
#define XFRMI_FEATURES …
static int xfrmi_dev_init(struct net_device *dev)
{ … }
static int xfrmi_validate(struct nlattr *tb[], struct nlattr *data[],
struct netlink_ext_ack *extack)
{ … }
static void xfrmi_netlink_parms(struct nlattr *data[],
struct xfrm_if_parms *parms)
{ … }
static int xfrmi_newlink(struct net *src_net, struct net_device *dev,
struct nlattr *tb[], struct nlattr *data[],
struct netlink_ext_ack *extack)
{ … }
static void xfrmi_dellink(struct net_device *dev, struct list_head *head)
{ … }
static int xfrmi_changelink(struct net_device *dev, struct nlattr *tb[],
struct nlattr *data[],
struct netlink_ext_ack *extack)
{ … }
static size_t xfrmi_get_size(const struct net_device *dev)
{ … }
static int xfrmi_fill_info(struct sk_buff *skb, const struct net_device *dev)
{ … }
static struct net *xfrmi_get_link_net(const struct net_device *dev)
{ … }
static const struct nla_policy xfrmi_policy[IFLA_XFRM_MAX + 1] = …;
static struct rtnl_link_ops xfrmi_link_ops __read_mostly = …;
static void __net_exit xfrmi_exit_batch_rtnl(struct list_head *net_exit_list,
struct list_head *dev_to_kill)
{ … }
static struct pernet_operations xfrmi_net_ops = …;
static struct xfrm6_protocol xfrmi_esp6_protocol __read_mostly = …;
static struct xfrm6_protocol xfrmi_ah6_protocol __read_mostly = …;
static struct xfrm6_protocol xfrmi_ipcomp6_protocol __read_mostly = …;
#if IS_REACHABLE(CONFIG_INET6_XFRM_TUNNEL)
static int xfrmi6_rcv_tunnel(struct sk_buff *skb)
{ … }
static struct xfrm6_tunnel xfrmi_ipv6_handler __read_mostly = …;
static struct xfrm6_tunnel xfrmi_ip6ip_handler __read_mostly = …;
#endif
static struct xfrm4_protocol xfrmi_esp4_protocol __read_mostly = …;
static struct xfrm4_protocol xfrmi_ah4_protocol __read_mostly = …;
static struct xfrm4_protocol xfrmi_ipcomp4_protocol __read_mostly = …;
#if IS_REACHABLE(CONFIG_INET_XFRM_TUNNEL)
static int xfrmi4_rcv_tunnel(struct sk_buff *skb)
{ … }
static struct xfrm_tunnel xfrmi_ipip_handler __read_mostly = …;
static struct xfrm_tunnel xfrmi_ipip6_handler __read_mostly = …;
#endif
static int __init xfrmi4_init(void)
{ … }
static void xfrmi4_fini(void)
{ … }
static int __init xfrmi6_init(void)
{ … }
static void xfrmi6_fini(void)
{ … }
static const struct xfrm_if_cb xfrm_if_cb = …;
static int __init xfrmi_init(void)
{ … }
static void __exit xfrmi_fini(void)
{ … }
module_init(…) …;
module_exit(xfrmi_fini);
MODULE_LICENSE(…) …;
MODULE_ALIAS_RTNL_LINK(…) …;
MODULE_ALIAS_NETDEV(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;