[netdrvr gianfar] use new phy layer
[linux-2.6/libata-dev.git] / include / linux / netfilter_ipv4 / ip_conntrack_pptp.h
blob389e3851d52f078cdaa5cc8a1d3048b24564969b
1 /* PPTP constants and structs */
2 #ifndef _CONNTRACK_PPTP_H
3 #define _CONNTRACK_PPTP_H
5 /* state of the control session */
6 enum pptp_ctrlsess_state {
7 PPTP_SESSION_NONE, /* no session present */
8 PPTP_SESSION_ERROR, /* some session error */
9 PPTP_SESSION_STOPREQ, /* stop_sess request seen */
10 PPTP_SESSION_REQUESTED, /* start_sess request seen */
11 PPTP_SESSION_CONFIRMED, /* session established */
14 /* state of the call inside the control session */
15 enum pptp_ctrlcall_state {
16 PPTP_CALL_NONE,
17 PPTP_CALL_ERROR,
18 PPTP_CALL_OUT_REQ,
19 PPTP_CALL_OUT_CONF,
20 PPTP_CALL_IN_REQ,
21 PPTP_CALL_IN_REP,
22 PPTP_CALL_IN_CONF,
23 PPTP_CALL_CLEAR_REQ,
27 /* conntrack private data */
28 struct ip_ct_pptp_master {
29 enum pptp_ctrlsess_state sstate; /* session state */
31 /* everything below is going to be per-expectation in newnat,
32 * since there could be more than one call within one session */
33 enum pptp_ctrlcall_state cstate; /* call state */
34 u_int16_t pac_call_id; /* call id of PAC, host byte order */
35 u_int16_t pns_call_id; /* call id of PNS, host byte order */
37 /* in pre-2.6.11 this used to be per-expect. Now it is per-conntrack
38 * and therefore imposes a fixed limit on the number of maps */
39 struct ip_ct_gre_keymap *keymap_orig, *keymap_reply;
42 /* conntrack_expect private member */
43 struct ip_ct_pptp_expect {
44 enum pptp_ctrlcall_state cstate; /* call state */
45 u_int16_t pac_call_id; /* call id of PAC */
46 u_int16_t pns_call_id; /* call id of PNS */
50 #ifdef __KERNEL__
52 #define IP_CONNTR_PPTP PPTP_CONTROL_PORT
54 #define PPTP_CONTROL_PORT 1723
56 #define PPTP_PACKET_CONTROL 1
57 #define PPTP_PACKET_MGMT 2
59 #define PPTP_MAGIC_COOKIE 0x1a2b3c4d
61 struct pptp_pkt_hdr {
62 __u16 packetLength;
63 __u16 packetType;
64 __u32 magicCookie;
67 /* PptpControlMessageType values */
68 #define PPTP_START_SESSION_REQUEST 1
69 #define PPTP_START_SESSION_REPLY 2
70 #define PPTP_STOP_SESSION_REQUEST 3
71 #define PPTP_STOP_SESSION_REPLY 4
72 #define PPTP_ECHO_REQUEST 5
73 #define PPTP_ECHO_REPLY 6
74 #define PPTP_OUT_CALL_REQUEST 7
75 #define PPTP_OUT_CALL_REPLY 8
76 #define PPTP_IN_CALL_REQUEST 9
77 #define PPTP_IN_CALL_REPLY 10
78 #define PPTP_IN_CALL_CONNECT 11
79 #define PPTP_CALL_CLEAR_REQUEST 12
80 #define PPTP_CALL_DISCONNECT_NOTIFY 13
81 #define PPTP_WAN_ERROR_NOTIFY 14
82 #define PPTP_SET_LINK_INFO 15
84 #define PPTP_MSG_MAX 15
86 /* PptpGeneralError values */
87 #define PPTP_ERROR_CODE_NONE 0
88 #define PPTP_NOT_CONNECTED 1
89 #define PPTP_BAD_FORMAT 2
90 #define PPTP_BAD_VALUE 3
91 #define PPTP_NO_RESOURCE 4
92 #define PPTP_BAD_CALLID 5
93 #define PPTP_REMOVE_DEVICE_ERROR 6
95 struct PptpControlHeader {
96 __u16 messageType;
97 __u16 reserved;
100 /* FramingCapability Bitmap Values */
101 #define PPTP_FRAME_CAP_ASYNC 0x1
102 #define PPTP_FRAME_CAP_SYNC 0x2
104 /* BearerCapability Bitmap Values */
105 #define PPTP_BEARER_CAP_ANALOG 0x1
106 #define PPTP_BEARER_CAP_DIGITAL 0x2
108 struct PptpStartSessionRequest {
109 __u16 protocolVersion;
110 __u8 reserved1;
111 __u8 reserved2;
112 __u32 framingCapability;
113 __u32 bearerCapability;
114 __u16 maxChannels;
115 __u16 firmwareRevision;
116 __u8 hostName[64];
117 __u8 vendorString[64];
120 /* PptpStartSessionResultCode Values */
121 #define PPTP_START_OK 1
122 #define PPTP_START_GENERAL_ERROR 2
123 #define PPTP_START_ALREADY_CONNECTED 3
124 #define PPTP_START_NOT_AUTHORIZED 4
125 #define PPTP_START_UNKNOWN_PROTOCOL 5
127 struct PptpStartSessionReply {
128 __u16 protocolVersion;
129 __u8 resultCode;
130 __u8 generalErrorCode;
131 __u32 framingCapability;
132 __u32 bearerCapability;
133 __u16 maxChannels;
134 __u16 firmwareRevision;
135 __u8 hostName[64];
136 __u8 vendorString[64];
139 /* PptpStopReasons */
140 #define PPTP_STOP_NONE 1
141 #define PPTP_STOP_PROTOCOL 2
142 #define PPTP_STOP_LOCAL_SHUTDOWN 3
144 struct PptpStopSessionRequest {
145 __u8 reason;
148 /* PptpStopSessionResultCode */
149 #define PPTP_STOP_OK 1
150 #define PPTP_STOP_GENERAL_ERROR 2
152 struct PptpStopSessionReply {
153 __u8 resultCode;
154 __u8 generalErrorCode;
157 struct PptpEchoRequest {
158 __u32 identNumber;
161 /* PptpEchoReplyResultCode */
162 #define PPTP_ECHO_OK 1
163 #define PPTP_ECHO_GENERAL_ERROR 2
165 struct PptpEchoReply {
166 __u32 identNumber;
167 __u8 resultCode;
168 __u8 generalErrorCode;
169 __u16 reserved;
172 /* PptpFramingType */
173 #define PPTP_ASYNC_FRAMING 1
174 #define PPTP_SYNC_FRAMING 2
175 #define PPTP_DONT_CARE_FRAMING 3
177 /* PptpCallBearerType */
178 #define PPTP_ANALOG_TYPE 1
179 #define PPTP_DIGITAL_TYPE 2
180 #define PPTP_DONT_CARE_BEARER_TYPE 3
182 struct PptpOutCallRequest {
183 __u16 callID;
184 __u16 callSerialNumber;
185 __u32 minBPS;
186 __u32 maxBPS;
187 __u32 bearerType;
188 __u32 framingType;
189 __u16 packetWindow;
190 __u16 packetProcDelay;
191 __u16 reserved1;
192 __u16 phoneNumberLength;
193 __u16 reserved2;
194 __u8 phoneNumber[64];
195 __u8 subAddress[64];
198 /* PptpCallResultCode */
199 #define PPTP_OUTCALL_CONNECT 1
200 #define PPTP_OUTCALL_GENERAL_ERROR 2
201 #define PPTP_OUTCALL_NO_CARRIER 3
202 #define PPTP_OUTCALL_BUSY 4
203 #define PPTP_OUTCALL_NO_DIAL_TONE 5
204 #define PPTP_OUTCALL_TIMEOUT 6
205 #define PPTP_OUTCALL_DONT_ACCEPT 7
207 struct PptpOutCallReply {
208 __u16 callID;
209 __u16 peersCallID;
210 __u8 resultCode;
211 __u8 generalErrorCode;
212 __u16 causeCode;
213 __u32 connectSpeed;
214 __u16 packetWindow;
215 __u16 packetProcDelay;
216 __u32 physChannelID;
219 struct PptpInCallRequest {
220 __u16 callID;
221 __u16 callSerialNumber;
222 __u32 callBearerType;
223 __u32 physChannelID;
224 __u16 dialedNumberLength;
225 __u16 dialingNumberLength;
226 __u8 dialedNumber[64];
227 __u8 dialingNumber[64];
228 __u8 subAddress[64];
231 /* PptpInCallResultCode */
232 #define PPTP_INCALL_ACCEPT 1
233 #define PPTP_INCALL_GENERAL_ERROR 2
234 #define PPTP_INCALL_DONT_ACCEPT 3
236 struct PptpInCallReply {
237 __u16 callID;
238 __u16 peersCallID;
239 __u8 resultCode;
240 __u8 generalErrorCode;
241 __u16 packetWindow;
242 __u16 packetProcDelay;
243 __u16 reserved;
246 struct PptpInCallConnected {
247 __u16 peersCallID;
248 __u16 reserved;
249 __u32 connectSpeed;
250 __u16 packetWindow;
251 __u16 packetProcDelay;
252 __u32 callFramingType;
255 struct PptpClearCallRequest {
256 __u16 callID;
257 __u16 reserved;
260 struct PptpCallDisconnectNotify {
261 __u16 callID;
262 __u8 resultCode;
263 __u8 generalErrorCode;
264 __u16 causeCode;
265 __u16 reserved;
266 __u8 callStatistics[128];
269 struct PptpWanErrorNotify {
270 __u16 peersCallID;
271 __u16 reserved;
272 __u32 crcErrors;
273 __u32 framingErrors;
274 __u32 hardwareOverRuns;
275 __u32 bufferOverRuns;
276 __u32 timeoutErrors;
277 __u32 alignmentErrors;
280 struct PptpSetLinkInfo {
281 __u16 peersCallID;
282 __u16 reserved;
283 __u32 sendAccm;
284 __u32 recvAccm;
288 struct pptp_priv_data {
289 __u16 call_id;
290 __u16 mcall_id;
291 __u16 pcall_id;
294 union pptp_ctrl_union {
295 struct PptpStartSessionRequest sreq;
296 struct PptpStartSessionReply srep;
297 struct PptpStopSessionRequest streq;
298 struct PptpStopSessionReply strep;
299 struct PptpOutCallRequest ocreq;
300 struct PptpOutCallReply ocack;
301 struct PptpInCallRequest icreq;
302 struct PptpInCallReply icack;
303 struct PptpInCallConnected iccon;
304 struct PptpClearCallRequest clrreq;
305 struct PptpCallDisconnectNotify disc;
306 struct PptpWanErrorNotify wanerr;
307 struct PptpSetLinkInfo setlink;
310 extern int
311 (*ip_nat_pptp_hook_outbound)(struct sk_buff **pskb,
312 struct ip_conntrack *ct,
313 enum ip_conntrack_info ctinfo,
314 struct PptpControlHeader *ctlh,
315 union pptp_ctrl_union *pptpReq);
317 extern int
318 (*ip_nat_pptp_hook_inbound)(struct sk_buff **pskb,
319 struct ip_conntrack *ct,
320 enum ip_conntrack_info ctinfo,
321 struct PptpControlHeader *ctlh,
322 union pptp_ctrl_union *pptpReq);
324 extern int
325 (*ip_nat_pptp_hook_exp_gre)(struct ip_conntrack_expect *exp_orig,
326 struct ip_conntrack_expect *exp_reply);
328 extern void
329 (*ip_nat_pptp_hook_expectfn)(struct ip_conntrack *ct,
330 struct ip_conntrack_expect *exp);
331 #endif /* __KERNEL__ */
332 #endif /* _CONNTRACK_PPTP_H */