1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef _UAPI_LINUX_L2TP_H_
8 #define _UAPI_LINUX_L2TP_H_
9 #include <linux/types.h>
10 #include <linux/socket.h>
11 #include <linux/in.h>
12 #include <linux/in6.h>
13 #define __SOCK_SIZE__ 16
14 struct sockaddr_l2tpip {
15   __kernel_sa_family_t l2tp_family;
16   __be16 l2tp_unused;
17   struct in_addr l2tp_addr;
18   __u32 l2tp_conn_id;
19   unsigned char __pad[__SOCK_SIZE__ - sizeof(__kernel_sa_family_t) - sizeof(__be16) - sizeof(struct in_addr) - sizeof(__u32)];
20 };
21 struct sockaddr_l2tpip6 {
22   __kernel_sa_family_t l2tp_family;
23   __be16 l2tp_unused;
24   __be32 l2tp_flowinfo;
25   struct in6_addr l2tp_addr;
26   __u32 l2tp_scope_id;
27   __u32 l2tp_conn_id;
28 };
29 enum {
30   L2TP_CMD_NOOP,
31   L2TP_CMD_TUNNEL_CREATE,
32   L2TP_CMD_TUNNEL_DELETE,
33   L2TP_CMD_TUNNEL_MODIFY,
34   L2TP_CMD_TUNNEL_GET,
35   L2TP_CMD_SESSION_CREATE,
36   L2TP_CMD_SESSION_DELETE,
37   L2TP_CMD_SESSION_MODIFY,
38   L2TP_CMD_SESSION_GET,
39   __L2TP_CMD_MAX,
40 };
41 #define L2TP_CMD_MAX (__L2TP_CMD_MAX - 1)
42 enum {
43   L2TP_ATTR_NONE,
44   L2TP_ATTR_PW_TYPE,
45   L2TP_ATTR_ENCAP_TYPE,
46   L2TP_ATTR_OFFSET,
47   L2TP_ATTR_DATA_SEQ,
48   L2TP_ATTR_L2SPEC_TYPE,
49   L2TP_ATTR_L2SPEC_LEN,
50   L2TP_ATTR_PROTO_VERSION,
51   L2TP_ATTR_IFNAME,
52   L2TP_ATTR_CONN_ID,
53   L2TP_ATTR_PEER_CONN_ID,
54   L2TP_ATTR_SESSION_ID,
55   L2TP_ATTR_PEER_SESSION_ID,
56   L2TP_ATTR_UDP_CSUM,
57   L2TP_ATTR_VLAN_ID,
58   L2TP_ATTR_COOKIE,
59   L2TP_ATTR_PEER_COOKIE,
60   L2TP_ATTR_DEBUG,
61   L2TP_ATTR_RECV_SEQ,
62   L2TP_ATTR_SEND_SEQ,
63   L2TP_ATTR_LNS_MODE,
64   L2TP_ATTR_USING_IPSEC,
65   L2TP_ATTR_RECV_TIMEOUT,
66   L2TP_ATTR_FD,
67   L2TP_ATTR_IP_SADDR,
68   L2TP_ATTR_IP_DADDR,
69   L2TP_ATTR_UDP_SPORT,
70   L2TP_ATTR_UDP_DPORT,
71   L2TP_ATTR_MTU,
72   L2TP_ATTR_MRU,
73   L2TP_ATTR_STATS,
74   L2TP_ATTR_IP6_SADDR,
75   L2TP_ATTR_IP6_DADDR,
76   L2TP_ATTR_UDP_ZERO_CSUM6_TX,
77   L2TP_ATTR_UDP_ZERO_CSUM6_RX,
78   L2TP_ATTR_PAD,
79   __L2TP_ATTR_MAX,
80 };
81 #define L2TP_ATTR_MAX (__L2TP_ATTR_MAX - 1)
82 enum {
83   L2TP_ATTR_STATS_NONE,
84   L2TP_ATTR_TX_PACKETS,
85   L2TP_ATTR_TX_BYTES,
86   L2TP_ATTR_TX_ERRORS,
87   L2TP_ATTR_RX_PACKETS,
88   L2TP_ATTR_RX_BYTES,
89   L2TP_ATTR_RX_SEQ_DISCARDS,
90   L2TP_ATTR_RX_OOS_PACKETS,
91   L2TP_ATTR_RX_ERRORS,
92   L2TP_ATTR_STATS_PAD,
93   L2TP_ATTR_RX_COOKIE_DISCARDS,
94   L2TP_ATTR_RX_INVALID,
95   __L2TP_ATTR_STATS_MAX,
96 };
97 #define L2TP_ATTR_STATS_MAX (__L2TP_ATTR_STATS_MAX - 1)
98 enum l2tp_pwtype {
99   L2TP_PWTYPE_NONE = 0x0000,
100   L2TP_PWTYPE_ETH_VLAN = 0x0004,
101   L2TP_PWTYPE_ETH = 0x0005,
102   L2TP_PWTYPE_PPP = 0x0007,
103   L2TP_PWTYPE_PPP_AC = 0x0008,
104   L2TP_PWTYPE_IP = 0x000b,
105   __L2TP_PWTYPE_MAX
106 };
107 enum l2tp_l2spec_type {
108   L2TP_L2SPECTYPE_NONE,
109   L2TP_L2SPECTYPE_DEFAULT,
110 };
111 enum l2tp_encap_type {
112   L2TP_ENCAPTYPE_UDP,
113   L2TP_ENCAPTYPE_IP,
114 };
115 enum l2tp_seqmode {
116   L2TP_SEQ_NONE = 0,
117   L2TP_SEQ_IP = 1,
118   L2TP_SEQ_ALL = 2,
119 };
120 enum l2tp_debug_flags {
121   L2TP_MSG_DEBUG = (1 << 0),
122   L2TP_MSG_CONTROL = (1 << 1),
123   L2TP_MSG_SEQ = (1 << 2),
124   L2TP_MSG_DATA = (1 << 3),
125 };
126 #define L2TP_GENL_NAME "l2tp"
127 #define L2TP_GENL_VERSION 0x1
128 #define L2TP_GENL_MCGROUP "l2tp"
129 #endif
130