blob: dee634e714fc32cbc174dfbc01a14ae71820e798 [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 __SOCK_SIZE__ 16
Christopher Ferris48af7cb2017-02-21 12:35:09 -080026struct sockaddr_l2tpip {
Tao Baod7db5942015-01-28 10:07:51 -080027 __kernel_sa_family_t l2tp_family;
28 __be16 l2tp_unused;
29 struct in_addr l2tp_addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080030 __u32 l2tp_conn_id;
31 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 -070032};
33struct sockaddr_l2tpip6 {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080034 __kernel_sa_family_t l2tp_family;
Tao Baod7db5942015-01-28 10:07:51 -080035 __be16 l2tp_unused;
36 __be32 l2tp_flowinfo;
37 struct in6_addr l2tp_addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080038 __u32 l2tp_scope_id;
Tao Baod7db5942015-01-28 10:07:51 -080039 __u32 l2tp_conn_id;
Ben Cheng655a7c02013-10-16 16:09:24 -070040};
41enum {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080042 L2TP_CMD_NOOP,
Tao Baod7db5942015-01-28 10:07:51 -080043 L2TP_CMD_TUNNEL_CREATE,
44 L2TP_CMD_TUNNEL_DELETE,
45 L2TP_CMD_TUNNEL_MODIFY,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080046 L2TP_CMD_TUNNEL_GET,
Tao Baod7db5942015-01-28 10:07:51 -080047 L2TP_CMD_SESSION_CREATE,
48 L2TP_CMD_SESSION_DELETE,
49 L2TP_CMD_SESSION_MODIFY,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080050 L2TP_CMD_SESSION_GET,
Tao Baod7db5942015-01-28 10:07:51 -080051 __L2TP_CMD_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -070052};
53#define L2TP_CMD_MAX (__L2TP_CMD_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080054enum {
Tao Baod7db5942015-01-28 10:07:51 -080055 L2TP_ATTR_NONE,
56 L2TP_ATTR_PW_TYPE,
57 L2TP_ATTR_ENCAP_TYPE,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080058 L2TP_ATTR_OFFSET,
Tao Baod7db5942015-01-28 10:07:51 -080059 L2TP_ATTR_DATA_SEQ,
60 L2TP_ATTR_L2SPEC_TYPE,
61 L2TP_ATTR_L2SPEC_LEN,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080062 L2TP_ATTR_PROTO_VERSION,
Tao Baod7db5942015-01-28 10:07:51 -080063 L2TP_ATTR_IFNAME,
64 L2TP_ATTR_CONN_ID,
65 L2TP_ATTR_PEER_CONN_ID,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080066 L2TP_ATTR_SESSION_ID,
Tao Baod7db5942015-01-28 10:07:51 -080067 L2TP_ATTR_PEER_SESSION_ID,
68 L2TP_ATTR_UDP_CSUM,
69 L2TP_ATTR_VLAN_ID,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080070 L2TP_ATTR_COOKIE,
Tao Baod7db5942015-01-28 10:07:51 -080071 L2TP_ATTR_PEER_COOKIE,
72 L2TP_ATTR_DEBUG,
73 L2TP_ATTR_RECV_SEQ,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080074 L2TP_ATTR_SEND_SEQ,
Tao Baod7db5942015-01-28 10:07:51 -080075 L2TP_ATTR_LNS_MODE,
76 L2TP_ATTR_USING_IPSEC,
77 L2TP_ATTR_RECV_TIMEOUT,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080078 L2TP_ATTR_FD,
Tao Baod7db5942015-01-28 10:07:51 -080079 L2TP_ATTR_IP_SADDR,
80 L2TP_ATTR_IP_DADDR,
81 L2TP_ATTR_UDP_SPORT,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080082 L2TP_ATTR_UDP_DPORT,
Tao Baod7db5942015-01-28 10:07:51 -080083 L2TP_ATTR_MTU,
84 L2TP_ATTR_MRU,
85 L2TP_ATTR_STATS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080086 L2TP_ATTR_IP6_SADDR,
Tao Baod7db5942015-01-28 10:07:51 -080087 L2TP_ATTR_IP6_DADDR,
88 L2TP_ATTR_UDP_ZERO_CSUM6_TX,
89 L2TP_ATTR_UDP_ZERO_CSUM6_RX,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080090 L2TP_ATTR_PAD,
Christopher Ferris106b3a82016-08-24 12:15:38 -070091 __L2TP_ATTR_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -070092};
93#define L2TP_ATTR_MAX (__L2TP_ATTR_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080094enum {
Christopher Ferris106b3a82016-08-24 12:15:38 -070095 L2TP_ATTR_STATS_NONE,
Tao Baod7db5942015-01-28 10:07:51 -080096 L2TP_ATTR_TX_PACKETS,
97 L2TP_ATTR_TX_BYTES,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080098 L2TP_ATTR_TX_ERRORS,
Christopher Ferris106b3a82016-08-24 12:15:38 -070099 L2TP_ATTR_RX_PACKETS,
Tao Baod7db5942015-01-28 10:07:51 -0800100 L2TP_ATTR_RX_BYTES,
101 L2TP_ATTR_RX_SEQ_DISCARDS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800102 L2TP_ATTR_RX_OOS_PACKETS,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700103 L2TP_ATTR_RX_ERRORS,
104 L2TP_ATTR_STATS_PAD,
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800105 L2TP_ATTR_RX_COOKIE_DISCARDS,
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700106 L2TP_ATTR_RX_INVALID,
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