/* * L2TP core. * * Copyright (c) 2008,2009,2010 Katalix Systems Ltd * * This file contains some code of the original L2TPv2 pppol2tp * driver, which has the following copyright: * * Authors: Martijn van Oosterhout <kleptog@svana.org> * James Chapman (jchapman@katalix.com) * Contributors: * Michal Ostrowski <mostrows@speakeasy.net> * Arnaldo Carvalho de Melo <acme@xconectiva.com.br> * David S. Miller (davem@redhat.com) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */#include<linux/module.h>#include<linux/string.h>#include<linux/list.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/ip.h>#include<linux/udp.h>#include<linux/hash.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/xfrm.h>#include<asm/byteorder.h>#include<asm/atomic.h>#include"l2tp_core.h"#define L2TP_DRV_VERSION "V2.0"/* L2TP header constants */#define L2TP_HDRFLAG_T 0x8000#define L2TP_HDRFLAG_L 0x4000#define L2TP_HDRFLAG_S 0x0800#define L2TP_HDRFLAG_O 0x0200#define L2TP_HDRFLAG_P 0x0100#define L2TP_HDR_VER_MASK 0x000F#define L2TP_HDR_VER_2 0x0002#define L2TP_HDR_VER_3 0x0003/* L2TPv3 default L2-specific sublayer */#define L2TP_SLFLAG_S 0x40000000#define L2TP_SL_SEQ_MASK 0x00ffffff#define L2TP_HDR_SIZE_SEQ 10#define L2TP_HDR_SIZE_NOSEQ 6