#include <linux/module.h>
#include <linux/errno.h>
#include <linux/socket.h>
#include <linux/skbuff.h>
#include <linux/ip.h>
#include <linux/icmp.h>
#include <linux/udp.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <net/genetlink.h>
#include <net/gro.h>
#include <net/gue.h>
#include <net/fou.h>
#include <net/ip.h>
#include <net/protocol.h>
#include <net/udp.h>
#include <net/udp_tunnel.h>
#include <uapi/linux/fou.h>
#include <uapi/linux/genetlink.h>
#include "fou_nl.h"
struct fou { … };
#define FOU_F_REMCSUM_NOPARTIAL …
struct fou_cfg { … };
static unsigned int fou_net_id;
struct fou_net { … };
static inline struct fou *fou_from_sock(struct sock *sk)
{ … }
static int fou_recv_pull(struct sk_buff *skb, struct fou *fou, size_t len)
{ … }
static int fou_udp_recv(struct sock *sk, struct sk_buff *skb)
{ … }
static struct guehdr *gue_remcsum(struct sk_buff *skb, struct guehdr *guehdr,
void *data, size_t hdrlen, u8 ipproto,
bool nopartial)
{ … }
static int gue_control_message(struct sk_buff *skb, struct guehdr *guehdr)
{ … }
static int gue_udp_recv(struct sock *sk, struct sk_buff *skb)
{ … }
static struct sk_buff *fou_gro_receive(struct sock *sk,
struct list_head *head,
struct sk_buff *skb)
{ … }
static int fou_gro_complete(struct sock *sk, struct sk_buff *skb,
int nhoff)
{ … }
static struct guehdr *gue_gro_remcsum(struct sk_buff *skb, unsigned int off,
struct guehdr *guehdr, void *data,
size_t hdrlen, struct gro_remcsum *grc,
bool nopartial)
{ … }
static struct sk_buff *gue_gro_receive(struct sock *sk,
struct list_head *head,
struct sk_buff *skb)
{ … }
static int gue_gro_complete(struct sock *sk, struct sk_buff *skb, int nhoff)
{ … }
static bool fou_cfg_cmp(struct fou *fou, struct fou_cfg *cfg)
{ … }
static int fou_add_to_port_list(struct net *net, struct fou *fou,
struct fou_cfg *cfg)
{ … }
static void fou_release(struct fou *fou)
{ … }
static int fou_create(struct net *net, struct fou_cfg *cfg,
struct socket **sockp)
{ … }
static int fou_destroy(struct net *net, struct fou_cfg *cfg)
{ … }
static struct genl_family fou_nl_family;
static int parse_nl_config(struct genl_info *info,
struct fou_cfg *cfg)
{ … }
int fou_nl_add_doit(struct sk_buff *skb, struct genl_info *info)
{ … }
int fou_nl_del_doit(struct sk_buff *skb, struct genl_info *info)
{ … }
static int fou_fill_info(struct fou *fou, struct sk_buff *msg)
{ … }
static int fou_dump_info(struct fou *fou, u32 portid, u32 seq,
u32 flags, struct sk_buff *skb, u8 cmd)
{ … }
int fou_nl_get_doit(struct sk_buff *skb, struct genl_info *info)
{ … }
int fou_nl_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
{ … }
static struct genl_family fou_nl_family __ro_after_init = …;
size_t fou_encap_hlen(struct ip_tunnel_encap *e)
{ … }
EXPORT_SYMBOL(…);
size_t gue_encap_hlen(struct ip_tunnel_encap *e)
{ … }
EXPORT_SYMBOL(…);
int __fou_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
u8 *protocol, __be16 *sport, int type)
{ … }
EXPORT_SYMBOL(…);
int __gue_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
u8 *protocol, __be16 *sport, int type)
{ … }
EXPORT_SYMBOL(…);
#ifdef CONFIG_NET_FOU_IP_TUNNELS
static void fou_build_udp(struct sk_buff *skb, struct ip_tunnel_encap *e,
struct flowi4 *fl4, u8 *protocol, __be16 sport)
{ … }
static int fou_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
u8 *protocol, struct flowi4 *fl4)
{ … }
static int gue_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
u8 *protocol, struct flowi4 *fl4)
{ … }
static int gue_err_proto_handler(int proto, struct sk_buff *skb, u32 info)
{ … }
static int gue_err(struct sk_buff *skb, u32 info)
{ … }
static const struct ip_tunnel_encap_ops fou_iptun_ops = …;
static const struct ip_tunnel_encap_ops gue_iptun_ops = …;
static int ip_tunnel_encap_add_fou_ops(void)
{ … }
static void ip_tunnel_encap_del_fou_ops(void)
{ … }
#else
static int ip_tunnel_encap_add_fou_ops(void)
{
return 0;
}
static void ip_tunnel_encap_del_fou_ops(void)
{
}
#endif
static __net_init int fou_init_net(struct net *net)
{ … }
static __net_exit void fou_exit_net(struct net *net)
{ … }
static struct pernet_operations fou_net_ops = …;
static int __init fou_init(void)
{ … }
static void __exit fou_fini(void)
{ … }
module_init(…) …;
module_exit(fou_fini);
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;