1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #ifndef _UAPI__LINUX_IF_PPPOX_H
18 #define _UAPI__LINUX_IF_PPPOX_H
19
20
21 #include <linux/types.h>
22 #include <asm/byteorder.h>
23
24 #include <linux/socket.h>
25 #include <linux/if.h>
26 #include <linux/if_ether.h>
27 #include <linux/if_pppol2tp.h>
28 #include <linux/in.h>
29 #include <linux/in6.h>
30
31
32
33
34 #ifndef AF_PPPOX
35 #define AF_PPPOX 24
36 #define PF_PPPOX AF_PPPOX
37 #endif
38
39
40
41
42 typedef __be16 sid_t;
43 struct pppoe_addr {
44 sid_t sid;
45 unsigned char remote[ETH_ALEN];
46 char dev[IFNAMSIZ];
47 };
48
49
50
51
52 struct pptp_addr {
53 __u16 call_id;
54 struct in_addr sin_addr;
55 };
56
57
58
59
60 #define PX_PROTO_OE 0
61 #define PX_PROTO_OL2TP 1
62 #define PX_PROTO_PPTP 2
63 #define PX_MAX_PROTO 3
64
65 struct sockaddr_pppox {
66 __kernel_sa_family_t sa_family;
67 unsigned int sa_protocol;
68 union {
69 struct pppoe_addr pppoe;
70 struct pptp_addr pptp;
71 } sa_addr;
72 } __packed;
73
74
75
76
77
78
79 struct sockaddr_pppol2tp {
80 __kernel_sa_family_t sa_family;
81 unsigned int sa_protocol;
82 struct pppol2tp_addr pppol2tp;
83 } __packed;
84
85 struct sockaddr_pppol2tpin6 {
86 __kernel_sa_family_t sa_family;
87 unsigned int sa_protocol;
88 struct pppol2tpin6_addr pppol2tp;
89 } __packed;
90
91
92
93
94 struct sockaddr_pppol2tpv3 {
95 __kernel_sa_family_t sa_family;
96 unsigned int sa_protocol;
97 struct pppol2tpv3_addr pppol2tp;
98 } __packed;
99
100 struct sockaddr_pppol2tpv3in6 {
101 __kernel_sa_family_t sa_family;
102 unsigned int sa_protocol;
103 struct pppol2tpv3in6_addr pppol2tp;
104 } __packed;
105
106
107
108
109
110
111
112 #define PPPOEIOCSFWD _IOW(0xB1 ,0, size_t)
113 #define PPPOEIOCDFWD _IO(0xB1 ,1)
114
115
116
117 #define PADI_CODE 0x09
118 #define PADO_CODE 0x07
119 #define PADR_CODE 0x19
120 #define PADS_CODE 0x65
121 #define PADT_CODE 0xa7
122 struct pppoe_tag {
123 __be16 tag_type;
124 __be16 tag_len;
125 char tag_data[0];
126 } __attribute__ ((packed));
127
128
129 #define PTT_EOL __cpu_to_be16(0x0000)
130 #define PTT_SRV_NAME __cpu_to_be16(0x0101)
131 #define PTT_AC_NAME __cpu_to_be16(0x0102)
132 #define PTT_HOST_UNIQ __cpu_to_be16(0x0103)
133 #define PTT_AC_COOKIE __cpu_to_be16(0x0104)
134 #define PTT_VENDOR __cpu_to_be16(0x0105)
135 #define PTT_RELAY_SID __cpu_to_be16(0x0110)
136 #define PTT_SRV_ERR __cpu_to_be16(0x0201)
137 #define PTT_SYS_ERR __cpu_to_be16(0x0202)
138 #define PTT_GEN_ERR __cpu_to_be16(0x0203)
139
140 struct pppoe_hdr {
141 #if defined(__LITTLE_ENDIAN_BITFIELD)
142 __u8 type : 4;
143 __u8 ver : 4;
144 #elif defined(__BIG_ENDIAN_BITFIELD)
145 __u8 ver : 4;
146 __u8 type : 4;
147 #else
148 #error "Please fix <asm/byteorder.h>"
149 #endif
150 __u8 code;
151 __be16 sid;
152 __be16 length;
153 struct pppoe_tag tag[0];
154 } __packed;
155
156
157 #define PPPOE_SES_HLEN 8
158
159
160 #endif