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.

347 lines
8.0 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. private\inc\ddwanarp.h
  5. Abstract:
  6. Revision History:
  7. Gurdeep Singh Pall 7/20/95 Created
  8. --*/
  9. #ifndef __DDWANARP_H__
  10. #define __DDWANARP_H__
  11. #ifndef ANY_SIZE
  12. #define ANY_SIZE 1
  13. #endif
  14. #define WANARP_SERVICE_NAME_W L"WANARP"
  15. #define WANARP_SERVICE_NAME_A "WANARP"
  16. #define WANARP_SERVICE_NAME_T TEXT("WANARP")
  17. //////////////////////////////////////////////////////////////////////////////
  18. // //
  19. // Device Name - this string is the name of the device. It is the name //
  20. // that should be passed to NtCreateFile when accessing the device. //
  21. // //
  22. //////////////////////////////////////////////////////////////////////////////
  23. #define DD_WANARP_DEVICE_NAME_W L"\\Device\\WANARP"
  24. #define DD_WANARP_DEVICE_NAME_A "\\Device\\WANARP"
  25. #define DD_WANARP_DEVICE_NAME_T TEXT("\\Device\\WANARP")
  26. //////////////////////////////////////////////////////////////////////////////
  27. // //
  28. // Win32 Name - This is the (Unicode and NonUnicode) name exposed by Win32 //
  29. // subsystem for the device. It is the name that should be passed to //
  30. // CreateFile(Ex) when opening the device. //
  31. // //
  32. //////////////////////////////////////////////////////////////////////////////
  33. #define WANARP_DOS_NAME_W L"\\\\.\\WANARP"
  34. #define WANARP_DOS_NAME_A "\\\\.\\WANARP"
  35. #define WANARP_DOS_NAME_T TEXT("\\\\.\\WANARP")
  36. #define FILE_DEVICE_WANARP 0x00009001
  37. #define WANARP_MAX_DEVICE_NAME_LEN 256
  38. #define _WANARP_CTL_CODE(function, method, access) \
  39. CTL_CODE(FILE_DEVICE_WANARP, function, method, access)
  40. #define MIN_WANARP_CODE 0
  41. #define NOTIFICATION_CODE (MIN_WANARP_CODE)
  42. #define ADD_INTERFACE_CODE (NOTIFICATION_CODE + 1)
  43. #define DELETE_INTERFACE_CODE (ADD_INTERFACE_CODE + 1)
  44. #define CONNECT_FAILED_CODE (DELETE_INTERFACE_CODE + 1)
  45. #define GET_IF_STATS_CODE (CONNECT_FAILED_CODE + 1)
  46. #define DELETE_ADAPTERS_CODE (GET_IF_STATS_CODE + 1)
  47. #define MAP_SERVER_ADAPTER_CODE (DELETE_ADAPTERS_CODE + 1)
  48. #define QUEUE_CODE (MAP_SERVER_ADAPTER_CODE + 1)
  49. #define MAX_WANARP_CODE (QUEUE_CODE + 1)
  50. typedef enum _DEMAND_DIAL_EVENT
  51. {
  52. DDE_CONNECT_INTERFACE = 0,
  53. DDE_INTERFACE_CONNECTED = 1,
  54. DDE_INTERFACE_DISCONNECTED = 2,
  55. DDE_CALLOUT_LINKUP = 3,
  56. DDE_CALLOUT_LINKDOWN = 4,
  57. }DEMAND_DIAL_EVENT, *PDEMAND_DIAL_EVENT;
  58. //
  59. // IOCTL_WANARP_NOTIFICATION
  60. // For DEMAND_DIAL_CONNECT_INTERFACE WANARP fills in as much of the packet
  61. // as can go into the following structure. The ulPacketLength denotes the whole
  62. // length of the packet and the consumer should copy out the
  63. // MIN(ulPacketLength, MAX_PACKET_COPY_SIZE);
  64. //
  65. #define IOCTL_WANARP_NOTIFICATION \
  66. _WANARP_CTL_CODE(NOTIFICATION_CODE,METHOD_BUFFERED,FILE_WRITE_ACCESS)
  67. #define MAX_PACKET_COPY_SIZE 128
  68. #pragma warning(disable:4201)
  69. typedef struct _WANARP_NOTIFICATION
  70. {
  71. DEMAND_DIAL_EVENT ddeEvent;
  72. DWORD dwUserIfIndex;
  73. DWORD dwAdapterIndex;
  74. union
  75. {
  76. struct
  77. {
  78. DWORD dwPacketSrcAddr;
  79. DWORD dwPacketDestAddr;
  80. ULONG ulPacketLength;
  81. BYTE byPacketProtocol;
  82. BYTE rgbyPacket[MAX_PACKET_COPY_SIZE];
  83. };
  84. struct
  85. {
  86. DWORD dwLocalAddr;
  87. DWORD dwLocalMask;
  88. DWORD dwRemoteAddr;
  89. DWORD fDefaultRoute;
  90. WCHAR rgwcName[WANARP_MAX_DEVICE_NAME_LEN + 2];
  91. };
  92. };
  93. }WANARP_NOTIFICATION, *PWANARP_NOTIFICATION;
  94. #pragma warning(default:4201)
  95. //
  96. // IOCTL_WANARP_ADD_INTERFACE
  97. //
  98. #define IOCTL_WANARP_ADD_INTERFACE \
  99. _WANARP_CTL_CODE(ADD_INTERFACE_CODE,METHOD_BUFFERED,FILE_WRITE_ACCESS)
  100. typedef struct _WANARP_ADD_INTERFACE_INFO
  101. {
  102. IN DWORD dwUserIfIndex;
  103. IN DWORD bCallinInterface;
  104. OUT DWORD dwAdapterIndex;
  105. OUT WCHAR rgwcDeviceName[WANARP_MAX_DEVICE_NAME_LEN + 2];
  106. }WANARP_ADD_INTERFACE_INFO, *PWANARP_ADD_INTERFACE_INFO;
  107. //
  108. // The user index can never be 0 (or NULL)
  109. //
  110. #define WANARP_INVALID_IFINDEX 0
  111. //
  112. // IOCTL_WANARP_DELETE_INTERFACE
  113. //
  114. #define IOCTL_WANARP_DELETE_INTERFACE \
  115. _WANARP_CTL_CODE(DELETE_INTERFACE_CODE,METHOD_BUFFERED,FILE_WRITE_ACCESS)
  116. typedef struct _WANARP_DELETE_INTERFACE_INFO
  117. {
  118. IN DWORD dwUserIfIndex;
  119. }WANARP_DELETE_INTERFACE_INFO, *PWANARP_DELETE_INTERFACE_INFO;
  120. //
  121. // IOCTL_WANARP_CONNECT_FAILED
  122. //
  123. #define IOCTL_WANARP_CONNECT_FAILED \
  124. _WANARP_CTL_CODE(CONNECT_FAILED_CODE,METHOD_BUFFERED,FILE_WRITE_ACCESS)
  125. typedef struct _WANARP_CONNECT_FAILED_INFO
  126. {
  127. IN DWORD dwUserIfIndex;
  128. }WANARP_CONNECT_FAILED_INFO, *PWANARP_CONNECT_FAILED_INFO;
  129. //
  130. // IOCTL_WANARP_GET_IF_STATS
  131. //
  132. #define IOCTL_WANARP_GET_IF_STATS \
  133. _WANARP_CTL_CODE(GET_IF_STATS_CODE,METHOD_BUFFERED,FILE_READ_ACCESS)
  134. typedef struct _WANARP_GET_IF_STATS_INFO
  135. {
  136. IN DWORD dwUserIfIndex;
  137. IFEntry ifeInfo;
  138. }WANARP_GET_IF_STATS_INFO, *PWANARP_GET_IF_STATS_INFO;
  139. //
  140. // IOCTL_WANARP_DELETE_ADAPTERS
  141. //
  142. #define IOCTL_WANARP_DELETE_ADAPTERS \
  143. _WANARP_CTL_CODE(DELETE_ADAPTERS_CODE,METHOD_BUFFERED,FILE_WRITE_ACCESS)
  144. typedef struct _WANARP_DELETE_ADAPTERS_INFO
  145. {
  146. //
  147. // IN: Number of adapters to delete
  148. // OUT: If == IN, then number of adapters deleted
  149. // If < IN, then number of adapters that can be deleted
  150. //
  151. IN OUT ULONG ulNumAdapters;
  152. OUT GUID rgAdapterGuid[ANY_SIZE];
  153. }WANARP_DELETE_ADAPTERS_INFO, *PWANARP_DELETE_ADAPTERS_INFO;
  154. //
  155. // IOCTL_WANARP_MAP_SERVER_ADAPTER
  156. //
  157. #define IOCTL_WANARP_MAP_SERVER_ADAPTER \
  158. _WANARP_CTL_CODE(MAP_SERVER_ADAPTER_CODE,METHOD_BUFFERED,FILE_WRITE_ACCESS)
  159. typedef struct _WANARP_MAP_SERVER_ADAPTER_INFO
  160. {
  161. IN DWORD fMap;
  162. OUT DWORD dwAdapterIndex;
  163. }WANARP_MAP_SERVER_ADAPTER_INFO, *PWANARP_MAP_SERVER_ADAPTER_INFO;
  164. //
  165. // IOCTL_WANARP_QUEUE
  166. //
  167. #define IOCTL_WANARP_QUEUE \
  168. _WANARP_CTL_CODE(QUEUE_CODE,METHOD_BUFFERED,FILE_WRITE_ACCESS)
  169. typedef struct _WANARP_IF_INFO
  170. {
  171. GUID InterfaceGuid;
  172. DWORD dwAdapterIndex;
  173. DWORD dwLocalAddr;
  174. DWORD dwLocalMask;
  175. DWORD dwRemoteAddr;
  176. }WANARP_IF_INFO, *PWANARP_IF_INFO;
  177. typedef struct _WANARP_QUEUE_INFO
  178. {
  179. IN DWORD fQueue;
  180. OUT ULONG ulNumCallout;
  181. OUT WANARP_IF_INFO rgIfInfo[ANY_SIZE];
  182. }WANARP_QUEUE_INFO, *PWANARP_QUEUE_INFO;
  183. //
  184. // IP Struct passed up in lineup indication
  185. //
  186. typedef enum _DIAL_USAGE
  187. {
  188. DU_CALLIN = 0,
  189. DU_CALLOUT = 1,
  190. DU_ROUTER = 2
  191. }DIAL_USAGE, *PDIAL_USAGE;
  192. typedef struct _IP_WAN_LINKUP_INFO
  193. {
  194. DIAL_USAGE duUsage;
  195. DWORD dwUserIfIndex;
  196. DWORD dwLocalAddr;
  197. DWORD dwLocalMask;
  198. DWORD dwRemoteAddr;
  199. DWORD fFilterNetBios;
  200. DWORD fDefaultRoute;
  201. }IP_WAN_LINKUP_INFO, *PIP_WAN_LINKUP_INFO;
  202. #define WANARP_RECONFIGURE_VERSION (DWORD)0x01
  203. typedef enum _WANARP_RECONFIGURE_CODE
  204. {
  205. WRC_ADD_INTERFACES = 1,
  206. WRC_TCP_WINDOW_SIZE_UPDATE = 2,
  207. }WANARP_RECONFIGURE_CODE, *PWANARP_RECONFIGURE_CODE;
  208. typedef struct _WANARP_RECONFIGURE_INFO
  209. {
  210. //
  211. // Version of this request
  212. //
  213. DWORD dwVersion;
  214. //
  215. // Code, see above
  216. //
  217. WANARP_RECONFIGURE_CODE wrcOperation;
  218. //
  219. // Number of Guids in the array below
  220. //
  221. ULONG ulNumInterfaces;
  222. //
  223. // Guids themselves
  224. //
  225. GUID rgInterfaces[ANYSIZE_ARRAY];
  226. }WANARP_RECONFIGURE_INFO, *PWANARP_RECONFIGURE_INFO;
  227. #endif // _WANARPIF_H_