Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 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 | */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef _UAPI_LINUX_L2TP_H_ |
| 8 | #define _UAPI_LINUX_L2TP_H_ |
| 9 | #include <linux/types.h> |
| 10 | #include <linux/socket.h> |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 11 | #include <linux/in.h> |
| 12 | #include <linux/in6.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 13 | #define __SOCK_SIZE__ 16 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 14 | struct sockaddr_l2tpip { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 15 | __kernel_sa_family_t l2tp_family; |
| 16 | __be16 l2tp_unused; |
| 17 | struct in_addr l2tp_addr; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 18 | __u32 l2tp_conn_id; |
| 19 | unsigned char __pad[__SOCK_SIZE__ - sizeof(__kernel_sa_family_t) - sizeof(__be16) - sizeof(struct in_addr) - sizeof(__u32)]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 20 | }; |
| 21 | struct sockaddr_l2tpip6 { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 22 | __kernel_sa_family_t l2tp_family; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 23 | __be16 l2tp_unused; |
| 24 | __be32 l2tp_flowinfo; |
| 25 | struct in6_addr l2tp_addr; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 26 | __u32 l2tp_scope_id; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | __u32 l2tp_conn_id; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 28 | }; |
| 29 | enum { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 30 | L2TP_CMD_NOOP, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 31 | L2TP_CMD_TUNNEL_CREATE, |
| 32 | L2TP_CMD_TUNNEL_DELETE, |
| 33 | L2TP_CMD_TUNNEL_MODIFY, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 34 | L2TP_CMD_TUNNEL_GET, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 35 | L2TP_CMD_SESSION_CREATE, |
| 36 | L2TP_CMD_SESSION_DELETE, |
| 37 | L2TP_CMD_SESSION_MODIFY, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 38 | L2TP_CMD_SESSION_GET, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 39 | __L2TP_CMD_MAX, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 40 | }; |
| 41 | #define L2TP_CMD_MAX (__L2TP_CMD_MAX - 1) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 42 | enum { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 43 | L2TP_ATTR_NONE, |
| 44 | L2TP_ATTR_PW_TYPE, |
| 45 | L2TP_ATTR_ENCAP_TYPE, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 46 | L2TP_ATTR_OFFSET, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 47 | L2TP_ATTR_DATA_SEQ, |
| 48 | L2TP_ATTR_L2SPEC_TYPE, |
| 49 | L2TP_ATTR_L2SPEC_LEN, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 50 | L2TP_ATTR_PROTO_VERSION, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 51 | L2TP_ATTR_IFNAME, |
| 52 | L2TP_ATTR_CONN_ID, |
| 53 | L2TP_ATTR_PEER_CONN_ID, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 54 | L2TP_ATTR_SESSION_ID, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 55 | L2TP_ATTR_PEER_SESSION_ID, |
| 56 | L2TP_ATTR_UDP_CSUM, |
| 57 | L2TP_ATTR_VLAN_ID, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 58 | L2TP_ATTR_COOKIE, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 59 | L2TP_ATTR_PEER_COOKIE, |
| 60 | L2TP_ATTR_DEBUG, |
| 61 | L2TP_ATTR_RECV_SEQ, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 62 | L2TP_ATTR_SEND_SEQ, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 63 | L2TP_ATTR_LNS_MODE, |
| 64 | L2TP_ATTR_USING_IPSEC, |
| 65 | L2TP_ATTR_RECV_TIMEOUT, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 66 | L2TP_ATTR_FD, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 67 | L2TP_ATTR_IP_SADDR, |
| 68 | L2TP_ATTR_IP_DADDR, |
| 69 | L2TP_ATTR_UDP_SPORT, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 70 | L2TP_ATTR_UDP_DPORT, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 71 | L2TP_ATTR_MTU, |
| 72 | L2TP_ATTR_MRU, |
| 73 | L2TP_ATTR_STATS, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 74 | L2TP_ATTR_IP6_SADDR, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 75 | L2TP_ATTR_IP6_DADDR, |
| 76 | L2TP_ATTR_UDP_ZERO_CSUM6_TX, |
| 77 | L2TP_ATTR_UDP_ZERO_CSUM6_RX, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 78 | L2TP_ATTR_PAD, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 79 | __L2TP_ATTR_MAX, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 80 | }; |
| 81 | #define L2TP_ATTR_MAX (__L2TP_ATTR_MAX - 1) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 82 | enum { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 83 | L2TP_ATTR_STATS_NONE, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 84 | L2TP_ATTR_TX_PACKETS, |
| 85 | L2TP_ATTR_TX_BYTES, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 86 | L2TP_ATTR_TX_ERRORS, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 87 | L2TP_ATTR_RX_PACKETS, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 88 | L2TP_ATTR_RX_BYTES, |
| 89 | L2TP_ATTR_RX_SEQ_DISCARDS, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 90 | L2TP_ATTR_RX_OOS_PACKETS, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 91 | L2TP_ATTR_RX_ERRORS, |
| 92 | L2TP_ATTR_STATS_PAD, |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 93 | L2TP_ATTR_RX_COOKIE_DISCARDS, |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 94 | L2TP_ATTR_RX_INVALID, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 95 | __L2TP_ATTR_STATS_MAX, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 96 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 97 | #define L2TP_ATTR_STATS_MAX (__L2TP_ATTR_STATS_MAX - 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 98 | enum l2tp_pwtype { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 99 | L2TP_PWTYPE_NONE = 0x0000, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 100 | L2TP_PWTYPE_ETH_VLAN = 0x0004, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 101 | L2TP_PWTYPE_ETH = 0x0005, |
| 102 | L2TP_PWTYPE_PPP = 0x0007, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 103 | L2TP_PWTYPE_PPP_AC = 0x0008, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 104 | L2TP_PWTYPE_IP = 0x000b, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 105 | __L2TP_PWTYPE_MAX |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 106 | }; |
| 107 | enum l2tp_l2spec_type { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 108 | L2TP_L2SPECTYPE_NONE, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 109 | L2TP_L2SPECTYPE_DEFAULT, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 110 | }; |
| 111 | enum l2tp_encap_type { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 112 | L2TP_ENCAPTYPE_UDP, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 113 | L2TP_ENCAPTYPE_IP, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 114 | }; |
| 115 | enum l2tp_seqmode { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 116 | L2TP_SEQ_NONE = 0, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 117 | L2TP_SEQ_IP = 1, |
| 118 | L2TP_SEQ_ALL = 2, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 119 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 120 | enum l2tp_debug_flags { |
| 121 | L2TP_MSG_DEBUG = (1 << 0), |
| 122 | L2TP_MSG_CONTROL = (1 << 1), |
| 123 | L2TP_MSG_SEQ = (1 << 2), |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 124 | L2TP_MSG_DATA = (1 << 3), |
| 125 | }; |
| 126 | #define L2TP_GENL_NAME "l2tp" |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 127 | #define L2TP_GENL_VERSION 0x1 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 128 | #define L2TP_GENL_MCGROUP "l2tp" |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 129 | #endif |