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

 <!-- This is the linkinfo returned in interface reports -->
 <define name="linkinfo" 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="login" min-state="link-authenticated" />
    <meta:require check="netif-config-state" op="linkUp" min-state="link-up" />
    <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"/>
  <protocol type="builtin-vlan-protocol"/>
  <tag type="uint16"/>
 </define>

 <!-- the properties of a VLAN device: -->
 <define name="properties" type="linkinfo"/>

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

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

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