Leaked source code of windows server 2003
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.

163 lines
4.9 KiB

  1. /********************************************************************/
  2. /** Copyright(c) 1989 Microsoft Corporation. **/
  3. /********************************************************************/
  4. //***
  5. //
  6. // Filename: lcp.h
  7. //
  8. // Description:
  9. //
  10. // History:
  11. // Nov 11,1993. NarenG Created original version.
  12. //
  13. #ifndef _LCP_
  14. #define _LCP_
  15. //
  16. // LCP option types
  17. //
  18. #define LCP_OPTION_MRU 0x01
  19. #define LCP_OPTION_ACCM 0x02
  20. #define LCP_OPTION_AUTHENT 0x03
  21. #define LCP_OPTION_MAGIC 0x05
  22. #define LCP_OPTION_PFC 0x07
  23. #define LCP_OPTION_ACFC 0x08
  24. #define LCP_OPTION_CALLBACK 0x0D
  25. #define LCP_OPTION_MRRU 0x11
  26. #define LCP_OPTION_SHORT_SEQ 0x12
  27. #define LCP_OPTION_ENDPOINT 0x13
  28. #define LCP_OPTION_LINK_DISCRIM 0x17
  29. #define LCP_OPTION_LIMIT 0x17 // highest # we can handle
  30. //
  31. // Authentication protocols
  32. //
  33. #define LCP_AP_FIRST 0x00000001
  34. #define LCP_AP_EAP 0x00000001
  35. #define LCP_AP_CHAP_MS_NEW 0x00000002
  36. #define LCP_AP_CHAP_MS 0x00000004
  37. #define LCP_AP_CHAP_MD5 0x00000008
  38. #define LCP_AP_SPAP_NEW 0x00000010
  39. #define LCP_AP_SPAP_OLD 0x00000020
  40. #define LCP_AP_PAP 0x00000040
  41. #define LCP_AP_MAX 0x00000080
  42. //
  43. // Table for LCP configuration requests
  44. //
  45. typedef struct _LCP_OPTIONS
  46. {
  47. DWORD Negotiate; // negotiation flags
  48. #define LCP_N_MRU (1 << LCP_OPTION_MRU)
  49. #define LCP_N_ACCM (1 << LCP_OPTION_ACCM)
  50. #define LCP_N_AUTHENT (1 << LCP_OPTION_AUTHENT)
  51. #define LCP_N_MAGIC (1 << LCP_OPTION_MAGIC)
  52. #define LCP_N_PFC (1 << LCP_OPTION_PFC)
  53. #define LCP_N_ACFC (1 << LCP_OPTION_ACFC)
  54. #define LCP_N_CALLBACK (1 << LCP_OPTION_CALLBACK)
  55. #define LCP_N_MRRU (1 << LCP_OPTION_MRRU)
  56. #define LCP_N_SHORT_SEQ (1 << LCP_OPTION_SHORT_SEQ)
  57. #define LCP_N_ENDPOINT (1 << LCP_OPTION_ENDPOINT)
  58. #define LCP_N_LINK_DISCRIM (1 << LCP_OPTION_LINK_DISCRIM)
  59. DWORD MRU; // Maximum Receive Unit
  60. DWORD ACCM; // Async Control Char Map
  61. DWORD AP; // Authentication protocol
  62. DWORD APDataSize; // Auth. protocol data size in bytes
  63. PBYTE pAPData; // Pointer Auth. protocol data
  64. DWORD MagicNumber; // Magic number value
  65. DWORD PFC; // Protocol field compression.
  66. DWORD ACFC; // Address and Control Field Compression.
  67. DWORD Callback; // Callback
  68. DWORD MRRU; // Maximum Reconstructed Receive Unit
  69. DWORD ShortSequence; // Short Sequence Number Header Format
  70. BYTE EndpointDiscr[21]; // Endpoint Discriminator.
  71. DWORD dwEDLength; // Length of Endpoint Discriminator
  72. DWORD dwLinkDiscriminator; // Link Discriminator (for BAP/BACP)
  73. } LCP_OPTIONS, *PLCP_OPTIONS;
  74. #define PPP_NEGOTIATE_CALLBACK 0x06
  75. //
  76. // Other configuration option values
  77. //
  78. #define LCP_ACCM_DEFAULT 0xFFFFFFFFL
  79. #define LCP_MRU_HI 1500 // High MRU limit
  80. #define LCP_MRU_LO 128 // Lower MRU limit
  81. #define LCP_DEFAULT_MRU 1500
  82. #define LCP_REQ_TRY 20 // REQ attempts
  83. #define LCP_SPAP_VERSION 0x01000001
  84. //
  85. // Local.Want: Options to request.
  86. // Contains desired value.
  87. // Only non-default options need to be negotiated.
  88. // Initially, all are default.
  89. // Local.WillNegotiate: Options to accept in a NAK from remote.
  90. // local.Work: Options currently being negotiated.
  91. // Value is valid only when negotiate bit is set.
  92. //
  93. // Remote.Want: Options to suggest by NAK if not present in REQ.
  94. // Contains desired value.
  95. // Remote.WillNegotiate: Options to accept in a REQ from remote.
  96. // Remote.Work: Options currently being negotiated.
  97. // Value is valid only when negotiate bit is set.
  98. //
  99. typedef struct _LCP_SIDE
  100. {
  101. DWORD WillNegotiate;
  102. DWORD fAPsAvailable;
  103. DWORD fLastAPTried;
  104. DWORD fOldLastAPTried;
  105. LCP_OPTIONS Want;
  106. LCP_OPTIONS Work;
  107. } LCP_SIDE, *PLCP_SIDE;
  108. //
  109. // LCP control block
  110. //
  111. typedef struct _LCPCB
  112. {
  113. HPORT hPort;
  114. BOOL fServer;
  115. BOOL fRouter;
  116. DWORD dwMRUFailureCount;
  117. DWORD dwMagicNumberFailureCount;
  118. PPP_CONFIG_INFO PppConfigInfo;
  119. LCP_SIDE Local;
  120. LCP_SIDE Remote;
  121. }LCPCB, *PLCPCB;
  122. DWORD
  123. LcpGetInfo(
  124. IN DWORD dwProtocolId,
  125. OUT PPPCP_INFO* pCpInfo
  126. );
  127. #endif