<?xml version="1.0"?>
<interfaceDefinition>
  <node name="service">
    <children>
      <node name="router-advert" owner="${vyos_conf_scripts_dir}/service_router-advert.py">
        <properties>
          <help>IPv6 Router Advertisements (RAs) service</help>
          <priority>900</priority>
        </properties>
        <children>
          <tagNode name="interface">
            <properties>
              <help>Interface to send RA on</help>
              <completionHelp>
                <script>${vyos_completion_dir}/list_interfaces</script>
              </completionHelp>
            </properties>
            <children>
              <leafNode name="hop-limit">
                <properties>
                  <help>Set Hop Count field of the IP header for outgoing packets</help>
                  <valueHelp>
                    <format>u32:0</format>
                    <description>Unspecified (by this router)</description>
                  </valueHelp>
                  <valueHelp>
                    <format>u32:1-255</format>
                    <description>Value should represent current diameter of the Internet</description>
                  </valueHelp>
                  <constraint>
                    <validator name="numeric" argument="--range 0-255"/>
                  </constraint>
                  <constraintErrorMessage>Hop count must be between 0 and 255</constraintErrorMessage>
                </properties>
                <defaultValue>64</defaultValue>
              </leafNode>
              <leafNode name="default-lifetime">
                <properties>
                  <help>Lifetime associated with the default router in units of seconds</help>
                  <valueHelp>
                    <format>u32:4-9000</format>
                    <description>Router Lifetime in seconds</description>
                  </valueHelp>
                  <valueHelp>
                    <format>0</format>
                    <description>Not a default router</description>
                  </valueHelp>
                  <constraint>
                    <validator name="numeric" argument="--range 0-0 --range 4-9000"/>
                  </constraint>
                  <constraintErrorMessage>Default router livetime bust be 0 or between 4 and 9000</constraintErrorMessage>
                </properties>
              </leafNode>
              <leafNode name="default-preference">
                <properties>
                  <help>Preference associated with the default router,</help>
                  <completionHelp>
                    <list>low medium high</list>
                  </completionHelp>
                  <valueHelp>
                    <format>low</format>
                    <description>Default router has low preference</description>
                  </valueHelp>
                  <valueHelp>
                    <format>medium</format>
                    <description>Default router has medium preference</description>
                  </valueHelp>
                  <valueHelp>
                    <format>high</format>
                    <description>Default router has high preference</description>
                  </valueHelp>
                  <constraint>
                    <regex>(low|medium|high)</regex>
                  </constraint>
                  <constraintErrorMessage>Default preference must be low, medium or high</constraintErrorMessage>
                </properties>
                <defaultValue>medium</defaultValue>
              </leafNode>
              <leafNode name="dnssl">
                <properties>
                  <help>DNS search list</help>
                  <multi/>
                </properties>
              </leafNode>
              <leafNode name="link-mtu">
                <properties>
                  <help>Link MTU value placed in RAs, exluded in RAs if unset</help>
                  <valueHelp>
                    <format>u32:1280-9000</format>
                    <description>Link MTU value in RAs</description>
                  </valueHelp>
                  <constraint>
                    <validator name="numeric" argument="--range 1280-9000"/>
                  </constraint>
                  <constraintErrorMessage>Link MTU must be between 1280 and 9000</constraintErrorMessage>
                </properties>
              </leafNode>
              <leafNode name="managed-flag">
                <properties>
                  <help>Hosts use the administered (stateful) protocol for address autoconfiguration in addition to any addresses autoconfigured using SLAAC</help>
                  <valueless/>
                </properties>
              </leafNode>
              <node name="interval">
                <properties>
                  <help>Set interval between unsolicited multicast RAs</help>
                </properties>
                <children>
                  <leafNode name="max">
                    <properties>
                      <help>Maximum interval between unsolicited multicast RAs</help>
                      <valueHelp>
                        <format>u32:4-1800</format>
                        <description>Maximum interval in seconds</description>
                      </valueHelp>
                      <constraint>
                        <validator name="numeric" argument="--range 4-1800"/>
                      </constraint>
                      <constraintErrorMessage>Maximum interval must be between 4 and 1800 seconds</constraintErrorMessage>
                    </properties>
                    <defaultValue>600</defaultValue>
                  </leafNode>
                  <leafNode name="min">
                    <properties>
                      <help>Minimum interval between unsolicited multicast RAs</help>
                      <valueHelp>
                        <format>u32:3-1350</format>
                        <description>Minimum interval in seconds</description>
                      </valueHelp>
                      <constraint>
                        <validator name="numeric" argument="--range 3-1350"/>
                      </constraint>
                      <constraintErrorMessage>Minimum interval must be between 3 and 1350 seconds</constraintErrorMessage>
                    </properties>
                  </leafNode>
                </children>
              </node>
              #include <include/name-server-ipv6.xml.i>
              <leafNode name="name-server-lifetime">
                <properties>
                  <help>Maximum duration how long the RDNSS entries are used</help>
                  <valueHelp>
                    <format>u32:0</format>
                    <description>Name-servers should no longer be used</description>
                  </valueHelp>
                  <valueHelp>
                    <format>u32:1-7200</format>
                    <description>Maximum interval in seconds</description>
                  </valueHelp>
                  <constraint>
                    <validator name="numeric" argument="--range 1-7200"/>
                  </constraint>
                  <constraintErrorMessage>Maximum interval must be between 1 and 7200 seconds</constraintErrorMessage>
                </properties>
              </leafNode>
              <leafNode name="other-config-flag">
                <properties>
                  <help>Hosts use the administered (stateful) protocol for autoconfiguration of other (non-address) information</help>
                  <valueless/>
                </properties>
              </leafNode>
              <tagNode name="route">
                <properties>
                  <help>IPv6 route to be advertised in Router Advertisements (RAs)</help>
                  <valueHelp>
                    <format>ipv6net</format>
                    <description>IPv6 route to be advertized</description>
                  </valueHelp>
                  <constraint>
                    <validator name="ipv6-prefix"/>
                  </constraint>
                </properties>
                <children>
                  <leafNode name="valid-lifetime">
                    <properties>
                      <help>Time in seconds that the route will remain valid</help>
                      <completionHelp>
                        <list>infinity</list>
                      </completionHelp>
                      <valueHelp>
                        <format>u32:1-4294967295</format>
                        <description>Time in seconds that the route will remain valid</description>
                      </valueHelp>
                      <valueHelp>
                        <format>infinity</format>
                        <description>Route will remain preferred forever</description>
                      </valueHelp>
                      <constraint>
                        <validator name="numeric" argument="--range 0-4294967295"/>
                        <regex>(infinity)</regex>
                      </constraint>
                    </properties>
                    <defaultValue>1800</defaultValue>
                  </leafNode>
                  <leafNode name="route-preference">
                    <properties>
                      <help>Preference associated with the route,</help>
                      <completionHelp>
                        <list>low medium high</list>
                      </completionHelp>
                      <valueHelp>
                        <format>low</format>
                        <description>Route has low preference</description>
                      </valueHelp>
                      <valueHelp>
                        <format>medium</format>
                        <description>Route has medium preference</description>
                      </valueHelp>
                      <valueHelp>
                        <format>high</format>
                        <description>Route has high preference</description>
                      </valueHelp>
                      <constraint>
                        <regex>(low|medium|high)</regex>
                      </constraint>
                      <constraintErrorMessage>Route preference must be low, medium or high</constraintErrorMessage>
                    </properties>
                    <defaultValue>medium</defaultValue>
                  </leafNode>
                  <leafNode name="no-remove-route">
                    <properties>
                      <help>Do not announce this route with a zero second lifetime upon shutdown</help>
                      <valueless/>
                    </properties>
                  </leafNode>
                </children>
              </tagNode>
              <tagNode name="prefix">
                <properties>
                  <help>IPv6 prefix to be advertised in Router Advertisements (RAs)</help>
                  <valueHelp>
                    <format>ipv6net</format>
                    <description>IPv6 prefix to be advertized</description>
                  </valueHelp>
                  <constraint>
                    <validator name="ipv6-prefix"/>
                  </constraint>
                </properties>
                <children>
                  <leafNode name="no-autonomous-flag">
                    <properties>
                      <help>Prefix can not be used for stateless address auto-configuration</help>
                      <valueless/>
                    </properties>
                  </leafNode>
                  <leafNode name="no-on-link-flag">
                    <properties>
                      <help>Prefix can not be used for on-link determination</help>
                      <valueless/>
                    </properties>
                  </leafNode>
                  <leafNode name="deprecate-prefix">
                    <properties>
                      <help>Upon shutdown, this option will deprecate the prefix by announcing it in the shutdown RA</help>
                      <valueless/>
                    </properties>
                  </leafNode>
                  <leafNode name="decrement-lifetime">
                    <properties>
                      <help>Lifetime is decremented by the number of seconds since the last RA - use in conjunction with a DHCPv6-PD prefix</help>
                      <valueless/>
                    </properties>
                  </leafNode>
                  <leafNode name="preferred-lifetime">
                    <properties>
                      <help>Time in seconds that the prefix will remain preferred</help>
                      <completionHelp>
                        <list>infinity</list>
                      </completionHelp>
                      <valueHelp>
                        <format>u32</format>
                        <description>Time in seconds that the prefix will remain preferred</description>
                      </valueHelp>
                      <valueHelp>
                        <format>infinity</format>
                        <description>Prefix will remain preferred forever</description>
                      </valueHelp>
                      <constraint>
                        <validator name="numeric" argument="--range 0-4294967295"/>
                        <regex>(infinity)</regex>
                      </constraint>
                    </properties>
                    <defaultValue>14400</defaultValue>
                  </leafNode>
                  <leafNode name="valid-lifetime">
                    <properties>
                      <help>Time in seconds that the prefix will remain valid</help>
                      <completionHelp>
                        <list>infinity</list>
                      </completionHelp>
                      <valueHelp>
                        <format>u32:1-4294967295</format>
                        <description>Time in seconds that the prefix will remain valid</description>
                      </valueHelp>
                      <valueHelp>
                        <format>infinity</format>
                        <description>Prefix will remain preferred forever</description>
                      </valueHelp>
                      <constraint>
                        <validator name="numeric" argument="--range 0-4294967295"/>
                        <regex>(infinity)</regex>
                      </constraint>
                    </properties>
                    <defaultValue>2592000</defaultValue>
                  </leafNode>
                </children>
              </tagNode>
              <leafNode name="source-address">
                <properties>
                  <help>Use IPv6 address as source address. Useful with VRRP.</help>
                  <valueHelp>
                    <format>ipv6</format>
                    <description>IPv6 address to be advertized (must be configured on interface)</description>
                  </valueHelp>
                  <constraint>
                    <validator name="ipv6-address"/>
                  </constraint>
                  <multi/>
                </properties>
              </leafNode>
              <leafNode name="reachable-time">
                <properties>
                  <help>Time, in milliseconds, that a node assumes a neighbor is reachable after having received a reachability confirmation</help>
                  <valueHelp>
                    <format>u32:0</format>
                    <description>Reachable Time unspecified by this router</description>
                  </valueHelp>
                  <valueHelp>
                    <format>u32:1-3600000</format>
                    <description>Reachable Time value in RAs (in milliseconds)</description>
                  </valueHelp>
                  <constraint>
                    <validator name="numeric" argument="--range 0-0 --range 1-3600000"/>
                  </constraint>
                  <constraintErrorMessage>Reachable time must be 0 or between 1 and 3600000 milliseconds</constraintErrorMessage>
                </properties>
                <defaultValue>0</defaultValue>
              </leafNode>
              <leafNode name="retrans-timer">
                <properties>
                  <help>Time in milliseconds between retransmitted Neighbor Solicitation messages</help>
                  <valueHelp>
                    <format>u32:0</format>
                    <description>Time, in milliseconds, between retransmitted Neighbor Solicitation messages</description>
                  </valueHelp>
                  <valueHelp>
                    <format>u32:1-4294967295</format>
                    <description>Minimum interval in milliseconds</description>
                  </valueHelp>
                  <constraint>
                    <validator name="numeric" argument="--range 0-0 --range 1-4294967295"/>
                  </constraint>
                  <constraintErrorMessage>Retransmit interval must be 0 or between 1 and 4294967295 milliseconds</constraintErrorMessage>
                </properties>
                <defaultValue>0</defaultValue>
              </leafNode>
              <leafNode name="no-send-advert">
                <properties>
                  <help>Do not send router adverts</help>
                  <valueless/>
                </properties>
              </leafNode>
            </children>
          </tagNode>
        </children>
      </node>
    </children>
  </node>
</interfaceDefinition>