Opened 7 years ago

Closed 7 years ago

#2409 closed defect (duplicate)

define complete RRtype instances without having Rdata definition

Reported by: jinmei Owned by: UnAssigned
Priority: medium Milestone:
Component: libdns++ Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DNS Feature Depending on Ticket:
Estimated Difficulty: 6 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no


Currently we don't define RRType instances for types that don't have
corresponding Rdata derived classes with a few special exceptions
hardcoded in the placeholder file (namely, IXFR, AXFR, and ANY).
Same for RR classes for 0 ("NONE") and 254 ("ANY").

This causes some inconvenience. The most notable one is that textual
conversion doesn't work well. For example,

    RRType rrtype_a("A"); // okay
    RRType rrtype_axfr("AXFR"); // fail with exception
    RRType::A().toText(); // returns "A"
    RRType::AXFR().toText(); // returns "TYPE252", counter intuitive.

This has been a known issue for quite some time, and is now becoming
more problematic, e.g., in implementing per RR type statistics. So
it's probably the time to fix this.

I propose the following approach:

  • for any pre-defined RR types that don't have corresponding Rdata definition (including meta types like AXFR and types that we simply haven't supported Rdata, like A6), create a dummy header file under the dns/rdata directory. example: dns/rdata/in_1/a6_38.h it may just be empty or would have some special keyword indicating it's a dummy file.
  • update so that if a particular type header file indicates it doesn't have Rdata it only generates RRType definitions. would also need to update generate_rrparam() so RRParamRegistry has complete mapping between text and type/class codes.
  • do the same thing for meta classes, but in this case we'll use empty directories.
  • we can then remove hardcoded special cases.


Change History (3)

comment:1 Changed 7 years ago by jinmei

  • Milestone set to Next-Sprint-Proposed

comment:2 Changed 7 years ago by jinmei

  • Milestone set to Next-Sprint-Proposed

comment:3 Changed 7 years ago by jinmei

  • Resolution set to duplicate
  • Status changed from new to closed

This issues was resolved in #1866 (in a different way than proposed in this ticket).
Closing this one.

Note: See TracTickets for help on using tickets.