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.

272 lines
7.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: T C P I P . H
  7. //
  8. // Contents: Tcpip config memory structure definitions
  9. //
  10. // Notes:
  11. //
  12. // Author: tongl 13 Nov, 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include "ncstring.h"
  17. #define ZERO_ADDRESS L"0.0.0.0"
  18. #define FF_ADDRESS L"255.0.0.0"
  19. typedef vector<tstring *> VSTR;
  20. typedef VSTR::iterator VSTR_ITER;
  21. typedef VSTR::const_iterator VSTR_CONST_ITER;
  22. //(08/18/98 nsun): for multiple interfaces of WAN adapters
  23. typedef vector<GUID> IFACECOL; // interface collection
  24. typedef IFACECOL::iterator IFACEITER; // interface iterator
  25. struct HANDLES
  26. {
  27. HWND m_hList;
  28. HWND m_hAdd;
  29. HWND m_hEdit;
  30. HWND m_hRemove;
  31. HWND m_hUp;
  32. HWND m_hDown;
  33. };
  34. //
  35. // ADAPTER_INFO data strucut:
  36. // contains adapter specific info for Tcpip
  37. //
  38. enum BindingState
  39. {
  40. BINDING_ENABLE,
  41. BINDING_DISABLE,
  42. BINDING_UNSET
  43. };
  44. enum ConnectionType
  45. {
  46. CONNECTION_LAN,
  47. CONNECTION_RAS_PPP,
  48. CONNECTION_RAS_SLIP,
  49. CONNECTION_RAS_VPN,
  50. CONNECTION_UNSET
  51. };
  52. struct BACKUP_CFG_INFO
  53. {
  54. tstring m_strIpAddr;
  55. tstring m_strSubnetMask;
  56. tstring m_strDefGw;
  57. tstring m_strPreferredDns;
  58. tstring m_strAlternateDns;
  59. tstring m_strPreferredWins;
  60. tstring m_strAlternateWins;
  61. BOOL m_fAutoNet;
  62. };
  63. struct ADAPTER_INFO
  64. {
  65. private:
  66. ADAPTER_INFO(const& ADAPTER_INFO); // do not allow others to use!
  67. public:
  68. ADAPTER_INFO() {}
  69. ~ADAPTER_INFO();
  70. ADAPTER_INFO & operator=(const ADAPTER_INFO & info); // copy operator
  71. HRESULT HrSetDefaults(const GUID* pguid,
  72. PCWSTR szNetCardDescription,
  73. PCWSTR szNetCardBindName,
  74. PCWSTR szNetCardTcpipBindPath);
  75. void ResetOldValues();
  76. public:
  77. //There is no Pnp for the backup config info
  78. BACKUP_CFG_INFO m_BackupInfo;
  79. // If the netcard has been unbound from NCPA (or anywhere else)
  80. BindingState m_BindingState;
  81. // Remember the initial bind state of the adapter
  82. BindingState m_InitialBindingState;
  83. // Inst Guid of net card ( we get the guid to identify cards from answer file )
  84. // tstring m_strServiceName;
  85. GUID m_guidInstanceId;
  86. // Bindname of the net card, such as El59x1{inst guid}
  87. tstring m_strBindName;
  88. // Bind path name from Tcpip's linkage\Bind key to the adapter
  89. tstring m_strTcpipBindPath;
  90. // Bind path name from NetBt's linkage key to the adapter
  91. tstring m_strNetBtBindPath;
  92. // User viewable net card description
  93. tstring m_strDescription;
  94. tstring m_strDnsDomain; // DNS -> Domain name
  95. tstring m_strOldDnsDomain;
  96. VSTR m_vstrIpAddresses; // IP Address
  97. VSTR m_vstrOldIpAddresses;
  98. VSTR m_vstrSubnetMask; // SubnetMask
  99. VSTR m_vstrOldSubnetMask;
  100. VSTR m_vstrDefaultGateway; // Default Gateways
  101. VSTR m_vstrOldDefaultGateway;
  102. VSTR m_vstrDefaultGatewayMetric; // Default gateway metrics
  103. VSTR m_vstrOldDefaultGatewayMetric;
  104. VSTR m_vstrDnsServerList; // DNS -> DNS server Search Order list
  105. VSTR m_vstrOldDnsServerList;
  106. VSTR m_vstrWinsServerList; // WINS -> WINS server Serach Order list
  107. VSTR m_vstrOldWinsServerList;
  108. // $REVIEW (tongl 9/6/98)Filter information (Added per bugs #109161, #216559)
  109. VSTR m_vstrTcpFilterList; // Options -> Filterng -> TCP Ports
  110. VSTR m_vstrOldTcpFilterList;
  111. VSTR m_vstrUdpFilterList; // Options -> Filterng -> UDP Ports
  112. VSTR m_vstrOldUdpFilterList;
  113. VSTR m_vstrIpFilterList; // Options -> Filterng -> IP Protocols
  114. VSTR m_vstrOldIpFilterList;
  115. // ATMARP client configurable parameters ( all per adapter based )
  116. VSTR m_vstrARPServerList; // list of ARP server addresses
  117. VSTR m_vstrOldARPServerList;
  118. VSTR m_vstrMARServerList; // list of MAR server addresses
  119. VSTR m_vstrOldMARServerList;
  120. DWORD m_dwMTU; // Maximum Transmission Unit
  121. DWORD m_dwOldMTU;
  122. DWORD m_dwInterfaceMetric; // metric for interface-local routes
  123. DWORD m_dwOldInterfaceMetric;
  124. DWORD m_dwNetbiosOptions; // (New, added inNT5 Beta2): Option to turn NetBt off
  125. DWORD m_dwOldNetbiosOptions;
  126. // RAS connection specific parameters
  127. // No dynamic reconfig, so no need to remember old values
  128. DWORD m_dwFrameSize;
  129. BOOL m_fUseRemoteGateway : 1;
  130. BOOL m_fUseIPHeaderCompression : 1;
  131. BOOL m_fIsDemandDialInterface : 1;
  132. BOOL m_fEnableDhcp : 1; // DHCP Enable -> Obtain an IP Address from a DHCP Server
  133. BOOL m_fOldEnableDhcp : 1;
  134. BOOL m_fDisableDynamicUpdate : 1; // Disable Ip address dynamic update on DNS server
  135. BOOL m_fOldDisableDynamicUpdate : 1;
  136. BOOL m_fEnableNameRegistration : 1;
  137. BOOL m_fOldEnableNameRegistration : 1;
  138. BOOL m_fPVCOnly : 1; // PVC only
  139. BOOL m_fOldPVCOnly : 1;
  140. // Is this card only added from answerfile,
  141. // i.e. not on binding path to Tcpip yet
  142. BOOL m_fIsFromAnswerFile : 1;
  143. // Is this an ATM card ?
  144. // ( ATM cards needs extra property page for ARP Client configuration)
  145. BOOL m_fIsAtmAdapter : 1;
  146. // Is this a WanAdapter ?
  147. // ( Wan adapters only have static parameters and don't show in UI)
  148. BOOL m_fIsWanAdapter : 1;
  149. // Is this a 1394 NET device?
  150. // (1394 devices currently do not need any special properties,
  151. // but they are associated with a specific arp module).
  152. BOOL m_fIs1394Adapter : 1;
  153. // Is this an fake adapter that represents a RAS connection,
  154. // but is not an adapter and does not bind
  155. BOOL m_fIsRasFakeAdapter : 1;
  156. // Is the card marked as for deletion
  157. BOOL m_fDeleted : 1;
  158. // Has this card been newly added. Valid only after calling
  159. // MarkNewlyAddedCards.
  160. // or Has the interfaces of the card been changed if it is a WAN adapter
  161. // Previously was m_fNewlyAdded
  162. BOOL m_fNewlyChanged : 1;
  163. // (08/18/98 nsun) added for multiple interfaces of WAN adapters
  164. // m_IfaceIds: collection of interface IDs
  165. BOOL m_fIsMultipleIfaceMode : 1;
  166. BOOL m_fBackUpSettingChanged : 1;
  167. IFACECOL m_IfaceIds;
  168. };
  169. typedef vector<ADAPTER_INFO *> VCARD;
  170. //
  171. // GLOBAL_INFO - TCP/IP global information data structure.
  172. struct GLOBAL_INFO
  173. {
  174. public:
  175. tstring m_strHostName; // DNS Host Name
  176. tstring m_strHostNameFromAnswerFile; // DNS Host Name from the answerfile
  177. //IPSec is removed from connection UI
  178. /*
  179. tstring m_strIpsecPol; // the ipsec local policy
  180. GUID m_guidIpsecPol;
  181. */
  182. VSTR m_vstrDnsSuffixList; // DNS: domain search suffix list
  183. VSTR m_vstrOldDnsSuffixList;
  184. BOOL m_fEnableLmHosts : 1; // WINS -> Enable LMHOSTS Lookup
  185. BOOL m_fOldEnableLmHosts : 1;
  186. BOOL m_fUseDomainNameDevolution : 1; // DNS: whether parent doamins should be searched
  187. BOOL m_fOldUseDomainNameDevolution : 1;
  188. BOOL m_fEnableRouter : 1; // ROUTING -> Enable IP Forwarding
  189. // unattended install for RRAS
  190. BOOL m_fEnableIcmpRedirect : 1;
  191. BOOL m_fDeadGWDetectDefault : 1;
  192. BOOL m_fDontAddDefaultGatewayDefault : 1;
  193. // $REVIEW (tongl 9/6/98)Filter information (Added per bugs #109161, #216559)
  194. BOOL m_fEnableFiltering : 1; // Options -> Filtering -> Enabled Filtering
  195. BOOL m_fOldEnableFiltering : 1;
  196. private:
  197. GLOBAL_INFO(const & GLOBAL_INFO); // no not allow others to use!
  198. public:
  199. GLOBAL_INFO() {};
  200. ~GLOBAL_INFO();
  201. GLOBAL_INFO& operator=(GLOBAL_INFO& glb); // copy operator
  202. HRESULT HrSetDefaults();
  203. void ResetOldValues();
  204. };