r2 - 2011-02-15 - 08:46:49 - MartinBjoerklundYou are here: TWiki >  Main Web > YangExamples > Ds0MibHtml
module ds0-mib {

    namespace "urn:ietf:ds0-mib";
    prefix ds0;

    import IF-MIB { prefix if; }

    organization "IETF Trunk MIB Working Group";

    description
        "The MIB module to describe
        DS0 interfaces objects.";

    revision "1998-05-24" {
        description
            "Initial version of the DS0-MIB.";
    }

    /*
      This is a modified version of the DS0-MIB.
      It is a simple example of how to use 'augment' with an XPath
      expression which extends instances of a particular type.  In
      this case, all ifEntries with ifType == ds0 are augmented with
      the objects defined here.

      bundleMappedIfIndex shows how an optional leafref can be used
      instead of InterfaceIndexOrZero.  I.e. if the bundleMappedIfIndex
      node exists, it must refer to an existing ifEntry.
    */  
  
    typedef ChannelNumber {
        type int8 { range "0..31"; }
    }
  
    typedef ABCDType {
        type int8 { range "0..15"; }
    }

    augment "/if:interfaces/if:ifEntry" {
        when "/if:interfaces/if:ifEntry[if:ifType='ds0']";
        leaf ds0ChannelNumber {
            config false;
            type ChannelNumber;
        }
        leaf robbedBitSignalling {
            type boolean;
        }
        leaf circuitIdentifier {
            type string;
        }
        leaf idleCode {
            type ABCDType;
        }
        leaf seizedCode {
            type ABCDType;
        }
        leaf receivedCode {
            type ABCDType;
        }
        leaf transmitCodeEnable {
            type boolean;
        }
        leaf bundleMappedIfIndex {
            type leafref { path "/if:interfaces/if:ifEntry/if:ifIndex"; }
        }
    }
}
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
YANG
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback