0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _UAPI__LINUX_IF_PPPOX_H
0018 #define _UAPI__LINUX_IF_PPPOX_H
0019
0020
0021 #include <linux/types.h>
0022 #include <asm/byteorder.h>
0023
0024 #include <linux/socket.h>
0025 #include <linux/if.h>
0026 #include <linux/if_ether.h>
0027 #include <linux/if_pppol2tp.h>
0028 #include <linux/in.h>
0029 #include <linux/in6.h>
0030
0031
0032
0033
0034 #ifndef AF_PPPOX
0035 #define AF_PPPOX 24
0036 #define PF_PPPOX AF_PPPOX
0037 #endif
0038
0039
0040
0041
0042 typedef __be16 sid_t;
0043 struct pppoe_addr {
0044 sid_t sid;
0045 unsigned char remote[ETH_ALEN];
0046 char dev[IFNAMSIZ];
0047 };
0048
0049
0050
0051
0052 struct pptp_addr {
0053 __u16 call_id;
0054 struct in_addr sin_addr;
0055 };
0056
0057
0058
0059
0060 #define PX_PROTO_OE 0
0061 #define PX_PROTO_OL2TP 1
0062 #define PX_PROTO_PPTP 2
0063 #define PX_MAX_PROTO 3
0064
0065 struct sockaddr_pppox {
0066 __kernel_sa_family_t sa_family;
0067 unsigned int sa_protocol;
0068 union {
0069 struct pppoe_addr pppoe;
0070 struct pptp_addr pptp;
0071 } sa_addr;
0072 } __packed;
0073
0074
0075
0076
0077
0078
0079 struct sockaddr_pppol2tp {
0080 __kernel_sa_family_t sa_family;
0081 unsigned int sa_protocol;
0082 struct pppol2tp_addr pppol2tp;
0083 } __packed;
0084
0085 struct sockaddr_pppol2tpin6 {
0086 __kernel_sa_family_t sa_family;
0087 unsigned int sa_protocol;
0088 struct pppol2tpin6_addr pppol2tp;
0089 } __packed;
0090
0091
0092
0093
0094 struct sockaddr_pppol2tpv3 {
0095 __kernel_sa_family_t sa_family;
0096 unsigned int sa_protocol;
0097 struct pppol2tpv3_addr pppol2tp;
0098 } __packed;
0099
0100 struct sockaddr_pppol2tpv3in6 {
0101 __kernel_sa_family_t sa_family;
0102 unsigned int sa_protocol;
0103 struct pppol2tpv3in6_addr pppol2tp;
0104 } __packed;
0105
0106
0107
0108
0109
0110
0111
0112 #define PPPOEIOCSFWD _IOW(0xB1 ,0, size_t)
0113 #define PPPOEIOCDFWD _IO(0xB1 ,1)
0114
0115
0116
0117 #define PADI_CODE 0x09
0118 #define PADO_CODE 0x07
0119 #define PADR_CODE 0x19
0120 #define PADS_CODE 0x65
0121 #define PADT_CODE 0xa7
0122 struct pppoe_tag {
0123 __be16 tag_type;
0124 __be16 tag_len;
0125 char tag_data[];
0126 } __attribute__ ((packed));
0127
0128
0129 #define PTT_EOL __cpu_to_be16(0x0000)
0130 #define PTT_SRV_NAME __cpu_to_be16(0x0101)
0131 #define PTT_AC_NAME __cpu_to_be16(0x0102)
0132 #define PTT_HOST_UNIQ __cpu_to_be16(0x0103)
0133 #define PTT_AC_COOKIE __cpu_to_be16(0x0104)
0134 #define PTT_VENDOR __cpu_to_be16(0x0105)
0135 #define PTT_RELAY_SID __cpu_to_be16(0x0110)
0136 #define PTT_SRV_ERR __cpu_to_be16(0x0201)
0137 #define PTT_SYS_ERR __cpu_to_be16(0x0202)
0138 #define PTT_GEN_ERR __cpu_to_be16(0x0203)
0139
0140 struct pppoe_hdr {
0141 #if defined(__LITTLE_ENDIAN_BITFIELD)
0142 __u8 type : 4;
0143 __u8 ver : 4;
0144 #elif defined(__BIG_ENDIAN_BITFIELD)
0145 __u8 ver : 4;
0146 __u8 type : 4;
0147 #else
0148 #error "Please fix <asm/byteorder.h>"
0149 #endif
0150 __u8 code;
0151 __be16 sid;
0152 __be16 length;
0153 struct pppoe_tag tag[];
0154 } __packed;
0155
0156
0157 #define PPPOE_SES_HLEN 8
0158
0159
0160 #endif