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_IF_PPPOX_H |
| 8 | #define _UAPI__LINUX_IF_PPPOX_H |
| 9 | #include <linux/types.h> |
| 10 | #include <asm/byteorder.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 11 | #include <linux/socket.h> |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 12 | #include <linux/if.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 13 | #include <linux/if_ether.h> |
| 14 | #include <linux/if_pppol2tp.h> |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 15 | #include <linux/in.h> |
| 16 | #include <linux/in6.h> |
| 17 | #ifndef AF_PPPOX |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 18 | #define AF_PPPOX 24 |
| 19 | #define PF_PPPOX AF_PPPOX |
| 20 | #endif |
| 21 | typedef __be16 sid_t; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 22 | struct pppoe_addr { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 23 | sid_t sid; |
| 24 | unsigned char remote[ETH_ALEN]; |
| 25 | char dev[IFNAMSIZ]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 26 | }; |
| 27 | struct pptp_addr { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 28 | __u16 call_id; |
| 29 | struct in_addr sin_addr; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 30 | }; |
| 31 | #define PX_PROTO_OE 0 |
| 32 | #define PX_PROTO_OL2TP 1 |
| 33 | #define PX_PROTO_PPTP 2 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 34 | #define PX_MAX_PROTO 3 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | struct sockaddr_pppox { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 36 | __kernel_sa_family_t sa_family; |
| 37 | unsigned int sa_protocol; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 38 | union { |
| 39 | struct pppoe_addr pppoe; |
| 40 | struct pptp_addr pptp; |
| 41 | } sa_addr; |
Colin Cross | 4ac3322 | 2022-12-15 15:45:35 -0800 | [diff] [blame] | 42 | } __attribute__((__packed__)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 43 | struct sockaddr_pppol2tp { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 44 | __kernel_sa_family_t sa_family; |
| 45 | unsigned int sa_protocol; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 46 | struct pppol2tp_addr pppol2tp; |
Colin Cross | 4ac3322 | 2022-12-15 15:45:35 -0800 | [diff] [blame] | 47 | } __attribute__((__packed__)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 48 | struct sockaddr_pppol2tpin6 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 49 | __kernel_sa_family_t sa_family; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 50 | unsigned int sa_protocol; |
| 51 | struct pppol2tpin6_addr pppol2tp; |
Colin Cross | 4ac3322 | 2022-12-15 15:45:35 -0800 | [diff] [blame] | 52 | } __attribute__((__packed__)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 53 | struct sockaddr_pppol2tpv3 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 54 | __kernel_sa_family_t sa_family; |
| 55 | unsigned int sa_protocol; |
| 56 | struct pppol2tpv3_addr pppol2tp; |
Colin Cross | 4ac3322 | 2022-12-15 15:45:35 -0800 | [diff] [blame] | 57 | } __attribute__((__packed__)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 58 | struct sockaddr_pppol2tpv3in6 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 59 | __kernel_sa_family_t sa_family; |
| 60 | unsigned int sa_protocol; |
| 61 | struct pppol2tpv3in6_addr pppol2tp; |
Colin Cross | 4ac3322 | 2022-12-15 15:45:35 -0800 | [diff] [blame] | 62 | } __attribute__((__packed__)); |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 63 | #define PPPOEIOCSFWD _IOW(0xB1, 0, size_t) |
| 64 | #define PPPOEIOCDFWD _IO(0xB1, 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 65 | #define PADI_CODE 0x09 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 66 | #define PADO_CODE 0x07 |
| 67 | #define PADR_CODE 0x19 |
| 68 | #define PADS_CODE 0x65 |
| 69 | #define PADT_CODE 0xa7 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 70 | struct pppoe_tag { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 71 | __be16 tag_type; |
| 72 | __be16 tag_len; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 73 | char tag_data[]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 74 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 75 | #define PTT_EOL __cpu_to_be16(0x0000) |
| 76 | #define PTT_SRV_NAME __cpu_to_be16(0x0101) |
| 77 | #define PTT_AC_NAME __cpu_to_be16(0x0102) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 78 | #define PTT_HOST_UNIQ __cpu_to_be16(0x0103) |
| 79 | #define PTT_AC_COOKIE __cpu_to_be16(0x0104) |
| 80 | #define PTT_VENDOR __cpu_to_be16(0x0105) |
| 81 | #define PTT_RELAY_SID __cpu_to_be16(0x0110) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 82 | #define PTT_SRV_ERR __cpu_to_be16(0x0201) |
| 83 | #define PTT_SYS_ERR __cpu_to_be16(0x0202) |
| 84 | #define PTT_GEN_ERR __cpu_to_be16(0x0203) |
| 85 | struct pppoe_hdr { |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 86 | #ifdef __LITTLE_ENDIAN_BITFIELD |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 87 | __u8 type : 4; |
| 88 | __u8 ver : 4; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 89 | #elif defined(__BIG_ENDIAN_BITFIELD) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 90 | __u8 ver : 4; |
| 91 | __u8 type : 4; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 92 | #else |
| 93 | #error "Please fix <asm/byteorder.h>" |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 94 | #endif |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 95 | __u8 code; |
| 96 | __be16 sid; |
| 97 | __be16 length; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 98 | struct pppoe_tag tag[]; |
Colin Cross | 4ac3322 | 2022-12-15 15:45:35 -0800 | [diff] [blame] | 99 | } __attribute__((__packed__)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 100 | #define PPPOE_SES_HLEN 8 |
| 101 | #endif |