mod engine;
mod outcome;
mod rdap;
mod referral;
mod registration;
pub(crate) mod registry;
mod resolve;
mod verdict;
mod whois;
pub use engine::{Engine, Settings, SourcePolicy};
pub use outcome::{Finding, Reason, Source, Status, Tally};
pub use referral::Delegation;
pub use registration::Registration;
pub use registry::{BOOTSTRAP_URL, Freshness, ServiceMap};
pub use resolve::{DnsRecords, DnsVerdict, dns_records};
pub use whois::{Server, Servers};
pub(crate) fn read_capped(path: &std::path::Path, limit: u64) -> std::io::Result<String> {
use std::io::Read as _;
let file = std::fs::File::open(path)?;
let mut text = String::new();
let read = file.take(limit + 1).read_to_string(&mut text)?;
if read as u64 > limit {
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
format!("{} is larger than {limit} bytes", path.display()),
));
}
Ok(text)
}
pub(crate) const MAX_TABLE_BYTES: u64 = 8 * 1024 * 1024;