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>
23#include <linux/socket.h>
24#include <linux/if.h>
25#include <linux/if_ether.h>
26#include <linux/if_pppol2tp.h>
27#include <linux/in.h>
28#include <linux/in6.h>
29#ifndef AF_PPPOX
30#define AF_PPPOX 24
31#define PF_PPPOX AF_PPPOX
32#endif
33typedef __be16 sid_t;
34struct pppoe_addr {
35  sid_t sid;
36  unsigned char remote[ETH_ALEN];
37  char dev[IFNAMSIZ];
38};
39struct pptp_addr {
40  __u16 call_id;
41  struct in_addr sin_addr;
42};
43#define PX_PROTO_OE 0
44#define PX_PROTO_OL2TP 1
45#define PX_PROTO_PPTP 2
46#define PX_MAX_PROTO 3
47struct sockaddr_pppox {
48  __kernel_sa_family_t sa_family;
49  unsigned int sa_protocol;
50  union {
51    struct pppoe_addr pppoe;
52    struct pptp_addr pptp;
53  } sa_addr;
54} __packed;
55struct sockaddr_pppol2tp {
56  __kernel_sa_family_t sa_family;
57  unsigned int sa_protocol;
58  struct pppol2tp_addr pppol2tp;
59} __packed;
60struct sockaddr_pppol2tpin6 {
61  __kernel_sa_family_t sa_family;
62  unsigned int sa_protocol;
63  struct pppol2tpin6_addr pppol2tp;
64} __packed;
65struct sockaddr_pppol2tpv3 {
66  __kernel_sa_family_t sa_family;
67  unsigned int sa_protocol;
68  struct pppol2tpv3_addr pppol2tp;
69} __packed;
70struct sockaddr_pppol2tpv3in6 {
71  __kernel_sa_family_t sa_family;
72  unsigned int sa_protocol;
73  struct pppol2tpv3in6_addr pppol2tp;
74} __packed;
75#define PPPOEIOCSFWD _IOW(0xB1, 0, size_t)
76#define PPPOEIOCDFWD _IO(0xB1, 1)
77#define PADI_CODE 0x09
78#define PADO_CODE 0x07
79#define PADR_CODE 0x19
80#define PADS_CODE 0x65
81#define PADT_CODE 0xa7
82struct pppoe_tag {
83  __be16 tag_type;
84  __be16 tag_len;
85  char tag_data[0];
86} __attribute__((packed));
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)
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)
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)
97struct pppoe_hdr {
98#ifdef __LITTLE_ENDIAN_BITFIELD
99  __u8 type : 4;
100  __u8 ver : 4;
101#elif defined(__BIG_ENDIAN_BITFIELD)
102  __u8 ver : 4;
103  __u8 type : 4;
104#else
105#error "Please fix <asm/byteorder.h>"
106#endif
107  __u8 code;
108  __be16 sid;
109  __be16 length;
110  struct pppoe_tag tag[0];
111} __packed;
112#define PPPOE_SES_HLEN 8
113#endif
114