<define name="ipv4-address">
  <array element-type="byte" minlen="4" maxlen="4" notation="ipv4addr"/>
</define>

<define name="ipv4-address-prefix" class="dict">
  <address type="ipv4-address"/>
  <prefix type="byte"/>
</define>

<define name="ipv6-address">
  <array element-type="byte" minlen="16" maxlen="16" notation="ipv6addr"/>
</define>

<define name="ipv6-address-prefix" class="dict">
  <address type="ipv6-address"/>
  <prefix type="byte"/>
</define>

<define name="ethernet-address">
  <array element-type="byte" minlen="6" maxlen="6" notation="hwaddr"/>
</define>

<!-- This represents a generic network address.
  -- The string notation uses the common numeric representation for
  -- IPv4 and IPv6 addresses (other formats currently not supported).
  -- On the wire, the address is represented in a packed format. -->
<define name="network-address">
  <description>
   This is a network address of any support address family.
   On the wire, it is represented as uint16 containing the address family,
   followed by the raw address bytes in network byte order.

   In the XML representation, an unambiguous "natural" representation is used,
   e.g.  dotted quad for IPv4.
  </description>
  <array element-type="byte" notation="net-address" />
</define>

<define name="network-address-prefix">
  <description>
   This is a network address in addr/prefix notation.
   On the wire, it is represented as uint16 containing the prefix length,
   followed by a uint16 containing the address family, and eventually
   the raw address bytes in network byte order.

   In the XML representation, an unambiguous "natural" representation is used,
   e.g.  dotted quad for IPv4, followed by a slash and the prefixlen.
  </description>
  <array element-type="byte" notation="net-address-prefix" />
</define>

<define name="uuid-type">
  <array element-type="byte" minlen="16" maxlen="16" notation="uuid"/>
</define>

<define name="external-file">
  <description>
    This type can be used in a schema definition. It is used to "splice"
    the contents of a file as raw binary data into the configuration that
    is passed to the server.

    The purpose of this is to be able to keep things like cryptographic
    keys in a separate file.
  </description>
  <array element-type="byte" notation="external-file"/>
</define>

<define name="hex-string">
  <description>
    On XML the data is in the format of `^([0-9a-f]{2})*$` and each two ascii
    characters representing one byte.

    It can be used to store opaque data in XML. The DBus end will get a
    byte-array.
  </description>
  <array element-type="byte" notation="hex-string"/>
</define>

<!--
  This type represents is a boolean like integer type with an
  additional "unset" / default value.
-->
<define name="tristate" type="int32" constraint="enum">
  <default value="-1"/>
  <false value="0"/>
  <true value="1"/>
</define>
<define name="valid-lifetime-type" type="uint32" constraint="enum">
  <infinite   value="4294967295"/>
  <expired    value="0"/>
</define>
<define name="pref-lifetime-type" type="uint32" constraint="enum">
  <infinite   value="4294967295"/>
  <deprecated value="0"/>
</define>
<define name="seconds-type" type="uint32" constraint="enum">
  <infinite   value="4294967295"/>
</define>

