<!--
  -- LLDP Service definition
  -->
<service name="lldp" interface="org.opensuse.Network.LLDP" object-class="netif">
 <description>
   This service manages the LLDP agent on a single network interface.
 </description>

 <define name="lldp-request" class="dict">
  <destination type="builtin-lldp-type"/>

  <!-- Chassis-ID is a discriminated union. -->
  <chassis-id class="union" switch="subtype">
   <chassis-component type="string"/>
   <port-component type="string"/>
   <mac-address type="ethernet-address"/>
   <net-address type="network-address"/>
   <ifalias type="string"/>

   <default-ifname class="void"/>
   <default-ifalias class="void"/>
   <default-mac-address class="void"/>
   <default-net-address class="void"/>
  </chassis-id>

  <!-- Port-ID is a discriminated union. -->
  <port-id class="union" switch="subtype">
   <port-component type="string"/>
   <agent-circuit-id type="string"/>
   <ifalias type="string"/>

   <default-ifname class="void"/>
   <default-ifalias class="void"/>
   <default-mac-address class="void"/>
   <default-net-address class="void"/>
  </port-id>

  <ttl type="uint32"/>

  <port-description type="string"/>

  <system class="dict">
   <name type="string"/>
   <!-- for now, we cannot call this "description" because the XML schema parser
     -- thinks it's a reserved word. -->
   <descr type="string"/>
   <capabilities type="builtin-lldp-system-capabilities"/>
  </system>

 </define>

 <!-- the LLDP properties of a device: -->
 <define name="properties" type="lldp-request"/>

 <method name="lldpUp">
   <arguments>
     <config type="lldp-request">
       <meta:mapping document-node="/lldp"/>
     </config>
   </arguments>
 </method>

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