BIND 10 #2442: update TXTLikeImpl with from lexer constructor

BIND 10 Development do-not-reply at isc.org
Wed Nov 21 02:18:40 UTC 2012


#2442: update TXTLikeImpl with from lexer constructor
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  UnAssigned
  jinmei                             |                Status:  new
                       Type:  task   |             Milestone:
                   Priority:         |  Sprint-20121204
  medium                             |            Resolution:
                  Component:         |             Sensitive:  0
  libdns++                           |           Sub-Project:  DNS
                   Keywords:         |  Estimated Difficulty:  4
            Defect Severity:  N/A    |           Total Hours:  0
Feature Depending on Ticket:         |
  loadzone-ng                        |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
Description changed by jinmei:

Old description:

> Subtask of #2368, depend on #2375.
>
> This will be necessary to support TXT and SPF, and not so
> straightforward than other due to escape handling.  So it's
> probably better to do it separately.

New description:

 Subtask of #2368, depend on #2375.

 This will be necessary to support TXT and SPF, and not so
 straightforward than other due to escape handling.  So it's
 probably better to do it separately.

 Slightly update: such special cases will need to be handled for other
 character-string RDATA fields (such as in HINFO and NAPTR).  So, first
 define a common helper function in, e.g. isc::dns::rdata::detail
 namespace:

 {{{#!cpp
 // define this in rdata.h
 typedef std::vector<uint8_> CharString;

 void
 strToCharstring(const MasterLexer::Token::StringRegion& str_region,
                 CharString& result);
 }}}

 This is a port of BIND 9's lib/dns/rdata.c:txt_fromtext().  It handles
 escaped characters and \DDD form, and performs length check.  It
 constructs the resulting character-string in the form of `CharString`
 in `result`.

 On error, it throws `RdataTextError` (define it in rdata.h) or some
 exception class derived from it.

 Then add a new constructor for `TXTLikeImpl`:
 {{{#!cpp
     TXTLikeImpl(MasterLexer& lexer, const Name*, MasterLoader::Option,
                 MasterLoader::Callbacks&);
 }}}

 The "from std::string" constructor is a simple wrapper of the internal
 of this version.

 At this point we're basically done for the TXT and SPF support.  So
 I suggest we include the support for these in this ticket.

--

-- 
Ticket URL: <http://bind10.isc.org/ticket/2442#comment:2>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list