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.

282 lines
10 KiB

  1. //
  2. // T C P C O N S T . H
  3. //
  4. // Constants used in tcpipcfg
  5. //
  6. #pragma once
  7. #define TCH_QUESTION_MARK L'?'
  8. #define CH_DOT L'.'
  9. #define BACK_SLASH L'\\'
  10. static const WCHAR c_chListSeparator = L',';
  11. // 0 - 9999 seconds
  12. #define MIN_HOPSTHRESHOLD 0
  13. #define MAX_HOPSTHRESHOLD 16
  14. #define DEF_HOPSTHRESHOLD 4
  15. #define MIN_SECSTHRESHOLD 0
  16. #define MAX_SECSTHRESHOLD 0x270F
  17. #define DEF_SECSTHRESHOLD 4
  18. // Tcpip
  19. #define RGAS_TCPIP_PARAM_INTERFACES L"Tcpip\\Parameters\\Interfaces\\"
  20. // Tcpip global Parameter
  21. #define RGAS_NAMESERVER L"NameServer"
  22. #define RGAS_HOSTNAME L"Hostname"
  23. #define RGAS_NVHOSTNAME L"NV Hostname"
  24. #define RGAS_DOMAIN L"Domain"
  25. #define RGAS_SEARCHLIST L"SearchList"
  26. #define RGAS_SECURITY_ENABLE L"EnableSecurityFilters"
  27. // Tcpip adapter Parameter
  28. #define RGAS_LLINTERFACE L"LLInterface"
  29. #define RGAS_IPCONFIG L"IpConfig"
  30. #define RGAS_IPINTERFACES L"IpInterfaces"
  31. #define RGAS_NUMINTERFACES L"NumInterfaces"
  32. // Tcpip interface Parameter
  33. // NTEContextLists, used to preserve the value when a WAN card becomes
  34. // support multiple interfaces
  35. #define RGAS_NTECONTEXTLIST L"NTEContextList"
  36. // Notify RAS team to update Load\SaveTcpipInfo
  37. #define RGAS_ENABLE_DHCP L"EnableDHCP"
  38. // Notify RAS team to update Load\SaveTcpipInfo
  39. #define RGAS_DEFAULTGATEWAY L"DefaultGateway"
  40. #define RGAS_DEFAULTGATEWAYMETRIC L"DefaultGatewayMetric"
  41. // Notify RAS team to update Load\SaveTcpipInfo
  42. #define RGAS_IPADDRESS L"IPAddress"
  43. // Notify RAS team to update Load\SaveTcpipInfo
  44. #define RGAS_SUBNETMASK L"SubnetMask"
  45. #define RGAS_FILTERING_TCP L"TCPAllowedPorts"
  46. #define RGAS_FILTERING_UDP L"UDPAllowedPorts"
  47. #define RGAS_FILTERING_IP L"RawIPAllowedProtocols"
  48. #define RGAS_USEZEROBROADCAST L"UseZeroBroadcast"
  49. // Wins global parameter
  50. #define RGAS_ENABLE_DNS L"EnableDNS"
  51. #define RGAS_ENABLE_LMHOSTS L"EnableLMHOSTS"
  52. // Wins interface parameter
  53. #define RGAS_PRIMARY_WINS L"NameServer"
  54. #define RGAS_SECONDARY_WINS L"NameServerBackup"
  55. // DHCP options
  56. #define RGAS_REG_LOCATION L"RegLocation"
  57. // Notify RAS team to update Load\SaveTcpipInfo if this changes
  58. #define RGAS_DHCP_IPADDRESS L"DhcpIPAddress"
  59. // Notify RAS team to update Load\SaveTcpipInfo if this changes
  60. #define RGAS_DHCP_SUBNETMASK L"DhcpSubnetMask"
  61. #define RGAS_DHCP_OPTIONS L"System\\CurrentControlSet\\Services\\DHCP\\Parameters\\Options"
  62. #define RGAS_DHCP_OPTION_IPADDRESS L"System\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\?\\DhcpIPAddress"
  63. #define RGAS_DHCP_OPTION_SUBNETMASK L"System\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\?\\DhcpSubnetMask"
  64. #define RGAS_DHCP_OPTION_NAMESERVERBACKUP L"System\\CurrentControlSet\\Services\\NetBT\\Parameters\\Interfaces\\?\\DhcpNameServerBackup"
  65. // LmHosts
  66. #define RGAS_LMHOSTS_PATH L"\\drivers\\etc\\lmhosts"
  67. #define RGAS_LMHOSTS_PATH_BACKUP L"\\drivers\\etc\\lmhosts.bak"
  68. // Components
  69. const WCHAR c_szTcpip[] = L"Tcpip";
  70. const WCHAR c_szNetBt[] = L"NetBT";
  71. const WCHAR c_szDhcp[] = L"DHCP";
  72. // Constant strings
  73. extern const WCHAR c_szEmpty[];
  74. const WCHAR c_mszNull[] = L"\0";
  75. const WCHAR c_szDisableFiltering[] = L"0";
  76. const WCHAR c_szAdaptersRegKey[] = L"Adapters";
  77. // Notify RAS team to update Load\SaveTcpipInfo
  78. const WCHAR c_szInterfacesRegKey[] = L"Interfaces";
  79. // Notify RAS team to update Load\SaveTcpipInfo
  80. const WCHAR c_szTcpip_[] = L"Tcpip_";
  81. // LLInterface values ( for ARP modules )
  82. const WCHAR c_szWanArp[] = L"WANARP";
  83. const WCHAR c_szAtmArp[] = L"ATMARPC";
  84. const WCHAR c_sz1394Arp[] = L"ARP1394";
  85. const WCHAR c_szAtmarpc[] = L"AtmArpC";
  86. // Other constants
  87. const int c_cchRemoveCharatersFromEditOrAddButton = 3;
  88. const WCHAR c_szBASE_SUBNET_MASK_1[] = L"255.0.0.0";
  89. const WCHAR c_szBASE_SUBNET_MASK_2[] = L"255.255.0.0";
  90. const WCHAR c_szBASE_SUBNET_MASK_3[] = L"255.255.255.0";
  91. const BYTE SUBNET_RANGE_1_MAX = 127;
  92. const BYTE SUBNET_RANGE_2_MAX = 191;
  93. const BYTE SUBNET_RANGE_3_MAX = 223;
  94. // Default range for IP address fields
  95. const int c_iIpLow =0;
  96. const int c_iIpHigh = 255;
  97. const int c_iEmptyIpField = -1;
  98. // IP address field range
  99. const int c_iIPADDR_FIELD_1_LOW = 1;
  100. const int c_iIPADDR_FIELD_1_HIGH = 223;
  101. // IP loopback address
  102. const int c_iIPADDR_FIELD_1_LOOPBACK = 127;
  103. // Ip address length
  104. const int IP_LIMIT = 32;
  105. const WCHAR c_szItoa[] = L"%d";
  106. // ATM ARP client parameters
  107. // Configurable parameters
  108. const WCHAR c_szREG_ARPServerList[] = L"ARPServerList";
  109. const WCHAR c_szREG_MARServerList[] = L"MARServerList";
  110. const WCHAR c_szREG_MTU[] = L"MTU";
  111. const WCHAR c_szREG_PVCOnly[] = L"PVCOnly";
  112. const WCHAR c_szDefaultAtmArpServer[] = L"4700790001020000000000000000A03E00000200";
  113. const WCHAR c_szDefaultAtmMarServer[] = L"4700790001020000000000000000A03E00000200";
  114. const DWORD c_dwDefaultAtmMTU = 9180;
  115. // Static parameters
  116. const WCHAR c_szREG_SapSelector[] = L"SapSelector";
  117. const WCHAR c_szREG_AddressResolutionTimeout[] = L"AddressResolutionTimeout";
  118. const WCHAR c_szREG_ARPEntryAgingTimeout[] = L"ARPEntryAgingTimeout";
  119. const WCHAR c_szREG_InARPWaitTimeout[] = L"InARPWaitTimeout";
  120. const WCHAR c_szREG_MaxRegistrationAttempts[] = L"MaxRegistrationAttempts";
  121. const WCHAR c_szREG_MaxResolutionAttempts[] = L"MaxResolutionAttempts";
  122. const WCHAR c_szREG_MinWaitAfterNak[] = L"MinWaitAfterNak";
  123. const WCHAR c_szREG_ServerConnectInterval[] = L"ServerConnectInterval";
  124. const WCHAR c_szREG_ServerRefreshTimeout[] = L"ServerRefreshTimeout";
  125. const WCHAR c_szREG_ServerRegistrationTimeout[] = L"ServerRegistrationTimeout";
  126. const WCHAR c_szREG_DefaultVcAgingTimeout[] = L"DefaultVcAgingTimeout";
  127. const WCHAR c_szREG_MARSConnectInterval[] = L"MARSConnectInterval";
  128. const WCHAR c_szREG_MARSRegistrationTimeout[] = L"MARSRegistrationTimeout";
  129. const WCHAR c_szREG_JoinTimeout[] = L"JoinTimeout";
  130. const WCHAR c_szREG_LeaveTimeout[] = L"LeaveTimeout";
  131. const WCHAR c_szREG_MaxDelayBetweenMULTIs[] = L"MaxDelayBetweenMULTIs";
  132. const DWORD c_dwSapSelector= 1;
  133. const DWORD c_dwAddressResolutionTimeout= 3;
  134. const DWORD c_dwARPEntryAgingTimeout= 900;
  135. const DWORD c_dwInARPWaitTimeout= 5;
  136. const DWORD c_dwMaxRegistrationAttempts= 5;
  137. const DWORD c_dwMaxResolutionAttempts= 4;
  138. const DWORD c_dwMinWaitAfterNak= 10;
  139. const DWORD c_dwServerConnectInterval= 5;
  140. const DWORD c_dwServerRefreshTimeout= 900;
  141. const DWORD c_dwServerRegistrationTimeout= 3;
  142. const DWORD c_dwDefaultVcAgingTimeout= 60;
  143. const DWORD c_dwMARSConnectInterval= 5;
  144. const DWORD c_dwMARSRegistrationTimeout= 3;
  145. const DWORD c_dwJoinTimeout= 10;
  146. const DWORD c_dwLeaveTimeout= 10;
  147. const DWORD c_dwMaxDelayBetweenMULTIs= 10;
  148. // Reg value
  149. const WCHAR c_szIpEnableRouter[] = L"IPEnableRouter";
  150. const WCHAR c_szPerformRouterDiscovery[] = L"PerformRouterDiscovery";
  151. const WCHAR c_szInterfaceMetric[] = L"InterfaceMetric";
  152. //(nsun) added to support unattended install for RRAS (global settings)
  153. const WCHAR c_szEnableICMPRedirect[] = L"EnableICMPRedirect";
  154. const WCHAR c_szPerformRouterDiscoveryDefault[] = L"PerformRouterDiscoveryDefault";
  155. const WCHAR c_szDeadGWDetectDefault[] = L"DeadGWDetectDefault";
  156. const WCHAR c_szDontAddDefaultGatewayDefault[] = L"DontAddDefaultGatewayDefault";
  157. //(nsun) added to support unattended install for RRAS (per interface settings)
  158. const WCHAR c_szDeadGWDetect[] = L"EnableDeadGWDetect";
  159. const WCHAR c_szDontAddDefaultGateway[] = L"DontAddDefaultGateway";
  160. const WCHAR c_szSearchList[] = L"SearchList";
  161. const WCHAR c_szUseDomainNameDevolution[] = L"UseDomainNameDevolution";
  162. const WCHAR c_szSvcDnsServer[] = L"DNS";
  163. // Notify RAS team to update Load\SaveTcpipInfo
  164. #define RGAS_NETBT_NAMESERVERLIST L"NameServerList"
  165. #define RGAS_NETBT_NETBIOSOPTIONS L"NetbiosOptions"
  166. // Dhcp parameter key
  167. const WCHAR c_szDhcpParam[] = L"SYSTEM\\CurrentControlSet\\Services\\Dhcp\\Parameters";
  168. const WCHAR c_szRegServices[] = L"SYSTEM\\CurrentControlSet\\Services";
  169. const WCHAR c_szRegParamsTcpip[] = L"\\Parameters\\Tcpip";
  170. // ServiceProvider key
  171. static const WCHAR c_szProviderOrderVal[] = L"ProviderOrder";
  172. static const WCHAR c_szSrvProvOrderKey[] = L"System\\CurrentControlSet\\Control\\ServiceProvider\\Order";
  173. // IsRasFakeGuid
  174. static const WCHAR c_szIsRasFakeAdapter[] = L"IsRasFakeAdapter";
  175. static const DWORD c_dwIsRasFakeAdapter = 0x01;
  176. static const WCHAR c_szRasFakeAdapterDesc[] = L"Ras connection";
  177. const WCHAR c_szREG_UseRemoteGateway[] = L"UseRemoteGateway";
  178. const WCHAR c_szREG_UseIPHeaderCompression[] = L"UseIPHeaderCompression";
  179. const WCHAR c_szREG_FrameSize[] = L"UseIPHeaderCompression";
  180. // Tcpip options
  181. const int c_iIpFilter = 0;
  182. const DWORD c_dwUnsetNetbios =0x0;
  183. const DWORD c_dwEnableNetbios =0x01;
  184. const DWORD c_dwDisableNetbios =0x02;
  185. // Ras connection: frame size
  186. const WCHAR c_szFrameSize1500[] = L"1500";
  187. const WCHAR c_szFrameSize1006[] = L"1006";
  188. const DWORD c_dwFrameSize1500 = 1500;
  189. const DWORD c_dwFrameSize1006 = 1006;
  190. //IPSec is removed from connection UI
  191. // Constants for Ipsec policy
  192. /*
  193. const WCHAR c_szIpsecNoPol[] = L"IPSEC_NOPOL";
  194. const WCHAR c_szIpsecUnset[] = L"IPSEC_UNSET";
  195. const WCHAR c_szIpsecDefPol[]= L"IPSEC_DEFAULT_POLICIES";
  196. */
  197. // Constants for metric
  198. #define MAX_GATEWAY 5
  199. #define MAX_METRIC_DIGITS 4 //maximum number of digits for metric
  200. #define MAX_METRIC 9999
  201. // Constants for identifiers in option list of REMOTE_IPINFO
  202. const WCHAR c_chOptionSeparator = L';';
  203. const WCHAR c_szIfMetric[] = L"IfMetric=";
  204. const WCHAR c_szDefGw[] = L"DefGw=";
  205. const WCHAR c_szGwMetric[] = L"GwMetric=";
  206. const WCHAR c_szDNS[] = L"DNS=";
  207. const WCHAR c_szWINS[] = L"WINS=";
  208. const WCHAR c_szDynamicUpdate[] = L"DynamicUpdate=";
  209. const WCHAR c_szNameRegistration[] = L"NameRegistration=";
  210. const DWORD c_dwDefaultMetricOfGateway = 0; //default metric value for a gateway
  211. // Multiple LAN configuration reg values
  212. const WCHAR c_szActiveConfigurations[] = L"ActiveConfigurations";
  213. const WCHAR c_szAlternate[] = L"Alternate_";
  214. const WCHAR c_szConfigOptions[] = L"Options";
  215. const WCHAR c_szDhcpConfigurations[] = L"SYSTEM\\CurrentControlSet\\Services\\Dhcp\\Configurations";
  216. const DWORD c_dwDefaultIfMetric = 0; //default interface metric (auto metric)