aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/l2tp.h
diff options
context:
space:
mode:
authorJames Chapman <jchapman@katalix.com>2010-04-02 02:19:00 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-03 17:56:04 -0400
commit0d76751fad7739014485ba5bd388d4f1b4fd4143 (patch)
tree25a4525bf6b2ec9f052f22ba98cdfd3ff3a86aa3 /include/linux/l2tp.h
parente0d4435f93905f517003cfa7328a36ea19788147 (diff)
l2tp: Add L2TPv3 IP encapsulation (no UDP) support
This patch adds a new L2TPIP socket family and modifies the core to handle the case where there is no UDP header in the L2TP packet. L2TP/IP uses IP protocol 115. Since L2TP/UDP and L2TP/IP packets differ in layout, the datapath packet handling code needs changes too. Userspace uses an L2TPIP socket instead of a UDP socket when IP encapsulation is required. We can't use raw sockets for this because the semantics of raw sockets don't lend themselves to the socket-per-tunnel model - we need to Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/l2tp.h')
-rw-r--r--include/linux/l2tp.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/linux/l2tp.h b/include/linux/l2tp.h
new file mode 100644
index 00000000000..deff7bca4e0
--- /dev/null
+++ b/include/linux/l2tp.h
@@ -0,0 +1,38 @@
1/*
2 * L2TP-over-IP socket for L2TPv3.
3 *
4 * Author: James Chapman <jchapman@katalix.com>
5 */
6
7#ifndef _LINUX_L2TP_H_
8#define _LINUX_L2TP_H_
9
10#include <linux/types.h>
11#ifdef __KERNEL__
12#include <linux/socket.h>
13#include <linux/in.h>
14#endif
15
16#define IPPROTO_L2TP 115
17
18/**
19 * struct sockaddr_l2tpip - the sockaddr structure for L2TP-over-IP sockets
20 * @l2tp_family: address family number AF_L2TPIP.
21 * @l2tp_addr: protocol specific address information
22 * @l2tp_conn_id: connection id of tunnel
23 */
24struct sockaddr_l2tpip {
25 /* The first fields must match struct sockaddr_in */
26 sa_family_t l2tp_family; /* AF_INET */
27 __be16 l2tp_unused; /* INET port number (unused) */
28 struct in_addr l2tp_addr; /* Internet address */
29
30 __u32 l2tp_conn_id; /* Connection ID of tunnel */
31
32 /* Pad to size of `struct sockaddr'. */
33 unsigned char __pad[sizeof(struct sockaddr) - sizeof(sa_family_t) -
34 sizeof(__be16) - sizeof(struct in_addr) -
35 sizeof(__u32)];
36};
37
38#endif