<?xml version="1.0" encoding="UTF-8"?>
<!--
  Device:2 Root Data Model: Common Object definitions [HomePlug]

  Copyright (c) 2010-2024, Broadband Forum

  Redistribution and use in source and binary forms, with or
  without modification, are permitted provided that the following
  conditions are met:

  1. Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above
     copyright notice, this list of conditions and the following
     disclaimer in the documentation and/or other materials
     provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its
     contributors may be used to endorse or promote products
     derived from this software without specific prior written
     permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

  The above license is used as a license under copyright only.
  Please reference the Forum IPR Policy for patent licensing terms
  <https://www.broadband-forum.org/ipr-policy>.

  Any moral rights which are necessary to exercise under the above
  license grant are also deemed granted under this license.

  Comments or questions about this Broadband Forum data model should be
  directed to <info@broadband-forum.org>.
-->

<dm:document
    xmlns:dm="urn:broadband-forum-org:cwmp:datamodel-1-10"
    xmlns:dmr="urn:broadband-forum-org:cwmp:datamodel-report-1-0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
      urn:broadband-forum-org:cwmp:datamodel-1-10
        https://www.broadband-forum.org/cwmp/cwmp-datamodel-1-10.xsd
      urn:broadband-forum-org:cwmp:datamodel-report-1-0
        https://www.broadband-forum.org/cwmp/cwmp-datamodel-report-1-0.xsd"
    spec="urn:broadband-forum-org:tr-181-2-21-0-homeplug"
    file="tr-181-2-21-0-homeplug.xml">

  <import file="tr-069-biblio.xml" spec="urn:broadband-forum-org:tr-069"/>

  <import file="tr-106-types.xml" spec="urn:broadband-forum-org:tr-106">
    <component name="Alias"/>
    <dataType name="MACAddress"/>
  </import>

  <import file="tr-181-2-root.xml"
      spec="urn:broadband-forum-org:tr-181-2-21-root">
    <component name="Root"/>
  </import>

  <import file="tr-181-2-interface.xml"
    spec="urn:broadband-forum-org:tr-181-2-21-interface">
    <component name="Layer12Interface"/>
  </import>

  <component name="HomePlug">

    <object name="Device.HomePlug." access="readOnly" minEntries="1"
        maxEntries="1" version="2.0">
      <description>
        HomePlug object that contains the {{object|Interface}} table. The
        HomePlug industry standard {{bibref|HPAV1.1}} defines peer to peer
        communication over powerline medium.
      </description>

      <component ref="Layer12Interface"/>
    </object>

    <object base="Device.HomePlug.Interface.{i}.">
      <description action="replace">
        HomePlug interface table (a stackable interface object as described in
        {{bibref|TR-181i2|Section 4.2}}). Each table entry models the PHY and
        MAC levels of a HomePlug interface {{bibref|HPAV1.1}}.
      </description>

      <parameter name="Type" version="2.20" access="readWrite">
        <description>
          The type of HomePlug interface. 
        </description>
        <syntax>
          <string>
            <enumeration value="Embedded">
              <description>
                Indicates that this is a physical HomePlug interface embedded in the Device.
              </description>
            </enumeration>
            <enumeration value="Logical">
              <description>
                Indicates that this is a logical HomePlug interface that operates
                over an Ethernet interface.

                It is used for gathering statistics from HomePlug devices in the network and should be used when no embedded HomePlug interface is available in the Device.
              </description>
            </enumeration>
          </string>
        </syntax>
      </parameter>

      <parameter name="Interface" access="readWrite" version="2.20">
        <description>
          The Layer 2 Ethernet Interface over which the network protocol operates, when the Type
          parameter is {{enum|Logical|Type}}.
        </description>
        <syntax>
          <string>
            <pathRef refType="strong" targetParent=".Ethernet.Link.
            .Logical.Interface." targetType="row"/>
          </string>
        </syntax>
      </parameter>

      <parameter name="MACAddress" access="readOnly">
        <description>
          The MAC Address of the interface.

          Note: This is not necessarily the same as the Ethernet header source
          or destination MAC address, which is associated with the IP interface
          and is modeled via the {{param|##.Ethernet.Link.{i}.MACAddress}}
          parameter.
        </description>
        <syntax>
          <dataType ref="MACAddress"/>
        </syntax>
      </parameter>

      <parameter name="LogicalNetwork" access="readWrite">
        <description>
          The textual name of the HomePlug Logical Network.
        </description>
        <syntax>
          <string>
            <size maxLength="64"/>
          </string>
        </syntax>
      </parameter>

      <parameter name="Version" access="readOnly">
        <description>
          Indicates the HomePlug version of the interface. This element SHOULD
          be in the form of dot-delimited integers, where each successive
          integer represents a more minor category of variation. For example:

          : "1.0"

          : "1.1"
        </description>
        <syntax>
          <string>
            <size maxLength="16"/>
          </string>
        </syntax>
      </parameter>

      <parameter name="FirmwareVersion" access="readOnly">
        <description>
          The firmware version of the interface.
        </description>
        <syntax>
          <string>
            <size maxLength="64"/>
          </string>
        </syntax>
      </parameter>

      <parameter name="ForceCCo" access="readWrite">
        <description>
          Central Coordinator (CCo) selection mode.

          If {{false}}, CCo selection is automatic. If {{true}}, the local
          HomePlug interface is forced to be CCo and all other devices in the
          Logical Network MUST be set to automatic CCo selection.

          Typically {{param}} is set to automatic CCo selection ({{false}}).
        </description>
        <syntax>
          <boolean/>
          <default type="factory" value="false"/>
        </syntax>
      </parameter>

      <parameter name="NetworkPassword" access="readWrite">
        <description>
          The network password of the device. This is a human readable ASCII
          string that is hashed per the HomePlug specification to generate the
          Network Membership Key (NMK). Note that care needs to be taken when
          setting this parameter as it might prohibit communication with other
          adapters or equipment connected via the powerline network.
        </description>
        <syntax secured="true">
          <string>
            <size maxLength="32"/>
          </string>
        </syntax>
      </parameter>

      <parameter name="OtherNetworksPresent" access="readOnly">
        <description>
          {{list}} Indicates whether any other HomePlug networks are currently
          visible via this interface. Examples of valid list items include, but
          are not limited to:

          : "HomePlugAV"

          : "HomePlug1.0"

          : "Other"
        </description>
        <syntax>
          <list>
            <size maxLength="64"/>
          </list>
          <string/>
        </syntax>
      </parameter>

      <parameter name="AssociatedDeviceNumberOfEntries" access="readOnly">
        <description>
          {{numentries}}
        </description>
        <syntax>
          <unsignedInt/>
        </syntax>
      </parameter>
    </object>

    <object base="Device.HomePlug.Interface.{i}.Stats.">
      <parameter name="MPDUTxAck" access="readOnly">
        <description>
          HomePlug-specific statistic. The Number of MAC Protocol Data Units
          (MPDUs) Transmitted and Acknowledged.
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>

      <parameter name="MPDUTxCol" access="readOnly">
        <description>
          HomePlug-specific statistic. The Number of MAC Protocol Data Units
          (MPDUs) Transmitted and Collided
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>

      <parameter name="MPDUTxFailed" access="readOnly">
        <description>
          HomePlug-specific statistic. The Number of MAC Protocol Data Units
          (MPDUs) Transmitted and Failed
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>

      <parameter name="MPDURxAck" access="readOnly">
        <description>
          HomePlug-specific statistic. The Number of MAC Protocol Data Units
          (MPDUs) Received and Acknowledged
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>

      <parameter name="MPDURxFailed" access="readOnly">
        <description>
          HomePlug-specific statistic. The Number of MAC Protocol Data Units
          (MPDUs) Received and Failed
        </description>
        <syntax>
          <unsignedLong/>
        </syntax>
      </parameter>
    </object>

    <object name="Device.HomePlug.Interface.{i}.AssociatedDevice.{i}."
        access="readOnly" numEntriesParameter="AssociatedDeviceNumberOfEntries"
        minEntries="0" maxEntries="unbounded" version="2.0">
      <description>
        This table contains information about other HomePlug devices connected
        to this HomePlug interface.
      </description>
      <uniqueKey functional="true">
        <parameter ref="MACAddress"/>
      </uniqueKey>

      <parameter name="MACAddress" access="readOnly">
        <description>
          MAC address of remote HomePlug device. It is used to uniquely
          identify and easily correlate with the connected remote HomePlug
          device.
        </description>
        <syntax>
          <dataType ref="MACAddress"/>
        </syntax>
      </parameter>

      <parameter name="Manufacturer" access="readOnly" version="2.20">
        <description>
          The manufacturer of the remote HomePlug device.
        </description>
        <syntax>
          <string>
            <size maxLength="64"/>
          </string>
        </syntax>
      </parameter>

      <parameter name="FirmwareVersion" access="readOnly" version="2.20">
        <description>
          The firmware version of the remote HomePlug device.
        </description>
        <syntax>
          <string/>
        </syntax>
      </parameter>

      <parameter name="TxPhyRate" access="readOnly">
        <description>
          The PHY transmit Rate (expressed in {{units}}) to this remote device.
        </description>
        <syntax>
          <unsignedInt>
            <units value="Mbps"/>
          </unsignedInt>
        </syntax>
      </parameter>

      <parameter name="RxPhyRate" access="readOnly">
        <description>
          The PHY receive Rate (expressed in {{units}}) from this remote
          device.
        </description>
        <syntax>
          <unsignedInt>
            <units value="Mbps"/>
          </unsignedInt>
        </syntax>
      </parameter>

      <parameter name="SNRPerTone" access="readOnly">
        <description>
          {{list}} List items indicate Signal to Noise Ratio (SNR) per tone
          from this remote device (expressed in {{units}}).
        </description>
        <syntax>
          <list maxItems="1155">
            <size/>
          </list>
          <unsignedInt>
            <units value="0.1dB"/>
          </unsignedInt>
        </syntax>
      </parameter>

      <parameter name="AvgAttenuation" access="readOnly">
        <description>
          Average attenuation from this remote device (expressed in {{units}}).
        </description>
        <syntax>
          <unsignedInt>
            <units value="0.1dB"/>
          </unsignedInt>
        </syntax>
      </parameter>

      <parameter name="EndStationMACs" access="readOnly">
        <description>
          {{list}} List items represent MAC addresses of end stations bridged
          by the remote HomePlug device.

          For example: "11:22:33:AA:BB:CC, 22:33:44:DD:EE:66"
        </description>
        <syntax>
          <list maxItems="16">
            <size/>
          </list>
          <dataType ref="MACAddress"/>
        </syntax>
      </parameter>

      <parameter name="Active" access="readOnly">
        <description>
          Whether or not this device is currently present in the HomePlug
          network.

          The ability to list inactive nodes is OPTIONAL. If the CPE includes
          inactive nodes in this table, {{param}} MUST be set to {{false}} for
          each inactive node. The length of time an inactive node remains
          listed in this table is a local matter to the CPE.
        </description>
        <syntax>
          <boolean/>
        </syntax>
      </parameter>
    </object>

    <profile name="HomePlug:1" version="2.0">
      <object ref="Device.HomePlug." requirement="present">
        <parameter ref="InterfaceNumberOfEntries" requirement="readOnly"/>
      </object>
      <object ref="Device.HomePlug.Interface.{i}." requirement="present">
        <parameter ref="Enable" requirement="readWrite"/>
        <parameter ref="Status" requirement="readOnly"/>
        <parameter ref="Alias" requirement="writeOnceReadOnly"/>
        <parameter ref="Name" requirement="readOnly"/>
        <parameter ref="LastChange" requirement="readOnly"/>
        <parameter ref="Upstream" requirement="readOnly"/>
        <parameter ref="MACAddress" requirement="readOnly"/>
        <parameter ref="LogicalNetwork" requirement="readWrite"/>
        <parameter ref="Version" requirement="readOnly"/>
        <parameter ref="FirmwareVersion" requirement="readOnly"/>
        <parameter ref="ForceCCo" requirement="readWrite"/>
        <parameter ref="NetworkPassword" requirement="readWrite"/>
        <parameter ref="OtherNetworksPresent" requirement="readOnly"/>
        <parameter ref="MaxBitRate" requirement="readOnly"/>
        <parameter ref="AssociatedDeviceNumberOfEntries"
            requirement="readOnly"/>
      </object>
      <object ref="Device.HomePlug.Interface.{i}.Stats." requirement="present">
        <parameter ref="BytesSent" requirement="readOnly"/>
        <parameter ref="BytesReceived" requirement="readOnly"/>
        <parameter ref="PacketsSent" requirement="readOnly"/>
        <parameter ref="PacketsReceived" requirement="readOnly"/>
        <parameter ref="MPDUTxAck" requirement="readOnly"/>
        <parameter ref="MPDUTxCol" requirement="readOnly"/>
        <parameter ref="MPDUTxFailed" requirement="readOnly"/>
        <parameter ref="MPDURxAck" requirement="readOnly"/>
        <parameter ref="MPDURxFailed" requirement="readOnly"/>
      </object>
      <object ref="Device.HomePlug.Interface.{i}.AssociatedDevice.{i}."
          requirement="present">
        <parameter ref="MACAddress" requirement="readOnly"/>
        <parameter ref="TxPhyRate" requirement="readOnly"/>
        <parameter ref="RxPhyRate" requirement="readOnly"/>
        <parameter ref="SNRPerTone" requirement="readOnly"/>
        <parameter ref="AvgAttenuation" requirement="readOnly"/>
        <parameter ref="EndStationMACs" requirement="readOnly"/>
        <parameter ref="Active" requirement="readOnly"/>
      </object>
    </profile>
  </component>

  <model name="HomePlug:2.21">
    <component ref="Root"/>
    <component ref="HomePlug"/>
  </model>
</dm:document>
