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.

182 lines
5.2 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. rasacd.h
  5. Abstract:
  6. This header file defines constants and types for accessing the NT
  7. Automatic Connection Driver (rasacd.sys).
  8. Author:
  9. Anthony Discolo (adiscolo) 18-Apr-1995
  10. Revision History:
  11. --*/
  12. #ifndef _RASACD_
  13. #define _RASACD_
  14. //
  15. // Device Name - this string is the name of the device. It is the name
  16. // that should be passed to NtCreateFile when accessing the device.
  17. //
  18. #define ACD_DEVICE_NAME L"\\Device\\RasAcd"
  19. //
  20. // Address type.
  21. //
  22. typedef enum {
  23. ACD_ADDR_IP, // IP address (128.95.1.4)
  24. ACD_ADDR_IPX, // IPX node address ()
  25. ACD_ADDR_NB, // NETBIOS name ("server")
  26. ACD_ADDR_INET, // Internet hostname ("ftp.microsoft.com")
  27. ACD_ADDR_MAX
  28. } ACD_ADDR_TYPE;
  29. //
  30. // Generic network address string.
  31. //
  32. #define ACD_ADDR_NB_LEN 16 // nb30.h/NCBNAMSZ
  33. #define ACD_ADDR_IPX_LEN 6 // wsipx.h
  34. #define ACD_ADDR_INET_LEN 1024 // wininet.h/INTERNET_MAX_PATH_LENGTH
  35. typedef struct _ACD_ADDR {
  36. ACD_ADDR_TYPE fType;
  37. union {
  38. ULONG ulIpaddr; // IP address
  39. UCHAR cNode[ACD_ADDR_IPX_LEN]; // IPX address
  40. UCHAR cNetbios[ACD_ADDR_NB_LEN]; // NetBios server
  41. UCHAR szInet[ACD_ADDR_INET_LEN]; // Internet address
  42. };
  43. } ACD_ADDR, *PACD_ADDR;
  44. //
  45. // Adapter information.
  46. //
  47. // Each transport passes up some identifier
  48. // of which adapter over which a successful
  49. // connection was made.
  50. //
  51. typedef enum {
  52. ACD_ADAPTER_LANA,
  53. ACD_ADAPTER_IP,
  54. ACD_ADAPTER_NAME,
  55. ACD_ADAPTER_MAC
  56. } ACD_ADAPTER_TYPE;
  57. #define ACD_ADAPTER_NAME_LEN 256
  58. typedef struct _ACD_ADAPTER {
  59. enum ACD_ADAPTER_TYPE fType;
  60. union {
  61. UCHAR bLana; // NetBios LANA
  62. ULONG ulIpaddr; // IP address
  63. WCHAR szName[ACD_ADAPTER_NAME_LEN]; // for example, "NdisWan4"
  64. UCHAR cMac[6]; // IPX mac address
  65. };
  66. } ACD_ADAPTER, *PACD_ADAPTER;
  67. //
  68. // Connection notification structure.
  69. //
  70. // The automatic connection system service
  71. // posts one of these to the automatic connection
  72. // driver. The request will be completed and
  73. // this structure filled in by the driver when a
  74. // new RAS connection is to be made.
  75. //
  76. #define ACD_NOTIFICATION_SUCCESS 0x00000001 // successful connection
  77. typedef struct _ACD_NOTIFICATION {
  78. ACD_ADDR addr; // address of connection attempt
  79. ULONG ulFlags; // ACD_NOTIFICATION_* flags above
  80. ACD_ADAPTER adapter; // adapter identifier
  81. HANDLE Pid; // pid of the process requesting the conneciton
  82. } ACD_NOTIFICATION, *PACD_NOTIFICATION;
  83. #if defined(_WIN64)
  84. typedef struct _ACD_NOTIFICATION_32 {
  85. ACD_ADDR addr; // address of connection attempt
  86. ULONG ulFlags; // ACD_NOTIFICATION_* flags above
  87. ACD_ADAPTER adapter; // adapter identifier
  88. VOID * POINTER_32 Pid; // pid of the process requesting the conneciton
  89. } ACD_NOTIFICATION_32, *PACD_NOTIFICATION_32;
  90. #endif
  91. typedef struct _ACD_STATUS {
  92. BOOLEAN fSuccess; // success or failure
  93. ACD_ADDR addr; // address of connection attempt
  94. } ACD_STATUS, *PACD_STATUS;
  95. typedef struct _ACD_ENABLE_ADDRESS {
  96. BOOLEAN fDisable;
  97. ACD_ADDR addr;
  98. } ACD_ENABLE_ADDRESS, *PACD_ENABLE_ADDRESS;
  99. //
  100. //
  101. // IOCTL code definitions
  102. //
  103. #define FILE_DEVICE_ACD 0x000000f1
  104. #define _ACD_CTL_CODE(function, method, access) \
  105. CTL_CODE(FILE_DEVICE_ACD, function, method, access)
  106. //
  107. // Set the notification mode for the driver.
  108. //
  109. #define IOCTL_ACD_RESET \
  110. _ACD_CTL_CODE(0, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  111. //
  112. // Set the notification mode for the driver.
  113. //
  114. #define IOCTL_ACD_ENABLE \
  115. _ACD_CTL_CODE(1, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  116. //
  117. // Wait for a connection request notification
  118. // from the automatic connection driver.
  119. //
  120. #define IOCTL_ACD_NOTIFICATION \
  121. _ACD_CTL_CODE(2, METHOD_BUFFERED, FILE_READ_ACCESS)
  122. //
  123. // Inform the automatic connection driver that
  124. // the connection attempt is progressing.
  125. //
  126. #define IOCTL_ACD_KEEPALIVE \
  127. _ACD_CTL_CODE(3, METHOD_BUFFERED, FILE_READ_ACCESS)
  128. //
  129. // Inform the automatic connection driver of
  130. // the final status of the connection attempt.
  131. //
  132. #define IOCTL_ACD_COMPLETION \
  133. _ACD_CTL_CODE(4, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  134. //
  135. // Generate an automatic connection attempt
  136. // from user space.
  137. //
  138. #define IOCTL_ACD_CONNECT_ADDRESS \
  139. _ACD_CTL_CODE(5, METHOD_BUFFERED, FILE_READ_ACCESS)
  140. //
  141. // Disable an address so that any automatic connection attempts
  142. // to this address are disabled. This is required so that we don't
  143. // create a deadlock when attempting to dial vpn connection by name.
  144. // We don't want the name resolution of the vpn destination to
  145. // cause an autodial attempt.
  146. //
  147. #define IOCTL_ACD_ENABLE_ADDRESS \
  148. _ACD_CTL_CODE(6, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  149. #endif // ifndef _RASACD_