blob: c65f7a9e2a4b6b0918f8d4021caad8c281d66a57 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_LINUX_L2TP_H_
20#define _UAPI_LINUX_L2TP_H_
21#include <linux/types.h>
22#include <linux/socket.h>
Christopher Ferris48af7cb2017-02-21 12:35:09 -080023#include <linux/in.h>
24#include <linux/in6.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070025#define IPPROTO_L2TP 115
26#define __SOCK_SIZE__ 16
Christopher Ferris48af7cb2017-02-21 12:35:09 -080027struct sockaddr_l2tpip {
Tao Baod7db5942015-01-28 10:07:51 -080028 __kernel_sa_family_t l2tp_family;
29 __be16 l2tp_unused;
30 struct in_addr l2tp_addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080031 __u32 l2tp_conn_id;
32 unsigned char __pad[__SOCK_SIZE__ - sizeof(__kernel_sa_family_t) - sizeof(__be16) - sizeof(struct in_addr) - sizeof(__u32)];
Ben Cheng655a7c02013-10-16 16:09:24 -070033};
34struct sockaddr_l2tpip6 {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080035 __kernel_sa_family_t l2tp_family;
Tao Baod7db5942015-01-28 10:07:51 -080036 __be16 l2tp_unused;
37 __be32 l2tp_flowinfo;
38 struct in6_addr l2tp_addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080039 __u32 l2tp_scope_id;
Tao Baod7db5942015-01-28 10:07:51 -080040 __u32 l2tp_conn_id;
Ben Cheng655a7c02013-10-16 16:09:24 -070041};
42enum {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080043 L2TP_CMD_NOOP,
Tao Baod7db5942015-01-28 10:07:51 -080044 L2TP_CMD_TUNNEL_CREATE,
45 L2TP_CMD_TUNNEL_DELETE,
46 L2TP_CMD_TUNNEL_MODIFY,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080047 L2TP_CMD_TUNNEL_GET,
Tao Baod7db5942015-01-28 10:07:51 -080048 L2TP_CMD_SESSION_CREATE,
49 L2TP_CMD_SESSION_DELETE,
50 L2TP_CMD_SESSION_MODIFY,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080051 L2TP_CMD_SESSION_GET,
Tao Baod7db5942015-01-28 10:07:51 -080052 __L2TP_CMD_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -070053};
54#define L2TP_CMD_MAX (__L2TP_CMD_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080055enum {
Tao Baod7db5942015-01-28 10:07:51 -080056 L2TP_ATTR_NONE,
57 L2TP_ATTR_PW_TYPE,
58 L2TP_ATTR_ENCAP_TYPE,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080059 L2TP_ATTR_OFFSET,
Tao Baod7db5942015-01-28 10:07:51 -080060 L2TP_ATTR_DATA_SEQ,
61 L2TP_ATTR_L2SPEC_TYPE,
62 L2TP_ATTR_L2SPEC_LEN,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080063 L2TP_ATTR_PROTO_VERSION,
Tao Baod7db5942015-01-28 10:07:51 -080064 L2TP_ATTR_IFNAME,
65 L2TP_ATTR_CONN_ID,
66 L2TP_ATTR_PEER_CONN_ID,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080067 L2TP_ATTR_SESSION_ID,
Tao Baod7db5942015-01-28 10:07:51 -080068 L2TP_ATTR_PEER_SESSION_ID,
69 L2TP_ATTR_UDP_CSUM,
70 L2TP_ATTR_VLAN_ID,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080071 L2TP_ATTR_COOKIE,
Tao Baod7db5942015-01-28 10:07:51 -080072 L2TP_ATTR_PEER_COOKIE,
73 L2TP_ATTR_DEBUG,
74 L2TP_ATTR_RECV_SEQ,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080075 L2TP_ATTR_SEND_SEQ,
Tao Baod7db5942015-01-28 10:07:51 -080076 L2TP_ATTR_LNS_MODE,
77 L2TP_ATTR_USING_IPSEC,
78 L2TP_ATTR_RECV_TIMEOUT,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080079 L2TP_ATTR_FD,
Tao Baod7db5942015-01-28 10:07:51 -080080 L2TP_ATTR_IP_SADDR,
81 L2TP_ATTR_IP_DADDR,
82 L2TP_ATTR_UDP_SPORT,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080083 L2TP_ATTR_UDP_DPORT,
Tao Baod7db5942015-01-28 10:07:51 -080084 L2TP_ATTR_MTU,
85 L2TP_ATTR_MRU,
86 L2TP_ATTR_STATS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080087 L2TP_ATTR_IP6_SADDR,
Tao Baod7db5942015-01-28 10:07:51 -080088 L2TP_ATTR_IP6_DADDR,
89 L2TP_ATTR_UDP_ZERO_CSUM6_TX,
90 L2TP_ATTR_UDP_ZERO_CSUM6_RX,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080091 L2TP_ATTR_PAD,
Christopher Ferris106b3a82016-08-24 12:15:38 -070092 __L2TP_ATTR_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -070093};
94#define L2TP_ATTR_MAX (__L2TP_ATTR_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080095enum {
Christopher Ferris106b3a82016-08-24 12:15:38 -070096 L2TP_ATTR_STATS_NONE,
Tao Baod7db5942015-01-28 10:07:51 -080097 L2TP_ATTR_TX_PACKETS,
98 L2TP_ATTR_TX_BYTES,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080099 L2TP_ATTR_TX_ERRORS,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700100 L2TP_ATTR_RX_PACKETS,
Tao Baod7db5942015-01-28 10:07:51 -0800101 L2TP_ATTR_RX_BYTES,
102 L2TP_ATTR_RX_SEQ_DISCARDS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800103 L2TP_ATTR_RX_OOS_PACKETS,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700104 L2TP_ATTR_RX_ERRORS,
105 L2TP_ATTR_STATS_PAD,
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800106 L2TP_ATTR_RX_COOKIE_DISCARDS,
Tao Baod7db5942015-01-28 10:07:51 -0800107 __L2TP_ATTR_STATS_MAX,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800108};
Ben Cheng655a7c02013-10-16 16:09:24 -0700109#define L2TP_ATTR_STATS_MAX (__L2TP_ATTR_STATS_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700110enum l2tp_pwtype {
Tao Baod7db5942015-01-28 10:07:51 -0800111 L2TP_PWTYPE_NONE = 0x0000,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800112 L2TP_PWTYPE_ETH_VLAN = 0x0004,
Tao Baod7db5942015-01-28 10:07:51 -0800113 L2TP_PWTYPE_ETH = 0x0005,
114 L2TP_PWTYPE_PPP = 0x0007,
Tao Baod7db5942015-01-28 10:07:51 -0800115 L2TP_PWTYPE_PPP_AC = 0x0008,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800116 L2TP_PWTYPE_IP = 0x000b,
Tao Baod7db5942015-01-28 10:07:51 -0800117 __L2TP_PWTYPE_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700118};
119enum l2tp_l2spec_type {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800120 L2TP_L2SPECTYPE_NONE,
Tao Baod7db5942015-01-28 10:07:51 -0800121 L2TP_L2SPECTYPE_DEFAULT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700122};
123enum l2tp_encap_type {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800124 L2TP_ENCAPTYPE_UDP,
Tao Baod7db5942015-01-28 10:07:51 -0800125 L2TP_ENCAPTYPE_IP,
Ben Cheng655a7c02013-10-16 16:09:24 -0700126};
127enum l2tp_seqmode {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800128 L2TP_SEQ_NONE = 0,
Tao Baod7db5942015-01-28 10:07:51 -0800129 L2TP_SEQ_IP = 1,
130 L2TP_SEQ_ALL = 2,
Ben Cheng655a7c02013-10-16 16:09:24 -0700131};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800132enum l2tp_debug_flags {
133 L2TP_MSG_DEBUG = (1 << 0),
134 L2TP_MSG_CONTROL = (1 << 1),
135 L2TP_MSG_SEQ = (1 << 2),
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800136 L2TP_MSG_DATA = (1 << 3),
137};
138#define L2TP_GENL_NAME "l2tp"
Ben Cheng655a7c02013-10-16 16:09:24 -0700139#define L2TP_GENL_VERSION 0x1
Christopher Ferris05d08e92016-02-04 13:16:38 -0800140#define L2TP_GENL_MCGROUP "l2tp"
Christopher Ferris05d08e92016-02-04 13:16:38 -0800141#endif