[bind10-dev] DNS message API: resource data classes

JINMEI Tatuya / 神明達哉 jinmei at isc.org
Mon Aug 17 05:17:06 UTC 2009


At Sun, 16 Aug 2009 13:56:06 -0700,
JINMEI Tatuya <jinmei at isc.org> wrote:

> This is an initial design proposal for various DNS resource data
> classes.  I've written a prototype header file and incomplete
> implementation with a sample test program as in my previous "name"
> class proposal.  The header file is attached to this message for
> reference.  I'll commit all .hh and .cc files to the repository later.

Committed.  Based on the suggestion in the last week's call, I've
created a new top level directory "experiments" and moved all the
prototype stuff there.  It can be retrieved by:
% svn co svn://bind10.isc.org/experiments/jinmei-messageapi

A minor note: as the directory name (and the subject of this thread)
indicates, I'm now calling it "message API", instead of "packet API",
because a DNS message is not necessary contained in a single IP
packet.

A more important note I forgot to mention in the previous message: I
used boost for this prototype implementation.  To compile, you should
extract a boost package somewhere in the same machine and make a
symblic link like this:
% cd experiments/jinmei-messageapi
% ln -s <somewhere>/boost_x_yy_z/boost

I used boost mainly for its shared_ptr feature (I also used
lexical_cast to convert an integer to string, but I wouldn't have
introduced the external dependency just for that purpose).  The main
motivation for using shared_ptr is to handle the Rdata class in a
polymorphic way in an STL container while minimizing the risk of
resource leak.  Within the scope of this specific API, I guess we
could use pure pointers if we want to reduce external dependency at
the cost of increasing the risk of resource leak.  But I suspect we'd
eventually still want to have something smart like boost::shared_ptr
for efficiency and safety.

In any event, whether to use boost in BIND10 is a broader topic to
discuss.

---
JINMEI, Tatuya



More information about the bind10-dev mailing list