5 releases

0.1.4 Nov 14, 2024
0.1.3 Oct 1, 2024
0.1.2 Sep 10, 2024
0.1.1 Sep 6, 2024
0.1.0 Sep 6, 2024

#1701 in Network programming

Download history 384/week @ 2024-09-05 65/week @ 2024-09-12 24/week @ 2024-09-19 126/week @ 2024-09-26 38/week @ 2024-10-03 5/week @ 2024-10-10 120/week @ 2024-11-14 7/week @ 2024-11-21 1/week @ 2024-11-28

128 downloads per month

MIT license

37KB
1K SLoC

ZoneParser: A zonefile parser with good performance

The ZoneParser is a DNS zonefile parser. It has been designed to have a good performance with regards to cpu and memory consumption. It works well with large zonefiles. The code is in an early stage of development and still has a somewhat limited functionality.

Usage

The parser is constructed with a file as input. It then works as an iterator yielding the resource records of the zone. An example:

use zoneparser::ZoneParser;

fn main() {
  let file = File::open("my-zone.no").unwrap();
  let p = ZoneParser::new(&file);

  for rr in p {
    println!("{}", rr);
  }
}

For further examples, see the included command line tools zonecount and zonediff.

Bugs

  • Escaped characters and octal number representations in the zonefile are not well handled.

Missing features

  • Error handling is rather crude. Parse errors cause panic. Quoted strings are somewhat poorly handled, esp. with escaped content.
  • Only the common record fields are parsed. Content specific to the record types are returned as anonymous data fields. A later version might support parsing the data content as a secondary function call.
  • Relative names are not converted to absolute ones.

Contributing

The limited functionality very much reflects the needs I had when I wrote the library. If you find it useful, and miss some functionality, please let me know. It might motivate me to further development. Bug reports are always welcome.

Dependencies

~0.7–1.4MB
~26K SLoC