huawei-mac

MAC address forwarding.

  • Version: 2020-08-07

    huawei-mac@2020-08-07


    
      module huawei-mac {
    
        yang-version 1;
    
        namespace "urn:huawei:yang:huawei-mac";
    
        prefix mac;
    
        import huawei-pub-type {
          prefix pub-type;
        }
        import ietf-inet-types {
          prefix inet;
        }
        import huawei-ifm {
          prefix ifm;
        }
        import huawei-vlan {
          prefix vlan;
        }
        import huawei-bd {
          prefix bd;
        }
        import huawei-ethernet {
          prefix ethernet;
        }
        import huawei-l2vpn {
          prefix l2vpn;
        }
        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 "MAC address forwarding.";
    
        revision "2020-08-07" {
          description
            "Modify uni-suppressions condition.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-04-16" {
          description "Modify description.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-03-13" {
          description "Modify description.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-07-08" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "mac";
    
        typedef mac-type {
          type enumeration {
            enum "static" {
              value 0;
              description "Static type.";
            }
            enum "black-hole" {
              value 1;
              description "Blackhole type.";
            }
            enum "dynamic" {
              value 2;
              description "Dynamic type.";
            }
            enum "sticky" {
              value 3;
              description "Sticky type.";
            }
            enum "mux" {
              value 4;
              description "Mux type.";
            }
            enum "security" {
              value 5;
              description "Security type.";
            }
            enum "snooping" {
              value 6;
              description "Snooping type.";
            }
            enum "tunnel" {
              value 7;
              description "Tunnel type.";
            }
            enum "evn" {
              value 9;
              description
                "EVN MAC address entry.";
            }
            enum "authen" {
              value 10;
              description
                "Authen MAC address entry.";
            }
            enum "dynamic-black-hole" {
              value 15;
              description
                "Dynamic blackhole MAC.";
            }
            enum "ovsdb" {
              value 14;
              description
                "Ovsdb MAC address entry.";
            }
            enum "sticky-static" {
              value 17;
              description
                "Sticky or static type learned from remote end.";
            }
          }
          description "MAC type.";
        }
    
        typedef vsi-mac-out-type {
          type enumeration {
            enum "ac" {
              value 0;
              description "AC type.";
            }
            enum "pw" {
              value 1;
              description "PW type.";
            }
          }
          description "VSI MAC direction.";
        }
    
        typedef pw-role-type {
          type enumeration {
            enum "master" {
              value 1;
              description "Master type.";
            }
            enum "slave" {
              value 2;
              description "Slave type.";
            }
            enum "null" {
              value 0;
              description "Null type.";
            }
          }
          description "PW role type.";
        }
    
        typedef suppress-type {
          type enumeration {
            enum "broadcast" {
              value 0;
              description "Broadcast type.";
            }
            enum "multicast" {
              value 1;
              description "Multicast type.";
            }
            enum "unknown-unicast" {
              value 2;
              description
                "Unknown unicast type.";
            }
          }
          description "Suppress type.";
        }
    
        typedef vsi-direction-type {
          type enumeration {
            enum "uni-inbound" {
              value 0;
              description "UNI inbound.";
            }
            enum "uni-outbound" {
              value 1;
              description "UNI outbound.";
            }
          }
          description "Direction type.";
        }
    
        typedef mac-limit-forward {
          type enumeration {
            enum "discard" {
              value 0;
              description "Discard type.";
            }
            enum "forward" {
              value 1;
              description "Forward type.";
            }
          }
          description "MAC limit forward type.";
        }
    
        typedef mac-enable-status {
          type enumeration {
            enum "disable" {
              value 0;
              description "Disable type.";
            }
            enum "enable" {
              value 1;
              description "Enable type.";
            }
          }
          description "MAC Enable type.";
        }
    
        typedef direction-type {
          type enumeration {
            enum "inbound" {
              value 0;
              description "Inbound type.";
            }
            enum "outbound" {
              value 1;
              description "Outbound type.";
            }
          }
          description "Direction type.";
        }
    
        typedef discard-type {
          type enumeration {
            enum "broadcast-discard" {
              value 0;
              description
                "Discard broadcast packets.";
            }
            enum "unknown-multicast-discard" {
              value 1;
              description
                "Discard unknown multicast packets.";
            }
            enum "unknown-unicast-discard" {
              value 2;
              description
                "Discard Unknown unicast packets.";
            }
          }
          description "Discard type.";
        }
    
        typedef broadcast-type {
          type enumeration {
            enum "VLAN" {
              value 1;
              description "VLAN type.";
            }
            enum "VSI" {
              value 2;
              description "VSI type.";
            }
            enum "BD" {
              value 4;
              description "BD type.";
            }
            enum "EVPN" {
              value 5;
              description "EVPN type.";
            }
          }
          description "Boardcast type.";
        }
    
        grouping pw-mac-suppression {
          description "PW MAC suppression.";
          list suppression {
            must "cir<=cbs";
            key "type";
            description
              "Configure PW traffic suppression.";
            leaf type {
              type suppress-type;
              description
                "Traffic suppression type.";
            }
    
            leaf cir {
              type uint64 {
                range "100..4294967295";
              }
              units "kbit/s";
              mandatory true;
              description "CIR value.";
            }
    
            leaf cbs {
              ext:dynamic-default {
                ext:default-value "10000" {
                  when "../cir <= 10000";
                  description "When cir less than 10000kbit/s,the default value is 10000 Byte.";
                }
                ext:default-value "cir" {
                  when "../cir > 10000";
                  description "When cir more than 10000kbit/s,the default value is the same as the value of cir.";
                }
              }
              type uint64 {
                range "100..4294967295";
              }
              units "Byte";
              description
                "CBS value. If user does not specify this value, the system will calc a value by CIR value.";
            }
          }  // list suppression
        }  // grouping pw-mac-suppression
    
        container mac {
          description "MAC address forwarding.";
          container global-attribute {
            description
              "Configure MAC global attribute.";
            leaf age-time-enable {
              type mac-enable-status;
              default "enable";
              description
                "Whether MAC address aging is enabled.";
            }
    
            leaf aging-time {
              when "../age-time-enable='enable'";
              type uint32 {
                range "60..1000000";
              }
              units "s";
              default "300";
              description "Aging time.";
            }
          }  // container global-attribute
    
          container global-mac-usage {
            description
              "Configure global MAC address table usage.";
            leaf mac-threshold {
              type uint32 {
                range "1..99";
              }
              units "%";
              default "90";
              description
                "The usage threshold of a MAC address table.";
            }
          }  // container global-mac-usage
    
          container mac-usages {
            description
              "List of MAC address table usage.";
            list mac-usage {
              key "slot";
              description
                "Configure MAC address table usage.";
              leaf slot {
                type string {
                  length "1..32";
                }
                description "Slot number.";
              }
    
              leaf mac-threshold {
                type uint32 {
                  range "1..99";
                }
                units "%";
                mandatory true;
                description
                  "The usage threshold of a MAC address table.";
              }
            }  // list mac-usage
          }  // container mac-usages
    
          container mac-limit-rules {
            description
              "List of global MAC address learning limit rule.";
            list mac-limit-rule {
              key "name";
              description
                "Configure global MAC address learning limit.";
              leaf name {
                type string {
                  length "1..31";
                }
                description
                  "Global MAC address learning limit rule name.";
              }
    
              leaf maximum {
                type uint32 {
                  range "0..131072";
                }
                must
                  "not(../rate=0) or (../rate=0 and ../maximum>0)";
                mandatory true;
                description
                  "Maximum number of MAC addresses that can be learned. The value 0 means unlimited.";
              }
    
              leaf rate {
                type uint16 {
                  range "0..1000";
                }
                units "ms";
                must
                  "not(../maximum=0) or (../maximum=0 and ../rate>0)";
                default "0";
                description
                  "Interval at which MAC addresses are learned. The value 0 indicates that no rate limit is set.";
              }
    
              leaf action {
                type mac-limit-forward;
                default "discard";
                description
                  "Discard or forward after the number of learned MAC addresses reaches the maximum number.";
              }
    
              leaf alarm {
                type mac-enable-status;
                default "enable";
                description
                  "Whether an alarm is generated after the number of learned MAC addresses reaches the maximum number.";
              }
            }  // list mac-limit-rule
          }  // container mac-limit-rules
    
          container global-blackhole-macs {
            description
              "List of global blackhole mac-addresses.";
            list global-blackhole-mac {
              key "address";
              max-elements 32;
              description
                "Configure global blackhole mac-address entry.";
              leaf address {
                type pub-type:mac-address {
                  pattern
                    "[0-9a-f][0|2|4|6|8|a|c|e][0-9a-f]{2}(-[0-9a-f]{4}){2}";
                }
                must
                  "'0000-0000-0000'!=current() and /bd:bd/bd:instances/bd:instance/mac:mac-addresss/mac:mac-address[mac:address!=current()] and /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/mac:mac/mac:mac-addresss/mac:unqualifys/mac:unqualify[mac:address!=current()] and /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/mac:mac/mac:mac-addresss/mac:qualifys/mac:qualify[mac:address!=current()] and /vlan:vlan/vlan:vlans/vlan:vlan/mac:mac-addresss/mac:mac-address[mac:address!=current()]";
                description "MAC address.";
              }
            }  // list global-blackhole-mac
          }  // container global-blackhole-macs
    
          container vlan-dynamic-macs {
            config false;
            description
              "List of displayed VLAN forwarding table.";
            list vlan-dynamic-mac {
              key "slot-id vlan-id address";
              description
                "Statistics of displayed VLAN forwarding entry.";
              leaf slot-id {
                type string {
                  length "1..24";
                }
                description "Slot ID.";
              }
    
              leaf vlan-id {
                type uint16 {
                  range "1..4094";
                }
                description "VLAN ID.";
              }
    
              leaf address {
                type pub-type:mac-address {
                  length "0..255";
                }
                description "MAC address.";
              }
    
              leaf type {
                type mac-type;
                description "MAC address type.";
              }
    
              leaf out-interface-name {
                type pub-type:if-name;
                description
                  "Outbound interface name.";
              }
    
              leaf last-change-time {
                type yang:date-and-time;
                description
                  "Dynamic MAC last change time.";
              }
            }  // list vlan-dynamic-mac
          }  // container vlan-dynamic-macs
    
          container bd-dynamic-macs {
            config false;
            description
              "List of displayed BD forwarding table. The query result of dynamic MAC addresses is disordered.";
            list bd-dynamic-mac {
              key "slot-id address bd-id pw-role";
              description
                "Statistics of displayed BD forwarding entry.";
              leaf slot-id {
                type string {
                  length "1..50";
                }
                description "Slot number.";
              }
    
              leaf address {
                type pub-type:mac-address {
                  length "0..255";
                }
                description "MAC address.";
              }
    
              leaf bd-id {
                type uint32 {
                  range "1..16777215";
                }
                description
                  "ID of a bridge domain.";
              }
    
              leaf pw-role {
                type pw-role-type;
                description "Role type.";
              }
    
              leaf type {
                ext:support-filter "true";
                type mac-type;
                description
                  "MAC address type of a bridge domain.";
              }
    
              leaf out-interface-name {
                type pub-type:if-name;
                description
                  "Outbound interface name.";
              }
    
              leaf untag {
                type boolean;
                description
                  "Packets without VLAN tags.";
              }
    
              leaf pe-default {
                type boolean;
                description "PE default VLAN.";
              }
    
              leaf ce-default {
                type boolean;
                description "CE default VLAN.";
              }
    
              leaf vid {
                type uint16 {
                  range "1..4094";
                }
                description "Outer VLAN tag.";
              }
    
              leaf ce-vid {
                type uint16 {
                  range "1..4094";
                }
                description "Inner VLAN tag.";
              }
    
              leaf learned-period {
                type uint32 {
                  range "0..4294967294";
                }
                description
                  "Dynamic MAC holding time.";
              }
    
              leaf peer-ip {
                ext:support-filter "true";
                type inet:ipv4-address-no-zone;
                description "Peer IP.";
              }
    
              leaf last-change-time {
                type yang:date-and-time;
                description
                  "Dynamic MAC last change time.";
              }
    
              leaf peer-ipv6 {
                ext:support-filter "true";
                type inet:ipv6-address-no-zone;
                description "Peer IPv6 address.";
              }
    
              leaf vsi-name {
                type string {
                  length "1..31";
                }
                description "VSI name.";
              }
    
              leaf account-enable {
                type boolean;
                description
                  "MAC acounting state.";
              }
    
              leaf destination-packet-count {
                type uint64;
                description
                  "Destination packet counts.";
              }
    
              leaf destination-byte-count {
                type uint64;
                description
                  "Destination byte counts.";
              }
    
              leaf source-packet-count {
                type uint64;
                description
                  "Source packet counts.";
              }
    
              leaf source-byte-count {
                type uint64;
                description
                  "Source byte counts.";
              }
    
              leaf is-qualify-mode {
                type boolean;
                description
                  "The MAC address learning style of BD is qualify.";
              }
            }  // list bd-dynamic-mac
          }  // container bd-dynamic-macs
    
          container vsi-dynamic-macs {
            config false;
            description
              "List of VSI forwarding table.";
            list vsi-dynamic-mac {
              key "slot-id vsi-name vlan-id address pw-role";
              description
                "Statistics of VSI forwarding entry.";
              leaf slot-id {
                type string {
                  length "1..24";
                }
                description "Slot ID.";
              }
    
              leaf vsi-name {
                type string {
                  length "1..31";
                }
                description "VSI name.";
              }
    
              leaf vlan-id {
                type uint16 {
                  range "0..4094";
                }
                description "VLAN ID.";
              }
    
              leaf address {
                type pub-type:mac-address;
                description "MAC address.";
              }
    
              leaf pw-role {
                type pw-role-type;
                description "PW role type.";
              }
    
              leaf out-interface-name {
                type leafref {
                  path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                }
                description
                  "Outbound interface name.";
              }
    
              leaf pe-vid {
                type uint16 {
                  range "1..4094";
                }
                description "Outer VLAN tag.";
              }
    
              leaf ce-vid {
                type uint16 {
                  range "1..4094";
                }
                description "Inner VLAN tag.";
              }
    
              leaf type {
                type mac-type;
                description "MAC type.";
              }
    
              leaf out-interface-type {
                type vsi-mac-out-type;
                description
                  "Outbound interface type.";
              }
    
              leaf pw-id {
                type uint32 {
                  range "1..4294967295";
                }
                description "PW ID.";
              }
    
              leaf peer-ip {
                type inet:ipv4-address-no-zone;
                description "Peer IP address.";
              }
    
              leaf pw-name {
                type string {
                  length "1..31";
                }
                description "PW name.";
              }
    
              leaf is-ingress-mac {
                type boolean;
                description "Ingress MAC.";
              }
    
              leaf is-include-stacking-ce-vlan {
                type boolean;
                description
                  "Is include stacking CE-VLAN.";
              }
    
              leaf last-change-time {
                type yang:date-and-time;
                description
                  "Dynamic MAC last change time.";
              }
    
              leaf account-enable {
                type boolean;
                description
                  "MAC acounting state.";
              }
    
              leaf destination-packet-count {
                type uint64;
                description
                  "Destination packet counts.";
              }
    
              leaf destination-byte-count {
                type uint64;
                description
                  "Destination byte counts.";
              }
    
              leaf source-packet-count {
                type uint64;
                description
                  "Source packet counts.";
              }
    
              leaf source-byte-count {
                type uint64;
                description
                  "Source byte counts.";
              }
            }  // list vsi-dynamic-mac
          }  // container vsi-dynamic-macs
    
          container evpn-dynamic-macs {
            config false;
            description
              "List of displayed EVPN forwarding table.";
            list evpn-dynamic-mac {
              key "slot-id evpn-name address";
              description
                "Statistics of displayed EVPN forwarding entry.";
              leaf slot-id {
                type string {
                  length "1..24";
                }
                description "Slot ID.";
              }
    
              leaf evpn-name {
                type string {
                  length "1..31";
                }
                description "EVPN name.";
              }
    
              leaf address {
                type pub-type:mac-address {
                  length "0..255";
                }
                description "MAC address.";
              }
    
              leaf type {
                type mac-type;
                description
                  "MAC address type of EVPN.";
              }
    
              leaf out-interface-name {
                type pub-type:if-name;
                description
                  "Outbound interface name.";
              }
    
              leaf peer-ip {
                type inet:ipv4-address-no-zone;
                description "Peer IP address.";
              }
    
              leaf is-ingress-mac {
                type boolean;
                description "Ingress MAC.";
              }
    
              leaf last-change-time {
                type yang:date-and-time;
                description
                  "Dynamic MAC last change time.";
              }
            }  // list evpn-dynamic-mac
          }  // container evpn-dynamic-macs
    
          container bd-mac-total-numbers {
            config false;
            description
              "List of MAC total number of bridge domain.";
            list bd-mac-total-number {
              key "bd-id";
              description
                "Statistics of MAC total number of bridge domain.";
              leaf bd-id {
                type uint32 {
                  range "1..16777215";
                }
                description
                  "ID of a bridge domain.";
              }
    
              leaf number {
                type uint32;
                description
                  "Total MAC address number.";
              }
            }  // list bd-mac-total-number
          }  // container bd-mac-total-numbers
    
          container pbb-macs {
            config false;
            description
              "List of PBB Fowarding tables.";
            list pbb-mac {
              key "slot-id mac-address";
              description
                "Statistics of PBB Fowarding table.";
              leaf slot-id {
                type string {
                  length "1..24";
                }
                description "Slot ID.";
              }
    
              leaf mac-address {
                type pub-type:mac-address {
                  length "0..255";
                }
                description "MAC address.";
              }
    
              leaf broadcast-type {
                type broadcast-type;
                description
                  "Broadcast Domain type.";
              }
    
              leaf broadcast-name {
                type string {
                  length "1..32";
                }
                description
                  "Broadcast Domain name.";
              }
    
              leaf tag {
                type uint32;
                description "PBB Tag.";
              }
    
              leaf source-mac {
                type pub-type:mac-address {
                  length "0..255";
                }
                description
                  "PBB Source MAC Address.";
              }
    
              leaf dest-mac {
                type pub-type:mac-address {
                  length "0..255";
                }
                description
                  "PBB Destination MAC Address.";
              }
    
              leaf last-change-time {
                type yang:date-and-time;
                description
                  "Dynamic MAC last change time.";
              }
            }  // list pbb-mac
          }  // container pbb-macs
    
          container mac-address-usages {
            config false;
            description
              "List of usage of all slot MAC address table.";
            list mac-address-usage {
              key "slot-id";
              description
                "Statistics of usage of a MAC address table.";
              leaf slot-id {
                type string {
                  length "1..50";
                }
                description "Slot number.";
              }
    
              leaf slot-type {
                type string {
                  length "1..50";
                }
                description
                  "Type of the board in the slot.";
              }
    
              leaf use-rate {
                type uint32 {
                  range "0..100";
                }
                description
                  "Percent of usage of the MAC address table.";
              }
    
              leaf threshold {
                type uint32 {
                  range "1..99";
                }
                description
                  "Percent of usage threshold of the MAC address table.";
              }
    
              leaf capability {
                type uint32;
                description
                  "Capability of mac-address table.";
              }
            }  // list mac-address-usage
          }  // container mac-address-usages
    
          container mac-statistics {
            config false;
            description "List of MAC summary.";
            list mac-statistic {
              key "slot-id";
              description
                "Statistics of MAC summary.";
              leaf slot-id {
                type string {
                  length "1..24";
                }
                description "Slot ID.";
              }
    
              leaf total {
                type uint32;
                description
                  "Number of total MAC addresses.";
              }
    
              leaf black-hole {
                type uint32;
                description
                  "Number of blackhole MAC addresses.";
              }
    
              leaf static {
                type uint32;
                description
                  "Number of static MAC addresses.";
              }
    
              leaf dynamic {
                type uint32;
                description
                  "Number of dynamic MAC addresses.";
              }
    
              leaf dynamic-local {
                type uint32;
                description
                  "Number of dynamic local MAC addresses.";
              }
    
              leaf dynamic-remote {
                type uint32;
                description
                  "Number of dynamic remote MAC addresses.";
              }
    
              leaf dynamic-trunk {
                type uint32;
                description
                  "Number of dynamic trunk MAC addresses.";
              }
    
              leaf oam {
                type uint32;
                description
                  "Number of OAM MAC addresses.";
              }
    
              leaf sticky {
                type uint32;
                description
                  "Number of sticky MAC addresses.";
              }
    
              leaf security {
                type uint32;
                description
                  "Number of security MAC addresses.";
              }
    
              leaf authen {
                type uint32;
                description
                  "Number of authen MAC addresses.";
              }
    
              leaf guest {
                type uint32;
                description
                  "Number of guest MAC addresses.";
              }
    
              leaf mux {
                type uint32;
                description
                  "Number of MUX MAC addresses.";
              }
    
              leaf tunnel {
                type uint32;
                description
                  "Number of tunnel MAC addresses.";
              }
    
              leaf snooping {
                type uint32;
                description
                  "Number of snooping MAC addresses.";
              }
    
              leaf evn {
                type uint32;
                description
                  "Number of EVN MAC addresses.";
              }
    
              leaf ovsdb {
                type uint32;
                description
                  "Number of ovsdb MAC addresses.";
              }
    
              leaf capacity {
                type uint32;
                description
                  "The capacity of MAC addresses.";
              }
            }  // list mac-statistic
          }  // container mac-statistics
        }  // container mac
    
        augment /vlan:vlan/vlan:vlans/vlan:vlan {
          description "MAC attribute of a VLAN.";
          container mac-addresss {
            description
              "List of VLAN forwarding table.";
            list mac-address {
              must
                "not (mac:ce-default and mac:ce-vlan-id)";
              key "address";
              description
                "Configure VLAN forwarding entry.";
              leaf address {
                type pub-type:mac-address {
                  pattern
                    '[0-9a-f][0|2|4|6|8|a|c|e][0-9a-f]{2}(-[0-9a-f]{4}){2}';
                }
                description "MAC address.";
              }
    
              choice mac-type {
                mandatory true;
                description "MAC type.";
                case black-hole {
                  description "Blackhole type.";
                  leaf black-hole {
                    type empty;
                    mandatory true;
                    description
                      "Blackhole type.";
                  }
                }  // case black-hole
    
                case static {
                  description "Static type.";
                  leaf out-interface-name {
                    type leafref {
                      path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                    }
                    must
                      "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/ethernet:pvid=current()/../../../vlan:id or /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/ethernet:vlan-stackings/ethernet:vlan-stacking[ethernet:stacking-vlan=current()/../../../vlan:id] or /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/ethernet:vlan-mappings/ethernet:vlan-mapping[ethernet:mapping-vlan=current()/../../../vlan:id] or /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/ethernet:trunk-vlans";
                    mandatory true;
                    description
                      "Outbound interface name. The to-be-delivered VLAN ID must be the default VLAN ID, the VLAN ID in the outer VLAN tag, the post-mapping VLAN ID, or a VLAN ID in the list of allowed VLANs on the specified interface.";
                  }
    
                  leaf ce-default {
                    type empty;
                    must
                      "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-interface-name]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/ethernet:vlan-stackings/ethernet:vlan-stacking[ethernet:stacking-vlan=current()/../../../vlan:id]/ethernet:ce-default";
                    description
                      "CE default VLAN. If the to-be-delivered VLAN ID is neither the VLAN ID in the outer VLAN tag to be added to a tagged packet, nor the post-mapping VLAN ID, nor a VLAN ID in the list of allowed VLANs on the specified interface, ce-default is mandatory.";
                  }
    
                  leaf ce-vlan-id {
                    type uint16 {
                      range "1..4094";
                    }
                    must
                      "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-interface-name]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/ethernet:vlan-stackings/ethernet:vlan-stacking[ethernet:stacking-vlan=current()/../../../vlan:id]/ethernet:trans-vlans or /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-interface-name]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/ethernet:vlan-mappings/ethernet:vlan-mapping[ethernet:mapping-vlan=current()/../../../vlan:id]/ethernet:trans-vlans";
                    description
                      "CE VLAN ID. The CE VLAN ID must exist in the list of VLAN IDs that can be received by adding the outer VLAN tag carrying the to-be-delivered VLAN ID, or in the list of VLAN IDs that can be mapped to the to-be-delivered VLAN ID on the specified interface. If the to-be-delivered VLAN ID is neither the default VLAN ID, nor the VLAN ID in the outer VLAN tag to be added to an untagged packet, nor a VLAN ID in the list of allowed VLANs on the specified interface, CE VLAN ID is mandatory.";
                  }
                }  // case static
              }  // choice mac-type
            }  // list mac-address
          }  // container mac-addresss
    
          container mac-limit {
            when "../vlan:type!='super'";
            presence "MAC address limit.";
            description
              "Configure MAC address limit.";
            leaf maximum {
              type uint32 {
                range "0..2048000";
              }
              must
                "not(../rate=0) or (../rate=0 and ../maximum>0)";
              mandatory true;
              description
                "Maximum number of MAC addresses that can be learned. The value 0 means unlimited.";
            }
    
            leaf rate {
              type uint16 {
                range "0..1000";
              }
              units "ms";
              must
                "not(../maximum=0) or (../maximum=0 and ../rate>0)";
              default "0";
              description
                "Interval at which MAC addresses are learned. The value 0 indicates that no rate limit is set.";
            }
    
            leaf action {
              type mac-limit-forward;
              default "discard";
              description
                "Discard or forward after the number of learned MAC addresses reaches the maximum number.";
            }
    
            leaf alarm {
              type mac-enable-status;
              default "enable";
              description
                "Whether an alarm is generated after the number of learned MAC addresses reaches the maximum number.";
            }
    
            leaf up-threshold {
              when "../maximum>0";
              type uint8 {
                range "1..100";
              }
              must
                "(not(../up-threshold) and not(../down-threshold)) or ((../up-threshold and ../down-threshold) and (../up-threshold>=../down-threshold))";
              description
                "Upper limit for the number of MAC addresses.";
            }
    
            leaf down-threshold {
              when "../maximum>0";
              type uint8 {
                range "1..100";
              }
              must
                "(not(../up-threshold) and not(../down-threshold)) or ((../up-threshold and ../down-threshold) and (../up-threshold>=../down-threshold))";
              description
                "Lower limit for the number of MAC addresses.";
            }
          }  // container mac-limit
        }
    
        augment /bd:bd/bd:instances/bd:instance {
          description "MAC attribute of a BD.";
          container mac-addresss {
            description
              "List of BD forwarding entries.";
            list mac-address {
              must
                "../../bd:mac-learn-style='unqualify'";
              key "address";
              description
                "Configure BD forwarding entry.";
              leaf address {
                type pub-type:mac-address {
                  pattern
                    '[0-9a-f][0|2|4|6|8|a|c|e][0-9a-f]{2}(-[0-9a-f]{4}){2}';
                }
                description
                  "MAC address. Only support unicast MAC address.";
              }
    
              choice mac-type {
                mandatory true;
                description
                  "MAC type, black hole or static.";
                case black-hole {
                  description "Blackhole type.";
                  leaf black-hole {
                    type empty;
                    mandatory true;
                    description
                      "Blackhole type.";
                  }
                }  // case black-hole
    
                case static {
                  description "Static type.";
                  choice out-interface-type {
                    mandatory true;
                    description "Outbound type.";
                    case ac {
                      description "AC type.";
                      leaf out-interface-name {
                        type leafref {
                          path "/bd:bd/bd:instances/bd:instance/bd:service-points/bd:service-point/bd:interface-name";
                        }
                        must
                          "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()]/ethernet:ethernet/ethernet:l2-sub-interface/ethernet:untag or /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()]/ethernet:ethernet/ethernet:l2-sub-interface/ethernet:default or /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()]/ethernet:ethernet/ethernet:l2-sub-interface/ethernet:dot1q/ethernet:vlans/ethernet:vlan-list or /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()]/ethernet:ethernet/ethernet:l2-sub-interface/ethernet:dot1q/ethernet:policy-vlans/ethernet:policy-vlan or /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()]/ethernet:ethernet/ethernet:l2-sub-interface/ethernet:qinqs/ethernet:qinq-vids/ethernet:qinq-vid or /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()]/ethernet:ethernet/ethernet:l2-sub-interface/ethernet:qinqs/ethernet:qinq-vid-ce-default/ethernet:pe-vlan-list";
                        mandatory true;
                        description
                          "Outbound interface name.";
                      }
    
                      leaf untag {
                        when
                          "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-interface-name]/ethernet:ethernet/ethernet:l2-sub-interface/ethernet:untag";
                        type empty;
                        mandatory true;
                        description
                          "Packets without VLAN tag.";
                      }
    
                      leaf pe-default {
                        when
                          "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-interface-name]/ethernet:ethernet/ethernet:l2-sub-interface/ethernet:default";
                        type empty;
                        mandatory true;
                        description
                          "PE default VLAN.";
                      }
    
                      leaf vid {
                        when
                          "(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-interface-name]/ethernet:ethernet/ethernet:l2-sub-interface/ethernet:dot1q or /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-interface-name]/ethernet:ethernet/ethernet:l2-sub-interface/ethernet:qinqs)";
                        type uint16 {
                          range "1..4094";
                        }
                        mandatory true;
                        description
                          "Outer VLAN tag.";
                      }
    
                      leaf ce-default {
                        when
                          "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-interface-name]/ethernet:ethernet/ethernet:l2-sub-interface/ethernet:qinqs/ethernet:qinq-vid-ce-default/ethernet:pe-vlan-list";
                        type empty;
                        mandatory true;
                        description
                          "CE default VLAN.";
                      }
    
                      leaf ce-vid {
                        when
                          "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-interface-name]/ethernet:ethernet/ethernet:l2-sub-interface/ethernet:qinqs/ethernet:qinq-vids/ethernet:qinq-vid[ethernet:pe-vlan-id=current()/../vid]/ethernet:ce-vlan-list";
                        type uint16 {
                          range "1..4094";
                        }
                        mandatory true;
                        description
                          "Inner VLAN tag.";
                      }
                    }  // case ac
    
                    case tunnel {
                      description "Tunnel type.";
                      leaf source-ip {
                        type inet:ipv4-address-no-zone;
                        mandatory true;
                        description
                          "Source IP address.";
                      }
    
                      leaf peer-ip {
                        type inet:ipv4-address-no-zone;
                        mandatory true;
                        description
                          "Peer IP address.";
                      }
    
                      leaf vni {
                        type uint32 {
                          range "1..16777215";
                        }
                        mandatory true;
                        description
                          "VXLAN network identifier.";
                      }
                    }  // case tunnel
                  }  // choice out-interface-type
                }  // case static
              }  // choice mac-type
            }  // list mac-address
          }  // container mac-addresss
    
          container mac-limit {
            presence "BD MAC address limit.";
            description
              "Configure BD MAC address limit.";
            leaf maximum {
              type uint32 {
                range "0..2048000";
              }
              must
                "not(../rate=0) or (../maximum>0)";
              mandatory true;
              description
                "Maximum number of MAC addresses that can be learned. The value 0 means unlimited.";
            }
    
            leaf rate {
              type uint16 {
                range "0..1000";
              }
              units "ms";
              must
                "not(../maximum=0) or (../rate>0)";
              default "0";
              description
                "Interval at which MAC addresses are learned. The value 0 indicates that no rate limit is set.";
            }
    
            leaf action {
              type mac-limit-forward;
              default "discard";
              description
                "Discard or forward after the number of learned MAC addresses reaches the maximum number.";
            }
    
            leaf up-threshold {
              when "../maximum>0";
              type uint8 {
                range "1..100";
              }
              must
                "(not(../up-threshold) and not(../down-threshold)) or ((../up-threshold and ../down-threshold) and (../up-threshold>=../down-threshold))";
              description
                "Upper limit for the number of MAC addresses.";
            }
    
            leaf down-threshold {
              when "../maximum>0";
              type uint8 {
                range "1..100";
              }
              must
                "(not(../up-threshold) and not(../down-threshold)) or ((../up-threshold and ../down-threshold) and (../up-threshold>=../down-threshold))";
              description
                "Lower limit for the number of MAC addresses.";
            }
          }  // container mac-limit
    
          container sticky-mac {
            description
              "Configure sticky MAC in BD.";
            leaf enable {
              type boolean;
              must
                "(../enable = 'false' or ((../enable = 'true') and not(/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:bds/l2vpn:bd[l2vpn:id=current()/../../bd:id])))";
              default "false";
              description
                "Enable/disable sticky MAC.";
            }
    
            leaf source-mac-check {
              type boolean;
              must
                "(../source-mac-check = 'false' or ((../source-mac-check = 'true') and (../../bd:mac-learning = 'enable') and not(/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:bds/l2vpn:bd[l2vpn:id=current()/../../bd:id])))";
              default "false";
              description
                "Enable/disable source MAC check.";
            }
    
            leaf-list whitelist {
              type pub-type:mac-address {
                pattern
                  '[0-9a-f][0|2|4|6|8|a|c|e][0-9a-f]{2}(-[0-9a-f]{4}){2}';
              }
              must
                "../../bd:mac-learn-style!='qualify'";
              description
                "Configure sticky MAC whitelist in BD. Multicast and broadcast addresses are not supported.";
            }
          }  // container sticky-mac
        }
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls {
          description "MAC attribute on VSI.";
          container mac {
            description
              "Configure MAC parameters on VSI.";
            container mac-addresss {
              description
                "Configure VSI MAC address table.";
              container qualifys {
                description
                  "List of qualify MAC address table.";
                list qualify {
                  must
                    "../../../../l2vpn:mac-learn-style='qualify'";
                  key "vlan-id address";
                  description
                    "Configure qualify MAC address entry.";
                  leaf vlan-id {
                    type uint16 {
                      range "1..4094";
                    }
                    description "VLAN ID.";
                  }
    
                  leaf address {
                    type pub-type:mac-address {
                      pattern
                        '[0-9a-f][0|2|4|6|8|a|c|e][0-9a-f]{2}(-[0-9a-f]{4}){2}';
                    }
                    description "MAC address.";
                  }
    
                  choice mac-type {
                    mandatory true;
                    description "MAC type.";
                    case black-hole {
                      description
                        "Blackhole type.";
                      leaf black-hole {
                        type empty;
                        mandatory true;
                        description
                          "Blackhole type.";
                      }
                    }  // case black-hole
    
                    case static {
                      description "Static type.";
                      choice out-bound-type {
                        mandatory true;
                        description
                          "Outbound type.";
                        case ac {
                          description "AC type.";
                          leaf out-if-name {
                            type leafref {
                              path "/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:acs/l2vpn:ac/l2vpn:interface-name";
                            }
                            must
                              "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:qinq-stacking";
                            mandatory true;
                            description
                              "Outbound interface name.";
                          }
                        }  // case ac
    
                        case pw {
                          description "PW type.";
                          leaf pw-id {
                            type leafref {
                              path "../../../../../l2vpn:ldp-signaling/l2vpn:pws/l2vpn:pw/l2vpn:negotiation-vc-id";
                            }
                            mandatory true;
                            description "PW ID.";
                          }
    
                          leaf peer-ip {
                            type leafref {
                              path "../../../../../l2vpn:ldp-signaling/l2vpn:pws/l2vpn:pw/l2vpn:peer-ip";
                            }
                            mandatory true;
                            description
                              "Peer IP address.";
                          }
                        }  // case pw
                      }  // choice out-bound-type
                    }  // case static
                  }  // choice mac-type
                }  // list qualify
              }  // container qualifys
    
              container unqualifys {
                description
                  "List of unqualify MAC address table.";
                list unqualify {
                  must
                    "../../../../l2vpn:mac-learn-style='unqualify'";
                  key "address";
                  description
                    "Configure unqualify MAC address entry.";
                  leaf address {
                    type pub-type:mac-address;
                    description "MAC address.";
                  }
    
                  choice mac-type {
                    mandatory true;
                    description "MAC type.";
                    case black-hole {
                      description
                        "Blackhole type.";
                      leaf black-hole {
                        type empty;
                        mandatory true;
                        description
                          "Blackhole type.";
                      }
                    }  // case black-hole
    
                    case static {
                      description "Static.";
                      choice out-bound-type {
                        mandatory true;
                        description
                          "Outbound type.";
                        case ac {
                          description "AC type.";
                          leaf out-if-name {
                            type leafref {
                              path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                            }
                            must
                              "((../vlanif-name and /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute) or (../../../../../l2vpn:acs/l2vpn:ac[l2vpn:interface-name=current()]))";
                            mandatory true;
                            description
                              "Outbound interface name.";
                          }
    
                          leaf pe-vid {
                            type uint16 {
                              range "0..4094";
                            }
                            must
                              "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-if-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:qinq-termination/ethernet:qinq-vids/ethernet:qinq-vid or /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-if-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:dot1q-termination/ethernet:dot1q-vlans/ethernet:dot1q-vlans/ethernet:vlan-list or /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-if-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:dot1q-termination/ethernet:dot1q-vlans-policy/ethernet:policy-vlans/ethernet:policy-vlan or /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-if-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:qinq-stacking/ethernet:stacking-vid";
                            description
                              "Outer VLAN tag.";
                          }
    
                          leaf ce-vid {
                            type uint16 {
                              range "0..4094";
                            }
                            must
                              "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-if-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:qinq-termination/ethernet:qinq-vids/ethernet:qinq-vid";
                            description
                              "Inner VLAN tag. If ce-vid exists in qinq-vid, ce-vid is mandatory.";
                          }
    
                          leaf ce-any {
                            type empty;
                            description
                              "Any Inner VLAN ID. If pe-vid exists in pe-VLAN-list, ce-any is mandatory.";
                          }
    
                          leaf vlanif-name {
                            type leafref {
                              path "../../../../../l2vpn:acs/l2vpn:ac/l2vpn:interface-name";
                            }
                            must
                              "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()]/ifm:type='Vlanif' and (/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-if-name]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/ethernet:pvid or /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../out-if-name]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/ethernet:trunk-vlans)";
                            description
                              "VLANIF interface. The VLANIF ID must exist in pvid or trunk-VLANs.";
                          }
                        }  // case ac
    
                        case pw {
                          description "PW type.";
                          leaf pw-id {
                            type leafref {
                              path "../../../../../l2vpn:ldp-signaling/l2vpn:pws/l2vpn:pw/l2vpn:negotiation-vc-id";
                            }
                            mandatory true;
                            description "PW ID.";
                          }
    
                          leaf peer-ip {
                            type leafref {
                              path "../../../../../l2vpn:ldp-signaling/l2vpn:pws/l2vpn:pw/l2vpn:peer-ip";
                            }
                            mandatory true;
                            description
                              "Peer IP address.";
                          }
                        }  // case pw
                      }  // choice out-bound-type
                    }  // case static
                  }  // choice mac-type
                }  // list unqualify
              }  // container unqualifys
            }  // container mac-addresss
    
            container suppression {
              description
                "Configure VSI traffic suppression list.";
              leaf inbound {
                type empty;
                must
                  "../../../l2vpn:work-mode='normal' or ../../../l2vpn:work-mode='i-vsi-b-evpn-interworking'";
                description
                  "Inbound suppression.";
              }
    
              leaf outbound {
                type empty;
                must
                  "../../../l2vpn:work-mode='normal' or ../../../l2vpn:work-mode='i-vsi-b-evpn-interworking'";
                description
                  "Outbound suppression.";
              }
            }  // container suppression
    
            container uni-suppressions {
              description
                "List of VSI traffic suppression.";
              list uni-suppression {
                must
                  "../../../l2vpn:work-mode='normal'";
                key "type direction";
                description
                  "Configure VSI traffic suppression.";
                leaf type {
                  type suppress-type;
                  description
                    "Traffic suppression type.";
                }
    
                leaf direction {
                  type vsi-direction-type;
                  description
                    "Suppression direction.";
                }
    
                leaf cir {
                  type uint64 {
                    range "0..4294967295";
                  }
                  units "kbit/s";
                  mandatory true;
                  description "CIR value.";
                }
    
                leaf cbs {
                  ext:dynamic-default {
                    ext:default-value "../cir*(1500/8)" {
                      when "../cir < 100000";
                      description "When cir less than 100000kbit/s,the default value is cir * (1500/8)Byte.";
                    }
                    ext:default-value "18750000" {
                      when "../cir >= 100000";
                      description "When cir more than 100000kbit/s,the default value is 100000 * (1500/8)Byte.";
                    }
                  }
                  type uint64 {
                    range "0..4294967295";
                  }
                  units "Byte";
                  description
                    "CBS value. If user does not specify this value, the system will calc a value by CIR value.";
                }
              }  // list uni-suppression
            }  // container uni-suppressions
    
            container mac-limit {
              must
                "../../l2vpn:work-mode='normal' or ../../l2vpn:work-mode='i-vsi-b-evpn-interworking'";
              presence "VSI MAC address limit.";
              description
                "Enable/disable to limit VSI MAC address.";
              leaf maximum {
                type uint32 {
                  range "0..2048000";
                }
                must
                  "not(../rate=0) or (../maximum>0)";
                mandatory true;
                description
                  "Maximum number of MAC addresses that can be learned in a VSI. The value 0 means unlimited.";
              }
    
              leaf rate {
                type uint16 {
                  range "0..1000";
                }
                units "ms";
                must
                  "not(../maximum=0) or (../rate>0)";
                default "0";
                description
                  "Interval at which MAC addresses are learned in a VSI. The value 0 indicates that no rate limit is set.";
              }
    
              leaf action {
                type mac-limit-forward;
                default "discard";
                description
                  "Discard or forward after the number of learned MAC addresses reaches the maximum number in a VSI.";
              }
    
              leaf alarm {
                type mac-enable-status;
                default "disable";
                description
                  "Whether an alarm is generated after the number of learned MAC addresses reaches the maximum number in a VSI.";
              }
    
              leaf up-threshold {
                when "../maximum>0";
                type uint8 {
                  range "1..100";
                }
                must
                  "(not(../up-threshold) and not(../down-threshold)) or ((../up-threshold and ../down-threshold) and (../up-threshold>=../down-threshold))";
                description
                  "Upper limit for the number of MAC addresses.";
              }
    
              leaf down-threshold {
                when "../maximum>0";
                type uint8 {
                  range "1..100";
                }
                must
                  "(not(../up-threshold) and not(../down-threshold)) or ((../up-threshold and ../down-threshold) and (../up-threshold>=../down-threshold))";
                description
                  "Lower limit for the number of MAC addresses.";
              }
            }  // container mac-limit
          }  // container mac
        }
    
        augment /ifm:ifm/ifm:interfaces/ifm:interface/ethernet:ethernet {
          description
            "MAC attribute of interface.";
          container mac {
            description
              "Configure MAC attribute of interface.";
            container sub-interface-mac-limit {
              must
                "(/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:acs/l2vpn:ac[l2vpn:interface-name=current()/../../../ifm:name]) or (../../../ifm:l2-mode-enable='true')";
              presence
                "Sub-interface MAC address limit.";
              description
                "Configure sub-interface MAC address limit.";
              choice limit-type {
                mandatory true;
                description
                  "Sub-interface MAC limit type.";
                case limit-rule-ref {
                  description
                    "Reference global MAC limit rule.";
                  leaf rule-name {
                    type leafref {
                      path "/mac:mac/mac:mac-limit-rules/mac:mac-limit-rule/mac:name";
                    }
                    description "Rule name.";
                  }
                }  // case limit-rule-ref
    
                case limit-parameters {
                  description
                    "Specify MAC limit parameters.";
                  leaf maximum {
                    type uint32 {
                      range "0..131072";
                    }
                    must
                      "not(../rate=0) or (../maximum>0)";
                    mandatory true;
                    description
                      "Maximum number of MAC addresses that can be learned on a sub-interface. The value 0 means unlimited.";
                  }
    
                  leaf rate {
                    type uint16 {
                      range "0..1000";
                    }
                    units "ms";
                    must
                      "not(../maximum=0) or (../rate>0)";
                    default "0";
                    description
                      "Interval at which MAC addresses are learned on a sub-interface. The value 0 indicates that no rate limit is set.";
                  }
    
                  leaf action {
                    type mac-limit-forward;
                    default "discard";
                    description
                      "Discard or forward after the number of learned MAC addresses reaches the maximum number on a sub-interface.";
                  }
    
                  leaf alarm {
                    type mac-enable-status;
                    default "enable";
                    description
                      "Whether an alarm is generated after the number of learned MAC addresses reaches the maximum number on a sub-interface.";
                  }
                }  // case limit-parameters
              }  // choice limit-type
            }  // container sub-interface-mac-limit
    
            container sub-interface-suppressions {
              description
                "List of sub-interface traffic suppression.";
              list sub-interface-suppression {
                must
                  "(/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:acs/l2vpn:ac[l2vpn:interface-name=current()/../../../../ifm:name]) or /bd:bd/bd:instances/bd:instance/bd:service-points/bd:service-point[bd:interface-name=current()/../../../../ifm:name]";
                key "type direction";
                description
                  "Configure sub-interface traffic suppression.";
                leaf type {
                  type suppress-type;
                  description
                    "Suppression type.";
                }
    
                leaf direction {
                  type direction-type;
                  description
                    "Suppression direction.";
                }
    
                leaf cir {
                  type uint64 {
                    range "0..4294967295";
                  }
                  units "kbit/s";
                  mandatory true;
                  description "CIR value.";
                }
    
                leaf cbs {
                  ext:dynamic-default {
                    ext:default-value "../cir*(1500/8)" {
                      when "../cir < 100000";
                      description "When cir less than 100000kbit/s,the default value is cir * (1500/8)Byte.";
                    }
                    ext:default-value "18750000" {
                      when "../cir >= 100000";
                      description "When cir more than 100000kbit/s,the default value is 100000 * (1500/8)Byte.";
                    }
                  }
                  type uint64 {
                    range "0..4294967295";
                  }
                  units "Byte";
                  description
                    "CBS value. If user does not specify this value, the system will calc a value by CIR value.";
                }
              }  // list sub-interface-suppression
            }  // container sub-interface-suppressions
    
            container discards {
              description
                "List of interface packet discarding.";
              list discard {
                key "type";
                description
                  "Configure an interface to discard broadcast packets.";
                leaf type {
                  type discard-type;
                  description "Discarding type.";
                }
              }  // list discard
            }  // container discards
          }  // container mac
        }
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:ldp-signaling/l2vpn:pws/l2vpn:pw {
          description "MAC attribute on PW.";
          container mac {
            when "../l2vpn:name";
            description
              "Configure MAC attribute on PW.";
            container mac-limit {
              presence "MAC address limit.";
              description
                "Configure MAC address limit.";
              leaf maximum {
                type uint32 {
                  range "0..130048";
                }
                must
                  "not(../rate=0) or (../rate=0 and ../maximum>0)";
                mandatory true;
                description
                  "Maximum number of MAC addresses that can be learned. The value 0 means unlimited.";
              }
    
              leaf rate {
                type uint16 {
                  range "0..1000";
                }
                units "ms";
                must
                  "not(../maximum=0) or (../maximum=0 and ../rate>0)";
                default "0";
                description
                  "Interval at which MAC addresses are learned. The value 0 indicates that no rate limit is set.";
              }
    
              leaf action {
                type mac-limit-forward;
                default "discard";
                description
                  "Discard or forward after the number of learned MAC addresses reaches the maximum number.";
              }
    
              leaf alarm {
                type mac-enable-status;
                default "enable";
                description
                  "Whether an alarm is generated after the number of learned MAC addresses reaches the maximum number.";
              }
            }  // container mac-limit
    
            container suppressions {
              description
                "Configure PW traffic suppress list.";
              uses pw-mac-suppression;
            }  // container suppressions
          }  // container mac
        }
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:bgp-multi-homing-signaling/l2vpn:pws/l2vpn:pw {
          description "MAC attribute on PW.";
          container mac {
            when "../l2vpn:name";
            description
              "Configure MAC attribute on PW.";
            container suppressions {
              description
                "Configure PW traffic suppress list.";
              uses pw-mac-suppression;
            }  // container suppressions
          }  // container mac
        }
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:bgp-signaling/l2vpn:pws/l2vpn:pw {
          description "MAC attribute on PW.";
          container mac {
            when "../l2vpn:name";
            description
              "Configure MAC attribute on PW.";
            container suppressions {
              description
                "Configure PW traffic suppress list.";
              uses pw-mac-suppression;
            }  // container suppressions
          }  // container mac
        }
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:bgpad-signaling/l2vpn:pws/l2vpn:pw {
          description "MAC attribute on PW.";
          container mac {
            when "../l2vpn:name";
            description
              "Configure MAC attribute on PW.";
            container suppressions {
              description
                "Configure PW traffic suppress list.";
              uses pw-mac-suppression;
            }  // container suppressions
          }  // container mac
        }
    
        augment /ifm:ifm/ifm:interfaces/ifm:interface/ethernet:ethernet/ethernet:main-interface {
          description
            "MAC attribute of main interface.";
          container mac-limit {
            presence
              "Main interface MAC address limit.";
            description
              "Configure main interface MAC address limit.";
            choice limit-type {
              mandatory true;
              description "MAC limit type.";
              case limit-rule-ref {
                description
                  "Reference global MAC limit rule.";
                leaf rule-name {
                  type leafref {
                    path "/mac:mac/mac:mac-limit-rules/mac:mac-limit-rule/mac:name";
                  }
                  mandatory true;
                  description "Rule name.";
                }
              }  // case limit-rule-ref
    
              case limit-parameter {
                description
                  "Specify MAC limit parameters.";
                leaf maximum {
                  type uint32 {
                    range "0..131072";
                  }
                  must
                    "not(../rate=0) or (../rate=0 and ../maximum>0)";
                  mandatory true;
                  description
                    "Maximum number of MAC addresses that can be learned. The value 0 means unlimited.";
                }
    
                leaf rate {
                  type uint16 {
                    range "0..1000";
                  }
                  units "ms";
                  must
                    "not(../maximum=0) or (../maximum=0 and ../rate>0)";
                  default "0";
                  description
                    "Interval at which MAC addresses are learned. The value 0 indicates that no rate limit is set.";
                }
    
                leaf action {
                  type mac-limit-forward;
                  default "discard";
                  description
                    "Discard or forward after the number of learned MAC addresses reaches the maximum number.";
                }
    
                leaf alarm {
                  type mac-enable-status;
                  default "enable";
                  description
                    "Whether an alarm is generated after the number of learned MAC addresses reaches the maximum number.";
                }
              }  // case limit-parameter
            }  // choice limit-type
          }  // container mac-limit
        }
    
        augment /ifm:ifm/ifm:interfaces/ifm:interface/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute {
          description
            "MAC attribute of layer 2 main interface.";
          container vlan-mac-limits {
            description
              "List of port VLAN MAC address limit.";
            list vlan-mac-limit {
              must "not(rate=0 and maximum=0)";
              key "maximum rate action alarm";
              description
                "Configure port VLAN MAC address limit.";
              leaf maximum {
                type uint32 {
                  range "0..131072";
                }
                description
                  "Maximum number of MAC addresses that can be learned. The value 0 means unlimited.";
              }
    
              leaf rate {
                type uint16 {
                  range "0..1000";
                }
                units "ms";
                description
                  "Interval at which MAC addresses are learned. The value 0 indicates that no rate limit is set.";
              }
    
              leaf action {
                type mac-limit-forward;
                description
                  "Discard or forward after the number of learned MAC addresses reaches the maximum number.";
              }
    
              leaf alarm {
                type mac-enable-status;
                description
                  "Whether an alarm is generated after the number of learned MAC addresses reaches the maximum number.";
              }
    
              leaf vlan-list {
                type pub-type:vlan-range;
                mandatory true;
                description
                  "VLAN ID list. Each VLAN on the interface can have only one MAC address limit rule.";
              }
            }  // list vlan-mac-limit
          }  // container vlan-mac-limits
    
          container vlan-mac-limit-rules {
            description
              "List of port VLAN MAC address limit rules.";
            list vlan-mac-limit-rule {
              key "rule-name";
              description
                "Configure port VLAN MAC address limit rule.";
              leaf rule-name {
                type leafref {
                  path
                    "/mac:mac/mac:mac-limit-rules/mac:mac-limit-rule/mac:name";
                }
                description "Rule name.";
              }
    
              leaf vlan-list {
                type pub-type:vlan-range;
                mandatory true;
                description
                  "VLAN ID list. Each VLAN on the interface can have only one MAC address limit rule.";
              }
            }  // list vlan-mac-limit-rule
          }  // container vlan-mac-limit-rules
    
          container suppressions {
            description
              "List of interface suppression.";
            list suppression {
              must
                "not(../../vlan-suppressions/vlan-suppression)";
              key "type direction";
              description
                "Configure interface suppression.";
              leaf type {
                type suppress-type;
                description "Suppression type.";
              }
    
              leaf direction {
                type direction-type;
                description
                  "Suppression direction.";
              }
    
              choice suppression-type {
                mandatory true;
                description "Suppression type.";
                case percent {
                  description "Percent type.";
                  leaf percent {
                    type uint32 {
                      range "0..99";
                    }
                    description
                      "Bandwidth usage percentage.";
                  }
                }  // case percent
    
                case value {
                  description "Value type.";
                  leaf band-width {
                    type uint32 {
                      range "0..1000";
                    }
                    units "Mbit/s";
                    description "Rate limit.";
                  }
                }  // case value
              }  // choice suppression-type
            }  // list suppression
          }  // container suppressions
    
          container vlan-suppressions {
            description
              "List of VLAN suppression.";
            list vlan-suppression {
              must
                "not(../../suppressions/suppression)";
              key "type cir cbs direction";
              description
                "Configure VLAN suppression.";
              leaf type {
                type suppress-type;
                description "Suppression type.";
              }
    
              leaf cir {
                type uint32 {
                  range "0..4294967295";
                }
                units "kbit/s";
                description "CIR value.";
              }
    
              leaf cbs {
                type uint32 {
                  range "0..4294967295";
                }
                units "Byte";
                description "CBS value.";
              }
    
              leaf direction {
                type direction-type;
                description
                  "Suppression direction.";
              }
    
              leaf vlan-list {
                type pub-type:vlan-range;
                mandatory true;
                description
                  "VLAN list. The VLAN must be created and be relationed with the interface.";
              }
            }  // list vlan-suppression
          }  // container vlan-suppressions
        }
      }  // module huawei-mac
    

© 2023 YumaWorks, Inc. All rights reserved.