On 11/03/2011 04:12 PM, ext Thiago Macieira wrote:
> (...)
> The DNS query is not the problem. A query is always composed of a domain name
> being queried, along with the DNS class (Internet, no one uses anything else
> for real purposes) and the record type. For the record type, it's very easy to
> just list all types and also say that the user can use other types from the
> DNS documentation. See the ns_type enum in /usr/include/arpa/nameser.h [1].

Yes, the query is quite simple, that is why I was wondering whether we 
need a class for it at all.

>
> The problem is the DNS reply. Each query type contains a different kind of 
> data
> structure that would need to be parsed. It gets very complex very quickly if
> we want to present the data in a nice, C++ class.

I am wondering: According to Jeremy it would be best to have separate 
classes for different record types; however the way QDnsReply is 
designed it looks like a generic class for DNS replies with special 
accessors for specific records like serviceRecords().
@Jeremy: Do you think this is feasible now? I.e. could we have all the 
accessors combined in one class and have a generic accessor for the 
QString cases?
Or would we have too many methods in the class for the special cases at 
some point and we should rather have special classes?

Peter

>
> A             4 bytes containing an IPv4 address (QHostAddress)
> NS            a domain name (QString)
> CNAME a domain name (QString)
> SOA           two domain names and five integers
> PTR           a domain name (QString)
> MX            an integer and a domain name
> TXT           text (QString)
> AAAA  16 bytes containing an IPv6 address (QHostAddress)
> SRV           two integers and a domain name
> A6            an integer, an IPv6 address and a domain name
> DNAME a domain name (QString)
> TKEY, TSIG    ?
>
> And that's just listing the ones that I thought we'd like to support. CNAME
> and DNAME are likely not to be the query, but they might appear as part of the
> reply.
>
> [1] a that suffers from the "creat" syndrome.
>
>
>
>
> _______________________________________________
> Development mailing list
> Development@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development


-- 
Qt Developer Days 2011 – REGISTER NOW!
October 24 – 26, Munich
November 29 – December 1, San Francisco
Learn more and Register at http://qt.nokia.com/qtdevdays2011
_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to