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.

210 lines
5.6 KiB

  1. //****************************************************************************
  2. //
  3. // Microsoft NT Remote Access Service
  4. //
  5. // Copyright (C) 1994-95 Microsft Corporation. All rights reserved.
  6. //
  7. // Filename: rastapi.h
  8. //
  9. // Revision History
  10. //
  11. // Mar 28 1992 Gurdeep Singh Pall Created
  12. //
  13. //
  14. // Description: This file contains all structs for TAPI.DLL
  15. //
  16. //****************************************************************************
  17. #define DEVICETYPE_ISDN "ISDN"
  18. #define DEVICETYPE_X25 "X25"
  19. #define DEVICETYPE_UNIMODEM "MODEM"
  20. // #define DEVICETYPE_UNIMODEM "MODEMS"
  21. #define DEVICETYPE_PPTP "VPN"
  22. #define REMOTEACCESS_APP "RemoteAccess"
  23. #define CONTROLBLOCKSIGNATURE 0x06051932
  24. #define CLIENT_USAGE "Client"
  25. #define SERVER_USAGE "Server"
  26. #define CLIENTANDSERVER_USAGE "ClientAndServer"
  27. #define REGISTRY_RASMAN_TAPI_KEY "Software\\Microsoft\\RAS\\Tapi Devices"
  28. #define REGISTRY_ADDRESS "Address"
  29. #define REGISTRY_FRIENDLYNAME "Friendly Name"
  30. #define REGISTRY_MEDIATYPE "Media Type"
  31. #define REGISTRY_USAGE "Usage"
  32. #define LOW_MAJOR_VERSION 0x0001
  33. #define LOW_MINOR_VERSION 0x0003
  34. #define HIGH_MAJOR_VERSION 0x0002
  35. #define HIGH_MINOR_VERSION 0x0000
  36. #define LOW_VERSION ((LOW_MAJOR_VERSION << 16) | LOW_MINOR_VERSION)
  37. #define HIGH_VERSION ((HIGH_MAJOR_VERSION << 16) | HIGH_MINOR_VERSION)
  38. #define LOW_EXT_MAJOR_VERSION 0x0000
  39. #define LOW_EXT_MINOR_VERSION 0x0000
  40. #define HIGH_EXT_MAJOR_VERSION 0x0000
  41. #define HIGH_EXT_MINOR_VERSION 0x0000
  42. #define LOW_EXT_VERSION ((LOW_EXT_MAJOR_VERSION << 16) | LOW_EXT_MINOR_VERSION)
  43. #define HIGH_EXT_VERSION ((HIGH_EXT_MAJOR_VERSION << 16) | HIGH_EXT_MINOR_VERSION)
  44. // Generic indexes
  45. #define ADDRESS_INDEX 0
  46. #define CONNECTBPS_INDEX 1
  47. // ISDN param indexes
  48. #define ISDN_ADDRESS_INDEX ADDRESS_INDEX
  49. #define ISDN_CONNECTBPS_INDEX CONNECTBPS_INDEX
  50. #define ISDN_LINETYPE_INDEX 2
  51. #define ISDN_FALLBACK_INDEX 3
  52. #define ISDN_COMPRESSION_INDEX 4
  53. #define ISDN_CHANNEL_AGG_INDEX 5
  54. // X25 indexes
  55. #define X25_ADDRESS_INDEX ADDRESS_INDEX
  56. #define X25_CONNECTBPS_INDEX CONNECTBPS_INDEX
  57. #define X25_DIAGNOSTICS_INDEX 2
  58. #define X25_USERDATA_INDEX 3
  59. #define X25_FACILITIES_INDEX 4
  60. enum PORT_STATE {
  61. PS_CLOSED,
  62. PS_OPEN,
  63. PS_LISTENING,
  64. PS_CONNECTED,
  65. PS_CONNECTING,
  66. PS_DISCONNECTING,
  67. PS_UNINITIALIZED,
  68. } ;
  69. typedef enum PORT_STATE PORT_STATE ;
  70. typedef enum PORT_STATE LINE_STATE ;
  71. enum LISTEN_SUBSTATE {
  72. LS_WAIT,
  73. LS_RINGING,
  74. LS_ACCEPT,
  75. LS_ANSWER,
  76. LS_COMPLETE,
  77. LS_ERROR,
  78. } ;
  79. typedef enum LISTEN_SUBSTATE LISTEN_SUBSTATE ;
  80. struct TapiLineInfo {
  81. DWORD TLI_LineId ; // Returned by LineInitialize
  82. HLINE TLI_LineHandle ; // Returned by LineOpen
  83. #define MAX_PROVIDER_NAME 48
  84. CHAR TLI_ProviderName[MAX_PROVIDER_NAME] ;
  85. LINE_STATE TLI_LineState ; // open?, closed?, listen posted?.
  86. DWORD TLI_OpenCount ;
  87. DWORD NegotiatedApiVersion;
  88. DWORD NegotiatedExtVersion;
  89. DWORD IdleReceived;
  90. } ;
  91. typedef struct TapiLineInfo TapiLineInfo ;
  92. struct TapiPortControlBlock {
  93. DWORD TPCB_Signature ; // Unique signature for verifying block ptr.
  94. HANDLE TPCB_Handle ; // Handle used to identify this port
  95. CHAR TPCB_Name[MAX_PORT_NAME] ; // Friendly Name of the port
  96. CHAR TPCB_Address[MAX_PORT_NAME] ;// Address
  97. PORT_STATE TPCB_State ; // State of the port
  98. LISTEN_SUBSTATE TPCB_ListenState ; // state of the listen
  99. CHAR TPCB_DeviceType[MAX_DEVICETYPE_NAME] ; // ISDN, etc.
  100. CHAR TPCB_DeviceName [MAX_DEVICE_NAME] ; // Digiboard etc.
  101. RASMAN_USAGE TPCB_Usage ; // CALLIN, CALLOUT or BOTH
  102. TapiLineInfo *TPCB_Line ; // Handle to the "line" this port belongs to
  103. DWORD TPCB_AddressId ; // Address ID for this "port"
  104. HCALL TPCB_CallHandle ; // When connected the call id
  105. HANDLE TPCB_DiscNotificationHandle ; // passed in open
  106. HANDLE TPCB_ReqNotificationHandle ; // passed in device listen and connect
  107. DWORD TPCB_RequestId ; // id for async requests.
  108. DWORD TPCB_AsyncErrorCode ; // used to store asycn returned code.
  109. CHAR TPCB_Info[6][100] ; // port info associated with this connection
  110. DWORD TPCB_Endpoint ; // used to store asyncmac context for unimodem ports
  111. HANDLE TPCB_CommHandle ; // used to store comm port handle used in unimodem ports
  112. OVERLAPPED TPCB_ReadOverlapped ; // used in read async ops.
  113. OVERLAPPED TPCB_WriteOverlapped ; // used in write async ops.
  114. DWORD TPCB_MediaMode ; // Media mode to use for lineopens.
  115. PBYTE TPCB_DevConfig ; // Opaque blob of data used for configuring tapi devices - this is passed in to
  116. // us using DeviceSetDevConfig() ;
  117. DWORD TPCB_SizeOfDevConfig ; // Size of the above blob.
  118. PBYTE TPCB_DefaultDevConfig ; // The current config for the device that is saved away before we write any changes
  119. // to the device. This allows RAS to be a good citizen by not overwriting defauls.
  120. DWORD TPCB_DefaultDevConfigSize ;
  121. DWORD TPCB_DisconnectReason ; // Reason for disconnection.
  122. DWORD TPCB_NumberOfRings ; // Number of rings received so far.
  123. } ;
  124. typedef struct TapiPortControlBlock TapiPortControlBlock ;
  125. VOID FAR PASCAL RasTapiCallback (HANDLE, DWORD, DWORD, DWORD, DWORD, DWORD) ;
  126. VOID SetIsdnParams (TapiPortControlBlock *, LINECALLPARAMS *) ;
  127. VOID GetMutex (HANDLE, DWORD) ;
  128. VOID FreeMutex (HANDLE) ;
  129. DWORD EnumerateTapiPorts (HANDLE) ;
  130. BOOL GetAssociatedPortName(char *szKeyName, CHAR *szPortName) ;