#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/string.h>
#include <linux/list.h>
#include <linux/rculist.h>
#include <linux/uaccess.h>
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/kthread.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/jiffies.h>
#include <linux/netdevice.h>
#include <linux/net.h>
#include <linux/inetdevice.h>
#include <linux/skbuff.h>
#include <linux/init.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/udp.h>
#include <linux/l2tp.h>
#include <linux/sort.h>
#include <linux/file.h>
#include <linux/nsproxy.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
#include <net/dst.h>
#include <net/ip.h>
#include <net/udp.h>
#include <net/udp_tunnel.h>
#include <net/inet_common.h>
#include <net/xfrm.h>
#include <net/protocol.h>
#include <net/inet6_connection_sock.h>
#include <net/inet_ecn.h>
#include <net/ip6_route.h>
#include <net/ip6_checksum.h>
#include <asm/byteorder.h>
#include <linux/atomic.h>
#include "l2tp_core.h"
#define CREATE_TRACE_POINTS
#include "trace.h"
#define L2TP_DRV_VERSION …
#define L2TP_HDRFLAG_T …
#define L2TP_HDRFLAG_L …
#define L2TP_HDRFLAG_S …
#define L2TP_HDRFLAG_O …
#define L2TP_HDRFLAG_P …
#define L2TP_HDR_VER_MASK …
#define L2TP_HDR_VER_2 …
#define L2TP_HDR_VER_3 …
#define L2TP_SLFLAG_S …
#define L2TP_SL_SEQ_MASK …
#define L2TP_HDR_SIZE_MAX …
#define L2TP_DEFAULT_DEBUG_FLAGS …
#define L2TP_DEPTH_NESTING …
#if L2TP_DEPTH_NESTING == SINGLE_DEPTH_NESTING
#error "L2TP requires its own lockdep subclass"
#endif
struct l2tp_skb_cb { … };
#define L2TP_SKB_CB(skb) …
static struct workqueue_struct *l2tp_wq;
static unsigned int l2tp_net_id;
struct l2tp_net { … };
static inline u32 l2tp_v2_session_key(u16 tunnel_id, u16 session_id)
{ … }
static inline unsigned long l2tp_v3_session_hashkey(struct sock *sk, u32 session_id)
{ … }
#if IS_ENABLED(CONFIG_IPV6)
static bool l2tp_sk_is_v6(struct sock *sk)
{ … }
#endif
static inline struct l2tp_net *l2tp_pernet(const struct net *net)
{ … }
static void l2tp_tunnel_free(struct l2tp_tunnel *tunnel)
{ … }
static void l2tp_session_free(struct l2tp_session *session)
{ … }
struct l2tp_tunnel *l2tp_sk_to_tunnel(struct sock *sk)
{ … }
EXPORT_SYMBOL_GPL(…);
void l2tp_tunnel_inc_refcount(struct l2tp_tunnel *tunnel)
{ … }
EXPORT_SYMBOL_GPL(…);
void l2tp_tunnel_dec_refcount(struct l2tp_tunnel *tunnel)
{ … }
EXPORT_SYMBOL_GPL(…);
void l2tp_session_inc_refcount(struct l2tp_session *session)
{ … }
EXPORT_SYMBOL_GPL(…);
void l2tp_session_dec_refcount(struct l2tp_session *session)
{ … }
EXPORT_SYMBOL_GPL(…);
struct l2tp_tunnel *l2tp_tunnel_get(const struct net *net, u32 tunnel_id)
{ … }
EXPORT_SYMBOL_GPL(…);
struct l2tp_tunnel *l2tp_tunnel_get_nth(const struct net *net, int nth)
{ … }
EXPORT_SYMBOL_GPL(…);
struct l2tp_session *l2tp_v3_session_get(const struct net *net, struct sock *sk, u32 session_id)
{ … }
EXPORT_SYMBOL_GPL(…);
struct l2tp_session *l2tp_v2_session_get(const struct net *net, u16 tunnel_id, u16 session_id)
{ … }
EXPORT_SYMBOL_GPL(…);
struct l2tp_session *l2tp_session_get(const struct net *net, struct sock *sk, int pver,
u32 tunnel_id, u32 session_id)
{ … }
EXPORT_SYMBOL_GPL(…);
struct l2tp_session *l2tp_session_get_nth(struct l2tp_tunnel *tunnel, int nth)
{ … }
EXPORT_SYMBOL_GPL(…);
struct l2tp_session *l2tp_session_get_by_ifname(const struct net *net,
const char *ifname)
{ … }
EXPORT_SYMBOL_GPL(…);
static void l2tp_session_coll_list_add(struct l2tp_session_coll_list *clist,
struct l2tp_session *session)
{ … }
static int l2tp_session_collision_add(struct l2tp_net *pn,
struct l2tp_session *session1,
struct l2tp_session *session2)
{ … }
static void l2tp_session_collision_del(struct l2tp_net *pn,
struct l2tp_session *session)
{ … }
int l2tp_session_register(struct l2tp_session *session,
struct l2tp_tunnel *tunnel)
{ … }
EXPORT_SYMBOL_GPL(…);
static void l2tp_recv_queue_skb(struct l2tp_session *session, struct sk_buff *skb)
{ … }
static void l2tp_recv_dequeue_skb(struct l2tp_session *session, struct sk_buff *skb)
{ … }
static void l2tp_recv_dequeue(struct l2tp_session *session)
{ … }
static int l2tp_seq_check_rx_window(struct l2tp_session *session, u32 nr)
{ … }
static int l2tp_recv_data_seq(struct l2tp_session *session, struct sk_buff *skb)
{ … }
void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb,
unsigned char *ptr, unsigned char *optr, u16 hdrflags,
int length)
{ … }
EXPORT_SYMBOL_GPL(…);
static void l2tp_session_queue_purge(struct l2tp_session *session)
{ … }
int l2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
{ … }
EXPORT_SYMBOL_GPL(…);
static void l2tp_udp_encap_err_recv(struct sock *sk, struct sk_buff *skb, int err,
__be16 port, u32 info, u8 *payload)
{ … }
static int l2tp_build_l2tpv2_header(struct l2tp_session *session, void *buf)
{ … }
static int l2tp_build_l2tpv3_header(struct l2tp_session *session, void *buf)
{ … }
static int l2tp_xmit_queue(struct l2tp_tunnel *tunnel, struct sk_buff *skb, struct flowi *fl)
{ … }
static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, unsigned int *len)
{ … }
int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb)
{ … }
EXPORT_SYMBOL_GPL(…);
static void l2tp_tunnel_destruct(struct sock *sk)
{ … }
static void l2tp_session_unhash(struct l2tp_session *session)
{ … }
static void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel)
{ … }
static void l2tp_udp_encap_destroy(struct sock *sk)
{ … }
static void l2tp_tunnel_remove(struct net *net, struct l2tp_tunnel *tunnel)
{ … }
static void l2tp_tunnel_del_work(struct work_struct *work)
{ … }
static int l2tp_tunnel_sock_create(struct net *net,
u32 tunnel_id,
u32 peer_tunnel_id,
struct l2tp_tunnel_cfg *cfg,
struct socket **sockp)
{ … }
int l2tp_tunnel_create(int fd, int version, u32 tunnel_id, u32 peer_tunnel_id,
struct l2tp_tunnel_cfg *cfg, struct l2tp_tunnel **tunnelp)
{ … }
EXPORT_SYMBOL_GPL(…);
static int l2tp_validate_socket(const struct sock *sk, const struct net *net,
enum l2tp_encap_type encap)
{ … }
int l2tp_tunnel_register(struct l2tp_tunnel *tunnel, struct net *net,
struct l2tp_tunnel_cfg *cfg)
{ … }
EXPORT_SYMBOL_GPL(…);
void l2tp_tunnel_delete(struct l2tp_tunnel *tunnel)
{ … }
EXPORT_SYMBOL_GPL(…);
void l2tp_session_delete(struct l2tp_session *session)
{ … }
EXPORT_SYMBOL_GPL(…);
void l2tp_session_set_header_len(struct l2tp_session *session, int version)
{ … }
EXPORT_SYMBOL_GPL(…);
struct l2tp_session *l2tp_session_create(int priv_size, struct l2tp_tunnel *tunnel, u32 session_id,
u32 peer_session_id, struct l2tp_session_cfg *cfg)
{ … }
EXPORT_SYMBOL_GPL(…);
static __net_init int l2tp_init_net(struct net *net)
{ … }
static __net_exit void l2tp_exit_net(struct net *net)
{ … }
static struct pernet_operations l2tp_net_ops = …;
static int __init l2tp_init(void)
{ … }
static void __exit l2tp_exit(void)
{ … }
module_init(…) …;
module_exit(l2tp_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_VERSION(…);