Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
l2tp_core.c File Reference
#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/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/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"

Go to the source code of this file.

Data Structures

struct  l2tp_skb_cb
 
struct  l2tp_net
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define L2TP_DRV_VERSION   "V2.0"
 
#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
 
#define L2TP_SLFLAG_S   0x40000000
 
#define L2TP_SL_SEQ_MASK   0x00ffffff
 
#define L2TP_HDR_SIZE_SEQ   10
 
#define L2TP_HDR_SIZE_NOSEQ   6
 
#define L2TP_DEFAULT_DEBUG_FLAGS   0
 
#define L2TP_SKB_CB(skb)   ((struct l2tp_skb_cb *) &skb->cb[sizeof(struct inet_skb_parm)])
 
#define l2tp_tunnel_inc_refcount(t)   l2tp_tunnel_inc_refcount_1(t)
 
#define l2tp_tunnel_dec_refcount(t)   l2tp_tunnel_dec_refcount_1(t)
 

Functions

struct l2tp_sessionl2tp_session_find (struct net *net, struct l2tp_tunnel *tunnel, u32 session_id)
 
 EXPORT_SYMBOL_GPL (l2tp_session_find)
 
struct l2tp_sessionl2tp_session_find_nth (struct l2tp_tunnel *tunnel, int nth)
 
 EXPORT_SYMBOL_GPL (l2tp_session_find_nth)
 
struct l2tp_sessionl2tp_session_find_by_ifname (struct net *net, char *ifname)
 
 EXPORT_SYMBOL_GPL (l2tp_session_find_by_ifname)
 
struct l2tp_tunnell2tp_tunnel_find (struct net *net, u32 tunnel_id)
 
 EXPORT_SYMBOL_GPL (l2tp_tunnel_find)
 
struct l2tp_tunnell2tp_tunnel_find_nth (struct net *net, int nth)
 
 EXPORT_SYMBOL_GPL (l2tp_tunnel_find_nth)
 
void l2tp_recv_common (struct l2tp_session *session, struct sk_buff *skb, unsigned char *ptr, unsigned char *optr, u16 hdrflags, int length, int(*payload_hook)(struct sk_buff *skb))
 
 EXPORT_SYMBOL (l2tp_recv_common)
 
int l2tp_udp_encap_recv (struct sock *sk, struct sk_buff *skb)
 
 EXPORT_SYMBOL_GPL (l2tp_udp_encap_recv)
 
int l2tp_xmit_skb (struct l2tp_session *session, struct sk_buff *skb, int hdr_len)
 
 EXPORT_SYMBOL_GPL (l2tp_xmit_skb)
 
int l2tp_tunnel_create (struct net *net, int fd, int version, u32 tunnel_id, u32 peer_tunnel_id, struct l2tp_tunnel_cfg *cfg, struct l2tp_tunnel **tunnelp)
 
 EXPORT_SYMBOL_GPL (l2tp_tunnel_create)
 
int l2tp_tunnel_delete (struct l2tp_tunnel *tunnel)
 
 EXPORT_SYMBOL_GPL (l2tp_tunnel_delete)
 
void l2tp_session_free (struct l2tp_session *session)
 
 EXPORT_SYMBOL_GPL (l2tp_session_free)
 
int l2tp_session_delete (struct l2tp_session *session)
 
 EXPORT_SYMBOL_GPL (l2tp_session_delete)
 
struct l2tp_sessionl2tp_session_create (int priv_size, struct l2tp_tunnel *tunnel, u32 session_id, u32 peer_session_id, struct l2tp_session_cfg *cfg)
 
 EXPORT_SYMBOL_GPL (l2tp_session_create)
 
 module_init (l2tp_init)
 
 module_exit (l2tp_exit)
 
 MODULE_AUTHOR ("James Chapman <[email protected]>")
 
 MODULE_DESCRIPTION ("L2TP core")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (L2TP_DRV_VERSION)
 

Macro Definition Documentation

#define L2TP_DEFAULT_DEBUG_FLAGS   0

Definition at line 89 of file l2tp_core.c.

#define L2TP_DRV_VERSION   "V2.0"

Definition at line 68 of file l2tp_core.c.

#define L2TP_HDR_SIZE_NOSEQ   6

Definition at line 86 of file l2tp_core.c.

#define L2TP_HDR_SIZE_SEQ   10

Definition at line 85 of file l2tp_core.c.

#define L2TP_HDR_VER_2   0x0002

Definition at line 78 of file l2tp_core.c.

#define L2TP_HDR_VER_3   0x0003

Definition at line 79 of file l2tp_core.c.

#define L2TP_HDR_VER_MASK   0x000F

Definition at line 77 of file l2tp_core.c.

#define L2TP_HDRFLAG_L   0x4000

Definition at line 72 of file l2tp_core.c.

#define L2TP_HDRFLAG_O   0x0200

Definition at line 74 of file l2tp_core.c.

#define L2TP_HDRFLAG_P   0x0100

Definition at line 75 of file l2tp_core.c.

#define L2TP_HDRFLAG_S   0x0800

Definition at line 73 of file l2tp_core.c.

#define L2TP_HDRFLAG_T   0x8000

Definition at line 71 of file l2tp_core.c.

#define L2TP_SKB_CB (   skb)    ((struct l2tp_skb_cb *) &skb->cb[sizeof(struct inet_skb_parm)])

Definition at line 100 of file l2tp_core.c.

#define L2TP_SL_SEQ_MASK   0x00ffffff

Definition at line 83 of file l2tp_core.c.

#define L2TP_SLFLAG_S   0x40000000

Definition at line 82 of file l2tp_core.c.

#define l2tp_tunnel_dec_refcount (   t)    l2tp_tunnel_dec_refcount_1(t)

Definition at line 156 of file l2tp_core.c.

#define l2tp_tunnel_inc_refcount (   t)    l2tp_tunnel_inc_refcount_1(t)

Definition at line 155 of file l2tp_core.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 21 of file l2tp_core.c.

Function Documentation

EXPORT_SYMBOL ( l2tp_recv_common  )
EXPORT_SYMBOL_GPL ( l2tp_session_find  )
EXPORT_SYMBOL_GPL ( l2tp_session_find_nth  )
EXPORT_SYMBOL_GPL ( l2tp_session_find_by_ifname  )
EXPORT_SYMBOL_GPL ( l2tp_tunnel_find  )
EXPORT_SYMBOL_GPL ( l2tp_tunnel_find_nth  )
EXPORT_SYMBOL_GPL ( l2tp_udp_encap_recv  )
EXPORT_SYMBOL_GPL ( l2tp_xmit_skb  )
EXPORT_SYMBOL_GPL ( l2tp_tunnel_create  )
EXPORT_SYMBOL_GPL ( l2tp_tunnel_delete  )
EXPORT_SYMBOL_GPL ( l2tp_session_free  )
EXPORT_SYMBOL_GPL ( l2tp_session_delete  )
EXPORT_SYMBOL_GPL ( l2tp_session_create  )
void l2tp_recv_common ( struct l2tp_session session,
struct sk_buff skb,
unsigned char ptr,
unsigned char optr,
u16  hdrflags,
int  length,
int(*)(struct sk_buff *skb payload_hook 
)

Definition at line 578 of file l2tp_core.c.

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 
)
read

Definition at line 1744 of file l2tp_core.c.

int l2tp_session_delete ( struct l2tp_session session)

Definition at line 1715 of file l2tp_core.c.

struct l2tp_session* l2tp_session_find ( struct net net,
struct l2tp_tunnel tunnel,
u32  session_id 
)
read

Definition at line 207 of file l2tp_core.c.

struct l2tp_session* l2tp_session_find_by_ifname ( struct net net,
char ifname 
)
read

Definition at line 260 of file l2tp_core.c.

struct l2tp_session* l2tp_session_find_nth ( struct l2tp_tunnel tunnel,
int  nth 
)
read

Definition at line 234 of file l2tp_core.c.

void l2tp_session_free ( struct l2tp_session session)

Definition at line 1669 of file l2tp_core.c.

int l2tp_tunnel_create ( struct net net,
int  fd,
int  version,
u32  tunnel_id,
u32  peer_tunnel_id,
struct l2tp_tunnel_cfg cfg,
struct l2tp_tunnel **  tunnelp 
)

Definition at line 1506 of file l2tp_core.c.

int l2tp_tunnel_delete ( struct l2tp_tunnel tunnel)

Definition at line 1643 of file l2tp_core.c.

struct l2tp_tunnel* l2tp_tunnel_find ( struct net net,
u32  tunnel_id 
)
read

Definition at line 285 of file l2tp_core.c.

struct l2tp_tunnel* l2tp_tunnel_find_nth ( struct net net,
int  nth 
)
read

Definition at line 303 of file l2tp_core.c.

int l2tp_udp_encap_recv ( struct sock sk,
struct sk_buff skb 
)

Definition at line 915 of file l2tp_core.c.

int l2tp_xmit_skb ( struct l2tp_session session,
struct sk_buff skb,
int  hdr_len 
)

Definition at line 1117 of file l2tp_core.c.

MODULE_AUTHOR ( "James Chapman <[email protected]>"  )
MODULE_DESCRIPTION ( "L2TP core )
module_exit ( l2tp_exit  )
module_init ( l2tp_init  )
MODULE_LICENSE ( "GPL"  )
MODULE_VERSION ( L2TP_DRV_VERSION  )