<service name="ppp" interface="org.opensuse.Network.PPP" object-class="netif-ppp">
 <description>
   This link-layer service is provided by all PPP devices.

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

  <define name="pppoe-config" class="dict">
    <device       type="string">
      <meta:netif-reference shared="true"/>
      <meta:require check="netif-config-state" op="newDevice" min-state="link-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>
  </define>

  <define name="auth-config" class="dict">
    <hostname     type="string"/>
    <username     type="string"/>
    <password     type="string"/>
  </define>

  <define name="dns-config" class="dict">
    <usepeerdns   type="boolean"/>
    <dns1         type="network-address"/>
    <dns2         type="network-address"/>
  </define>

  <define name="ipv4-config" class="dict">
    <local-ip     type="network-address"/>
    <remote-ip    type="network-address"/>
    <ipcp         class="dict">
      <accept-local  type="boolean"/>
      <accept-remote type="boolean"/>
    </ipcp>
  </define>

  <define name="ipv6-config" class="dict">
    <enabled      type="boolean"/>
    <local-ip     type="network-address"/>
    <remote-ip    type="network-address"/>
    <ipcp         class="dict">
      <accept-local  type="boolean"/>
    </ipcp>
  </define>

  <define name="configuration" class="dict">
    <mode class="union" switch="name">
      <pppoe      type="pppoe-config"/>
    </mode>

    <debug        type="boolean"/>

    <demand       type="boolean"/>
    <persist      type="boolean"/>
    <idle         type="uint32"/>
    <maxfail      type="uint32"/>
    <holdoff      type="uint32"/>

    <multilink    type="boolean"/>
    <endpoint     type="string"/>

    <dns          type="dns-config"/>
    <defaultroute type="boolean"/>

    <auth         type="auth-config"/>
    <ipv4         type="ipv4-config"/>
    <ipv6         type="ipv6-config"/>
  </define>

  <define name="properties" type="ppp:configuration"/>

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

</service>

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