<!--
  -- macvlan service definition
  -->
<service name="macvlan" interface="org.opensuse.Network.MACVLAN"
			object-class="netif-macvlan">
 <description>
   This link-layer service is provided by all MACVLAN devices. Since there isn't a lot
   to tune about a MACVLAN once it has been created, this DBus interface doesn't offer
   an own changeDevice() method (yet).

   MACVLAN devices can be created through the org.opensuse.Network.MACVLAN.Factory
   factory interface.
 </description>

 <!-- This are the properties used to configure the macvlan -->
 <define name="configuration" class="dict">
  <device type="string">
    <meta:netif-reference shared="true"/>
    <meta:require check="netif-config-state" op="newDevice" min-state="device-up" />
    <meta:require check="netif-config-state" op="linkUp"    min-state="link-up" />
    <meta:require check="netif-config-state" op="login"     min-state="link-authenticated" />
    <meta:require check="netif-system-state" op="linkDown" max-state="firewall-up" />
    <meta:require check="netif-system-state" op="deleteDevice" max-state="device-down" />
  </device>
  <address  type="ethernet-address"/>
  <mode     type="builtin-macvlan-mode"/>
  <flags    type="builtin-macvlan-flag-bits"/>
 </define>

 <!-- The same properties are returned in interface state reports -->
 <define name="properties" type="macvlan:configuration"/>

 <method name="changeDevice">
  <arguments>
   <config type="macvlan:configuration">
    <meta:mapping document-node="/macvlan" skip-unless-present="true" />
   </config>
  </arguments>
 </method>

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

<service name="macvlan-factory" interface="org.opensuse.Network.MACVLAN.Factory"
				object-class="netif-list">
 <method name="newDevice">
  <arguments>
   <name type="string"/>
   <config type="macvlan:configuration">
    <meta:mapping document-node="/macvlan"/>
   </config>
  </arguments>
  <return>
   <!-- this is really an object handle -->
   <string/>
  </return>
 </method>
</service>


<!--
  -- macvtap service definition
  -->
<service name="macvtap" interface="org.opensuse.Network.MACVTAP"
			object-class="netif-macvtap">
 <description>
   This link-layer service is provided by all MACVTAP devices.
   MACVTAP devices can be created through the org.opensuse.Network.MACVTAP.Factory
   factory interface.
 </description>

 <!-- The same properties are returned in interface state reports -->
 <define name="properties" type="macvlan:configuration"/>

 <method name="changeDevice">
  <arguments>
   <config type="macvlan:configuration">
    <!-- type is macvlan, but config node has it under /macvtap -->
    <meta:mapping document-node="/macvtap" skip-unless-present="true" />
   </config>
  </arguments>
 </method>

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

<service name="macvtap-factory" interface="org.opensuse.Network.MACVTAP.Factory"
				object-class="netif-list">
 <method name="newDevice">
  <arguments>
   <name type="string"/>
   <config type="macvlan:configuration">
    <!-- type is macvlan, but config node has it under /macvtap -->
    <meta:mapping document-node="/macvtap"/>
   </config>
  </arguments>
  <return>
   <!-- this is really an object handle -->
   <string/>
  </return>
 </method>
</service>
