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.

184 lines
5.3 KiB

  1. /*******************************************************************/
  2. /* Copyright(c) 1993 Microsoft Corporation */
  3. /*******************************************************************/
  4. //***
  5. //
  6. // Filename: ipxcp.h
  7. //
  8. // Description: IPX network layer configuration definitions
  9. //
  10. //
  11. // Author: Stefan Solomon (stefans) November 24, 1993.
  12. //
  13. // Revision History:
  14. //
  15. //***
  16. #ifndef _IPXCP_
  17. #define _IPXCP_
  18. //*** IPXCP Option Offsets ***
  19. #define OPTIONH_TYPE 0
  20. #define OPTIONH_LENGTH 1
  21. #define OPTIONH_DATA 2
  22. //*** IPXCP Configuration Option Types ***
  23. #define IPX_NETWORK_NUMBER (UCHAR)1
  24. #define IPX_NODE_NUMBER (UCHAR)2
  25. #define IPX_COMPRESSION_PROTOCOL (UCHAR)3
  26. #define IPX_ROUTING_PROTOCOL (UCHAR)4
  27. #define IPX_ROUTER_NAME (UCHAR)5
  28. #define IPX_CONFIGURATION_COMPLETE (UCHAR)6
  29. //*** IPXCP Configuration Option Values ***
  30. #define RIP_SAP_ROUTING 2
  31. #define TELEBIT_COMPRESSED_IPX 0x0002
  32. // nr of parameters we will try to negotiate
  33. #define MAX_DESIRED_PARAMETERS 3
  34. //*** IPXCP Work Buffer ***
  35. typedef enum _ROUTE_STATE {
  36. NO_ROUTE,
  37. ROUTE_ALLOCATED,
  38. ROUTE_ACTIVATED
  39. } ROUTE_STATE;
  40. typedef enum _IPXWAN_STATE {
  41. IPXWAN_NOT_STARTED,
  42. IPXWAN_ACTIVE,
  43. IPXWAN_DONE
  44. } IPXWAN_STATE;
  45. typedef struct _IPXCP_CONTEXT {
  46. ULONG InterfaceType;
  47. ROUTE_STATE RouteState;
  48. IPXWAN_STATE IpxwanState;
  49. ULONG IpxwanConfigResult;
  50. IPXCP_CONFIGURATION Config;
  51. ULONG IpxConnectionHandle; // used in IpxGetWanInactivityCounter
  52. ULONG AllocatedNetworkIndex; // net number index from the wannet pool
  53. USHORT CompressionProtocol;
  54. BOOL SetReceiveCompressionProtocol;
  55. BOOL SetSendCompressionProtocol;
  56. BOOL ErrorLogged;
  57. USHORT NetNumberNakSentCount; // nr of Naks we issued by the CLIENT
  58. USHORT NetNumberNakReceivedCount; // nr of Naks recv by the SERVER
  59. // This array is used to turn off negotiation for certain options.
  60. // An option negotiation is turned off if it gets rejected by the other end
  61. // or if (in the compression case) is not supported by the other end.
  62. BOOL DesiredParameterNegotiable[MAX_DESIRED_PARAMETERS];
  63. // hash tables linkages
  64. LIST_ENTRY ConnHtLinkage; // linkage in connection id hash table
  65. LIST_ENTRY NodeHtLinkage; // linkage in node hash table
  66. // these two variables used to store the previous browser enabling state
  67. // for nwlnkipx and nwlnknb
  68. BOOL NwLnkIpxPreviouslyEnabled;
  69. BOOL NwLnkNbPreviouslyEnabled;
  70. // !!! This should go away !!!
  71. ULONG hPort;
  72. HBUNDLE hConnection;
  73. } IPXCP_CONTEXT, *PIPXCP_CONTEXT;
  74. //*** max nr of Naks we can send or receive for the Net Number
  75. // if you modify these values set max naks sent < max naks received to give
  76. // the client a chance to terminate and inform the user before the server terminates
  77. // max nr of naks the client can send before giving up and terminating the connection
  78. #define MAX_NET_NUMBER_NAKS_SENT 5
  79. // max nr of naks the server can receive before giving up
  80. #define MAX_NET_NUMBER_NAKS_RECEIVED 5
  81. //*** The following define the index for each option as they appear in the
  82. // DesiredParameter array. CHANGE THESE DEFS IF YOU CHANGE DESIREDPARAMETER!
  83. #define IPX_NETWORK_NUMBER_INDEX 0
  84. #define IPX_NODE_NUMBER_INDEX 1
  85. #define IPX_COMPRESSION_PROTOCOL_INDEX 2
  86. //*** Option Handler Actions ***
  87. typedef enum _OPT_ACTION {
  88. SNDREQ_OPTION, // Copy the option value from the local context struct
  89. // to the REQ option frame to be sent
  90. RCVNAK_OPTION, // Check the option value from the received NAK frame.
  91. // Copy it to our local context struct if it is acceptable
  92. // for us.
  93. RCVACK_OPTION, // Compare option values from the received ACK frame and
  94. // the local context struct.
  95. RCVREQ_OPTION, // Check if the option value in the received REQ frame is
  96. // acceptable. If not, write the acceptable value in the
  97. // response NAK frame.
  98. SNDNAK_OPTION // Make an acceptable option in the response NAK frame.
  99. // This happens when a desired option is missing from the
  100. // received REQ frame.
  101. } OPT_ACTION;
  102. extern CRITICAL_SECTION DbaseCritSec;
  103. #define ACQUIRE_DATABASE_LOCK EnterCriticalSection(&DbaseCritSec)
  104. #define RELEASE_DATABASE_LOCK LeaveCriticalSection(&DbaseCritSec)
  105. extern BOOL RouterStarted;
  106. extern DWORD SingleClientDialinIfNoRouter;
  107. extern UCHAR nullnet[4];
  108. extern UCHAR nullnode[6];
  109. extern DWORD WorkstationDialoutActive;
  110. typedef struct _IPXCP_GLOBAL_CONFIG_PARAMS {
  111. IPXCP_ROUTER_CONFIG_PARAMS RParams;
  112. DWORD SingleClientDialout;
  113. DWORD FirstWanNet;
  114. DWORD WanNetPoolSize;
  115. UNICODE_STRING WanNetPoolStr;
  116. DWORD EnableUnnumberedWanLinks;
  117. DWORD EnableAutoWanNetAllocation;
  118. DWORD EnableCompressionProtocol;
  119. DWORD EnableIpxwanForWorkstationDialout;
  120. DWORD AcceptRemoteNodeNumber;
  121. DWORD DebugLog;
  122. UCHAR puSpecificNode[6];
  123. } IPXCP_GLOBAL_CONFIG_PARAMS, *PIPXCP_GLOBAL_CONFIG_PARAMS;
  124. extern IPXCP_GLOBAL_CONFIG_PARAMS GlobalConfig;
  125. extern VOID (*PPPCompletionRoutine)(HCONN hPortOrBundle,
  126. DWORD Protocol,
  127. PPP_CONFIG * pSendConfig,
  128. DWORD dwError);
  129. extern HANDLE PPPThreadHandle;
  130. extern HINSTANCE IpxWanDllHandle;
  131. // ipxwan dll name
  132. #define IPXWANDLLNAME "ipxwan.dll"
  133. #endif