huawei-mstp

Multiple spanning tree protocol.

  • Version: 2019-04-23

    huawei-mstp@2019-04-23


    
      module huawei-mstp {
    
        yang-version 1;
    
        namespace "urn:huawei:yang:huawei-mstp";
    
        prefix mstp;
    
        import huawei-ifm {
          prefix ifm;
        }
        import huawei-vlan {
          prefix vlan;
        }
        import huawei-ethernet {
          prefix ethernet;
        }
        import huawei-l2vpn {
          prefix l2vpn;
        }
        import huawei-pub-type {
          prefix pub-type;
        }
        import ietf-yang-types {
          prefix yang;
        }
        import huawei-extension {
          prefix ext;
        }
    
        organization
          "Huawei Technologies Co., Ltd.";
    
        contact
          "Huawei Industrial Base
         Bantian, Longgang
         Shenzhen 518129
         People's Republic of China
         Website: http://www.huawei.com
         Email: support@huawei.com";
    
        description
          "Multiple spanning tree protocol.";
    
        revision "2019-04-23" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "mstp";
    
        typedef bpdu-filter-type {
          type enumeration {
            enum "disable" {
              value 1;
              description
                "Disable the BPDU filter function.";
            }
            enum "enable" {
              value 2;
              description
                "Enable the BPDU filter function.";
            }
            enum "default" {
              value 3;
              description
                "The default BPDU filter function.";
            }
          }
          description "BPDU filter type.";
        }
    
        typedef compliance-type {
          type enumeration {
            enum "auto" {
              value 1;
              description
                "Indicates that the MST BPDU format is self-adaptive.";
            }
            enum "dot1s" {
              value 2;
              description
                "Indicates that the MST BPDU format is standard IEEE 802.1s.";
            }
            enum "legacy" {
              value 3;
              description
                "Indicates that the MST BPDU format is proprietary.";
            }
          }
          description "MSTP BPDU format type.";
        }
    
        typedef edge-port-type {
          type enumeration {
            enum "disable" {
              value 1;
              description
                "Set a port as a non-edge port.";
            }
            enum "enable" {
              value 2;
              description
                "Set a port as an edge port.";
            }
            enum "default" {
              value 3;
              description "Default port.";
            }
          }
          description "Edge port type.";
        }
    
        typedef stp-mode {
          type enumeration {
            enum "stp" {
              value 0;
              description
                "Spanning tree protocol mode.";
            }
            enum "rstp" {
              value 2;
              description
                "Rapid spanning tree protocol mode.";
            }
            enum "mstp" {
              value 3;
              description
                "Multiple ppanning tree protocol mode.";
            }
            enum "vbst" {
              value 4;
              description
                "VLAN-Based spanning tree protocol mode.";
            }
          }
          description "STP mode.";
        }
    
        typedef path-cost-standard-type {
          type enumeration {
            enum "dot1d-1998" {
              value 1;
              description
                "IEEE 802.1D standard used to calculate the path cost.";
            }
            enum "dot1t" {
              value 2;
              description
                "IEEE 802.1T standard used to calculate the path cost.";
            }
            enum "legacy" {
              value 3;
              description
                "Huawei legacy standard used to calculate the path cost.";
            }
          }
          description "Path Cost Standard.";
        }
    
        typedef point-to-point-type {
          type enumeration {
            enum "force-true" {
              value 1;
              description
                "The link type is a point to point link.";
            }
            enum "force-false" {
              value 2;
              description
                "The link type is not a point to point link.";
            }
            enum "auto" {
              value 3;
              description
                "The spanning tree protocol detects automatically whether the port is connected to a point to point link.";
            }
          }
          description "The link type of a port.";
        }
    
        typedef port-state-type {
          type enumeration {
            enum "down" {
              value 1;
              description "Down status.";
            }
            enum "disabled" {
              value 2;
              description "Disabled status.";
            }
            enum "forwarding" {
              value 3;
              description "Forwarding status.";
            }
            enum "learning" {
              value 4;
              description "Learning status.";
            }
            enum "discarding" {
              value 5;
              description "Discarding status.";
            }
            enum "inactive" {
              value 6;
              description "Inactive status.";
            }
          }
          description
            "The type of STP port state.";
        }
    
        typedef protection-type {
          type enumeration {
            enum "none" {
              value 1;
              description "No protection.";
            }
            enum "loopback" {
              value 2;
              description "Loopback detection.";
            }
            enum "bpdu-root" {
              value 3;
              description
                "BPDU and root protection.";
            }
            enum "root" {
              value 4;
              description "Root protection.";
            }
            enum "bpdu" {
              value 5;
              description "BPDU protection.";
            }
            enum "loop" {
              value 6;
              description "Loop protection.";
            }
          }
          description "STP protection type.";
        }
    
        typedef port-role-type {
          type enumeration {
            enum "disabled" {
              value 1;
              description "Inactive port.";
            }
            enum "alternate" {
              value 2;
              description "Alternate port.";
            }
            enum "backup" {
              value 3;
              description "Backup port.";
            }
            enum "root" {
              value 4;
              description "Root port.";
            }
            enum "designated" {
              value 5;
              description "Designated port.";
            }
            enum "master" {
              value 6;
              description "Master Port.";
            }
          }
          description "STP port role.";
        }
    
        typedef root-type {
          type enumeration {
            enum "normal" {
              value 1;
              description
                "Configure a device as a normal root bridge of a spanning tree.";
            }
            enum "primary" {
              value 2;
              description
                "Configure a device as a primary root bridge of a spanning tree.";
            }
            enum "secondary" {
              value 3;
              description
                "Configure a device as a secondary root bridge of a spanning tree.";
            }
          }
          description "STP root type.";
        }
    
        typedef converge-mode {
          type enumeration {
            enum "fast" {
              value 1;
              description
                "Set MSTP aging mode to fast.";
            }
            enum "normal" {
              value 2;
              description
                "Set MSTP aging mode to normal.";
            }
          }
          description "MSTP converge mode.";
        }
    
        grouping process-common {
          description
            "Common attributes of process.";
          leaf enable {
            type boolean;
            default "false";
            description
              "Enable/disable STP/RSTP/MSTP on a device.";
          }
    
          leaf bpdu-protection {
            type boolean;
            default "false";
            description
              "Enable/disable to configure BPDU protection on an edge port. This function prevents network flapping caused by attack packets.";
          }
    
          leaf flush-capability {
            type boolean;
            default "true";
            description
              "Enable/disable to flush capability on a switch.";
          }
    
          leaf max-hops {
            type uint16 {
              range "1..40";
            }
            default "20";
            description
              "Set the maximum hops of a spanning tree in an MST region.";
          }
    
          leaf mode {
            type stp-mode;
            default "mstp";
            description
              "Set an operation mode for the current MSTP process.";
          }
    
          leaf path-cost-standard {
            type path-cost-standard-type;
            default "dot1t";
            description
              "Set a standard for calculating the path cost.";
          }
    
          leaf tc-protection {
            type boolean;
            default "false";
            description
              "Enable/disable to configure the TC BPDU protection function for an MSTP process.";
          }
    
          leaf tc-protection-threshold {
            type uint32 {
              range "1..255";
            }
            default "1";
            description
              "Set the maximum number of TC BPDUs that the MSTP can handle.";
          }
    
          leaf tc-protection-interval {
            type uint16 {
              range "1..600";
            }
            units "s";
            description
              "Set the time the MSTP device takes to handle the maximum number of TC BPDUs and immediately refresh forwarding entries.";
          }
    
          leaf timer-factor {
            type uint8 {
              range "1..10";
            }
            default "3";
            description
              "Set a multiplier for the Hello timer. If a device does not receive BPDUs from an upstream device within the timeout period (timeout period = hello time x 3 x timer factor), the spanning tree is calculated again.";
          }
    
          leaf region-name {
            ext:dynamic-default;
            type string {
              length "1..32";
            }
            description
              "Configure an MST region name for a device.";
          }
    
          leaf revision-level {
            type uint16 {
              range "0..65535";
            }
            default "0";
            description
              "Configure a revision level for an MST region.";
          }
    
          leaf forward-delay {
            type uint16 {
              range "400..3000";
            }
            units "10 ms";
            must
              "(../forward-delay) mod 100 = 0";
            default "1500";
            description
              "Set the value of the forward delay. The step is 1000ms.";
          }
    
          leaf hello-time {
            type uint16 {
              range "100..1000";
            }
            units "10 ms";
            must "(../hello-time) mod 100 = 0";
            default "200";
            description
              "Set the interval at which BPDUs are sent. The step is 1000ms.";
          }
    
          leaf max-age {
            type uint16 {
              range "600..4000";
            }
            units "10 ms";
            must "(../max-age) mod 100 = 0";
            default "2000";
            description
              "Set the BPDU aging time on a port of a device. The step is 1000ms.";
          }
        }  // grouping process-common
    
        grouping instance-common {
          description
            "Common attributes of instance.";
          leaf priority {
            when "../root-type='normal'";
            type uint32 {
              range "0..61440";
            }
            must "(../priority) mod 4096 = 0";
            default "32768";
            description
              "Set the priority of a device in a spanning tree instance. The default step is 4096, that is, the device can have 16 priorities configured, such as 0, 4096, and 8192. A smaller value indicates a higher priority.";
          }
    
          leaf root-type {
            type root-type;
            default "normal";
            description
              "Configure the current device as the root bridge of a spanning tree instance.";
          }
        }  // grouping instance-common
    
        grouping process-instance {
          description
            "Configuration of instance.";
          container default-instance {
            description "Configure instance.";
            uses instance-common;
    
            leaf vlan-mapping {
              type pub-type:vlan-range;
              config false;
              description
                "VLAN mappings in instance 0.";
            }
          }  // container default-instance
    
          container instances {
            description
              "List of configurations of process instance.";
            list instance {
              must
                "(priority and priority!=32768) or (root-type and root-type!='normal') or vlan-mapping";
              key "id";
              description
                "Configure process instance.";
              leaf id {
                type uint32 {
                  range "1..4094";
                }
                description "Instance ID.";
              }
    
              uses instance-common;
    
              leaf vlan-mapping {
                type pub-type:vlan-range;
                description
                  "VLAN mappings in instance.";
              }
            }  // list instance
          }  // container instances
    
          container cist-info {
            config false;
            description "Statistics of stp.";
            leaf bridge-id {
              type string {
                length "1..64";
              }
              description
                "Common and internal spanning tree (CIST) bridge ID.";
            }
    
            leaf root-id {
              type string {
                length "1..64";
              }
              description "CIST root bridge ID.";
            }
    
            leaf erpc-cost {
              type uint32;
              description
                "Cost of the external path from the switch to the CIST root bridge.";
            }
    
            leaf regroot-id {
              type string {
                length "1..64";
              }
              description
                "ID of the CIST region root bridge.";
            }
    
            leaf irpc-cost {
              type uint32;
              description
                "Cost of the internal path from the switch to the CIST region root bridge.";
            }
    
            leaf active-hello-time {
              type uint16 {
                range "1..10";
              }
              units "s";
              description
                "BPDUs parameters hello-time is being used.";
            }
    
            leaf active-max-age {
              type uint16 {
                range "6..40";
              }
              units "s";
              description
                "BPDUs parameters max-age is being used.";
            }
    
            leaf active-forward-delay {
              type uint16 {
                range "4..30";
              }
              units "s";
              description
                "BPDUs parameters forward-delay is being used.";
            }
    
            leaf active-max-hops {
              type uint16 {
                range "1..40";
              }
              description
                "BPDUs parameters max-hops is being used.";
            }
    
            leaf root-port-id {
              type string {
                length "1..32";
              }
              description
                "ID of the CIST root port.";
            }
    
            leaf tc-tcn-receive-num {
              type uint32;
              description
                "Number of received TC or TCN BPDUs.";
            }
    
            leaf tc-count-pre-hello {
              type uint32;
              description
                "Number of TC BPDUs received each Hello time.";
            }
    
            leaf last-change-interval {
              type string {
                length "1..128";
              }
              description
                "Time past since the last topology changed.";
            }
    
            leaf tc-number {
              type uint32;
              description
                "Number of topology changes.";
            }
    
            leaf is-topo-changed {
              type boolean;
              description
                "Whether the topology is changed.";
            }
          }  // container cist-info
    
          container msti-infos {
            config false;
            description "List of STP msti-info.";
            list msti-info {
              key "instance-id";
              description
                "Statistics of msti-info.";
              leaf instance-id {
                type uint32 {
                  range "1..4094";
                }
                description "Instance ID.";
              }
    
              leaf bridge-id {
                type string {
                  length "1..64";
                }
                description
                  "Common and internal spanning tree (CIST) bridge ID.";
              }
    
              leaf reg-root-id {
                type string {
                  length "1..32";
                }
                description
                  "Region root bridge ID.";
              }
    
              leaf root-port-id {
                type string {
                  length "1..32";
                }
                description
                  "ID of the CIST root port.";
              }
    
              leaf master-bridge {
                type string {
                  length "1..64";
                }
                description
                  "ID of the bridge where the master interface resides.";
              }
    
              leaf irpc-cost {
                type uint32;
                description
                  "Cost of the internal path from the switch to the CIST region root bridge.";
              }
    
              leaf cost-to-master {
                type uint32;
                description
                  "Cost of the path from the switch to the bridge where the master interface resides.";
              }
    
              leaf tc-receive-num {
                type uint32;
                description
                  "Number of received TC BPDUs.";
              }
    
              leaf tc-count-pre-hello {
                type uint32;
                description
                  "Number of TC BPDUs received each Hello time.";
              }
    
              leaf last-change-interval {
                type string {
                  length "1..128";
                }
                description
                  "Time past since the last topology changed.";
              }
    
              leaf last-change-occurred {
                type string {
                  length "1..128";
                }
                description "Last TC occurred.";
              }
    
              leaf tc-number {
                type uint32;
                description
                  "Number of topology changes.";
              }
    
              leaf is-topo-changed {
                type boolean;
                description
                  "Whether the topology is changed.";
              }
            }  // list msti-info
          }  // container msti-infos
    
          container interface-bpdu-statistics {
            config false;
            description
              "List of statistics about sent and received topology change (TC) and topology change notification (TCN) BPDUs on interfaces.";
            list interface-bpdu-statistic {
              key "instance-id port-name";
              description
                "Statistics of sent and received topology change (TC) and topology change notification (TCN) BPDUs on interfaces.";
              leaf instance-id {
                type uint32 {
                  range "0..4094";
                }
                description "STP instance id.";
              }
    
              leaf port-name {
                type leafref {
                  path
                    "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                }
                description "Port name.";
              }
    
              leaf tc-send {
                type uint32;
                description
                  "Statistics about sent TC BPDUs.";
              }
    
              leaf tc-receive {
                type uint32;
                description
                  "Statistics about receive TC BPDUs.";
              }
    
              leaf tc-discard {
                type uint32;
                description
                  "Statistics about discard TC BPDUs.";
              }
    
              leaf tcn-send {
                type uint32;
                description
                  "Statistics about sent TCN BPDUs.";
              }
    
              leaf tcn-receive {
                type uint32;
                description
                  "Statistics about receive TCN BPDUs.";
              }
    
              leaf tcn-discard {
                type uint32;
                description
                  "Statistics about discard TCN BPDUs.";
              }
            }  // list interface-bpdu-statistic
          }  // container interface-bpdu-statistics
    
          container pw-bpdu-statistics {
            config false;
            description
              "List of statistics about sent and received topology change (TC) and topology change notification (TCN) BPDUs on interfaces.";
            list pw-bpdu-statistic {
              key "instance-id pw-name vsi-name";
              description
                "Statistics of sent and received topology change (TC) and topology change notification (TCN) BPDUs on interfaces.";
              leaf instance-id {
                type uint32 {
                  range "0..4094";
                }
                description "STP instance id.";
              }
    
              leaf pw-name {
                type string {
                  length "1..63";
                }
                description "PW name.";
              }
    
              leaf vsi-name {
                type string {
                  length "1..63";
                }
                description "VSI name.";
              }
    
              leaf tc-send {
                type uint32;
                description
                  "Statistics about sent TC BPDUs.";
              }
    
              leaf tc-receive {
                type uint32;
                description
                  "Statistics about receive TC BPDUs.";
              }
    
              leaf tc-discard {
                type uint32;
                description
                  "Statistics about discard TC BPDUs.";
              }
    
              leaf tcn-send {
                type uint32;
                description
                  "Statistics about sent TCN BPDUs.";
              }
    
              leaf tcn-receive {
                type uint32;
                description
                  "Statistics about receive TCN BPDUs.";
              }
    
              leaf tcn-discard {
                type uint32;
                description
                  "Statistics about discard TCN BPDUs.";
              }
            }  // list pw-bpdu-statistic
          }  // container pw-bpdu-statistics
        }  // grouping process-instance
    
        grouping port-pw-common {
          description
            "Common attributes of port and PW.";
          leaf enable {
            type boolean;
            default "false";
            description
              "Enable/disable STP/RSTP/MSTP on PW.";
          }
    
          leaf compliance {
            type compliance-type;
            default "auto";
            description
              "Configures the format of MST BPDUs received and sent.";
          }
    
          leaf digest-snooping {
            type boolean;
            default "false";
            description
              "Enable/disable digest snooping.";
          }
    
          leaf loop-protection {
            type boolean;
            default "false";
            description
              "Enable/disable loop protection on the current port.";
          }
    
          leaf no-agreement-check {
            type boolean;
            default "false";
            description
              "Enable/disable to configure the common fast transition mechanism on the current interface.";
          }
    
          leaf point-to-point {
            type point-to-point-type;
            default "auto";
            description
              "Set the link type of a port.";
          }
    
          leaf root-protection {
            type boolean;
            must
              "../loop-protection='false' or ../root-protection='false'";
            default "false";
            description
              "Enable/disable root protection on the current port.";
          }
    
          leaf transmit-limit {
            type uint16 {
              range "1..255";
            }
            description
              "Set the maximum number of BPDUs sent by the current port within each hello interval.";
          }
    
          leaf tc-restriction {
            type boolean;
            default "false";
            description
              "Enable/disable to configure TC/TCN packet suppression.";
          }
        }  // grouping port-pw-common
    
        grouping port-common {
          description
            "Common attributes of port.";
          uses port-pw-common;
    
          leaf bpdu-filter {
            type bpdu-filter-type;
            default "default";
            description
              "Specify the current port as a BPDU filter port or a non-BPDU filter port.";
          }
    
          leaf edge-port {
            type edge-port-type;
            default "default";
            description
              "Specify the current port as an edge port or a non-edge port.";
          }
    
          leaf vpls-sub-interface {
            type boolean;
            default "false";
            description
              "Enable/disable to configure an interface to instruct its VPLS-bound sub-interfaces to update ARP and MAC entries after the interface receives TC BPDUs.";
          }
    
          leaf deny-vlans {
            when "../enable = 'true'";
            type pub-type:vlan-range;
            description
              "The BPDUs that carries the VLAN is discarded. A maximum of 16 VLAN IDs can be configured in the same interface.";
          }
        }  // grouping port-common
    
        grouping port-permit-mac {
          description
            "Configurations of port permit mac-address.";
          container permit-macs {
            when "../enable = 'true'";
            description
              "List of allowing the BPDUs to be carried with this MAC through.";
            list permit-mac {
              key "mac";
              max-elements 16;
              description
                "Configure the BPDUs to be carried with this MAC through.";
              leaf mac {
                type pub-type:mac-address;
                description "MAC address.";
              }
    
              leaf mask {
                type pub-type:mac-address;
                mandatory true;
                description "MAC mask.";
              }
            }  // list permit-mac
          }  // container permit-macs
        }  // grouping port-permit-mac
    
        grouping port-instance-common {
          description
            "Instance attributes of port.";
          leaf cost {
            type uint32 {
              range "1..200000000";
            }
            must
              "(current()<=65535 and ((../process-id=0 and /mstp:mstp/mstp:default-process/mstp:path-cost-standard='dot1d-1998') or (../process-id!=0 and /mstp:mstp/mstp:processs/mstp:process[mstp:id=current()/../process-id]/mstp:path-cost-standard='dot1d-1998'))) or (current()<=200000 and ((../process-id=0 and /mstp:mstp/mstp:default-process/mstp:path-cost-standard='legacy') or (../process-id!=0 and /mstp:mstp/mstp:processs/mstp:process[mstp:id=current()/../process-id]/mstp:path-cost-standard='legacy'))) or (current()<=200000000 and ((../process-id=0 and /mstp:mstp/mstp:default-process/mstp:path-cost-standard='dot1t') or (../process-id!=0 and /mstp:mstp/mstp:processs/mstp:process[mstp:id=current()/../process-id]/mstp:path-cost-standard='dot1t')))";
            description
              "Set the path cost for the spanning tree port. The value range varies with path cost calculation standards: 1 to 200,000 for the Huawei legacy standard, 1 to 65535 for the IEEE 802.1D standard, and 1 to 200,000,000 for the IEEE 802.1t standard.";
          }
    
          leaf priority {
            type uint16 {
              range "0..240";
            }
            must "(../priority) mod 16 = 0";
            default "128";
            description
              "Set the priority for the spanning tree port. The default step is 16, that is, the device can have 16 priorities configured, such as 0, 16, 32 and 240.";
          }
        }  // grouping port-instance-common
    
        grouping port-process-instance {
          description
            "Process instance attributes of port.";
          container process-instances {
            description
              "List of process instances.";
            list process-instance {
              must
                "count(../mstp:process-instance[mstp:process-id=current()/process-id])<=65";
              key "process-id instance-id";
              description
                "Configure MSTP attribute of process instance.";
              leaf process-id {
                type uint32 {
                  range "0..256";
                }
                description
                  "MSTP process ID. 0 means default process.";
              }
    
              leaf instance-id {
                type uint32 {
                  range "0..4094";
                }
                description
                  "Instance ID. 0 means default instance.";
              }
    
              uses port-instance-common;
            }  // list process-instance
          }  // container process-instances
        }  // grouping port-process-instance
    
        grouping pw-process-attribute {
          description
            "Process attributes of pw.";
          container processes {
            description "List of processes.";
            list process {
              key "process-id";
              description
                "Configure MSTP attribute of process.";
              leaf process-id {
                type uint32 {
                  range "0..256";
                }
                description
                  "MSTP process ID. 0 means default process.";
              }
    
              uses port-instance-common;
            }  // list process
          }  // container processes
        }  // grouping pw-process-attribute
    
        grouping mstp-tc {
          description
            "Configurations of port STP TC BPDUs.";
          leaf tc-notify-bd {
            when "../enable = 'true'";
            type boolean;
            default "false";
            description
              "Enable/disable to configure an interface to instruct its bridge-domain member to update ARP and MAC entries after the interface receives TC BPDUs.";
          }
    
          container tc-snooping {
            description
              "Configure an interface to snoop STP TC BPDUs.";
            leaf enable {
              type boolean;
              must
                "current() = 'false' or ../../enable = 'false'";
              default "false";
              description
                "Enable/disable to configure an interface to snoop STP TC BPDUs.";
            }
    
            choice notify-bd {
              description
                "Configure an interface to instruct its BD-bound sub-interfaces to update ARP and MAC entries in time after receiving STP TC BPDUs.";
              case default-process {
                description
                  "Configure an interface to instruct its BD-bound sub-interfaces to update ARP and MAC entries according to the VLAN under process 0 in time after receiving STP TC BPDUs.";
                leaf notify-bd-default-process {
                  when "../enable = 'true'";
                  type empty;
                  description
                    "Enable/disable to configure an interface to instruct its BD-bound sub-interfaces to update ARP and MAC entries according to the VLAN under process 0.";
                }
              }  // case default-process
    
              case process {
                description
                  "Configure an interface to instruct its BD-bound sub-interfaces to update ARP and MAC entries according to the VLAN under specified process in time after receiving STP TC BPDUs.";
                leaf notify-bd-process {
                  when "../enable = 'true'";
                  type leafref {
                    path "/mstp:mstp/mstp:processs/mstp:process/mstp:id";
                  }
                  description
                    "Specify the process id.";
                }
              }  // case process
            }  // choice notify-bd
          }  // container tc-snooping
        }  // grouping mstp-tc
    
        grouping port-process {
          description "MSTP port process.";
          container process {
            when "../enable = 'true'";
            description
              "Configure port process ID.";
            leaf process-id {
              type leafref {
                path "/mstp:mstp/mstp:processs/mstp:process/mstp:id";
              }
              description "MSTP process ID.";
            }
    
            leaf-list link-share-process {
              type leafref {
                path "/mstp:mstp/mstp:processs/mstp:process/mstp:id";
              }
              must
                "not(../process-id) or ../link-share-process != ../process-id";
              description
                "Configure port link-share process ID.";
            }
          }  // container process
        }  // grouping port-process
    
        container mstp {
          description
            "Multiple spanning tree protocol.";
          container global {
            description
              "Configure MSTP global attributes.";
            leaf bpdu-filter {
              type boolean;
              default "false";
              description
                "Enable/disable to default configuration of the BPDU filter function.";
            }
    
            leaf edge-port {
              type boolean;
              default "false";
              description
                "Enable/disable default configuration of global edge port function.";
            }
    
            leaf bridge-address {
              type pub-type:mac-address {
                pattern
                  '[0-9a-f][02468ace][0-9a-f]{2}(-[0-9a-f]{4}){2}';
              }
              description "Bridge MAC address.";
            }
    
            leaf transmit-limit {
              type uint16 {
                range "1..255";
              }
              default "6";
              description
                "Maximum number of BPDUs allowed to be sent globally within a hello interval.";
            }
    
            leaf vstp-enable {
              type boolean;
              default "false";
              description
                "Enable/disable V-STP function.";
            }
          }  // container global
    
          container default-process {
            description
              "Configure default MSTP process.";
            uses process-common;
    
            leaf converge-mode {
              type converge-mode;
              default "normal";
              description
                "MSTP convergence mode.";
            }
    
            uses process-instance {
              refine instances/instance/vlan-mapping {
                must
                  "not(/vlan:vlan/vlan:instances/vlan:instance)";
              }
            }
          }  // container default-process
    
          container processs {
            description
              "List of MSTP processes.";
            list process {
              key "id";
              description
                "Configure MSTP process.";
              leaf id {
                type uint32 {
                  range "1..256";
                }
                description "MSTP process ID.";
              }
    
              uses process-common;
    
              leaf tc-notify {
                type boolean;
                default "false";
                description
                  "Enable/disable the TC notification function on the current MSTP process.";
              }
    
              leaf link-share-protect {
                type boolean;
                default "false";
                description
                  "Enable/disable to configure shared-link protection for an MSTP process.";
              }
    
              uses process-instance {
                refine instances/instance/vlan-mapping {
                  must
                    "not(/vlan:vlan/vlan:instances/vlan:instance)";
                }
              }
            }  // list process
          }  // container processs
    
          container error-packet-statistic {
            config false;
            description
              "Operational state of displaying error packet information, including error packet statistics, packet contents and receiving time.";
            leaf time {
              type yang:date-and-time;
              description
                "Display the last time when error packets were received.";
            }
    
            leaf count {
              type uint32;
              description
                "Display the statistics about error packets received by MSTP.";
            }
    
            leaf content {
              type string {
                length "0..4500";
              }
              description
                "Display the contents of received error packets.";
            }
          }  // container error-packet-statistic
        }  // container mstp
    
        rpc defalut-process-mcheck {
          ext:node-ref "/mstp:mstp/mstp:default-process";
          description
            "Configure all ports bound to the default MSTP process to automatically switch back to the RSTP/MSTP mode.";
        }  // rpc defalut-process-mcheck
    
        rpc process-mcheck {
          ext:node-ref "/mstp:mstp/mstp:processs/mstp:process";
          description
            "Configure all ports bound to the current MSTP process to automatically switch back to the RSTP/MSTP mode.";
          input {
            leaf process-id {
              type leafref {
                path "/mstp:mstp/mstp:processs/mstp:process/mstp:id";
              }
              mandatory true;
              description "MSTP process ID.";
            }
          }
        }  // rpc process-mcheck
    
        rpc port-mcheck {
          ext:node-ref "/ifm:ifm/ifm:interfaces/ifm:interface/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/mstp:mstp-attribute";
          ext:node-ref "/ifm:ifm/ifm:interfaces/ifm:interface/ethernet:ethernet/ethernet:main-interface/mstp:mstp-attribute";
          description
            "Configure the current port to automatically switch back to the RSTP/MSTP mode.";
          input {
            leaf if-name {
              type leafref {
                path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
              }
              mandatory true;
              description "Interface name.";
            }
          }
        }  // rpc port-mcheck
    
        rpc pw-mcheck {
          ext:node-ref "/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:ldp-signaling/l2vpn:pws/l2vpn:pw/mstp:mstp-attribute";
          description
            "Configure the current PW to automatically switch back to the RSTP/MSTP mode.";
          input {
            leaf vsi-name {
              type leafref {
                path "/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:name";
              }
              mandatory true;
              description "VSI name.";
            }
    
            leaf pw-name {
              type leafref {
                path "/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:ldp-signaling/l2vpn:pws/l2vpn:pw/l2vpn:name";
              }
              mandatory true;
              description "PW name.";
            }
          }
        }  // rpc pw-mcheck
    
        rpc set-default-process-bridge-diameter {
          ext:node-ref "/mstp:mstp/mstp:default-process";
          description
            "The device will automatically set proper values for hello time, forward delay, and max age based on the configured network diameter.";
          input {
            leaf bridge-diameter {
              type uint8 {
                range "2..7";
              }
              description "Bridge diameter.";
            }
          }
        }  // rpc set-default-process-bridge-diameter
    
        rpc unset-default-process-bridge-diameter {
          ext:node-ref "/mstp:mstp/mstp:default-process";
          description
            "The device will not automatically set proper values for hello time, forward delay, and max age based on the configured network diameter.";
        }  // rpc unset-default-process-bridge-diameter
    
        rpc set-process-bridge-diameter {
          ext:node-ref "/mstp:mstp/mstp:processs/mstp:process";
          description
            "The device will automatically set proper values for hello time, forward delay, and max age based on the configured network diameter.";
          input {
            leaf process-id {
              type leafref {
                path "/mstp:mstp/mstp:processs/mstp:process/mstp:id";
              }
              mandatory true;
              description "MSTP process ID.";
            }
    
            leaf bridge-diameter {
              type uint8 {
                range "2..7";
              }
              mandatory true;
              description "Bridge diameter.";
            }
          }
        }  // rpc set-process-bridge-diameter
    
        rpc unset-process-bridge-diameter {
          ext:node-ref "/mstp:mstp/mstp:processs/mstp:process";
          description
            "The device will not automatically set proper values for hello time, forward delay, and max age based on the configured network diameter.";
          input {
            leaf process-id {
              type leafref {
                path "/mstp:mstp/mstp:processs/mstp:process/mstp:id";
              }
              mandatory true;
              description "MSTP process ID.";
            }
          }
        }  // rpc unset-process-bridge-diameter
    
        augment /ifm:ifm/ifm:interfaces/ifm:interface/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute {
          description
            "MSTP attribute on layer 2 port.";
          container mstp-attribute {
            description
              "Configure MSTP attribute on layer 2 port.";
            uses port-common {
              refine enable {
                default "true";
                description
                  "Enable/disable STP/RSTP/MSTP on layer 2 port.";
              }
            }
    
            uses port-permit-mac;
    
            uses mstp-tc;
    
            uses port-process;
          }  // container mstp-attribute
    
          container mstp-process-attribute {
            description
              "Configure MSTP process attribute on layer 2 port.";
            uses port-process-instance;
          }  // container mstp-process-attribute
        }
    
        augment /ifm:ifm/ifm:interfaces/ifm:interface/ethernet:ethernet/ethernet:main-interface {
          when "not(ethernet:l2-attribute)";
          description
            "MSTP attribute on layer 3 port.";
          container mstp-attribute {
            presence "MSTP attribute";
            description
              "Configure MSTP attribute on layer 3 port. The container must have non-default attributes. If you want to change all attributes to the default attributes, delete the container.";
            uses port-common {
              refine enable {
                description
                  "Enable/disable STP/RSTP/MSTP on layer 3 port.";
              }
            }
    
            uses port-permit-mac;
    
            uses mstp-tc;
    
            uses port-process;
          }  // container mstp-attribute
    
          container mstp-process-attribute {
            description
              "Configure MSTP process attribute on layer 3 port.";
            uses port-process-instance;
          }  // container mstp-process-attribute
        }
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:ldp-signaling/l2vpn:pws/l2vpn:pw {
          description "MSTP attribute on PW.";
          container mstp-attribute {
            when "../l2vpn:name";
            description
              "Configure MSTP attribute on PW.";
            uses port-pw-common;
    
            leaf deny-vlans {
              when "../enable = 'true'";
              type pub-type:vlan-range;
              description
                "The BPDUs that carries the VLAN is discarded. A maximum of 16 VLAN IDs can be configured in the same PW.";
            }
    
            uses port-permit-mac;
    
            uses port-process;
          }  // container mstp-attribute
    
          container mstp-process-attribute {
            when "../l2vpn:name";
            description
              "Configure MSTP process attribute on pw.";
            uses pw-process-attribute;
          }  // container mstp-process-attribute
        }
      }  // module huawei-mstp
    

© 2023 YumaWorks, Inc. All rights reserved.