Class | KASPAuditor::Preparser |
In: |
../../auditor/lib/kasp_auditor/preparser.rb
|
Parent: | Object |
This class reads a zone file, and transforms it to a form suitable to be sorted by the OS sort command. For purposes of sorting, each RR should be prepended by the reversed domain name, followed by a separator (each label of the name is preserved
- the labels are simply written in reverse order)
This allows the auditor to operate on a zone file which is essentially in canonical order.
SORT_SEPARATOR | = | "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" |
NAME_SEPARATOR | = | "\0\0$~$~$~\0\0" |
LABEL_SEPARATOR | = | "\0\1\0" |
Take an input zone file ("zonefile") and output a new file ("zonefile.sorted") The output file has each (expanded) line prepended by the labels of the owner name for the RR in reversed order. The type is also prepended to the line - this allows RRSets to be ordered with the RRSIG and NSEC records last.