• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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   */
7  #ifndef _UAPI__LINUX_IF_PPPOX_H
8  #define _UAPI__LINUX_IF_PPPOX_H
9  #include <linux/types.h>
10  #include <asm/byteorder.h>
11  #include <linux/socket.h>
12  #include <linux/if.h>
13  #include <linux/if_ether.h>
14  #include <linux/if_pppol2tp.h>
15  #include <linux/in.h>
16  #include <linux/in6.h>
17  #ifndef AF_PPPOX
18  #define AF_PPPOX 24
19  #define PF_PPPOX AF_PPPOX
20  #endif
21  typedef __be16 sid_t;
22  struct pppoe_addr {
23    sid_t sid;
24    unsigned char remote[ETH_ALEN];
25    char dev[IFNAMSIZ];
26  };
27  struct pptp_addr {
28    __u16 call_id;
29    struct in_addr sin_addr;
30  };
31  #define PX_PROTO_OE 0
32  #define PX_PROTO_OL2TP 1
33  #define PX_PROTO_PPTP 2
34  #define PX_MAX_PROTO 3
35  struct sockaddr_pppox {
36    __kernel_sa_family_t sa_family;
37    unsigned int sa_protocol;
38    union {
39      struct pppoe_addr pppoe;
40      struct pptp_addr pptp;
41    } sa_addr;
42  } __attribute__((__packed__));
43  struct sockaddr_pppol2tp {
44    __kernel_sa_family_t sa_family;
45    unsigned int sa_protocol;
46    struct pppol2tp_addr pppol2tp;
47  } __attribute__((__packed__));
48  struct sockaddr_pppol2tpin6 {
49    __kernel_sa_family_t sa_family;
50    unsigned int sa_protocol;
51    struct pppol2tpin6_addr pppol2tp;
52  } __attribute__((__packed__));
53  struct sockaddr_pppol2tpv3 {
54    __kernel_sa_family_t sa_family;
55    unsigned int sa_protocol;
56    struct pppol2tpv3_addr pppol2tp;
57  } __attribute__((__packed__));
58  struct sockaddr_pppol2tpv3in6 {
59    __kernel_sa_family_t sa_family;
60    unsigned int sa_protocol;
61    struct pppol2tpv3in6_addr pppol2tp;
62  } __attribute__((__packed__));
63  #define PPPOEIOCSFWD _IOW(0xB1, 0, size_t)
64  #define PPPOEIOCDFWD _IO(0xB1, 1)
65  #define PADI_CODE 0x09
66  #define PADO_CODE 0x07
67  #define PADR_CODE 0x19
68  #define PADS_CODE 0x65
69  #define PADT_CODE 0xa7
70  struct pppoe_tag {
71    __be16 tag_type;
72    __be16 tag_len;
73    char tag_data[];
74  } __attribute__((packed));
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)
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)
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 {
86  #ifdef __LITTLE_ENDIAN_BITFIELD
87    __u8 type : 4;
88    __u8 ver : 4;
89  #elif defined(__BIG_ENDIAN_BITFIELD)
90    __u8 ver : 4;
91    __u8 type : 4;
92  #else
93  #error "Please fix <asm/byteorder.h>"
94  #endif
95    __u8 code;
96    __be16 sid;
97    __be16 length;
98    struct pppoe_tag tag[];
99  } __attribute__((__packed__));
100  #define PPPOE_SES_HLEN 8
101  #endif
102