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.

101 lines
3.3 KiB

  1. ; Copyright (C) 1993 Microsoft Corporation
  2. ; All rights reserved.
  3. ;
  4. ; The ipinfo.inf file allows network administrators to provide smart
  5. ; defaults for TCP/IP configuration parameters. By modifying this
  6. ; template, an administrator can distribute the Windows NT TCP/IP
  7. ; software over the network or on floppy disks to users with some
  8. ; smart default configuration parameters. End users will still be
  9. ; able to modify these values when installing TCP/IP, however, the
  10. ; default values will be automatically filled in for them.
  11. ;
  12. ; This file may contain defaults for the default gateway, IP
  13. ; addresses (per interface), and subnet mask (per interface). To modify
  14. ; the default 'default gateway' edit the line in the [DefaultIPInfo]
  15. ; section below that looks like this:
  16. ;
  17. ; DefaultGateway = "xxx.xxx.xxx.xxx"
  18. ;
  19. ; xxx.xxx.xxx.xxx represents a valid IP address for the default
  20. ; gateway. If the default gateway is unknown, it can be left blank:
  21. ;
  22. ; DefaultGateway = ""
  23. ;
  24. ; To modify the default IP addresses and subnet mask IP addresses,
  25. ; modify the following lines in the [DefaultIPInfo] section below:
  26. ;
  27. ; NumberOfIPAddress = X
  28. ;
  29. ; X represents the number of IP addresses for the machine.
  30. ;
  31. ; Add the following pair of values for each interface <X>:
  32. ;
  33. ; IPAddress<Y> = "xxx.xxx.xxx.xxx"
  34. ; SubnetMask<Y> = "xxx.xxx.xxx.xxx"
  35. ;
  36. ; where 1 <= Y <=X and <Y> represents the interface(s) on the system.
  37. ; The IPAddress and SubnetMask values can be left blank ("") for no
  38. ; default, or can be set with valid IP addresses.
  39. ;
  40. ; For example:
  41. ;
  42. ;[DefaultIPInfo]
  43. ; DefaultGateway = "11.1.0.0"
  44. ; NumberOfIPAddress = 3
  45. ; IPAddress1 = "11.1.12.1"
  46. ; SubnetMask1 = "255.255.0.1"
  47. ; IPAddress2 = "11.1.12.2"
  48. ; SubnetMask2 = "255.255.0.2"
  49. ; IPAddress3 = "11.1.12.3"
  50. ; SubnetMask3 = "255.255.0.3"
  51. [DefaultIPInfo]
  52. DefaultGateway = ""
  53. NumberOfIPAddress = 0
  54. IPAddress1 = ""
  55. SubnetMask1 = ""
  56. ;------------------------------------------------------------------------
  57. ; GetIPInfo: Returns the default gateway IP address, a list of default IP
  58. ; addresses and a list of default subnet mask IP addresses to the
  59. ; caller.
  60. ;------------------------------------------------------------------------
  61. [GetIPInfo]
  62. set DefaultGateway = ""
  63. set NumberOfIPAddress = 0
  64. set IPAddressList = ""
  65. set SubnetMaskList = ""
  66. read-syms DefaultIPInfo
  67. set Count = 1
  68. set UseHostFile = TRUE
  69. LoadLibrary "x" $(!STF_CWDDIR)\tcpcfg.dll !TCPCFG_HANDLE
  70. LibraryProcedure Result, $(!TCPCFG_HANDLE), CPlGetIPAddress
  71. freeLibrary $(!TCPCFG_HANDLE)
  72. ifint *($(Result),1) == 0
  73. set IPAddressList = {*($(Result),2)}
  74. else
  75. set UseHostFile = FALSE
  76. endif
  77. LOOP = +
  78. ifint $(Count) <= $(NumberOfIPAddress)
  79. ifstr(i) $(UseHostFile) == FALSE
  80. ifstr(i) $(IPAddressList) == ""
  81. set IPAddressList = $(IPAddress$(Count))
  82. else
  83. set IPAddressList = >($(IPAddressList),$(IPAddress$(Count))))
  84. endif
  85. endif
  86. ifstr(i) $(SubnetMaskList) == ""
  87. set SubnetMaskList = $(SubnetMask$(Count))
  88. else
  89. set SubnetMaskList = >($(SubnetMaskList),$(SubnetMask$(Count)))
  90. endif
  91. set-add Count = $(Count), 1
  92. goto LOOP
  93. endif
  94. return $(DefaultGateway), $(IPAddressList), $(SubnetMaskList)