blob: 580ffd9d55a14e162e6fa4be93ebb0f3396ac64e [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
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 Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _UAPI__LINUX_IF_PPPOX_H
8#define _UAPI__LINUX_IF_PPPOX_H
9#include <linux/types.h>
10#include <asm/byteorder.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070011#include <linux/socket.h>
Christopher Ferris49f525c2016-12-12 14:55:36 -080012#include <linux/if.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070013#include <linux/if_ether.h>
14#include <linux/if_pppol2tp.h>
Christopher Ferris49f525c2016-12-12 14:55:36 -080015#include <linux/in.h>
16#include <linux/in6.h>
17#ifndef AF_PPPOX
Ben Cheng655a7c02013-10-16 16:09:24 -070018#define AF_PPPOX 24
19#define PF_PPPOX AF_PPPOX
20#endif
21typedef __be16 sid_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070022struct pppoe_addr {
Tao Baod7db5942015-01-28 10:07:51 -080023 sid_t sid;
24 unsigned char remote[ETH_ALEN];
25 char dev[IFNAMSIZ];
Ben Cheng655a7c02013-10-16 16:09:24 -070026};
27struct pptp_addr {
Tao Baod7db5942015-01-28 10:07:51 -080028 __u16 call_id;
29 struct in_addr sin_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -070030};
31#define PX_PROTO_OE 0
32#define PX_PROTO_OL2TP 1
33#define PX_PROTO_PPTP 2
Christopher Ferris38062f92014-07-09 15:33:25 -070034#define PX_MAX_PROTO 3
Ben Cheng655a7c02013-10-16 16:09:24 -070035struct sockaddr_pppox {
Tao Baod7db5942015-01-28 10:07:51 -080036 __kernel_sa_family_t sa_family;
37 unsigned int sa_protocol;
Tao Baod7db5942015-01-28 10:07:51 -080038 union {
39 struct pppoe_addr pppoe;
40 struct pptp_addr pptp;
41 } sa_addr;
Colin Cross4ac33222022-12-15 15:45:35 -080042} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -070043struct sockaddr_pppol2tp {
Tao Baod7db5942015-01-28 10:07:51 -080044 __kernel_sa_family_t sa_family;
45 unsigned int sa_protocol;
Tao Baod7db5942015-01-28 10:07:51 -080046 struct pppol2tp_addr pppol2tp;
Colin Cross4ac33222022-12-15 15:45:35 -080047} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -070048struct sockaddr_pppol2tpin6 {
Tao Baod7db5942015-01-28 10:07:51 -080049 __kernel_sa_family_t sa_family;
Tao Baod7db5942015-01-28 10:07:51 -080050 unsigned int sa_protocol;
51 struct pppol2tpin6_addr pppol2tp;
Colin Cross4ac33222022-12-15 15:45:35 -080052} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -070053struct sockaddr_pppol2tpv3 {
Tao Baod7db5942015-01-28 10:07:51 -080054 __kernel_sa_family_t sa_family;
55 unsigned int sa_protocol;
56 struct pppol2tpv3_addr pppol2tp;
Colin Cross4ac33222022-12-15 15:45:35 -080057} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -070058struct sockaddr_pppol2tpv3in6 {
Tao Baod7db5942015-01-28 10:07:51 -080059 __kernel_sa_family_t sa_family;
60 unsigned int sa_protocol;
61 struct pppol2tpv3in6_addr pppol2tp;
Colin Cross4ac33222022-12-15 15:45:35 -080062} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -080063#define PPPOEIOCSFWD _IOW(0xB1, 0, size_t)
64#define PPPOEIOCDFWD _IO(0xB1, 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070065#define PADI_CODE 0x09
Ben Cheng655a7c02013-10-16 16:09:24 -070066#define PADO_CODE 0x07
67#define PADR_CODE 0x19
68#define PADS_CODE 0x65
69#define PADT_CODE 0xa7
Ben Cheng655a7c02013-10-16 16:09:24 -070070struct pppoe_tag {
Tao Baod7db5942015-01-28 10:07:51 -080071 __be16 tag_type;
72 __be16 tag_len;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070073 char tag_data[];
Tao Baod7db5942015-01-28 10:07:51 -080074} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070075#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 Cheng655a7c02013-10-16 16:09:24 -070078#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 Cheng655a7c02013-10-16 16:09:24 -070082#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)
85struct pppoe_hdr {
Ben Cheng655a7c02013-10-16 16:09:24 -070086#ifdef __LITTLE_ENDIAN_BITFIELD
Tao Baod7db5942015-01-28 10:07:51 -080087 __u8 type : 4;
88 __u8 ver : 4;
Ben Cheng655a7c02013-10-16 16:09:24 -070089#elif defined(__BIG_ENDIAN_BITFIELD)
Tao Baod7db5942015-01-28 10:07:51 -080090 __u8 ver : 4;
91 __u8 type : 4;
Ben Cheng655a7c02013-10-16 16:09:24 -070092#else
93#error "Please fix <asm/byteorder.h>"
Ben Cheng655a7c02013-10-16 16:09:24 -070094#endif
Tao Baod7db5942015-01-28 10:07:51 -080095 __u8 code;
96 __be16 sid;
97 __be16 length;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070098 struct pppoe_tag tag[];
Colin Cross4ac33222022-12-15 15:45:35 -080099} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -0700100#define PPPOE_SES_HLEN 8
101#endif