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.";
        }
    
        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
      }  // module huawei-mac
    

© 2023 YumaWorks, Inc. All rights reserved.