home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 February / VPR9602A.ISO / i386 / ipinfo.inf < prev    next >
INI File  |  1995-10-27  |  4KB  |  102 lines

  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.  
  52. [DefaultIPInfo]
  53.     DefaultGateway = ""
  54.     NumberOfIPAddress = 0
  55.     IPAddress1  = ""
  56.     SubnetMask1 = ""
  57.  
  58.  
  59. ;------------------------------------------------------------------------
  60. ; GetIPInfo: Returns the default gateway IP address, a list of default IP
  61. ;       addresses and a list of default subnet mask IP addresses to the
  62. ;       caller.
  63. ;------------------------------------------------------------------------
  64.  
  65. [GetIPInfo]
  66.     set DefaultGateway = ""
  67.     set NumberOfIPAddress = 0
  68.     set IPAddressList  = ""
  69.     set SubnetMaskList = ""
  70.     read-syms DefaultIPInfo
  71.     set Count = 1
  72.     set UseHostFile = TRUE
  73.     LoadLibrary "x" $(!STF_CWDDIR)\tcpcfg.dll !TCPCFG_HANDLE
  74.     LibraryProcedure Result, $(!TCPCFG_HANDLE), CPlGetIPAddress
  75.     freeLibrary $(!TCPCFG_HANDLE)
  76.     ifint *($(Result),1) == 0
  77.         set IPAddressList = {*($(Result),2)}
  78.     else
  79.         set UseHostFile = FALSE
  80.     endif
  81.     
  82. LOOP = +
  83.     ifint $(Count) <= $(NumberOfIPAddress)
  84.         ifstr(i) $(UseHostFile) == FALSE
  85.             ifstr(i) $(IPAddressList) == ""
  86.                 set IPAddressList = $(IPAddress$(Count))
  87.             else
  88.                 set IPAddressList = >($(IPAddressList),$(IPAddress$(Count))))
  89.             endif
  90.         endif
  91.         ifstr(i) $(SubnetMaskList) == ""
  92.             set SubnetMaskList = $(SubnetMask$(Count))
  93.         else
  94.             set SubnetMaskList = >($(SubnetMaskList),$(SubnetMask$(Count)))
  95.         endif
  96.         set-add Count = $(Count), 1
  97.         goto LOOP
  98.     endif
  99.  
  100.     return $(DefaultGateway), $(IPAddressList), $(SubnetMaskList)
  101.         
  102.