fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / linux / netfilter_ipv4 / ip_conntrack_pptp.h
index 0fbec88..2644b1f 100644 (file)
@@ -31,23 +31,24 @@ struct ip_ct_pptp_master {
        /* everything below is going to be per-expectation in newnat,
         * since there could be more than one call within one session */
        enum pptp_ctrlcall_state cstate;        /* call state */
-       u_int16_t pac_call_id;                  /* call id of PAC, host byte order */
-       u_int16_t pns_call_id;                  /* call id of PNS, host byte order */
+       __be16 pac_call_id;                     /* call id of PAC, host byte order */
+       __be16 pns_call_id;                     /* call id of PNS, host byte order */
+
+       /* in pre-2.6.11 this used to be per-expect. Now it is per-conntrack
+        * and therefore imposes a fixed limit on the number of maps */
+       struct ip_ct_gre_keymap *keymap_orig, *keymap_reply;
 };
 
 /* conntrack_expect private member */
 struct ip_ct_pptp_expect {
        enum pptp_ctrlcall_state cstate;        /* call state */
-       u_int16_t pac_call_id;                  /* call id of PAC */
-       u_int16_t pns_call_id;                  /* call id of PNS */
+       __be16 pac_call_id;                     /* call id of PAC */
+       __be16 pns_call_id;                     /* call id of PNS */
 };
 
 
 #ifdef __KERNEL__
 
-#include <linux/netfilter_ipv4/lockhelp.h>
-DECLARE_LOCK_EXTERN(ip_pptp_lock);
-
 #define IP_CONNTR_PPTP         PPTP_CONTROL_PORT
 
 #define PPTP_CONTROL_PORT      1723
@@ -59,8 +60,8 @@ DECLARE_LOCK_EXTERN(ip_pptp_lock);
 
 struct pptp_pkt_hdr {
        __u16   packetLength;
-       __u16   packetType;
-       __u32   magicCookie;
+       __be16  packetType;
+       __be32  magicCookie;
 };
 
 /* PptpControlMessageType values */
@@ -92,7 +93,7 @@ struct pptp_pkt_hdr {
 #define PPTP_REMOVE_DEVICE_ERROR       6
 
 struct PptpControlHeader {
-       __u16   messageType;
+       __be16  messageType;
        __u16   reserved;
 };
 
@@ -105,13 +106,12 @@ struct PptpControlHeader {
 #define PPTP_BEARER_CAP_DIGITAL                0x2
 
 struct PptpStartSessionRequest {
-       __u16   protocolVersion;
-       __u8    reserved1;
-       __u8    reserved2;
-       __u32   framingCapability;
-       __u32   bearerCapability;
-       __u16   maxChannels;
-       __u16   firmwareRevision;
+       __be16  protocolVersion;
+       __u16   reserved1;
+       __be32  framingCapability;
+       __be32  bearerCapability;
+       __be16  maxChannels;
+       __be16  firmwareRevision;
        __u8    hostName[64];
        __u8    vendorString[64];
 };
@@ -124,13 +124,13 @@ struct PptpStartSessionRequest {
 #define PPTP_START_UNKNOWN_PROTOCOL    5
 
 struct PptpStartSessionReply {
-       __u16   protocolVersion;
+       __be16  protocolVersion;
        __u8    resultCode;
        __u8    generalErrorCode;
-       __u32   framingCapability;
-       __u32   bearerCapability;
-       __u16   maxChannels;
-       __u16   firmwareRevision;
+       __be32  framingCapability;
+       __be32  bearerCapability;
+       __be16  maxChannels;
+       __be16  firmwareRevision;
        __u8    hostName[64];
        __u8    vendorString[64];
 };
@@ -142,6 +142,8 @@ struct PptpStartSessionReply {
 
 struct PptpStopSessionRequest {
        __u8    reason;
+       __u8    reserved1;
+       __u16   reserved2;
 };
 
 /* PptpStopSessionResultCode */
@@ -151,10 +153,11 @@ struct PptpStopSessionRequest {
 struct PptpStopSessionReply {
        __u8    resultCode;
        __u8    generalErrorCode;
+       __u16   reserved1;
 };
 
 struct PptpEchoRequest {
-       __u32 identNumber;
+       __be32 identNumber;
 };
 
 /* PptpEchoReplyResultCode */
@@ -162,7 +165,7 @@ struct PptpEchoRequest {
 #define PPTP_ECHO_GENERAL_ERROR                2
 
 struct PptpEchoReply {
-       __u32   identNumber;
+       __be32  identNumber;
        __u8    resultCode;
        __u8    generalErrorCode;
        __u16   reserved;
@@ -179,17 +182,16 @@ struct PptpEchoReply {
 #define PPTP_DONT_CARE_BEARER_TYPE     3
 
 struct PptpOutCallRequest {
-       __u16   callID;
-       __u16   callSerialNumber;
-       __u32   minBPS;
-       __u32   maxBPS;
-       __u32   bearerType;
-       __u32   framingType;
-       __u16   packetWindow;
-       __u16   packetProcDelay;
+       __be16  callID;
+       __be16  callSerialNumber;
+       __be32  minBPS;
+       __be32  maxBPS;
+       __be32  bearerType;
+       __be32  framingType;
+       __be16  packetWindow;
+       __be16  packetProcDelay;
+       __be16  phoneNumberLength;
        __u16   reserved1;
-       __u16   phoneNumberLength;
-       __u16   reserved2;
        __u8    phoneNumber[64];
        __u8    subAddress[64];
 };
@@ -204,24 +206,24 @@ struct PptpOutCallRequest {
 #define PPTP_OUTCALL_DONT_ACCEPT       7
 
 struct PptpOutCallReply {
-       __u16   callID;
-       __u16   peersCallID;
+       __be16  callID;
+       __be16  peersCallID;
        __u8    resultCode;
        __u8    generalErrorCode;
-       __u16   causeCode;
-       __u32   connectSpeed;
-       __u16   packetWindow;
-       __u16   packetProcDelay;
-       __u32   physChannelID;
+       __be16  causeCode;
+       __be32  connectSpeed;
+       __be16  packetWindow;
+       __be16  packetProcDelay;
+       __be32  physChannelID;
 };
 
 struct PptpInCallRequest {
-       __u16   callID;
-       __u16   callSerialNumber;
-       __u32   callBearerType;
-       __u32   physChannelID;
-       __u16   dialedNumberLength;
-       __u16   dialingNumberLength;
+       __be16  callID;
+       __be16  callSerialNumber;
+       __be32  callBearerType;
+       __be32  physChannelID;
+       __be16  dialedNumberLength;
+       __be16  dialingNumberLength;
        __u8    dialedNumber[64];
        __u8    dialingNumber[64];
        __u8    subAddress[64];
@@ -233,78 +235,92 @@ struct PptpInCallRequest {
 #define PPTP_INCALL_DONT_ACCEPT                3
 
 struct PptpInCallReply {
-       __u16   callID;
-       __u16   peersCallID;
+       __be16  callID;
+       __be16  peersCallID;
        __u8    resultCode;
        __u8    generalErrorCode;
-       __u16   packetWindow;
-       __u16   packetProcDelay;
+       __be16  packetWindow;
+       __be16  packetProcDelay;
        __u16   reserved;
 };
 
 struct PptpInCallConnected {
-       __u16   peersCallID;
+       __be16  peersCallID;
        __u16   reserved;
-       __u32   connectSpeed;
-       __u16   packetWindow;
-       __u16   packetProcDelay;
-       __u32   callFramingType;
+       __be32  connectSpeed;
+       __be16  packetWindow;
+       __be16  packetProcDelay;
+       __be32  callFramingType;
 };
 
 struct PptpClearCallRequest {
-       __u16   callID;
+       __be16  callID;
        __u16   reserved;
 };
 
 struct PptpCallDisconnectNotify {
-       __u16   callID;
+       __be16  callID;
        __u8    resultCode;
        __u8    generalErrorCode;
-       __u16   causeCode;
+       __be16  causeCode;
        __u16   reserved;
        __u8    callStatistics[128];
 };
 
 struct PptpWanErrorNotify {
-       __u16   peersCallID;
+       __be16  peersCallID;
        __u16   reserved;
-       __u32   crcErrors;
-       __u32   framingErrors;
-       __u32   hardwareOverRuns;
-       __u32   bufferOverRuns;
-       __u32   timeoutErrors;
-       __u32   alignmentErrors;
+       __be32  crcErrors;
+       __be32  framingErrors;
+       __be32  hardwareOverRuns;
+       __be32  bufferOverRuns;
+       __be32  timeoutErrors;
+       __be32  alignmentErrors;
 };
 
 struct PptpSetLinkInfo {
-       __u16   peersCallID;
+       __be16  peersCallID;
        __u16   reserved;
-       __u32   sendAccm;
-       __u32   recvAccm;
-};
-
-
-struct pptp_priv_data {
-       __u16   call_id;
-       __u16   mcall_id;
-       __u16   pcall_id;
+       __be32  sendAccm;
+       __be32  recvAccm;
 };
 
 union pptp_ctrl_union {
-               struct PptpStartSessionRequest  sreq;
-               struct PptpStartSessionReply    srep;
-               struct PptpStopSessionRequest   streq;
-               struct PptpStopSessionReply     strep;
-                struct PptpOutCallRequest       ocreq;
-                struct PptpOutCallReply         ocack;
-                struct PptpInCallRequest        icreq;
-                struct PptpInCallReply          icack;
-                struct PptpInCallConnected      iccon;
-               struct PptpClearCallRequest     clrreq;
-                struct PptpCallDisconnectNotify disc;
-                struct PptpWanErrorNotify       wanerr;
-                struct PptpSetLinkInfo          setlink;
+       struct PptpStartSessionRequest  sreq;
+       struct PptpStartSessionReply    srep;
+       struct PptpStopSessionRequest   streq;
+       struct PptpStopSessionReply     strep;
+       struct PptpOutCallRequest       ocreq;
+       struct PptpOutCallReply         ocack;
+       struct PptpInCallRequest        icreq;
+       struct PptpInCallReply          icack;
+       struct PptpInCallConnected      iccon;
+       struct PptpClearCallRequest     clrreq;
+       struct PptpCallDisconnectNotify disc;
+       struct PptpWanErrorNotify       wanerr;
+       struct PptpSetLinkInfo          setlink;
 };
 
+extern int
+(*ip_nat_pptp_hook_outbound)(struct sk_buff **pskb,
+                         struct ip_conntrack *ct,
+                         enum ip_conntrack_info ctinfo,
+                         struct PptpControlHeader *ctlh,
+                         union pptp_ctrl_union *pptpReq);
+
+extern int
+(*ip_nat_pptp_hook_inbound)(struct sk_buff **pskb,
+                         struct ip_conntrack *ct,
+                         enum ip_conntrack_info ctinfo,
+                         struct PptpControlHeader *ctlh,
+                         union pptp_ctrl_union *pptpReq);
+
+extern void
+(*ip_nat_pptp_hook_exp_gre)(struct ip_conntrack_expect *exp_orig,
+                           struct ip_conntrack_expect *exp_reply);
+
+extern void
+(*ip_nat_pptp_hook_expectfn)(struct ip_conntrack *ct,
+                            struct ip_conntrack_expect *exp);
 #endif /* __KERNEL__ */
 #endif /* _CONNTRACK_PPTP_H */