Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
l2tp_core.h File Reference

Go to the source code of this file.

Data Structures

struct  l2tp_stats
 
struct  l2tp_session_cfg
 
struct  l2tp_session
 
struct  l2tp_tunnel_cfg
 
struct  l2tp_tunnel
 
struct  l2tp_nl_cmd_ops
 

Macros

#define L2TP_TUNNEL_MAGIC   0x42114DDA
 
#define L2TP_SESSION_MAGIC   0x0C04EB7D
 
#define L2TP_HASH_BITS   4
 
#define L2TP_HASH_SIZE   (1 << L2TP_HASH_BITS)
 
#define L2TP_HASH_BITS_2   8
 
#define L2TP_HASH_SIZE_2   (1 << L2TP_HASH_BITS_2)
 
#define l2tp_session_inc_refcount(s)   l2tp_session_inc_refcount_1(s)
 
#define l2tp_session_dec_refcount(s)   l2tp_session_dec_refcount_1(s)
 
#define l2tp_printk(ptr, type, func, fmt,...)
 
#define l2tp_warn(ptr, type, fmt,...)   l2tp_printk(ptr, type, pr_warn, fmt, ##__VA_ARGS__)
 
#define l2tp_info(ptr, type, fmt,...)   l2tp_printk(ptr, type, pr_info, fmt, ##__VA_ARGS__)
 
#define l2tp_dbg(ptr, type, fmt,...)   l2tp_printk(ptr, type, pr_debug, fmt, ##__VA_ARGS__)
 

Enumerations

enum  { L2TP_MSG_DEBUG = (1 << 0), L2TP_MSG_CONTROL = (1 << 1), L2TP_MSG_SEQ = (1 << 2), L2TP_MSG_DATA = (1 << 3) }
 

Functions

struct l2tp_sessionl2tp_session_find (struct net *net, struct l2tp_tunnel *tunnel, u32 session_id)
 
struct l2tp_sessionl2tp_session_find_nth (struct l2tp_tunnel *tunnel, int nth)
 
struct l2tp_sessionl2tp_session_find_by_ifname (struct net *net, char *ifname)
 
struct l2tp_tunnell2tp_tunnel_find (struct net *net, u32 tunnel_id)
 
struct l2tp_tunnell2tp_tunnel_find_nth (struct net *net, int nth)
 
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)
 
int l2tp_tunnel_delete (struct l2tp_tunnel *tunnel)
 
struct l2tp_sessionl2tp_session_create (int priv_size, struct l2tp_tunnel *tunnel, u32 session_id, u32 peer_session_id, struct l2tp_session_cfg *cfg)
 
int l2tp_session_delete (struct l2tp_session *session)
 
void l2tp_session_free (struct l2tp_session *session)
 
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))
 
int l2tp_udp_encap_recv (struct sock *sk, struct sk_buff *skb)
 
int l2tp_xmit_skb (struct l2tp_session *session, struct sk_buff *skb, int hdr_len)
 
int l2tp_nl_register_ops (enum l2tp_pwtype pw_type, const struct l2tp_nl_cmd_ops *ops)
 
void l2tp_nl_unregister_ops (enum l2tp_pwtype pw_type)
 

Macro Definition Documentation

#define l2tp_dbg (   ptr,
  type,
  fmt,
  ... 
)    l2tp_printk(ptr, type, pr_debug, fmt, ##__VA_ARGS__)

Definition at line 294 of file l2tp_core.h.

#define L2TP_HASH_BITS   4

Definition at line 19 of file l2tp_core.h.

#define L2TP_HASH_BITS_2   8

Definition at line 23 of file l2tp_core.h.

#define L2TP_HASH_SIZE   (1 << L2TP_HASH_BITS)

Definition at line 20 of file l2tp_core.h.

#define L2TP_HASH_SIZE_2   (1 << L2TP_HASH_BITS_2)

Definition at line 24 of file l2tp_core.h.

#define l2tp_info (   ptr,
  type,
  fmt,
  ... 
)    l2tp_printk(ptr, type, pr_info, fmt, ##__VA_ARGS__)

Definition at line 292 of file l2tp_core.h.

#define l2tp_printk (   ptr,
  type,
  func,
  fmt,
  ... 
)
Value:
do { \
if (((ptr)->debug) & (type)) \
func(fmt, ##__VA_ARGS__); \
} while (0)

Definition at line 284 of file l2tp_core.h.

#define l2tp_session_dec_refcount (   s)    l2tp_session_dec_refcount_1(s)

Definition at line 281 of file l2tp_core.h.

#define l2tp_session_inc_refcount (   s)    l2tp_session_inc_refcount_1(s)

Definition at line 280 of file l2tp_core.h.

#define L2TP_SESSION_MAGIC   0x0C04EB7D

Definition at line 16 of file l2tp_core.h.

#define L2TP_TUNNEL_MAGIC   0x42114DDA

Definition at line 15 of file l2tp_core.h.

#define l2tp_warn (   ptr,
  type,
  fmt,
  ... 
)    l2tp_printk(ptr, type, pr_warn, fmt, ##__VA_ARGS__)

Definition at line 290 of file l2tp_core.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
L2TP_MSG_DEBUG 
L2TP_MSG_CONTROL 
L2TP_MSG_SEQ 
L2TP_MSG_DATA 

Definition at line 27 of file l2tp_core.h.

Function Documentation

int l2tp_nl_register_ops ( enum l2tp_pwtype  pw_type,
const struct l2tp_nl_cmd_ops ops 
)

Definition at line 870 of file l2tp_netlink.c.

void l2tp_nl_unregister_ops ( enum l2tp_pwtype  pw_type)

Definition at line 893 of file l2tp_netlink.c.

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.