<service name="team" interface="org.opensuse.Network.Team" object-class="netif-team">
  <description>
    This link-layer service is provided by all team network interfaces.

    Team interfaces can be created through the org.opensuse.Network.Team.Factory.
  </description>

  <define name="tx-balancer-type" class="dict">
    <name               type="builtin-team-tx-balancer-type" />
    <balancing_interval type="uint32" />
  </define>

  <define name="roundrobin-runner" class="dict">
  </define>

  <define name="activebackup-runner" class="dict">
    <hwaddr_policy     type="builtin-team-ab-hwaddr-policy" />
  </define>

  <define name="loadbalance-runner" class="dict">
    <tx_hash           type="builtin-team-tx-hash-mask" />
    <tx_balancer       type="team:tx-balancer-type" />
  </define>

  <define name="broadcast-runner" class="dict">
  </define>

  <define name="random-runner" class="dict">
  </define>

  <define name="lacp-runner" class="dict">
    <active            type="boolean" />
    <sys_prio          type="uint16" />
    <fast_rate         type="boolean" />
    <min_ports         type="uint16" />
    <select_policy     type="builtin-team-lacp-select-policy" />
    <tx_hash           type="builtin-team-tx-hash-mask" />
    <tx_balancer       type="team:tx-balancer-type" />
  </define>

  <define name="arp-ping-linkwatch-type" class="dict">
    <source_host       type="string" />
    <target_host       type="string" />
    <interval          type="uint32" />
    <init_wait         type="uint32" />
    <validate_active   type="boolean" />
    <validate_inactive type="boolean" />
    <send_always       type="boolean" />
    <missed_max        type="uint32" />
    <missed            type="uint32" />
    <vlanid            type="uint16" />
  </define>

  <define name="tipc-linkwatch-type" class="dict">
    <bearer      type="string" />
  </define>

  <define name="nsna-ping-linkwatch-type" class="dict">
    <target_host type="string" />
    <interval    type="uint32" />
    <init_wait   type="uint32" />
    <missed_max  type="uint32" />
    <missed      type="uint32" />
  </define>

  <define name="ethtool-linkwatch-type" class="dict">
    <delay_up    type="uint32" />
    <delay_down  type="uint32" />
  </define>

  <define name="port-config" class="dict">
    <queue_id    type="uint32" />
    <prio        type="uint32" />
    <sticky      type="boolean" />
    <lacp_key    type="uint32" />
    <lacp_prio   type="uint32" />
  </define>

  <define name="port-info" class="dict"
          description="Team port specific interface info properties">

    <runner       class="union" switch="name">
      <roundrobin    class="dict"/>
      <activebackup  class="dict"/>
      <loadbalance   class="dict"/>
      <broadcast     class="dict"/>
      <random        class="dict"/>
      <lacp          class="dict">
        <aggregator-id type="uint16"/>
        <selected      type="boolean"/>
        <state         type="string"/>
      </lacp>
    </runner>
    <link_watches    class="dict">
      <up              type="boolean" />
    </link_watches>

  </define>

  <define name="team-config" class="dict"
          description="Team specific interface configuration properties">

    <debug_level  type="uint32"/>
    <notify_peers class="dict">
      <count        type="uint32"/>
      <interval     type="uint32"/>
    </notify_peers>
    <mcast_rejoin class="dict">
      <count        type="uint32"/>
      <interval     type="uint32"/>
    </mcast_rejoin>
    <runner class="union" switch="name">
      <roundrobin   type="roundrobin-runner"/>
      <activebackup type="activebackup-runner"/>
      <loadbalance  type="loadbalance-runner"/>
      <broadcast    type="broadcast-runner"/>
      <random       type="random-runner"/>
      <lacp         type="lacp-runner"/>
    </runner>
    <link_watch_policy    type="builtin-team-link-watch-policy" />
    <link_watch class="dict">
      <watch class="union" switch="name">
        <ethtool   type="ethtool-linkwatch-type" />
        <arp_ping  type="arp-ping-linkwatch-type" />
        <nsna_ping type="nsna-ping-linkwatch-type" />
        <tipc      type="tipc-linkwatch-type" />
      </watch>
    </link_watch>

  </define>

  <define name="configuration" class="dict" extends="team:team-config"
          description="Team interface (changeDevice) configuration">

    <!-- additional non-team specific changeDevice() configuratio -->

    <address type="ethernet-address"/>
  </define>

  <define name="properties" class="dict" extends="team:team-config"
          description="Team interface (service) state info properties">

    <!-- additional non-team specific team service properties -->

    <address type="ethernet-address"/>
  </define>


  <method name="changeDevice">
    <arguments>
      <config type="team:configuration">
        <meta:mapping document-node="/team"/>
      </config>
    </arguments>
  </method>

</service>

<service name="team-factory" interface="org.opensuse.Network.Team.Factory" object-class="netif-list">

  <method name="newDevice">
    <arguments>
      <name type="string"/>
      <config type="team:configuration">
        <meta:mapping document-node="/team"/>
      </config>
    </arguments>
    <return>
      <string/>
    </return>
  </method>

</service>
