extern crate libknot;
#[cfg(feature = "native")]
use libknot::native::MessageBuilder;
#[cfg(feature = "native")]
use crate::libknot::KnotSync;
#[cfg(feature = "native")]
use std::time::Duration;
#[cfg(feature = "native")]
fn main() -> libknot::error::Result<()> {
let mut knotc = libknot::native::Control::new("/run/knot/knot.sock")?;
knotc.set_timeout(Some(Duration::from_secs(2)));
knotc.conf_transaction(|knotc| {
let msg = MessageBuilder::new().cmd("conf-get").build();
for el in knotc.send_request(&msg)? {
println!("{:#?}", el);
}
knotc.conf_set("zone", Some("zone.dynmaic"), None, None)?;
knotc.conf_set(
"zone",
Some("zone.dynmaic"),
Some("file"),
Some("zone.dynamic.zone"),
)?;
libknot::error::Result::Ok(())
})?;
Ok(())
}
#[cfg(not(feature = "native"))]
fn main() {}