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

version» Context lines:

pike.git/lib/modules/Protocols.pmod/DNS.pmod:1: - // $Id: DNS.pmod,v 1.102 2010/01/05 18:47:33 bill Exp $ + // $Id$   // Not yet finished -- Fredrik Hubinette       //inherit Stdio.UDP : udp;   //! RFC 1034, RFC 1035 and RFC 2308    protected void send_reply(mapping r, mapping q, mapping m, Stdio.UDP udp);      #pike __REAL_VERSION__      final constant NOERROR=0;   final constant FORMERR=1;
pike.git/lib/modules/Protocols.pmod/DNS.pmod:130:    if(pos<0x4000)    comp[n]=pos;    string l = mklabel(labels[0]);    return l + mkname(labels[1..], pos+sizeof(l), comp);    }    }       protected string make_raw_addr6(string addr6)    {    if(!addr6) return "\0"*16; -  if(has_value(addr6, "::")) { -  int parts = sizeof((addr6/":")-({""})); -  if(has_value(addr6, ".")) parts++; -  addr6 = replace(addr6, "::", ":"+"0:"*(8-parts)); -  sscanf(addr6, ":%s", addr6); +  return sprintf ("%@2c", Protocols.IPv6.parse_addr (addr6));    } -  if(has_value(addr6, ".")) -  return sprintf("%2c%2c%2c%2c%2c%2c%1c%1c%1c%1c", -  @array_sscanf(addr6, "%x:%x:%x:%x:%x:%x:%x.%x.%x.%x")); -  else -  return sprintf("%@2c", -  array_sscanf(addr6, "%x:%x:%x:%x:%x:%x:%x:%x")); -  } +        protected private string mkrdata(mapping entry, int pos, mapping(string:int) c)    {    switch(entry->type) {    case T_CNAME:    return mkname(entry->cname, pos, c);    case T_PTR:    return mkname(entry->ptr, pos, c);    case T_NS:    return mkname(entry->ns, pos, c);