3.3 PPTP Control Messages

The PPTP control message header is very simple. The only information it contains is the message type, which is one of the following:


    /*
     * The PPTP Control Message Types.
     *
     */

typedef enum {
    PPTP_START_SESSION_REQUEST = 1,
    PPTP_START_SESSION_REPLY,
    PPTP_STOP_SESSION_REQUEST,
    PPTP_STOP_SESSION_REPLY,
    PPTP_ECHO_REQUEST,
    PPTP_ECHO_REPLY,
    PPTP_OUT_CALL_REQUEST,
    PPTP_OUT_CALL_REPLY,
    PPTP_IN_CALL_REQUEST,
    PPTP_IN_CALL_REPLY,
    PPTP_IN_CALL_CONNECTED,
    PPTP_CALL_CLEAR_REQUEST,
    PPTP_CALL_DISCONNECT_NOTIFY,
    PPTP_WAN_ERROR_NOTIFY,
    PPTP_SET_LINK_INFO,
    PPTP_NUMBER_OF_CONTROL_MESSAGES
} PptpControlMessageType;

The following values are PPTP general error codes:


    /*
     * General Error Codes. Each command, when applicable, has a 
     * "resultCode" and "generalErrorCode" field. If the resultCode
     * field is set to *_GENERAL_ERROR, then the generalErrorCode field
     * must be examined to determine the true error code.
     *
     * PPTP_NOT_CONNECTED:        We have not done a full handshake
     *                            yet. Can't accept this command.
     *
     * PPTP_BAD_FORMAT:           Command length is wrong.
     *
     * PPTP_BAD_VALUE:            One of the field values was out
     *                            of range.
     *
     * PPTP_NO_RESOURCE:          Can't deal with this command 
     *                            right now.
     *
     * PPTP_BAD_CALLID:           The callID is invalid for this
     *                            context.
     *
     * PPTP_REMOTE_DEVICE_ERROR:  Generic vendor-specific error
     *                            occurred on the FEP.
     */

typedef enum {
    PPTP_ERROR_CODE_NONE = 0,
    PPTP_NOT_CONNECTED = 1,
    PPTP_BAD_FORMAT,
    PPTP_BAD_VALUE,
    PPTP_NO_RESOURCE,
    PPTP_BAD_CALLID,
    PPTP_REMOTE_DEVICE_ERROR
} PptpGeneralError;

The format for the Control message header is the following:


    /*
     * The PPTP Control Header
     *
     * messageType:         One of PptpControlMessageType
     *                      that indicates which control
     *                      message is being sent.
     *
     */

typedef struct {
    Word      messageType;
    Word      reserved;
} PptpControlHeader;