NLnetLabs / simdzone

Fast and standards compliant DNS zone parser
BSD 3-Clause "New" or "Revised" License
68 stars 13 forks source link

Evaluate usefulness of `zone_field_info_t` #98

Closed k0ekk0ek closed 11 months ago

k0ekk0ek commented 1 year ago

simdzone exposes "type" (not RRTYPE) information for each RDATA field. Originally, this was modeled after the implementation in NSD (wire format/zone format tables) and studying draft-levine-dnsextlang-12. There were two reasons for having that information available.

  1. The parser can call the functions when iterating fields.
  2. The application can discover the type of field.

Since the first implementation, the parser simply uses a table of callback functions for each RRTYPE. The RRTYPE function simply invokes the correct data type parse functions in order. While no zone_printer has been implemented yet, it stands to reason it will operate in the same way. Therefore, the information in zone_field_info_t is redundant wrt the implementation itself.

As for exposing the information to the application, the more I think about it, the less sense it makes. The output format is simply the standardized DNS wire format, which the application must be able to interpret if it wants to consume it. I highly doubt any application will iterate RDATA fields based on the table.

k0ekk0ek commented 11 months ago

Having talked this through with some people, zone_type_info_t and zone_field_info_t will not be exposed in the public API.