Branch: Tag:

1998-04-07

1998-04-07 03:52:30 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

modified to handle W95 (I hope)

Rev: lib/modules/Protocols.pmod/DNS.pmod:1.12

220:       static private mapping etc_hosts;    + #ifdef __NT__ +  string get_tcpip_param(string val) +  { +  foreach(({ +  "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters", +  "SYSTEM\\CurrentControlSet\\Services\\VxD\\MSTCP" +  }),string key) +  { +  catch { +  return RegGetValue(HKEY_LOCAL_MACHINE, key, value); +  }; +  } +  } + #endif +     static private string match_etc_hosts(string host)    {    if (!etc_hosts) {    string raw;   #ifdef __NT__ -  raw = RegGetValue(HKEY_LOCAL_MACHINE, -  "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters", -  "DataBasePath"); -  raw+="\\hosts"; +  raw=get_tcpip_param("DataBasePath")+"\\hosts";   #else    raw="/etc/hosts";   #endif
267:    {    string domain;   #if __NT__ -  domain=RegGetValue(HKEY_LOCAL_MACHINE, -  "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters", -  "Domain"); -  nameservers = ({ RegGetValue(HKEY_LOCAL_MACHINE, -  "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters", -  "NameServer") }); -  domains=RegGetValue(HKEY_LOCAL_MACHINE, -  "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters", -  "SearchList") / " "- ({""}); +  +  +  domain=get_tcpip_param("Domain"); +  nameservers = ({ get_tcpip_param("NameServer") }); +  domains=get_tcpip_param("SearchList") / " "- ({""});   #else    string resolv_conf = Stdio.read_file("/etc/resolv.conf");