<!--
  gre service definition
  -->
<service name="gre" interface="org.opensuse.Network.GRE"
                    object-class="netif-gre">
 <description>
   This link-layer service is provided by GRE tunnel devices.
 </description>

 <!-- This are the properties used to configure the gre tunnel -->
 <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="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>
  <local-address   type="ipv4-address"/>
  <remote-address  type="ipv4-address"/>
  <ttl             type="uint16"/>	<!-- u8 from netlink -->
  <tos             type="uint16"/>	<!-- u8 from netlink -->
  <pmtudisc        type="boolean"/>	<!-- u8 from netlink -->
  <flags           type="builtin-gre-flag-mask"/>
  <ikey            type="ipv4-address"/>
  <okey            type="ipv4-address"/>
  <!-- encap       class="dict">
    <type          type="builtin-gre-encap-type"/>
    <flags         type="builtin-gre-encap-flag-mask"/>
    <sport         type="uint16"/>
    <dport         type="uint16"/>
  </encap -->
 </define>

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

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

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

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