pike.git
/
lib
/
modules
/
Protocols.pmod
/
DNS.pmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Protocols.pmod/DNS.pmod:1:
-
// $Id: DNS.pmod,v 1.
90
2007/
03
/
19
10
:
52
:
48
grubba Exp $
+
// $Id: DNS.pmod,v 1.
91
2007/
04
/
07
13
:
30
:
13
grubba Exp $
// Not yet finished -- Fredrik Hubinette //! Domain Name System //! RFC 1035 #pike __REAL_VERSION__ constant NOERROR=0; constant FORMERR=1; constant SERVFAIL=2;
pike.git/lib/modules/Protocols.pmod/DNS.pmod:132:
static 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); } if(has_value(addr6, "."))
-
return sprintf("%2c%2c%2c%2c%2c%2c%
c
%
c
%
c
%
c
",
-
array
_sscanf(addr6, "%x:%x:%x:%x:%x:%x:%x.%x.%x.%x"));
+
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")); } static private string mkrdata(mapping entry, int pos, mapping(string:int) c) { switch(entry->type) { case T_CNAME: return mkname(entry->cname, pos, c);