diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-28 22:31:39 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-28 22:31:39 -0600 |
commit | 41bb408dde90e755b07cd2ab8a9bdec7548c84b0 (patch) | |
tree | 6d4d5407c000add30aa78630e009c0e5d633e440 /src/network/qdns.cpp | |
parent | 1740cd279522c060e738bbbffacab83355d2b794 (diff) | |
download | tqt3-41bb408dde90e755b07cd2ab8a9bdec7548c84b0.tar.gz tqt3-41bb408dde90e755b07cd2ab8a9bdec7548c84b0.zip |
Automated conversion from qt3
Diffstat (limited to 'src/network/qdns.cpp')
-rw-r--r-- | src/network/qdns.cpp | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/src/network/qdns.cpp b/src/network/qdns.cpp index 17b78b684..ac5ced853 100644 --- a/src/network/qdns.cpp +++ b/src/network/qdns.cpp @@ -411,7 +411,7 @@ void TQDnsAnswer::parseA() { if ( next != pp + 4 ) { #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw %d bytes long IN A for %s", + tqDebug( "TQDns: saw %d bytes long IN A for %s", next - pp, label.ascii() ); #endif return; @@ -424,7 +424,7 @@ void TQDnsAnswer::parseA() ( answer[pp+2] << 8 ) + ( answer[pp+3] ) ); #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw %s IN A %s (ttl %d)", label.ascii(), + tqDebug( "TQDns: saw %s IN A %s (ttl %d)", label.ascii(), rr->address.toString().ascii(), ttl ); #endif } @@ -434,7 +434,7 @@ void TQDnsAnswer::parseAaaa() { if ( next != pp + 16 ) { #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw %d bytes long IN Aaaa for %s", + tqDebug( "TQDns: saw %d bytes long IN Aaaa for %s", next - pp, label.ascii() ); #endif return; @@ -444,7 +444,7 @@ void TQDnsAnswer::parseAaaa() rr->t = TQDns::Aaaa; rr->address = TQHostAddress( answer+pp ); #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw %s IN Aaaa %s (ttl %d)", label.ascii(), + tqDebug( "TQDns: saw %s IN Aaaa %s (ttl %d)", label.ascii(), rr->address.toString().ascii(), ttl ); #endif } @@ -455,7 +455,7 @@ void TQDnsAnswer::parseMx() { if ( next < pp + 2 ) { #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw %d bytes long IN MX for %s", + tqDebug( "TQDns: saw %d bytes long IN MX for %s", next - pp, label.ascii() ); #endif return; @@ -467,13 +467,13 @@ void TQDnsAnswer::parseMx() rr->target = readString().lower(); if ( !ok ) { #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw bad string in MX for %s", label.ascii() ); + tqDebug( "TQDns: saw bad string in MX for %s", label.ascii() ); #endif return; } rr->t = TQDns::Mx; #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw %s IN MX %d %s (ttl %d)", label.ascii(), + tqDebug( "TQDns: saw %s IN MX %d %s (ttl %d)", label.ascii(), rr->priority, rr->target.ascii(), ttl ); #endif } @@ -483,7 +483,7 @@ void TQDnsAnswer::parseSrv() { if ( next < pp + 6 ) { #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw %d bytes long IN SRV for %s", + tqDebug( "TQDns: saw %d bytes long IN SRV for %s", next - pp, label.ascii() ); #endif return; @@ -497,13 +497,13 @@ void TQDnsAnswer::parseSrv() rr->target = readString().lower(); if ( !ok ) { #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw bad string in SRV for %s", label.ascii() ); + tqDebug( "TQDns: saw bad string in SRV for %s", label.ascii() ); #endif return; } rr->t = TQDns::Srv; #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw %s IN SRV %d %d %d %s (ttl %d)", label.ascii(), + tqDebug( "TQDns: saw %s IN SRV %d %d %d %s (ttl %d)", label.ascii(), rr->priority, rr->weight, rr->port, rr->target.ascii(), ttl ); #endif } @@ -514,7 +514,7 @@ void TQDnsAnswer::parseCname() TQString target = readString().lower(); if ( !ok ) { #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw bad cname for for %s", label.ascii() ); + tqDebug( "TQDns: saw bad cname for for %s", label.ascii() ); #endif return; } @@ -523,7 +523,7 @@ void TQDnsAnswer::parseCname() rr->t = TQDns::Cname; rr->target = target; #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw %s IN CNAME %s (ttl %d)", label.ascii(), + tqDebug( "TQDns: saw %s IN CNAME %s (ttl %d)", label.ascii(), rr->target.ascii(), ttl ); #endif } @@ -534,7 +534,7 @@ void TQDnsAnswer::parseNs() TQString target = readString().lower(); if ( !ok ) { #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw bad cname for for %s", label.ascii() ); + tqDebug( "TQDns: saw bad cname for for %s", label.ascii() ); #endif return; } @@ -542,7 +542,7 @@ void TQDnsAnswer::parseNs() // parse, but ignore #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw %s IN NS %s (ttl %d)", label.ascii(), + tqDebug( "TQDns: saw %s IN NS %s (ttl %d)", label.ascii(), target.ascii(), ttl ); #endif } @@ -553,7 +553,7 @@ void TQDnsAnswer::parsePtr() TQString target = readString().lower(); if ( !ok ) { #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw bad PTR for for %s", label.ascii() ); + tqDebug( "TQDns: saw bad PTR for for %s", label.ascii() ); #endif return; } @@ -562,7 +562,7 @@ void TQDnsAnswer::parsePtr() rr->t = TQDns::Ptr; rr->target = target; #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw %s IN PTR %s (ttl %d)", label.ascii(), + tqDebug( "TQDns: saw %s IN PTR %s (ttl %d)", label.ascii(), rr->target.ascii(), ttl ); #endif } @@ -573,7 +573,7 @@ void TQDnsAnswer::parseTxt() TQString text = readString(FALSE); if ( !ok ) { #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw bad TXT for for %s", label.ascii() ); + tqDebug( "TQDns: saw bad TXT for for %s", label.ascii() ); #endif return; } @@ -582,7 +582,7 @@ void TQDnsAnswer::parseTxt() rr->t = TQDns::Txt; rr->text = text; #if defined(TQDNS_DEBUG) - qDebug( "TQDns: saw %s IN TXT \"%s\" (ttl %d)", label.ascii(), + tqDebug( "TQDns: saw %s IN TXT \"%s\" (ttl %d)", label.ascii(), rr->text.ascii(), ttl ); #endif } @@ -593,7 +593,7 @@ void TQDnsAnswer::parse() // okay, do the work... if ( (answer[2] & 0x78) != 0 ) { #if defined(TQDNS_DEBUG) - qDebug( "DNS Manager: answer to wrong query type (%d)", answer[1] ); + tqDebug( "DNS Manager: answer to wrong query type (%d)", answer[1] ); #endif ok = FALSE; return; @@ -605,7 +605,7 @@ void TQDnsAnswer::parse() // TC if ( (answer[2] & 2) != 0 ) { #if defined(TQDNS_DEBUG) - qDebug( "DNS Manager: truncated answer; pressing on" ); + tqDebug( "DNS Manager: truncated answer; pressing on" ); #endif } @@ -617,7 +617,7 @@ void TQDnsAnswer::parse() if ( (answer[3] & 0x0f) == 3 ) { #if defined(TQDNS_DEBUG) - qDebug( "DNS Manager: saw NXDomain for %s", query->l.ascii() ); + tqDebug( "DNS Manager: saw NXDomain for %s", query->l.ascii() ); #endif // NXDomain. cache that for one minute. rr = new TQDnsRR( query->l ); @@ -632,7 +632,7 @@ void TQDnsAnswer::parse() if ( (answer[3] & 0x0f) != 0 ) { #if defined(TQDNS_DEBUG) - qDebug( "DNS Manager: error code %d", answer[3] & 0x0f ); + tqDebug( "DNS Manager: error code %d", answer[3] & 0x0f ); #endif ok = FALSE; return; @@ -671,7 +671,7 @@ void TQDnsAnswer::parse() rdlength = ( answer[pp+8] << 8 ) + answer[pp+9]; if ( pp + 10 + rdlength > size ) { #if defined(TQDNS_DEBUG) - qDebug( "DNS Manager: ran out of stuff to parse (%d+%d>%d (%d)", + tqDebug( "DNS Manager: ran out of stuff to parse (%d+%d>%d (%d)", pp, rdlength, size, rrno < ancount ); #endif // if we're still in the AN section, we should go back and @@ -689,7 +689,7 @@ void TQDnsAnswer::parse() pp = pp + 10; if ( clas != 1 ) { #if defined(TQDNS_DEBUG) - qDebug( "DNS Manager: class %d (not internet) for %s", + tqDebug( "DNS Manager: class %d (not internet) for %s", clas, label.isNull() ? "." : label.ascii() ); #endif } else { @@ -723,7 +723,7 @@ void TQDnsAnswer::parse() default: // something we don't know #if defined(TQDNS_DEBUG) - qDebug( "DNS Manager: type %d for %s", type, + tqDebug( "DNS Manager: type %d for %s", type, label.isNull() ? "." : label.ascii() ); #endif break; @@ -750,7 +750,7 @@ void TQDnsAnswer::parse() } if ( answers == 0 ) { #if defined(TQDNS_DEBUG) - qDebug( "DNS Manager: answer contained no answers" ); + tqDebug( "DNS Manager: answer contained no answers" ); #endif ok = ( aa && rd ); } @@ -790,7 +790,7 @@ void TQDnsAnswer::parse() // well, it's equal, but it's not the same. so we kill it, // but use its expiry time. #if defined(TQDNS_DEBUG) - qDebug( "killing off old %d for %s, expire was %d", + tqDebug( "killing off old %d for %s, expire was %d", older->t, older->domain->name().latin1(), rr->expireTime ); #endif @@ -799,7 +799,7 @@ void TQDnsAnswer::parse() rr->deleteTime = TQMAX( older->deleteTime, rr->deleteTime ); older->deleteTime = 0; #if defined(TQDNS_DEBUG) - qDebug( " adjusted expire is %d", rr->expireTime ); + tqDebug( " adjusted expire is %d", rr->expireTime ); #endif } drrs->next(); @@ -808,7 +808,7 @@ void TQDnsAnswer::parse() } #if defined(TQDNS_DEBUG) - //qDebug( "DNS Manager: ()" ); + //tqDebug( "DNS Manager: ()" ); #endif } @@ -836,7 +836,7 @@ void TQDnsAnswer::notify() notified.insert( (void*)dns, (void*)42 ); if ( rrs->count() == 0 ) { #if defined(TQDNS_DEBUG) - qDebug( "DNS Manager: found no answers!" ); + tqDebug( "DNS Manager: found no answers!" ); #endif dns->d->noNames = TRUE; ((TQDnsUgleHack*)dns)->ugle( TRUE ); @@ -846,7 +846,7 @@ void TQDnsAnswer::notify() ((TQDnsUgleHack*)dns)->ugle(); #if defined(TQDNS_DEBUG) else - qDebug( "DNS Manager: DNS thing %s not notified for %s", + tqDebug( "DNS Manager: DNS thing %s not notified for %s", dns->label().ascii(), query->l.ascii() ); #endif } @@ -902,7 +902,7 @@ static void cleanupDns() TQDnsManager * TQDnsManager::manager() { if ( !globalManager ) { - qAddPostRoutine(cleanupDns); + tqAddPostRoutine(cleanupDns); new TQDnsManager(); } return globalManager; @@ -913,7 +913,7 @@ void TQDnsUgleHack::ugle( bool emitAnyway) { if ( emitAnyway || !isWorking() ) { #if defined(TQDNS_DEBUG) - qDebug( "DNS Manager: status change for %s (type %d)", + tqDebug( "DNS Manager: status change for %s (type %d)", label().ascii(), recordType() ); #endif emit resultsReady(); @@ -977,9 +977,9 @@ TQDnsManager::TQDnsManager() if ( !ns->current() ) { ns->append( new TQHostAddress(*h) ); #if defined(TQDNS_DEBUG) - qDebug( "using name server %s", h->toString().latin1() ); + tqDebug( "using name server %s", h->toString().latin1() ); } else { - qDebug( "skipping address %s", h->toString().latin1() ); + tqDebug( "skipping address %s", h->toString().latin1() ); #endif } ::ns->next(); @@ -1000,9 +1000,9 @@ TQDnsManager::TQDnsManager() if ( !domains->current() ) { domains->append( s ); #if defined(TQDNS_DEBUG) - qDebug( "searching domain %s", s ); + tqDebug( "searching domain %s", s ); } else { - qDebug( "skipping domain %s", s ); + tqDebug( "skipping domain %s", s ); #endif } ::domains->next(); @@ -1035,7 +1035,7 @@ void TQDnsManager::cleanCache() TQDnsDomain * d; Q_UINT32 thisSweep = now(); #if defined(TQDNS_DEBUG) - qDebug( "TQDnsManager::cleanCache(: Called, time is %u, last was %u", + tqDebug( "TQDnsManager::cleanCache(: Called, time is %u, last was %u", thisSweep, lastSweep ); #endif @@ -1079,12 +1079,12 @@ void TQDnsManager::answer() #endif #if defined(TQDNS_DEBUG) #if !defined (QT_NO_IPV6) - qDebug("DNS Manager: answer arrived: %d bytes from %s:%d", r, + tqDebug("DNS Manager: answer arrived: %d bytes from %s:%d", r, useIpv4Socket ? ipv4Socket->peerAddress().toString().ascii() : ipv6Socket->peerAddress().toString().ascii(), useIpv4Socket ? ipv4Socket->peerPort() : ipv6Socket->peerPort() ); #else - qDebug("DNS Manager: answer arrived: %d bytes from %s:%d", r, + tqDebug("DNS Manager: answer arrived: %d bytes from %s:%d", r, ipv4Socket->peerAddress().toString().ascii(), ipv4Socket->peerPort());; #endif #endif @@ -1101,7 +1101,7 @@ void TQDnsManager::answer() i++; if ( i == queries.size() ) { #if defined(TQDNS_DEBUG) - qDebug( "DNS Manager: bad id (0x%04x) %d", aid, i ); + tqDebug( "DNS Manager: bad id (0x%04x) %d", aid, i ); #endif return; } @@ -1110,7 +1110,7 @@ void TQDnsManager::answer() if ( ( (Q_UINT8)(a[2]) & 0x80 ) == 0 ) { #if defined(TQDNS_DEBUG) - qDebug( "DNS Manager: received a query" ); + tqDebug( "DNS Manager: received a query" ); #endif return; } @@ -1159,7 +1159,7 @@ void TQDnsManager::transmitQuery( int i ) // and then get rid of the query queries.take( i ); #if defined(TQDNS_DEBUG) - qDebug( "DNS Manager: giving up on query 0x%04x", q->id ); + tqDebug( "DNS Manager: giving up on query 0x%04x", q->id ); #endif delete q; TQTimer::singleShot( 0, TQDnsManager::manager(), SLOT(cleanCache()) ); @@ -1255,7 +1255,7 @@ void TQDnsManager::transmitQuery( int i ) // and then get rid of the query queries.take( i ); #if defined(TQDNS_DEBUG) - qDebug( "DNS Manager: no DNS server found on query 0x%04x", q->id ); + tqDebug( "DNS Manager: no DNS server found on query 0x%04x", q->id ); #endif delete q; TQTimer::singleShot( 1000*10, TQDnsManager::manager(), SLOT(cleanCache()) ); @@ -1271,7 +1271,7 @@ void TQDnsManager::transmitQuery( int i ) ipv6Socket->writeBlock( p.data(), pp, receiver, 53 ); #endif #if defined(TQDNS_DEBUG) - qDebug( "issuing query 0x%04x (%d) about %s type %d to %s", + tqDebug( "issuing query 0x%04x (%d) about %s type %d to %s", q->id, q->step, q->l.ascii(), q->t, ns->at( q->step % ns->count() )->toString().ascii() ); #endif @@ -1289,7 +1289,7 @@ void TQDnsManager::transmitQuery( int i ) ipv6Socket->writeBlock( p.data(), pp, *server, 53 ); #endif #if defined(TQDNS_DEBUG) - qDebug( "copying query to %s", server->toString().ascii() ); + tqDebug( "copying query to %s", server->toString().ascii() ); #endif } } @@ -1408,12 +1408,12 @@ TQPtrList<TQDnsRR> * TQDnsDomain::cached( const TQDns * r ) TQString s = *it++; nxdomain = FALSE; #if defined(TQDNS_DEBUG) - qDebug( "looking at cache for %s (%s %d)", + tqDebug( "looking at cache for %s (%s %d)", s.ascii(), r->label().ascii(), r->recordType() ); #endif TQDnsDomain * d = m->domain( s ); #if defined(TQDNS_DEBUG) - qDebug( " - found %d RRs", d && d->rrs ? d->rrs->count() : 0 ); + tqDebug( " - found %d RRs", d && d->rrs ? d->rrs->count() : 0 ); #endif if ( d->rrs ) d->rrs->first(); @@ -1425,7 +1425,7 @@ TQPtrList<TQDnsRR> * TQDnsDomain::cached( const TQDns * r ) // cname. if the code is ugly, that may just // possibly be because the concept is. #if defined(TQDNS_DEBUG) - qDebug( "found cname from %s to %s", + tqDebug( "found cname from %s to %s", r->label().ascii(), rr->target.ascii() ); #endif s = rr->target; @@ -1472,11 +1472,11 @@ TQPtrList<TQDnsRR> * TQDnsDomain::cached( const TQDns * r ) // if we found a positive result, return tquickly if ( answer && l->count() ) { #if defined(TQDNS_DEBUG) - qDebug( "found %d records for %s", + tqDebug( "found %d records for %s", l->count(), r->label().ascii() ); l->first(); while( l->current() ) { - qDebug( " type %d target %s address %s", + tqDebug( " type %d target %s address %s", l->current()->t, l->current()->target.latin1(), l->current()->address.toString().latin1() ); @@ -1489,7 +1489,7 @@ TQPtrList<TQDnsRR> * TQDnsDomain::cached( const TQDns * r ) #if defined(TQDNS_DEBUG) if ( nxdomain ) - qDebug( "found NXDomain %s", s.ascii() ); + tqDebug( "found NXDomain %s", s.ascii() ); #endif if ( !nxdomain ) { @@ -1539,7 +1539,7 @@ void TQDnsDomain::sweep( Q_UINT32 thisSweep ) rr->deleteTime = thisSweep; // will hit next time around #if defined(TQDNS_DEBUG) - qDebug( "TQDns::sweep: %s type %d expires %u %u - %s / %s", + tqDebug( "TQDns::sweep: %s type %d expires %u %u - %s / %s", rr->domain->name().latin1(), rr->t, rr->expireTime, rr->deleteTime, rr->target.latin1(), rr->address.toString().latin1()); @@ -1775,10 +1775,10 @@ void TQDns::setLabel( const TQString & label ) setStartQueryTimer(); // start query the next time we enter event loop #endif #if defined(TQDNS_DEBUG) - qDebug( "TQDns::setLabel: %d address(es) for %s", n.count(), l.ascii() ); + tqDebug( "TQDns::setLabel: %d address(es) for %s", n.count(), l.ascii() ); int i = 0; for( i = 0; i < (int)n.count(); i++ ) - qDebug( "TQDns::setLabel: %d: %s", i, n[i].ascii() ); + tqDebug( "TQDns::setLabel: %d: %s", i, n[i].ascii() ); #endif } @@ -1965,7 +1965,7 @@ TQString TQDns::toInAddrArpaDomain( const TQHostAddress &address ) bool TQDns::isWorking() const { #if defined(TQDNS_DEBUG) - qDebug( "TQDns::isWorking (%s, %d)", l.ascii(), t ); + tqDebug( "TQDns::isWorking (%s, %d)", l.ascii(), t ); #endif if ( t == None ) return FALSE; @@ -2020,7 +2020,7 @@ bool TQDns::isWorking() const TQValueList<TQHostAddress> TQDns::addresses() const { #if defined(TQDNS_DEBUG) - qDebug( "TQDns::addresses (%s)", l.ascii() ); + tqDebug( "TQDns::addresses (%s)", l.ascii() ); #endif TQValueList<TQHostAddress> result; if ( t != A && t != Aaaa ) @@ -2074,7 +2074,7 @@ TQValueList<TQHostAddress> TQDns::addresses() const TQValueList<TQDns::MailServer> TQDns::mailServers() const { #if defined(TQDNS_DEBUG) - qDebug( "TQDns::mailServers (%s)", l.ascii() ); + tqDebug( "TQDns::mailServers (%s)", l.ascii() ); #endif TQValueList<TQDns::MailServer> result; if ( t != Mx ) @@ -2131,7 +2131,7 @@ TQValueList<TQDns::MailServer> TQDns::mailServers() const TQValueList<TQDns::Server> TQDns::servers() const { #if defined(TQDNS_DEBUG) - qDebug( "TQDns::servers (%s)", l.ascii() ); + tqDebug( "TQDns::servers (%s)", l.ascii() ); #endif TQValueList<TQDns::Server> result; if ( t != Srv ) @@ -2170,7 +2170,7 @@ TQValueList<TQDns::Server> TQDns::servers() const TQStringList TQDns::hostNames() const { #if defined(TQDNS_DEBUG) - qDebug( "TQDns::hostNames (%s)", l.ascii() ); + tqDebug( "TQDns::hostNames (%s)", l.ascii() ); #endif TQStringList result; if ( t != Ptr ) @@ -2208,7 +2208,7 @@ TQStringList TQDns::hostNames() const TQStringList TQDns::texts() const { #if defined(TQDNS_DEBUG) - qDebug( "TQDns::texts (%s)", l.ascii() ); + tqDebug( "TQDns::texts (%s)", l.ascii() ); #endif TQStringList result; if ( t != Txt ) @@ -2475,7 +2475,7 @@ void TQDns::doResInit() last = searchList.find( separator, first ); if ( last < 0 ) last = searchList.length(); - domains->append( qstrdup( searchList.mid( first, last-first ) ) ); + domains->append( tqstrdup( searchList.mid( first, last-first ) ) ); first = last+1; } while( first < (int)searchList.length() ); } |