#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/etherdevice.h>
#include <linux/hash.h>
#include <net/dst_metadata.h>
#include <net/gro_cells.h>
#include <net/rtnetlink.h>
#include <net/protocol.h>
#include <net/ip6_tunnel.h>
#include <net/ip_tunnels.h>
#include <net/udp_tunnel.h>
#include <net/bareudp.h>
#define BAREUDP_BASE_HLEN …
#define BAREUDP_IPV4_HLEN …
#define BAREUDP_IPV6_HLEN …
static bool log_ecn_error = …;
module_param(log_ecn_error, bool, 0644);
MODULE_PARM_DESC(…) …;
static unsigned int bareudp_net_id;
struct bareudp_net { … };
struct bareudp_conf { … };
struct bareudp_dev { … };
static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
{ … }
static int bareudp_err_lookup(struct sock *sk, struct sk_buff *skb)
{ … }
static int bareudp_init(struct net_device *dev)
{ … }
static void bareudp_uninit(struct net_device *dev)
{ … }
static struct socket *bareudp_create_sock(struct net *net, __be16 port)
{ … }
static int bareudp_socket_create(struct bareudp_dev *bareudp, __be16 port)
{ … }
static int bareudp_open(struct net_device *dev)
{ … }
static void bareudp_sock_release(struct bareudp_dev *bareudp)
{ … }
static int bareudp_stop(struct net_device *dev)
{ … }
static int bareudp_xmit_skb(struct sk_buff *skb, struct net_device *dev,
struct bareudp_dev *bareudp,
const struct ip_tunnel_info *info)
{ … }
static int bareudp6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
struct bareudp_dev *bareudp,
const struct ip_tunnel_info *info)
{ … }
static bool bareudp_proto_valid(struct bareudp_dev *bareudp, __be16 proto)
{ … }
static netdev_tx_t bareudp_xmit(struct sk_buff *skb, struct net_device *dev)
{ … }
static int bareudp_fill_metadata_dst(struct net_device *dev,
struct sk_buff *skb)
{ … }
static const struct net_device_ops bareudp_netdev_ops = …;
static const struct nla_policy bareudp_policy[IFLA_BAREUDP_MAX + 1] = …;
static const struct device_type bareudp_type = …;
static void bareudp_setup(struct net_device *dev)
{ … }
static int bareudp_validate(struct nlattr *tb[], struct nlattr *data[],
struct netlink_ext_ack *extack)
{ … }
static int bareudp2info(struct nlattr *data[], struct bareudp_conf *conf,
struct netlink_ext_ack *extack)
{ … }
static struct bareudp_dev *bareudp_find_dev(struct bareudp_net *bn,
const struct bareudp_conf *conf)
{ … }
static int bareudp_configure(struct net *net, struct net_device *dev,
struct bareudp_conf *conf,
struct netlink_ext_ack *extack)
{ … }
static int bareudp_link_config(struct net_device *dev,
struct nlattr *tb[])
{ … }
static void bareudp_dellink(struct net_device *dev, struct list_head *head)
{ … }
static int bareudp_newlink(struct net *net, struct net_device *dev,
struct nlattr *tb[], struct nlattr *data[],
struct netlink_ext_ack *extack)
{ … }
static size_t bareudp_get_size(const struct net_device *dev)
{ … }
static int bareudp_fill_info(struct sk_buff *skb, const struct net_device *dev)
{ … }
static struct rtnl_link_ops bareudp_link_ops __read_mostly = …;
static __net_init int bareudp_init_net(struct net *net)
{ … }
static void bareudp_destroy_tunnels(struct net *net, struct list_head *head)
{ … }
static void __net_exit bareudp_exit_batch_rtnl(struct list_head *net_list,
struct list_head *dev_kill_list)
{ … }
static struct pernet_operations bareudp_net_ops = …;
static int __init bareudp_init_module(void)
{ … }
late_initcall(bareudp_init_module);
static void __exit bareudp_cleanup_module(void)
{ … }
module_exit(bareudp_cleanup_module);
MODULE_ALIAS_RTNL_LINK(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;