diff options
Diffstat (limited to 'include/linux/if_pppox.h')
| -rw-r--r-- | include/linux/if_pppox.h | 60 | 
1 files changed, 39 insertions, 21 deletions
| diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h index 1925e0c3f162..397921b09ef9 100644 --- a/include/linux/if_pppox.h +++ b/include/linux/if_pppox.h | |||
| @@ -40,26 +40,36 @@ | |||
| 40 | * PPPoE addressing definition | 40 | * PPPoE addressing definition | 
| 41 | */ | 41 | */ | 
| 42 | typedef __be16 sid_t; | 42 | typedef __be16 sid_t; | 
| 43 | struct pppoe_addr{ | 43 | struct pppoe_addr { | 
| 44 | sid_t sid; /* Session identifier */ | 44 | sid_t sid; /* Session identifier */ | 
| 45 | unsigned char remote[ETH_ALEN]; /* Remote address */ | 45 | unsigned char remote[ETH_ALEN]; /* Remote address */ | 
| 46 | char dev[IFNAMSIZ]; /* Local device to use */ | 46 | char dev[IFNAMSIZ]; /* Local device to use */ | 
| 47 | }; | 47 | }; | 
| 48 | 48 | ||
| 49 | /************************************************************************ | 49 | /************************************************************************ | 
| 50 | * Protocols supported by AF_PPPOX | 50 | * PPTP addressing definition | 
| 51 | */ | 51 | */ | 
| 52 | struct pptp_addr { | ||
| 53 | __be16 call_id; | ||
| 54 | struct in_addr sin_addr; | ||
| 55 | }; | ||
| 56 | |||
| 57 | /************************************************************************ | ||
| 58 | * Protocols supported by AF_PPPOX | ||
| 59 | */ | ||
| 52 | #define PX_PROTO_OE 0 /* Currently just PPPoE */ | 60 | #define PX_PROTO_OE 0 /* Currently just PPPoE */ | 
| 53 | #define PX_PROTO_OL2TP 1 /* Now L2TP also */ | 61 | #define PX_PROTO_OL2TP 1 /* Now L2TP also */ | 
| 54 | #define PX_MAX_PROTO 2 | 62 | #define PX_PROTO_PPTP 2 | 
| 63 | #define PX_MAX_PROTO 3 | ||
| 55 | 64 | ||
| 56 | struct sockaddr_pppox { | 65 | struct sockaddr_pppox { | 
| 57 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 66 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 
| 58 | unsigned int sa_protocol; /* protocol identifier */ | 67 | unsigned int sa_protocol; /* protocol identifier */ | 
| 59 | union{ | 68 | union { | 
| 60 | struct pppoe_addr pppoe; | 69 | struct pppoe_addr pppoe; | 
| 61 | }sa_addr; | 70 | struct pptp_addr pptp; | 
| 62 | } __packed; | 71 | } sa_addr; | 
| 72 | } __attribute__((packed)); | ||
| 63 | 73 | ||
| 64 | /* The use of the above union isn't viable because the size of this | 74 | /* The use of the above union isn't viable because the size of this | 
| 65 | * struct must stay fixed over time -- applications use sizeof(struct | 75 | * struct must stay fixed over time -- applications use sizeof(struct | 
| @@ -70,7 +80,7 @@ struct sockaddr_pppol2tp { | |||
| 70 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 80 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 
| 71 | unsigned int sa_protocol; /* protocol identifier */ | 81 | unsigned int sa_protocol; /* protocol identifier */ | 
| 72 | struct pppol2tp_addr pppol2tp; | 82 | struct pppol2tp_addr pppol2tp; | 
| 73 | } __packed; | 83 | } __attribute__((packed)); | 
| 74 | 84 | ||
| 75 | /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 | 85 | /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 | 
| 76 | * bits. So we need a different sockaddr structure. | 86 | * bits. So we need a different sockaddr structure. | 
| @@ -79,7 +89,7 @@ struct sockaddr_pppol2tpv3 { | |||
| 79 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 89 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 
| 80 | unsigned int sa_protocol; /* protocol identifier */ | 90 | unsigned int sa_protocol; /* protocol identifier */ | 
| 81 | struct pppol2tpv3_addr pppol2tp; | 91 | struct pppol2tpv3_addr pppol2tp; | 
| 82 | } __packed; | 92 | } __attribute__((packed)); | 
| 83 | 93 | ||
| 84 | /********************************************************************* | 94 | /********************************************************************* | 
| 85 | * | 95 | * | 
| @@ -101,7 +111,7 @@ struct pppoe_tag { | |||
| 101 | __be16 tag_type; | 111 | __be16 tag_type; | 
| 102 | __be16 tag_len; | 112 | __be16 tag_len; | 
| 103 | char tag_data[0]; | 113 | char tag_data[0]; | 
| 104 | } __attribute ((packed)); | 114 | } __attribute__ ((packed)); | 
| 105 | 115 | ||
| 106 | /* Tag identifiers */ | 116 | /* Tag identifiers */ | 
| 107 | #define PTT_EOL __cpu_to_be16(0x0000) | 117 | #define PTT_EOL __cpu_to_be16(0x0000) | 
| @@ -129,7 +139,7 @@ struct pppoe_hdr { | |||
| 129 | __be16 sid; | 139 | __be16 sid; | 
| 130 | __be16 length; | 140 | __be16 length; | 
| 131 | struct pppoe_tag tag[0]; | 141 | struct pppoe_tag tag[0]; | 
| 132 | } __packed; | 142 | } __attribute__((packed)); | 
| 133 | 143 | ||
| 134 | /* Length of entire PPPoE + PPP header */ | 144 | /* Length of entire PPPoE + PPP header */ | 
| 135 | #define PPPOE_SES_HLEN 8 | 145 | #define PPPOE_SES_HLEN 8 | 
| @@ -150,15 +160,23 @@ struct pppoe_opt { | |||
| 150 | relayed to (PPPoE relaying) */ | 160 | relayed to (PPPoE relaying) */ | 
| 151 | }; | 161 | }; | 
| 152 | 162 | ||
| 163 | struct pptp_opt { | ||
| 164 | struct pptp_addr src_addr; | ||
| 165 | struct pptp_addr dst_addr; | ||
| 166 | u32 ack_sent, ack_recv; | ||
| 167 | u32 seq_sent, seq_recv; | ||
| 168 | int ppp_flags; | ||
| 169 | }; | ||
| 153 | #include <net/sock.h> | 170 | #include <net/sock.h> | 
| 154 | 171 | ||
| 155 | struct pppox_sock { | 172 | struct pppox_sock { | 
| 156 | /* struct sock must be the first member of pppox_sock */ | 173 | /* struct sock must be the first member of pppox_sock */ | 
| 157 | struct sock sk; | 174 | struct sock sk; | 
| 158 | struct ppp_channel chan; | 175 | struct ppp_channel chan; | 
| 159 | struct pppox_sock *next; /* for hash table */ | 176 | struct pppox_sock *next; /* for hash table */ | 
| 160 | union { | 177 | union { | 
| 161 | struct pppoe_opt pppoe; | 178 | struct pppoe_opt pppoe; | 
| 179 | struct pptp_opt pptp; | ||
| 162 | } proto; | 180 | } proto; | 
| 163 | __be16 num; | 181 | __be16 num; | 
| 164 | }; | 182 | }; | 
| @@ -186,7 +204,7 @@ struct pppox_proto { | |||
| 186 | struct module *owner; | 204 | struct module *owner; | 
| 187 | }; | 205 | }; | 
| 188 | 206 | ||
| 189 | extern int register_pppox_proto(int proto_num, struct pppox_proto *pp); | 207 | extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp); | 
| 190 | extern void unregister_pppox_proto(int proto_num); | 208 | extern void unregister_pppox_proto(int proto_num); | 
| 191 | extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */ | 209 | extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */ | 
| 192 | extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | 210 | extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | 
