<service name="bridge" interface="org.opensuse.Network.Bridge" object-class="netif-bridge">

  <define name="port-config" class="dict"
	        description="Bridge port (link-request) configuration">

    <priority type="uint32" constraint="range">
      <min value="0"/>
      <max value="63"/>
    </priority>
    <path-cost type="uint32" />

  </define>

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

    <state      type="builtin-bridge-port-state" />
    <port-no    type="uint32" />
    <port-id    type="uint32" />
    <priority   type="uint32" />
    <path-cost  type="uint32" />

  </define>

  <define name="bridge-config" class="dict"
          description="Bridge specific interface configuration properties">

    <!-- STP protocol related settings -->
    <stp type="boolean"
         description="Enables Spanning Tree Protocol to handle multiple hops and avoid cyclic routes"/>

    <priority type="uint32" constraint="range"
              description="The bridge with the lowest priority will be elected as the 'central' root bridge in the spanning tree.">
      <min value="0"/>
      <max value="65535"/>
    </priority>
    <forward-delay type="double" description="Forwarding delay time is the time spent in each of the Listening and Learning states before the Forwarding state is entered." />
    <hello-time type="double"    description="Periodically, a hello packet is sent out by the Root Bridge and the Designated Bridges to communicate information about the topology throughout." />
    <max-age type="double"       description="If a another bridge in the spanning tree does not send out a hello packet for this period of time, it is assumed to be dead." />

    <!-- Forwarding database related settings -->
    <aging-time type="double"    description="Ethernet (MAC) address ageing time. Setting it to 0 makes all entries permanent." />
    <gc-interval type="double"   description="Garbage collection interval for the bridge" />
  </define>

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

    <!-- additional configurables supported by a bridge changeDevice() -->

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

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

    <!-- actual stp state reported by the kernel driver -->
    <stp-state type="uint32" constraint="enum">
      <none          value="0" description="STP is disabled"/>
      <kernel-stp    value="1" description="Kernel built-in STP implementation"/>
      <userspace-stp value="2" description="STP via /sbin/bridge-stp, e.g. RSTP"/>
    </stp-state>

    <!-- we may implement more status information properties here -->

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

  <method name="changeDevice">
    <arguments>
      <!-- First and only argument to changeDevice() method is a
           configuration properties dict.
           The mapping info tells the client to take the device
           configuration from the <bridge> element, and to skip the
           call to changeDevice() if that element isn't there.
        -->
      <config type="bridge:configuration">
        <meta:mapping document-node="/bridge" skip-unless-present="true" />
      </config>
    </arguments>
  </method>

  <method name="deleteDevice">
    <!-- no arguments, no return code -->
  </method>

</service>

<service name="bridge-factory" interface="org.opensuse.Network.Bridge.Factory" object-class="netif-list">
  <method name="newDevice">
    <arguments>
      <name type="string"/>
      <config type="bridge:configuration">
        <meta:mapping document-node="/bridge"/>
      </config>
    </arguments>
    <return>
      <string/>
    </return>
  </method>
</service>

