pike.git / lib / modules / Protocols.pmod / DNS.pmod

version» Context lines:

pike.git/lib/modules/Protocols.pmod/DNS.pmod:1:   // Not yet finished -- Fredrik Hubinette      //! module Protocols   //! submodule DNS + //! + //! $Id: DNS.pmod,v 1.41 2000/09/06 21:33:03 leif Exp $      constant NOERROR=0;   constant FORMERR=1;   constant SERVFAIL=2;   constant NXDOMAIN=3;   constant NOTIMPL=4;   constant NXRRSET=8;      constant QUERY=0;   
pike.git/lib/modules/Protocols.pmod/DNS.pmod:295:    {    if(!server)    {    string domain;      #if __NT__    domain=get_tcpip_param("Domain");    if(!domain || !sizeof(domain))    domain=get_tcpip_param("DhcpDomain");    -  nameservers = get_tcpip_param("NameServer") / " "; -  nameservers+= get_tcpip_param("DhcpNameServer") / " "; -  nameservers -= ({""}); +  string temp; +  if (stringp(temp = get_tcpip_param("NameServer"))) +  nameservers += temp / " "; +  if (stringp(temp = get_tcpip_param("DhcpNameServer"))) +  nameservers += temp / " "; +  nameservers -= ({ "" });    -  domains=get_tcpip_param("SearchList") / " "- ({""}); +  if (stringp(temp = get_tcpip_param("SearchList"))) +  domains = (temp / " ") - ({ "" });   #else    string resolv_conf;    foreach(({"/etc/resolv.conf", "/amitcp/db/resolv.conf"}), string resolv_loc)    if ((resolv_conf = Stdio.read_file(resolv_loc)))    break;       if (!resolv_conf) {    /* FIXME: Is this a good idea?    * Why not just try the fallback?    * /grubba 1999-04-14