Subject: Re: [netmod] smi2yang-20: duplicate objects in INDEXes [strawman: adopt #20-01]

From: David Spakes <[email-masked]>
Date: Mon, 14 Nov 2011 19:01:35 -0500 (EST)

On Mon, 14 Nov 2011, Juergen Schoenwaelder wrote:

> * smi2yang-20: duplicate objects in INDEXes [strawman: adopt #20-01]
>
>   RMON2-MIB (RFC 4502) has an INDEX clause in which the same object
>   appears twice. Specifically, alHostEntry's INDEX clause uses
>   protocolDirLocalIndex twice. Following the current conversion rules
>   results in a translated document that violates the YANG rule that a
>   leaf identifier MUST NOT appear more than once in the key.
>
> ** Solution #20-01
>
>     o The SMIv2 INDEX clause is mapped to the YANG key clause listing
>       the columnar objects forming the key of the YANG list.  If the
>       same object appears more than once in the INDEX clause, append
>       '_<n>' to the duplicate object names where '<n>' counts the
>       occurances of the object in the INDEX clause, starting from 2.
>
>   This would result in
>
>     key "hlHostControlIndex alHostTimeMark protocolDirLocalIndex "
>         "nlHostAddress protocolDirLocalIndex_2";

The text written to describe Solution #20-01 should include a statement
that it is normal and expected for the smiv2:oid (or smiv2:subid)
statement generated in YANG document for each '_<n>' object to refer
to the same object identifier as the object that it duplicates.

By example, in this case both protocolDirLocalIndex and
and protocolDirLocalIndex_2 would refer to 1.3.6.1.2.1.16.11.2.1.3.

    leaf protocolDirLocalIndex {
      type leafref {
        path "/rmon2-mib:protocolDirTable/rmon2-mib:protocolDirEntry/rmon2-mib:protocolDirLocalIndex";
      }
      smiv2:oid 1.3.6.1.2.1.16.11.2.1.3;
    }

    leaf protocolDirLocalIndex_2 {
      type leafref {
        path "/rmon2-mib:protocolDirTable/rmon2-mib:protocolDirEntry/rmon2-mib:protocolDirLocalIndex";
      }
      smiv2:oid 1.3.6.1.2.1.16.11.2.1.3;
    }

-dss

-------------------------------------------------------------
 David Spakes                       email:   [email-masked]
 SNMP Research                      voice:   +1 865 573 1434
 3001 Kimberlin Heights Road          fax:   +1 865 573 9197
 Knoxville, TN  37920-9716  USA      http://www.snmp.com
-------------------------------------------------------------