[bind10-dev] DNS packet API: the name object

JINMEI Tatuya / 神明達哉 jinmei at isc.org
Sat Sep 19 03:27:48 UTC 2009


At Tue, 25 Aug 2009 15:46:57 -0500,
Michael Graff <mgraff at isc.org> wrote:

> 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.

A quick check: are you suggesting the following style?

message->addRecord(answer, r1);
message->addRecord(answer, r2);
message->addRecord(authority, r3);
message->addRecord(additional, r4);
for_each(message->records().begin(), message->records().end(),
         record::renderWire());

or this style?
r1->renderWire(message, answer);  // starting with an empty message
r2->renderWire(message, answer);
r3->renderWire(message, authority);
r4->renderWire(message, additional);

That is, build with addRecord() then renderWire(), or only do
renderWire() for everything?

---
JINMEI, Tatuya



More information about the bind10-dev mailing list