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

version» Context lines:

pike.git/lib/modules/Protocols.pmod/DNS.pmod:424:    int base = min((int)(subject*100.0/pow(10.0,power)), 9);    return ((base&0xf)<<4)|(power&0xf);    };    if ((entry->version? entry->version:1) != 1)    error("Only T_LOC version 1 is supported");    return sprintf("%1c%1c%1c%1c%4c%4c%4c",    0, // Only version that currently exists    encode_T_LOC_tinyfloat(entry->size? entry->size:100.0), //Default is 1M    encode_T_LOC_tinyfloat(entry->h_prec? entry->h_prec:1000*100.0), // Default is 10KM    encode_T_LOC_tinyfloat(entry->v_prec? entry->v_prec:10*100.0), // Default is 10M -  entry->lat?(int)(entry->lat*3600000.0)+(2<<30):2<<30, // Default is 2<<30 which is 0.0 -  entry->long?(int)(entry->long*3600000.0)+(2<<30):2<<30, // Default is 2<<30 which is 0.0 -  entry->alt?(int)((entry->alt+100000)*100):100000, // Default to 0 WGS84 (which is 100000) +  entry->lat?(int)round(entry->lat*3600000.0)+(2<<30):2<<30, // Default is 2<<30 which is 0.0 +  entry->long?(int)round(entry->long*3600000.0)+(2<<30):2<<30, // Default is 2<<30 which is 0.0 +  entry->alt?(int)round((entry->alt+100000)*100):100000, // Default to 0 WGS84 (which is 100000)    );    case T_CAA:    if (entry->tag == "" || !entry->tag)    error("An empty tag is not permitted.\n");    return sprintf("%c%H%s", entry->flags | (!!entry->critical << 7),    entry->tag, entry->value || "");    default:    return "";    }    }