<model>
    <mount>/dnsmasq</mount>
    <version>1.0.3</version>
    <items>
        <enable type="BooleanField"/>
        <regdhcp type="BooleanField"/>
        <regdhcpstatic type="BooleanField"/>
        <dhcpfirst type="BooleanField"/>
        <strict_order type="BooleanField"/>
        <domain_needed type="BooleanField"/>
        <no_private_reverse type="BooleanField"/>
        <log_queries type="BooleanField"/>
        <no_hosts type="BooleanField"/>
        <strictbind type="BooleanField"/>
        <dnssec type="BooleanField"/>
        <regdhcpdomain type="HostnameField">
            <IsDNSName>Y</IsDNSName>
        </regdhcpdomain>
        <interface type="InterfaceField">
            <Multiple>Y</Multiple>
        </interface>
        <port type="IntegerField">
            <MinimumValue>0</MinimumValue>
            <MaximumValue>65535</MaximumValue>
        </port>
        <dns_port type="IntegerField" volatile="true"/>
        <dns_forward_max type="IntegerField">
            <MinimumValue>0</MinimumValue>
        </dns_forward_max>
        <cache_size type="IntegerField">
            <MinimumValue>0</MinimumValue>
        </cache_size>
        <local_ttl type="IntegerField">
            <MinimumValue>0</MinimumValue>
        </local_ttl>
        <dhcp>
            <no_interface type="InterfaceField">
                <Multiple>Y</Multiple>
            </no_interface>
            <fqdn type="BooleanField"/>
            <domain type="HostnameField">
                <IsDNSName>Y</IsDNSName>
                <IpAllowed>N</IpAllowed>
            </domain>
            <lease_max type="IntegerField">
                <MinimumValue>0</MinimumValue>
            </lease_max>
            <authoritative type="BooleanField"/>
            <default_fw_rules type="BooleanField">
                <Required>Y</Required>
                <Default>1</Default>
            </default_fw_rules>
            <reply_delay type="IntegerField">
                <MinimumValue>0</MinimumValue>
                <MaximumValue>60</MaximumValue>
            </reply_delay>
            <nosync type="BooleanField"/>
        </dhcp>
        <no_ident type="BooleanField">
            <Required>Y</Required>
            <Default>1</Default>
        </no_ident>
        <hosts type="ArrayField">
            <host type="HostnameField">
                <IsDNSName>Y</IsDNSName>
                <IpAllowed>N</IpAllowed>
            </host>
            <domain type="TextField">
                <Mask>/^(?:(?:[a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*(?:[a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])$/i</Mask>
                <ValidationMessage>A valid domain must be specified.</ValidationMessage>
            </domain>
            <ip type="NetworkField">
                <Required>Y</Required>
                <NetMaskAllowed>N</NetMaskAllowed>
            </ip>
            <hwaddr type="MacAddressField"/>
            <set_tag type="ModelRelationField">
                <Model>
                    <tag>
                        <source>OPNsense.Dnsmasq.Dnsmasq</source>
                        <items>dhcp_tags</items>
                        <display>tag</display>
                    </tag>
                </Model>
            </set_tag>
            <descr type="TextField"/>
            <comments type="TextField"/>
            <!-- Intentionally last, AliasesField back references other fields (which should already be there) -->
            <aliases type=".\AliasesField">
                <AsList>Y</AsList>
                <FieldSeparator>,</FieldSeparator>
                <IsDNSName>Y</IsDNSName>
                <IpAllowed>N</IpAllowed>
            </aliases>
        </hosts>
        <domainoverrides type="ArrayField">
            <sequence type="AutoNumberField">
                <MinimumValue>1</MinimumValue>
                <MaximumValue>99999</MaximumValue>
                <Default>1</Default>
                <Required>Y</Required>
                <ValidationMessage>Please enter a value between 1 and 99999.</ValidationMessage>
            </sequence>
            <domain type="HostnameField">
                <IsDNSName>Y</IsDNSName>
                <IpAllowed>N</IpAllowed>
                <Required>Y</Required>
            </domain>
            <srcip type="NetworkField">
                <NetMaskAllowed>N</NetMaskAllowed>
            </srcip>
            <port type="PortField"/>
            <!-- Intentionally last, DomainIPField back references other fields (which should already be there) -->
            <ip type=".\DomainIPField">
                <NetMaskAllowed>N</NetMaskAllowed>
            </ip>
            <descr type="TextField"/>
        </domainoverrides>
        <dhcp_tags type="ArrayField">
            <tag type="TextField">
                <Mask>/^([0-9a-zA-Z$]){1,1024}$/u</Mask>
                <Constraints>
                    <check001>
                        <type>UniqueConstraint</type>
                        <ValidationMessage>Tag names should be unique.</ValidationMessage>
                    </check001>
                </Constraints>
                <Required>Y</Required>
            </tag>
        </dhcp_tags>
        <dhcp_ranges type="ArrayField">
            <interface type="InterfaceField">
                <BlankDesc>Any</BlankDesc>
                <Filters>
                    <if>/^(?!lo0$).*/</if>
                </Filters>
                <AllowDynamic>Y</AllowDynamic>
            </interface>
            <set_tag type="ModelRelationField">
                <Model>
                    <tag>
                        <source>OPNsense.Dnsmasq.Dnsmasq</source>
                        <items>dhcp_tags</items>
                        <display>tag</display>
                    </tag>
                </Model>
            </set_tag>
            <start_addr type=".\RangeAddressField">
                <NetMaskAllowed>N</NetMaskAllowed>
                <Required>Y</Required>
            </start_addr>
            <end_addr type=".\RangeAddressField">
                <NetMaskAllowed>N</NetMaskAllowed>
            </end_addr>
            <constructor type="InterfaceField"/>
            <mode type="OptionField">
                <OptionValues>
                    <static>static</static>
                </OptionValues>
                <Multiple>Y</Multiple>
            </mode>
            <prefix_len type="IntegerField">
                <MinimumValue>1</MinimumValue>
                <MaximumValue>64</MaximumValue>
            </prefix_len>
            <lease_time type="IntegerField">
                <MinimumValue>1</MinimumValue>
            </lease_time>
            <domain type="HostnameField">
                <IsDNSName>Y</IsDNSName>
                <IpAllowed>N</IpAllowed>
            </domain>
            <nosync type="BooleanField"/>
            <description type="DescriptionField"/>
        </dhcp_ranges>
        <dhcp_options type="ArrayField">
            <option type="JsonKeyValueStoreField">
                <ConfigdPopulateAct>dnsmasq list dhcp_options</ConfigdPopulateAct>
                <Required>Y</Required>
            </option>
            <interface type="InterfaceField">
                <BlankDesc>Any</BlankDesc>
                <Filters>
                    <if>/^(?!lo0$).*/</if>
                </Filters>
                <AllowDynamic>Y</AllowDynamic>
            </interface>
            <tag type="ModelRelationField">
                <Model>
                    <tag>
                        <source>OPNsense.Dnsmasq.Dnsmasq</source>
                        <items>dhcp_tags</items>
                        <display>tag</display>
                    </tag>
                </Model>
                <Multiple>Y</Multiple>
            </tag>
            <value type="TextField"/>
            <force type="BooleanField"/>
            <description type="DescriptionField"/>
        </dhcp_options>
        <dhcp_options_match type="ArrayField">
            <option type="JsonKeyValueStoreField">
                <ConfigdPopulateAct>dnsmasq list dhcp_options</ConfigdPopulateAct>
                <Required>Y</Required>
            </option>
            <set_tag type="ModelRelationField">
                <Model>
                    <tag>
                        <source>OPNsense.Dnsmasq.Dnsmasq</source>
                        <items>dhcp_tags</items>
                        <display>tag</display>
                    </tag>
                </Model>
                <Required>Y</Required>
            </set_tag>
            <value type="TextField"/>
            <description type="DescriptionField"/>
        </dhcp_options_match>
        <dhcp_boot type="ArrayField">
            <tag type="ModelRelationField">
                <Model>
                    <tag>
                        <source>OPNsense.Dnsmasq.Dnsmasq</source>
                        <items>dhcp_tags</items>
                        <display>tag</display>
                    </tag>
                </Model>
            </tag>
            <filename type="TextField"/>
            <servername type="TextField"/>
            <address type="TextField"/>
            <description type="DescriptionField"/>
        </dhcp_boot>
    </items>
</model>
