forked from NationTech/harmony
feat: Add OKD DNS score with DNS entries and registering dhcp leases
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use opnsense_config_xml::OPNsense;
|
||||
use opnsense_config_xml::{Host, OPNsense};
|
||||
|
||||
use crate::config::OPNsenseShell;
|
||||
|
||||
@@ -17,6 +17,22 @@ impl<'a> DnsConfig<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn register_hosts(&mut self, mut hosts: Vec<Host>) {
|
||||
let unbound = match &mut self.opnsense.opnsense.unboundplus {
|
||||
Some(unbound) => unbound,
|
||||
None => todo!("Handle case where unboundplus is not used"),
|
||||
};
|
||||
unbound.hosts.hosts.append(&mut hosts);
|
||||
}
|
||||
|
||||
pub fn get_hosts(&self) -> Vec<Host> {
|
||||
let unbound = match &self.opnsense.opnsense.unboundplus {
|
||||
Some(unbound) => unbound,
|
||||
None => todo!("Handle case where unboundplus is not used"),
|
||||
};
|
||||
unbound.hosts.hosts.clone()
|
||||
}
|
||||
|
||||
pub fn register_dhcp_leases(&mut self, register: bool) {
|
||||
let unbound = match &mut self.opnsense.opnsense.unboundplus {
|
||||
Some(unbound) => unbound,
|
||||
|
||||
Reference in New Issue
Block a user