[bind10-dev] DNS packet API: the name object
Michael Graff
mgraff at isc.org
Tue Aug 25 20:46:57 UTC 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jelte Jansen wrote:
> we might also want to think about how to efficiently do name compression, which
> makes it a bit more involved even if all rrs are stored in wire format, and if
> we want to be memory-efficient for in-memory zones; whether we need to have a
> separate name for every rr, or that we could have names that contain (class,
> type, ttl) tuples, which in turn contain rdata sets, and for dnssec the
> associated sigs and nsecs (yes yes, all database again). Perhaps some c++
> smartness could help in this regard, but i'm not completely up to speed on that yet.
I thought a little about that in fact.
Knowing where the names are is good, and the resource record itself is
best suited for that goal. I would not want to see an API that did this:
if (record->canCompress())
record->renderCompressedWire(message)
else
record->renderUncompressedWire(message)
end
but just a simple record->renderWire(message) or something. The smarts
are under the hood.
Passing in the message (which might have things like a list of names
currently in the message, for compression purposes) allows the smartness
to be hidden.
Note that many APIs reverse this, and use message->addRecord(). This is
fine to build up a list of records, but I think the actual rendering
should be as I describe above.
- --Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkqUTcEACgkQ+NNi0s9NRJ0x+QCfYQmZtBkOfTWDiY1U3g9z7D2T
LTEAn3Eq4DKxahqWkgUtPToCuMhC4rl+
=O+nQ
-----END PGP SIGNATURE-----
More information about the bind10-dev
mailing list