feat(wip): Support opnsense 25.7 which defaults to dnsmasq instead of isc dhcp
This commit is contained in:
111
opnsense-config-xml/src/data/dnsmasq.rs
Normal file
111
opnsense-config-xml/src/data/dnsmasq.rs
Normal file
@@ -0,0 +1,111 @@
|
||||
use yaserde::MaybeString;
|
||||
use yaserde_derive::{YaDeserialize, YaSerialize};
|
||||
|
||||
// This is the top-level struct that represents the entire <dnsmasq> element.
|
||||
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
|
||||
pub struct DnsMasq {
|
||||
#[yaserde(attribute = true)]
|
||||
pub version: String,
|
||||
#[yaserde(attribute = true)]
|
||||
pub persisted_at: Option<String>,
|
||||
|
||||
pub enable: u8,
|
||||
pub regdhcp: u8,
|
||||
pub regdhcpstatic: u8,
|
||||
pub dhcpfirst: u8,
|
||||
pub strict_order: u8,
|
||||
pub domain_needed: u8,
|
||||
pub no_private_reverse: u8,
|
||||
pub no_resolv: Option<u8>,
|
||||
pub log_queries: u8,
|
||||
pub no_hosts: u8,
|
||||
pub strictbind: u8,
|
||||
pub dnssec: u8,
|
||||
pub regdhcpdomain: MaybeString,
|
||||
pub interface: Option<String>,
|
||||
pub port: Option<u32>,
|
||||
pub dns_forward_max: MaybeString,
|
||||
pub cache_size: MaybeString,
|
||||
pub local_ttl: MaybeString,
|
||||
pub add_mac: Option<MaybeString>,
|
||||
pub add_subnet: Option<u8>,
|
||||
pub strip_subnet: Option<u8>,
|
||||
pub no_ident: Option<u8>,
|
||||
pub dhcp: Option<Dhcp>,
|
||||
pub dhcp_ranges: Vec<DhcpRange>,
|
||||
pub dhcp_options: Vec<DhcpOptions>,
|
||||
pub dhcp_boot: Vec<DhcpBoot>,
|
||||
}
|
||||
|
||||
// Represents the <dhcp> element and its nested fields.
|
||||
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
|
||||
#[yaserde(rename = "dhcp")]
|
||||
pub struct Dhcp {
|
||||
pub no_interface: MaybeString,
|
||||
pub fqdn: u8,
|
||||
pub domain: MaybeString,
|
||||
pub lease_max: MaybeString,
|
||||
pub authoritative: u8,
|
||||
pub default_fw_rules: u8,
|
||||
pub reply_delay: MaybeString,
|
||||
pub enable_ra: u8,
|
||||
pub nosync: u8,
|
||||
}
|
||||
|
||||
// Represents a single <dhcp_ranges> element.
|
||||
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
|
||||
#[yaserde(rename = "dhcp_ranges")]
|
||||
pub struct DhcpRange {
|
||||
#[yaserde(attribute = true)]
|
||||
pub uuid: String,
|
||||
pub interface: String,
|
||||
pub set_tag: MaybeString,
|
||||
pub start_addr: String,
|
||||
pub end_addr: String,
|
||||
pub subnet_mask: MaybeString,
|
||||
pub constructor: MaybeString,
|
||||
pub mode: MaybeString,
|
||||
pub prefix_len: MaybeString,
|
||||
pub lease_time: MaybeString,
|
||||
pub domain_type: String,
|
||||
pub domain: MaybeString,
|
||||
pub nosync: u8,
|
||||
pub ra_mode: MaybeString,
|
||||
pub ra_priority: MaybeString,
|
||||
pub ra_mtu: MaybeString,
|
||||
pub ra_interval: MaybeString,
|
||||
pub ra_router_lifetime: MaybeString,
|
||||
pub description: MaybeString,
|
||||
}
|
||||
|
||||
// Represents a single <dhcp_boot> element.
|
||||
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
|
||||
#[yaserde(rename = "dhcp_boot")]
|
||||
pub struct DhcpBoot {
|
||||
#[yaserde(attribute = true)]
|
||||
pub uuid: String,
|
||||
pub interface: MaybeString,
|
||||
pub tag: MaybeString,
|
||||
pub filename: String,
|
||||
pub servername: String,
|
||||
pub address: String,
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
// Represents a single <dhcp_options> element.
|
||||
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
|
||||
#[yaserde(rename = "dhcp_options")]
|
||||
pub struct DhcpOptions {
|
||||
#[yaserde(attribute = true)]
|
||||
pub uuid: String,
|
||||
#[yaserde(rename = "type")]
|
||||
pub _type: String,
|
||||
pub option: MaybeString,
|
||||
pub option6: MaybeString,
|
||||
pub interface: MaybeString,
|
||||
pub tag: MaybeString,
|
||||
pub set_tag: MaybeString,
|
||||
pub value: String,
|
||||
pub force: u8,
|
||||
pub description: MaybeString,
|
||||
}
|
||||
Reference in New Issue
Block a user