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

version» Context lines:

pike.git/lib/modules/Protocols.pmod/DNS.pmod:262:   //! @param cl   //! record class such as Protocols.DNS.C_IN   //! @param type   //! query type such Protocols.DNS.T_A   //!   //! @returns   //! data suitable for use with   //! @[Protocols.DNS.client.do_sync_query]   //!   //! @example - //! // generate a query PDU for a address lookup on the hostname pike.ida.liu.se - //! string q=Protocols.DNS.protocol()->mkquery("pike.ida.liu.se", Protocols.DNS.C_IN, Protocols.DNS.T_A); + //! // generate a query PDU for a address lookup on the hostname pike.lysator.liu.se + //! string q=Protocols.DNS.protocol()->mkquery("pike.lysator.liu.se", Protocols.DNS.C_IN, Protocols.DNS.T_A);    string mkquery(string|mapping dnameorquery, int|void cl, int|void type)    {    if(mappingp(dnameorquery))    return low_low_mkquery(dnameorquery);    else    return low_mkquery(random(65536),dnameorquery,cl,type);    }       string decode_domain(string msg, array(int) n)    {
pike.git/lib/modules/Protocols.pmod/DNS.pmod:1047:   //!   //! @param s   //! Result of @[Protocols.DNS.protocol.mkquery]   //! @returns   //! mapping containing query result or 0 on failure/timeout   //!   //! @example   //! @code   //! // Perform a hostname lookup, results stored in r->an   //! object d=Protocols.DNS.client(); - //! mapping r=d->do_sync_query(d->mkquery("pike.ida.liu.se", C_IN, T_A)); + //! mapping r=d->do_sync_query(d->mkquery("pike.lysator.liu.se", C_IN, T_A));   //! @endcode    mapping do_sync_query(string s)    {    int i;    object udp = Stdio.UDP();    // Attempt to randomize the source port.    for (i = 0; i < RETRIES; i++) {    if (!catch { udp->bind(1024 + random(65536-1024)); }) continue;    }    if (i >= RETRIES) udp->bind(0);