/*
 * This YANG module has been generated by smidump 0.5.0:
 *
 *      smidump -f yang IF-MIB
 *
 */
module test-if-mib {

  namespace "http://www.yumaworks.com/ns/test-if-mib";
  prefix "if-mib";

  import IANAifType-MIB {
    prefix "ianaiftype-mib";
  }

  import SNMPv2-TC {
    prefix "snmpv2-tc";
  }

  import ietf-yang-smiv2 {
    prefix "smiv2";
  }

  import ietf-yang-types {
    prefix "yang";
  }

  revision 2017-03-19 {
    description
     "Initial revision";
  }

  typedef InterfaceIndex {
    type int32 {
      range "1..2147483647";
    }
    smiv2:display-hint "d";
  }

  typedef InterfaceIndexOrZero {
    type int32 {
      range "0..2147483647";
    }
    smiv2:display-hint "d";
  }

  container IF-MIB {
    config false;

    container interfaces {
      smiv2:oid "1.3.6.1.2.1.2";

      leaf ifNumber {
        type int32;
        smiv2:max-access "read-only";
        smiv2:oid "1.3.6.1.2.1.2.1";
      }
    }

    container ifMIBObjects {
      smiv2:oid "1.3.6.1.2.1.31.1";

      leaf ifTableLastChange {
        type yang:timeticks;
        smiv2:max-access "read-only";
        smiv2:oid "1.3.6.1.2.1.31.1.5";
      }

      leaf ifStackLastChange {
        type yang:timeticks;
        smiv2:max-access "read-only";
        smiv2:oid "1.3.6.1.2.1.31.1.6";
      }
    }

    container ifTable {
      smiv2:oid "1.3.6.1.2.1.2.2";

      /* ONE key LIST */
      list ifEntry {
        key "ifIndex";
        smiv2:oid "1.3.6.1.2.1.2.2.1";

        leaf ifIndex {
          type if-mib:InterfaceIndex;
          smiv2:max-access "read-only";
          smiv2:oid "1.3.6.1.2.1.2.2.1.1";
        }

        leaf ifDescr {
          type snmpv2-tc:DisplayString {
            length "0..255";
          }
          smiv2:max-access "read-only";
          smiv2:oid "1.3.6.1.2.1.2.2.1.2";
        }

        leaf ifType {
          type ianaiftype-mib:IANAifType;
          smiv2:max-access "read-only";
          smiv2:oid "1.3.6.1.2.1.2.2.1.3";
        }

        leaf ifOutErrors {
          type yang:counter32;
          smiv2:max-access "read-only";
          smiv2:oid "1.3.6.1.2.1.2.2.1.4";
        }

        leaf ifAdminStatus {
          type enumeration {
            enum "up" {
              value "1";
            }
            enum "down" {
              value "2";
            }
            enum "testing" {
              value "3";
            }
          }
          smiv2:max-access "read-write";
          smiv2:oid "1.3.6.1.2.1.2.2.1.5";
        }
      }
    }

    container ifStackTable {
      smiv2:oid "1.3.6.1.2.1.31.1.2";

      /* TWO keys LIST */
      list ifStackEntry {
        key "ifStackHigherLayer ifStackLowerLayer";

        smiv2:oid "1.3.6.1.2.1.31.1.2.1";

        leaf ifStackHigherLayer {
          type uint32;
          smiv2:max-access "not-accessible";
          smiv2:oid "1.3.6.1.2.1.31.1.2.1.1";
        }

        leaf ifStackLowerLayer {
          type string;
          smiv2:max-access "not-accessible";
          smiv2:oid "1.3.6.1.2.1.31.1.2.1.2";
        }

        leaf ifStackStatus {
          type snmpv2-tc:RowStatus;
          smiv2:max-access "read-write";
          smiv2:oid "1.3.6.1.2.1.31.1.2.1.3";
        }
      }
    }

    container ifRcvAddressTable {
      smiv2:oid "1.3.6.1.2.1.31.1.4";

      /* TWO keys LIST, one is leafrefed */
      list ifRcvAddressEntry {
        key "ifIndex ifRcvAddressAddress";
        smiv2:oid "1.3.6.1.2.1.31.1.4.1";

        leaf ifIndex {
          type leafref {
            path "/if-mib:IF-MIB/if-mib:ifTable/if-mib:ifEntry/if-mib:ifIndex";
          }
        }

        leaf ifRcvAddressAddress {
          type yang:phys-address;
          smiv2:oid "1.3.6.1.2.1.31.1.4.1.1";
        }

        leaf ifRcvAddressStatus {
          type snmpv2-tc:RowStatus;
          smiv2:max-access "read-write";
          smiv2:oid "1.3.6.1.2.1.31.1.4.1.2";
        }

        leaf ifRcvAddressType {
          type enumeration {
            enum "other" {
              value "1";
            }
            enum "volatile" {
              value "2";
            }
            enum "nonVolatile" {
              value "3";
            }
          }
          smiv2:defval "volatile";
          smiv2:max-access "read-write";
          smiv2:oid "1.3.6.1.2.1.31.1.4.1.3";
        }
      }
    }
  }

  smiv2:alias "ifXTable" {
    smiv2:oid "1.3.6.1.2.1.31.1.1";
  }

  smiv2:alias "ifXEntry" {
    smiv2:oid "1.3.6.1.2.1.31.1.1.1";
  }

  augment "/if-mib:IF-MIB/if-mib:ifTable/if-mib:ifEntry" {
    smiv2:oid "1.3.6.1.2.1.31.1.1.1";

    leaf ifName {
      type snmpv2-tc:DisplayString;
      smiv2:max-access "read-only";
      smiv2:oid "1.3.6.1.2.1.31.1.1.1.1";
    }

    leaf ifInMulticastPkts {
      type yang:counter32;
      smiv2:max-access "read-only";
      smiv2:oid "1.3.6.1.2.1.31.1.1.1.2";
    }

    leaf ifHCInOctets {
      type yang:counter64;
      smiv2:max-access "read-only";
      smiv2:oid "1.3.6.1.2.1.31.1.1.1.3";
    }

    leaf ifLinkUpDownTrapEnable {
      type enumeration {
        enum "enabled" {
          value "1";
        }
        enum "disabled" {
          value "2";
        }
      }
      smiv2:max-access "read-write";
      smiv2:oid "1.3.6.1.2.1.31.1.1.1.4";
    }

    leaf ifHighSpeed {
      type yang:gauge32;
      smiv2:max-access "read-only";
      smiv2:oid "1.3.6.1.2.1.31.1.1.1.5";
    }

    leaf ifPromiscuousMode {
      type boolean;
      smiv2:max-access "read-write";
      smiv2:oid "1.3.6.1.2.1.31.1.1.1.6";
    }

    leaf ifConnectorPresent {
      type boolean;
      smiv2:max-access "read-only";
      smiv2:oid "1.3.6.1.2.1.31.1.1.1.7";
    }

    leaf ifAlias {
      type snmpv2-tc:DisplayString {
        length "0..64";
      }
      smiv2:max-access "read-write";
      smiv2:oid "1.3.6.1.2.1.31.1.1.1.8";
    }

    leaf ifCounterDiscontinuityTime {
      type yang:timestamp;
      smiv2:max-access "read-only";
      smiv2:oid "1.3.6.1.2.1.31.1.1.1.9";
    }
  }

  notification linkDown {
    smiv2:oid "1.3.6.1.6.3.1.1.5.3";

    container object-1 {

      leaf ifIndex {
        type leafref {
          path "/if-mib:IF-MIB/if-mib:ifTable/if-mib:ifEntry/if-mib:ifIndex";
        }
      }
    }

    container object-2 {

      leaf ifIndex {
        type leafref {
          path "/if-mib:IF-MIB/if-mib:ifTable/if-mib:ifEntry/if-mib:ifIndex";
        }
      }

      leaf ifAdminStatus {
        type leafref {
          path "/if-mib:IF-MIB/if-mib:ifTable/if-mib:ifEntry/if-mib:ifAdminStatus";
        }
      }
    }

    container object-3 {

      leaf ifIndex {
        type leafref {
          path "/if-mib:IF-MIB/if-mib:ifTable/if-mib:ifEntry/if-mib:ifIndex";
        }
      }
    }
  }

  notification linkUp {
    smiv2:oid "1.3.6.1.6.3.1.1.5.4";

    container object-1 {

      leaf ifIndex {
        type leafref {
          path "/if-mib:IF-MIB/if-mib:ifTable/if-mib:ifEntry/if-mib:ifIndex";
        }
      }
    }

    container object-2 {

      leaf ifIndex {
        type leafref {
          path "/if-mib:IF-MIB/if-mib:ifTable/if-mib:ifEntry/if-mib:ifIndex";
        }
      }

      leaf ifAdminStatus {
        type leafref {
          path "/if-mib:IF-MIB/if-mib:ifTable/if-mib:ifEntry/if-mib:ifAdminStatus";
        }
      }
    }

    container object-3 {

      leaf ifIndex {
        type leafref {
          path "/if-mib:IF-MIB/if-mib:ifTable/if-mib:ifEntry/if-mib:ifIndex";
        }
      }

    }
  }

  smiv2:alias "interfaces" {
    smiv2:oid "1.3.6.1.2.1.2";
  }

  smiv2:alias "ifMIB" {
    smiv2:oid "1.3.6.1.2.1.31";
  }

  smiv2:alias "ifMIBObjects" {
    smiv2:oid "1.3.6.1.2.1.31.1";
  }

  smiv2:alias "ifConformance" {
    smiv2:oid "1.3.6.1.2.1.31.2";
  }

  smiv2:alias "ifGroups" {
    smiv2:oid "1.3.6.1.2.1.31.2.1";
  }

  smiv2:alias "ifCompliances" {
    smiv2:oid "1.3.6.1.2.1.31.2.2";
  }

}
