blob: 40d25e8b8c949211c0609d0d834de8f2b2deba14 [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_IF_PPPOX_H
20#define _UAPI__LINUX_IF_PPPOX_H
21#include <linux/types.h>
22#include <asm/byteorder.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#include <linux/socket.h>
Christopher Ferris49f525c2016-12-12 14:55:36 -080024#include <linux/if.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070025#include <linux/if_ether.h>
26#include <linux/if_pppol2tp.h>
Christopher Ferris49f525c2016-12-12 14:55:36 -080027#include <linux/in.h>
28#include <linux/in6.h>
29#ifndef AF_PPPOX
Ben Cheng655a7c02013-10-16 16:09:24 -070030#define AF_PPPOX 24
31#define PF_PPPOX AF_PPPOX
32#endif
33typedef __be16 sid_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070034struct pppoe_addr {
Tao Baod7db5942015-01-28 10:07:51 -080035 sid_t sid;
36 unsigned char remote[ETH_ALEN];
37 char dev[IFNAMSIZ];
Ben Cheng655a7c02013-10-16 16:09:24 -070038};
39struct pptp_addr {
Tao Baod7db5942015-01-28 10:07:51 -080040 __u16 call_id;
41 struct in_addr sin_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -070042};
43#define PX_PROTO_OE 0
44#define PX_PROTO_OL2TP 1
45#define PX_PROTO_PPTP 2
Christopher Ferris38062f92014-07-09 15:33:25 -070046#define PX_MAX_PROTO 3
Ben Cheng655a7c02013-10-16 16:09:24 -070047struct sockaddr_pppox {
Tao Baod7db5942015-01-28 10:07:51 -080048 __kernel_sa_family_t sa_family;
49 unsigned int sa_protocol;
Tao Baod7db5942015-01-28 10:07:51 -080050 union {
51 struct pppoe_addr pppoe;
52 struct pptp_addr pptp;
53 } sa_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -070054} __packed;
55struct sockaddr_pppol2tp {
Tao Baod7db5942015-01-28 10:07:51 -080056 __kernel_sa_family_t sa_family;
57 unsigned int sa_protocol;
Tao Baod7db5942015-01-28 10:07:51 -080058 struct pppol2tp_addr pppol2tp;
Ben Cheng655a7c02013-10-16 16:09:24 -070059} __packed;
60struct sockaddr_pppol2tpin6 {
Tao Baod7db5942015-01-28 10:07:51 -080061 __kernel_sa_family_t sa_family;
Tao Baod7db5942015-01-28 10:07:51 -080062 unsigned int sa_protocol;
63 struct pppol2tpin6_addr pppol2tp;
Ben Cheng655a7c02013-10-16 16:09:24 -070064} __packed;
65struct sockaddr_pppol2tpv3 {
Tao Baod7db5942015-01-28 10:07:51 -080066 __kernel_sa_family_t sa_family;
67 unsigned int sa_protocol;
68 struct pppol2tpv3_addr pppol2tp;
Ben Cheng655a7c02013-10-16 16:09:24 -070069} __packed;
Ben Cheng655a7c02013-10-16 16:09:24 -070070struct sockaddr_pppol2tpv3in6 {
Tao Baod7db5942015-01-28 10:07:51 -080071 __kernel_sa_family_t sa_family;
72 unsigned int sa_protocol;
73 struct pppol2tpv3in6_addr pppol2tp;
Ben Cheng655a7c02013-10-16 16:09:24 -070074} __packed;
Tao Baod7db5942015-01-28 10:07:51 -080075#define PPPOEIOCSFWD _IOW(0xB1, 0, size_t)
76#define PPPOEIOCDFWD _IO(0xB1, 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070077#define PADI_CODE 0x09
Ben Cheng655a7c02013-10-16 16:09:24 -070078#define PADO_CODE 0x07
79#define PADR_CODE 0x19
80#define PADS_CODE 0x65
81#define PADT_CODE 0xa7
Ben Cheng655a7c02013-10-16 16:09:24 -070082struct pppoe_tag {
Tao Baod7db5942015-01-28 10:07:51 -080083 __be16 tag_type;
84 __be16 tag_len;
85 char tag_data[0];
Tao Baod7db5942015-01-28 10:07:51 -080086} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070087#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 Cheng655a7c02013-10-16 16:09:24 -070090#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 Cheng655a7c02013-10-16 16:09:24 -070094#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 {
Ben Cheng655a7c02013-10-16 16:09:24 -070098#ifdef __LITTLE_ENDIAN_BITFIELD
Tao Baod7db5942015-01-28 10:07:51 -080099 __u8 type : 4;
100 __u8 ver : 4;
Ben Cheng655a7c02013-10-16 16:09:24 -0700101#elif defined(__BIG_ENDIAN_BITFIELD)
Tao Baod7db5942015-01-28 10:07:51 -0800102 __u8 ver : 4;
103 __u8 type : 4;
Ben Cheng655a7c02013-10-16 16:09:24 -0700104#else
105#error "Please fix <asm/byteorder.h>"
Ben Cheng655a7c02013-10-16 16:09:24 -0700106#endif
Tao Baod7db5942015-01-28 10:07:51 -0800107 __u8 code;
108 __be16 sid;
109 __be16 length;
Tao Baod7db5942015-01-28 10:07:51 -0800110 struct pppoe_tag tag[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700111} __packed;
112#define PPPOE_SES_HLEN 8
113#endif