[bind10-dev] RRset API is hard to use

Michael Graff mgraff at isc.org
Mon Feb 8 15:48:53 UTC 2010


It may be my difficulty in how I'm doing things, so suggestions are
welcomed.

What I am doing is more or less this:

  issue SQL query to find records
  for each record found:
    Add it to an RDATAset.

However, this is rather hard currently.

The "add" step currently means I need to put a giant switch statement in
my code to create the correct type of record to parse.

I suspect a factory would help here, but the code isn't currently
written.  Perhaps this is more important for the short term than adding
more types?

What I want is to say "make an RRset from this list of string" or at
least "here is a complete rdataset line.  If it is incompatible with
what is already there, throw an exception, otherwise just do what I want"

Where "what I want" means "if the TTL is not the same, make it the
smaller of (current, newttl).  If the name does not match, throw.  If
the type does not match, throw.  If the class does not match, throw.  If
the rdata is not parsable, throw.  Otherwise add it."

Ideally this would not mean I need any sort of switch statement to do this.

--Michael



More information about the bind10-dev mailing list