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