BIND 10 #956: Message::toWire() should be TSIG agnostic

BIND 10 Development do-not-reply at isc.org
Fri May 20 23:07:50 UTC 2011


#956: Message::toWire() should be TSIG agnostic
-------------------------------------+-------------------------------------
            Reporter:  jinmei        |                        Owner:
                Type:  enhancement   |  jinmei
            Priority:  major         |                       Status:  new
           Component:  DNSPacket     |                    Milestone:  New
  API                                |  Tasks
           Sensitive:  0             |                     Keywords:
         Sub-Project:  DNS           |              Defect Severity:  N/A
Estimated Difficulty:  0             |  Feature Depending on Ticket:
         Total Hours:  0             |          Add Hours to Ticket:  0
                                     |                    Internal?:  0
-------------------------------------+-------------------------------------
 I found the current interface of Message::toWire() not very convenient
 with or without a TSIG context.  The caller often needs to write if-else
 depending on a TSIG is to be used like this:

 {{{
     if (tsig_context.get() != NULL) {
         message->toWire(renderer, *tsig_context);
     } else {
         message->toWire(renderer);
     }
 }}}

 I now think we should convine these two versions of toWire, changing
 the type of tsig_ctx to a pointer with a default value of NULL:

 {{{
     void toWire(AbstractMessageRenderer& renderer,
                 TSIGContext* tsig_ctx = NULL);
     // (and remove the single parameter version)
 }}}

 I chose the current API because I generally prefer avoiding NULL to be
 accidentally passed, but in this case the convenience seems to
 outweigh the possible benefit of safety.

 Likewise, we should allow the python version Message.toWire() to
 accept None for the tsig_ctx parameter.

-- 
Ticket URL: <http://bind10.isc.org/ticket/956>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list