Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
3.0 KiB

  1. /********************************************************************/
  2. /** Copyright(c) 1989 Microsoft Corporation. **/
  3. /********************************************************************/
  4. //***
  5. //
  6. // Filename: rascbcp.h
  7. //
  8. // Description: Co
  9. //
  10. // History:
  11. // April 11,1994. NarenG Created original version.
  12. //
  13. #ifndef _RASCBCP_H_
  14. #define _RASCBCP_H_
  15. #include <mprapi.h>
  16. //
  17. // CbCP packet codes from CbCP spec.
  18. //
  19. #define CBCP_CODE_Request 1
  20. #define CBCP_CODE_Response 2
  21. #define CBCP_CODE_Ack 3
  22. #define MAX_CBCP_CODE 3
  23. //
  24. // Callback Option Types
  25. //
  26. #define CBCP_TYPE_NO_CALLBACK 1
  27. #define CBCP_TYPE_CALLER_SET 2
  28. #define CBCP_TYPE_CALLEE_SET 3
  29. #define CBCP_TYPE_NUMBER_LIST 4
  30. //
  31. // Defines states within CBCP
  32. //
  33. typedef enum _CBCP_STATE
  34. {
  35. CBCP_STATE_INITIAL,
  36. CBCP_STATE_WAIT_FOR_REQUEST,
  37. CBCP_STATE_WAIT_FOR_ACK,
  38. CBCP_STATE_WAIT_FOR_RESPONSE,
  39. CBCP_STATE_GET_CALLBACK_NUMBER,
  40. CBCP_STATE_DONE
  41. } CBCP_STATE;
  42. #define CBCP_PSTN_NUMBER 1
  43. //
  44. // Defines the WorkBuf stored for us by the PPP engine.
  45. //
  46. typedef struct _CBCP_WORKBUFFER
  47. {
  48. BOOL fServer;
  49. CBCP_STATE State;
  50. PPP_CONFIG * pRequest;
  51. PPP_CONFIG * pResponse;
  52. DWORD fCallbackPrivilege;
  53. CHAR szCallbackNumber[ MAX_CALLBACKNUMBER_SIZE + 1];
  54. DWORD CallbackDelay;
  55. } CBCP_WORKBUFFER, *PCBCP_WORKBUFFER;
  56. //
  57. // Function Prototypes.
  58. //
  59. DWORD
  60. CbCPBegin(
  61. OUT VOID** ppWorkBuf,
  62. IN VOID* pInfo
  63. );
  64. DWORD
  65. CbCPEnd(
  66. IN VOID* pWorkBuf
  67. );
  68. DWORD
  69. CbCPMakeMessage(
  70. IN VOID* pWorkBuf,
  71. IN PPP_CONFIG* pReceiveBuf,
  72. OUT PPP_CONFIG* pSendBuf,
  73. IN DWORD cbSendBuf,
  74. OUT PPPAP_RESULT* pResult,
  75. IN PPPAP_INPUT* pInput
  76. );
  77. DWORD
  78. CbCPCMakeMessage(
  79. IN CBCP_WORKBUFFER * pCbCPWorkBuf,
  80. IN PPP_CONFIG* pReceiveBuf,
  81. OUT PPP_CONFIG* pSendBuf,
  82. IN DWORD cbSendBuf,
  83. OUT PPPCB_RESULT* pResult,
  84. IN PPPCB_INPUT* pInput
  85. );
  86. DWORD
  87. CbCPSMakeMessage(
  88. IN CBCP_WORKBUFFER * pCbCPWorkBuf,
  89. IN PPP_CONFIG* pReceiveBuf,
  90. OUT PPP_CONFIG* pSendBuf,
  91. IN DWORD cbSendBuf,
  92. OUT PPPCB_RESULT* pResult,
  93. IN PPPCB_INPUT* pInput
  94. );
  95. DWORD
  96. MakeRequest(
  97. IN DWORD fCallbackPrivilege,
  98. IN OUT PPP_CONFIG * pSendBuf,
  99. IN DWORD cbSendBuf
  100. );
  101. DWORD
  102. GetCallbackPrivilegeFromRequest(
  103. IN PPP_CONFIG * pRequest,
  104. IN OUT DWORD * lpdwCallbackPriv
  105. );
  106. DWORD
  107. MakeResponse(
  108. IN DWORD RASCallbackPriv,
  109. IN LPSTR szCallbackNumber,
  110. IN DWORD ModemDelay,
  111. IN PPP_CONFIG * pRequest,
  112. IN OUT PPP_CONFIG * pSendBuf,
  113. IN DWORD cbSendBuf
  114. );
  115. DWORD
  116. ValidateResponse(
  117. IN PPP_CONFIG * pReceiveBuf,
  118. IN CBCP_WORKBUFFER * pCbCPWorkBuf
  119. );
  120. #endif // _RASCBCP_H_