mirror of
https://github.com/NLnetLabs/domain.git
synced 2026-09-22 17:54:59 +02:00
This PR adds experimental support for client transport of DNS messages. It also adds a new concept of unstable features which gate code that can introduce breaking changes also in non-breaking releases.
35 lines
976 B
Rust
35 lines
976 B
Rust
//! Reads a zone file.
|
|
|
|
fn main() {
|
|
use domain::zonefile::inplace::Zonefile;
|
|
use std::env;
|
|
use std::fs::File;
|
|
use std::time::SystemTime;
|
|
|
|
for arg in env::args().skip(1) {
|
|
print!("Processing {}: ", arg);
|
|
let start = SystemTime::now();
|
|
let mut zone = Zonefile::load(&mut File::open(arg).unwrap()).unwrap();
|
|
println!(
|
|
"Data loaded ({:.03}s).",
|
|
start.elapsed().unwrap().as_secs_f32()
|
|
);
|
|
let mut i = 0;
|
|
while zone.next_entry().unwrap().is_some() {
|
|
i += 1;
|
|
if i % 100_000_000 == 0 {
|
|
eprintln!(
|
|
"Processed {}M records ({:.03}s)",
|
|
i / 1_000_000,
|
|
start.elapsed().unwrap().as_secs_f32()
|
|
);
|
|
}
|
|
}
|
|
eprintln!(
|
|
"Complete with {} records ({:.03}s)\n",
|
|
i,
|
|
start.elapsed().unwrap().as_secs_f32()
|
|
);
|
|
}
|
|
}
|