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.

153 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1998, Microsoft Corporation
  3. Module Name:
  4. natconn.h
  5. Abstract:
  6. This module contains declarations for the NAT's RAS connection management.
  7. Outgoing RAS client connections may be shared by associating them with
  8. a router-interface of type ROUTER_IF_TYPE_HOME_ROUTER.
  9. When such a connection is established by the user, we detect the connection
  10. and create a corresponding NAT interface with the kernel-mode translator.
  11. Author:
  12. Abolade Gbadegesin (aboladeg) 2-May-1998
  13. Revision History:
  14. --*/
  15. #ifndef _NATHLP_NATCONN_H_
  16. #define _NATHLP_NATCONN_H_
  17. extern HANDLE NatConnectionNotifyEvent;
  18. extern HANDLE NatConfigurationChangedEvent;
  19. //
  20. // Structure : NAT_UDP_BROADCAST_MAPPING
  21. //
  22. typedef struct _NAT_UDP_BROADCAST_MAPPING
  23. {
  24. LIST_ENTRY Link;
  25. USHORT usPublicPort;
  26. PVOID pvCookie;
  27. } NAT_UDP_BROADCAST_MAPPING, *PNAT_UDP_BROADCAST_MAPPING;
  28. //
  29. // Structure: NAT_PORT_MAPPING_ENTRY
  30. //
  31. typedef struct _NAT_PORT_MAPPING_ENTRY
  32. {
  33. LIST_ENTRY Link;
  34. UCHAR ucProtocol;
  35. USHORT usPublicPort;
  36. ULONG ulPrivateAddress;
  37. USHORT usPrivatePort;
  38. BOOLEAN fNameActive;
  39. BOOLEAN fUdpBroadcastMapping;
  40. PVOID pvBroadcastCookie;
  41. GUID *pProtocolGuid;
  42. IHNetPortMappingProtocol *pProtocol;
  43. IHNetPortMappingBinding *pBinding;
  44. } NAT_PORT_MAPPING_ENTRY, *PNAT_PORT_MAPPING_ENTRY;
  45. //
  46. // Structure: NAT_CONNECTION_ENTRY
  47. //
  48. typedef struct _NAT_CONNECTION_INFO
  49. {
  50. LIST_ENTRY Link;
  51. //
  52. // Information needed to configure kernel driver
  53. //
  54. PIP_NAT_INTERFACE_INFO pInterfaceInfo;
  55. PIP_ADAPTER_BINDING_INFO pBindingInfo;
  56. NAT_INTERFACE Interface;
  57. ULONG AdapterIndex;
  58. //
  59. // HNetCfg interfaces for the connection
  60. //
  61. IHNetConnection *pHNetConnection;
  62. IHNetFirewalledConnection *pHNetFwConnection;
  63. IHNetIcsPublicConnection *pHNetIcsPublicConnection;
  64. //
  65. // Cached information describing the connection. Storing
  66. // this allows us to reduce roundtrips to the store.
  67. //
  68. HNET_CONN_PROPERTIES HNetProperties;
  69. GUID Guid;
  70. LPWSTR wszPhonebookPath;
  71. //
  72. // Stored port mapping information
  73. //
  74. LIST_ENTRY PortMappingList; // The length of this list is the sum of the counts
  75. ULONG PortMappingCount;
  76. ULONG UdpBroadcastPortMappingCount;
  77. } NAT_CONNECTION_ENTRY, *PNAT_CONNECTION_ENTRY;
  78. PNAT_CONNECTION_ENTRY
  79. NatFindConnectionEntry(
  80. GUID *pGuid
  81. );
  82. PNAT_PORT_MAPPING_ENTRY
  83. NatFindPortMappingEntry(
  84. PNAT_CONNECTION_ENTRY pConnection,
  85. GUID *pGuid
  86. );
  87. VOID
  88. NatFreePortMappingEntry(
  89. PNAT_PORT_MAPPING_ENTRY pEntry
  90. );
  91. #ifdef DIALIN_SHARING
  92. VOID
  93. NatProcessClientConnection(
  94. VOID
  95. );
  96. #endif
  97. PCHAR
  98. NatQuerySharedConnectionDomainName(
  99. VOID
  100. );
  101. ULONG
  102. NatStartConnectionManagement(
  103. VOID
  104. );
  105. VOID
  106. NatStopConnectionManagement(
  107. VOID
  108. );
  109. BOOLEAN
  110. NatUnbindAllConnections(
  111. VOID
  112. );
  113. #endif // _NATHLP_NATCONN_H_