huawei-l2vpn-extension

L2 virtual private network extensions.

  • Version: 2019-07-08

    huawei-l2vpn-extension@2019-07-08


    
      module huawei-l2vpn-extension {
    
        yang-version 1;
    
        namespace
          "urn:huawei:yang:huawei-l2vpn-extension";
    
        prefix l2vpn-extension;
    
        import ietf-inet-types {
          prefix inet;
        }
        import huawei-ifm {
          prefix ifm;
        }
        import huawei-qos {
          prefix qos;
        }
        import huawei-l2vpn {
          prefix l2vpn;
        }
        import huawei-extension {
          prefix ext;
        }
        import huawei-vrrp {
          prefix vrrp;
        }
        import huawei-ip {
          prefix ip;
        }
        import huawei-network-instance {
          prefix ni;
        }
        import huawei-tunnel-management {
          prefix tnlm;
        }
        import huawei-mpls-te {
          prefix mpls-te;
        }
        import huawei-mpls-te-cr-static {
          prefix mpls-te-cr-static;
        }
    
        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
          "L2 virtual private network extensions.";
    
        revision "2019-07-08" {
          description "Init revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "l2vpn";
    
        typedef qos-query-type {
          type enumeration {
            enum "be" {
              value 0;
              description
                "Best effort (BE) service-class.";
            }
            enum "af1" {
              value 1;
              description
                "Assured forwarding 1 (AF1) service-class.";
            }
            enum "af2" {
              value 2;
              description
                "Assured forwarding 2 (AF2) service-class.";
            }
            enum "af3" {
              value 3;
              description
                "Assured forwarding 3 (AF3) service-class.";
            }
            enum "af4" {
              value 4;
              description
                "Assured forwarding 4 (AF4) service-class.";
            }
            enum "ef" {
              value 5;
              description
                "Expedited forwarding (EF) service-class.";
            }
            enum "cs6" {
              value 6;
              description
                "Class selector 6 (CS6) service-class.";
            }
            enum "cs7" {
              value 7;
              description
                "Class selector 7 (CS7) service-class.";
            }
          }
          description "L2VPN QoS query.";
        }
    
        typedef pw-role-type {
          type enumeration {
            enum "primary" {
              value 1;
              description
                "The PW role type is primary.";
            }
            enum "backup" {
              value 2;
              description
                "The PW role type is backup.";
            }
            enum "bypass" {
              value 3;
              description
                "The PW role type is bypass.";
            }
            enum "left-primary" {
              value 4;
              description
                "The left side PW of multi-segment instance.";
            }
            enum "right-primary" {
              value 5;
              description
                "The right side PW of multi-segment instance.";
            }
            enum "right-backup" {
              value 6;
              description
                "The backup of the right side PW.";
            }
            enum "ac-bypass" {
              value 7;
              description
                "The PW role type is AC-bypass.";
            }
            enum "pw-bypass" {
              value 8;
              description
                "The PW role type is PW-bypass.";
            }
          }
          description "L2VPN PW role type.";
        }
    
        grouping qos-query-info-grp {
          description "QoS query info.";
          leaf packets {
            type uint64;
            units "packet";
            description
              "The total number of output packets.";
          }
    
          leaf bytes {
            type uint64;
            units "Byte";
            description
              "The total number of output bytes.";
          }
    
          leaf packets-rate {
            type uint64;
            units "pps";
            description
              "The last 300 seconds packets rate.";
          }
    
          leaf bits-rate {
            type uint64;
            units "bit/s";
            description
              "The last 300 seconds bits rate.";
          }
    
          leaf discard-packets {
            type uint64;
            units "packet";
            description
              "The total discard number of the packets.";
          }
    
          leaf discard-bytes {
            type uint64;
            units "Byte";
            description
              "The total discard number of the bytes.";
          }
    
          leaf discard-packets-rate {
            type uint64;
            units "pps";
            description
              "The last 300 seconds discard packets rate.";
          }
    
          leaf discard-bit-rate {
            type uint64;
            units "bit/s";
            description
              "The last 300 seconds discard bits rate.";
          }
        }  // grouping qos-query-info-grp
    
        grouping qos-traffic-statistics-grp {
          description
            "QoS traffic-statistics table.";
          leaf last-clear-time {
            type string {
              length "1..60";
            }
            description
              "Last time of clean out.";
          }
    
          leaf bits-rate {
            type uint64;
            units "bit/s";
            description
              "The traffic bits rate received on the PW.";
          }
    
          leaf packets-rate {
            type uint64;
            units "pps";
            description
              "The traffic packet rate received on the PW.";
          }
    
          leaf output-bytes {
            type uint64;
            units "Byte";
            description
              "The traffic bytes transmitted out of the PW.";
          }
    
          leaf output-packets {
            type uint64;
            units "packet";
            description
              "The traffic packets transmitted out of the PW.";
          }
    
          container qos-querys {
            description
              "List of the QoS traffic-statistics.";
            list qos-query {
              key "query";
              description
                "Indicates the query table of the QoS traffic statistics.";
              leaf query {
                type qos-query-type;
                description
                  "Indicates the query of the QoS traffic statistics.";
              }
    
              uses qos-query-info-grp;
            }  // list qos-query
          }  // container qos-querys
        }  // grouping qos-traffic-statistics-grp
    
        grouping qos-parameter-grp {
          description
            "QoS parameter information.";
          leaf cir {
            type uint32 {
              range "0 | 16..4294967294";
            }
            units "kbit/s";
            default "0";
            description "Specify the CIR.";
          }
    
          leaf pir {
            type uint32 {
              range "0 | 16..4294967294";
            }
            units "kbit/s";
            description "Specify the PIR.";
          }
    
          leaf profile-name {
            when "../pir>0";
            type leafref {
              path "/qos:qos/qos:queue-scheduler-template/qos:profiles/qos:profile/qos:name";
            }
            description
              "Specify the name of QoS profile.";
          }
        }  // grouping qos-parameter-grp
    
        grouping pw-info-grp {
          description
            "Operational data of L2VPN PWs using tunnels.";
          container pws {
            config false;
            description
              "List of L2VPN PWs using tunnels.";
            list pw {
              key "index";
              description
                "Operational data of L2VPN PW using tunnels.";
              leaf index {
                type uint32;
                description
                  "Index automatically generated by the host for each PW, which is used to quickly search for PWs.";
              }
    
              leaf instance-name {
                type l2vpn:l2vpn-instance-name;
                description
                  "The name of L2VPN instance.";
              }
    
              leaf instance-type {
                type l2vpn:l2vpn-instance-type;
                description
                  "The type of L2VPN instance.";
              }
    
              leaf pw-role {
                type pw-role-type;
                description "Role of a PW.";
              }
    
              leaf peer-ip {
                type inet:ip-address-no-zone;
                description
                  "Peer IP address of a PW.";
              }
    
              leaf pw-id {
                type uint32;
                description "PW ID of a PW.";
              }
    
              leaf encapsulation-type {
                type l2vpn:encapsulation-type;
                description
                  "Encapsulation type of a PW.";
              }
    
              leaf interface-name {
                type leafref {
                  path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                }
                description
                  "The name of an AC interface.";
              }
            }  // list pw
          }  // container pws
        }  // grouping pw-info-grp
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls {
          description
            "Configure the vpls QoS traffic statistics.";
          container qos-parameter {
            must "cir<=pir" {
              error-message
                "The pir value is less than cir value.";
            }
            must "not(cir=0 and pir=0)" {
              error-message
                "The cir and pir value can not be zero at same time.";
            }
            must
              "not(/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance[l2vpn:name=current()/../../l2vpn:name][l2vpn:type='vpls']/l2vpn:vpls/l2vpn:ldp-signaling/l2vpn:pws/l2vpn:pw/l2vpn-extension:qos-parameter)";
            presence "enable QoS for pw";
            description
              "Enable/disable the QoS parameter information.";
            uses qos-parameter-grp;
          }  // container qos-parameter
    
          container qos-traffic-statistics {
            config false;
            description
              "Operational data of QoS traffic statistics table.";
            uses qos-traffic-statistics-grp;
          }  // container qos-traffic-statistics
        }
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:ldp-signaling/l2vpn:pws/l2vpn:pw {
          description
            "Configure the vpls ldp pw QoS traffic statistics.";
          container qos-parameter {
            when "../l2vpn:name";
            must "cir<=pir" {
              error-message
                "The pir value is less than cir value.";
            }
            must "not(cir=0 and pir=0)" {
              error-message
                "The cir and pir value can not be zero at same time.";
            }
            must
              "not(/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance[l2vpn:name=current()/../../../../../l2vpn:name][l2vpn:type='vpls']/l2vpn:vpls/l2vpn-extension:qos-parameter)";
            presence "enable QoS for pw";
            description
              "Enable/disable the QoS parameter information.";
            uses qos-parameter-grp;
          }  // container qos-parameter
    
          container qos-traffic-statistics {
            config false;
            description
              "Operational data of QoS traffic statistics table.";
            uses qos-traffic-statistics-grp;
          }  // container qos-traffic-statistics
        }
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpws-bgp/l2vpn:pws/l2vpn:pw {
          description
            "Configure the vpws-bgp pw QoS traffic statistics.";
          container qos-parameter {
            must "cir<=pir" {
              error-message
                "The pir value is less than cir value.";
            }
            must "not(cir=0 and pir=0)" {
              error-message
                "The cir and pir value can not be zero at same time.";
            }
            presence "enable QoS for pw";
            description
              "Enable/disable the QoS parameter information.";
            uses qos-parameter-grp;
          }  // container qos-parameter
    
          container qos-traffic-statistics {
            config false;
            description
              "Operational data of QoS traffic statistics table.";
            leaf interface-name {
              type leafref {
                path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
              }
              description
                "Indicates the type and number of the AC interface.";
            }
    
            uses qos-traffic-statistics-grp;
          }  // container qos-traffic-statistics
        }
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpws-ldp/l2vpn:pws/l2vpn:pw {
          description
            "Configure the vpws-ldp pw QoS traffic statistics.";
          container qos-parameter {
            when
              "../l2vpn:role!='ac-bypass' and ../l2vpn:role!='pw-bypass'";
            must "cir<=pir" {
              error-message
                "The pir value is less than cir value.";
            }
            must "not(cir=0 and pir=0)" {
              error-message
                "The cir and pir value can not be zero at same time.";
            }
            must
              "not(/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpws-ldp/l2vpn:pws/l2vpn:pw/l2vpn:endpoint)";
            must
              "not(/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpws-ldp/l2vpn:pws/l2vpn:pw/l2vpn:color)";
            presence "enable QoS for pw";
            description
              "Enable/disable the QoS parameter information.";
            uses qos-parameter-grp;
          }  // container qos-parameter
    
          container qos-traffic-statistics {
            config false;
            description
              "Operational data of QoS traffic statistics table.";
            leaf interface-name {
              type leafref {
                path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
              }
              description
                "Indicates the type and number of the AC interface.";
            }
    
            uses qos-traffic-statistics-grp;
          }  // container qos-traffic-statistics
        }
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpws-switch/l2vpn:pws/l2vpn:pw {
          description
            "Configure the vpws-switch pw QoS traffic statistics.";
          container qos-parameter {
            when
              "../../../l2vpn:switch-type != 'ldp-ldp-bak'";
            must "cir<=pir" {
              error-message
                "The pir value is less than cir value.";
            }
            must "not(cir=0 and pir=0)" {
              error-message
                "The cir and pir value can not be zero at same time.";
            }
            must
              "not(/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpws-switch/l2vpn:pws/l2vpn:pw/l2vpn:endpoint)";
            must
              "not(/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpws-switch/l2vpn:pws/l2vpn:pw/l2vpn:color)";
            presence "enable QoS for pw";
            description
              "Enable/disable QoS parameter information.";
            uses qos-parameter-grp;
          }  // container qos-parameter
        }
    
        augment /l2vpn:l2vpn/l2vpn:common/l2vpn:pw-templates/l2vpn:pw-template {
          description
            "Configure the QoS traffic statistics in pw-template.";
          container qos-parameter {
            must "cir<=pir" {
              error-message
                "The pir value is less than cir value.";
            }
            must "not(cir=0 and pir=0)" {
              error-message
                "The cir and pir value can not be zero at same time.";
            }
            presence "enable QoS for pw";
            description
              "Enable/disable QoS parameter information.";
            uses qos-parameter-grp;
          }  // container qos-parameter
        }
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:acs/l2vpn:ac {
          description
            "Configure the VPLS OAM mapping.";
          container ac-oam-mapping {
            ext:operation-exclude "update";
            when
              "../../../l2vpn:work-mode='normal' and /ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../l2vpn:interface-name]/ifm:class='sub-interface'";
            presence "enable ac oam mapping";
            description
              "Enable/disable OAM mapping.";
            leaf type {
              type l2vpn:ac-oam-mapping-type;
              must
                "../type='1ag' and ../md-name and ../ma-name";
              mandatory true;
              description
                "VPLS OAM mapping type.";
            }
    
            leaf md-name {
              when "../type='1ag'";
              type string {
                length "1..43";
              }
              description
                "VPLS OAM mapping parameter MD name.";
            }
    
            leaf ma-name {
              when "../type='1ag'";
              type string {
                length "1..43";
              }
              description
                "VPLS OAM mapping parameter MA name.";
            }
          }  // container ac-oam-mapping
        }
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:ldp-signaling/l2vpn:pws/l2vpn:pw {
          description
            "Configure the vpls track VRRP.";
          container track-vrrp {
            ext:operation-exclude "update";
            when
              "../../../../l2vpn:work-mode='bd-mode'";
            presence "enable pw track vrrp";
            description
              "Configure VRRP parameter list.";
            leaf vrrp-interface-name {
              type leafref {
                path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
              }
              must
                "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()]/ip:ipv4/vrrp:vrrp/vrrp:groups/vrrp:group[vrrp:id=current()/../vrrp-vrid]/vrrp:admin-flag or
    /ni:network-instance/ni:instances/ni:instance/vrrp:vrrp/vrrp:groups/vrrp:group[vrrp:id=current()/../vrrp-vrid]/vrrp:admin-flag";
              mandatory true;
              description "VRRP interface.";
            }
    
            leaf vrrp-vrid {
              type uint32 {
                range "1..255";
              }
              mandatory true;
              description
                "VRID of a VRRP backup group.";
            }
    
            leaf pw-redundancy {
              type boolean;
              must "../pw-redundancy='true'";
              default "true";
              description
                "Enable/disable VRRP PW redundancy mode.";
            }
    
            leaf backup-block-all {
              type boolean;
              must "../backup-block-all='true'";
              default "true";
              description
                "Enable/disable block the traffic on the backup PW.";
            }
          }  // container track-vrrp
        }
    
        augment /ifm:ifm/ifm:interfaces/ifm:interface/tnlm:tunnel-protocol/tnlm:type/mpls-te:mpls-te/mpls-te:te-tunnel/mpls-te:tunnel-mode/mpls-te:p2p-rsvp-te/mpls-te:rsvp-te {
          description
            "Operational data of L2VPN PWs using tunnels.";
          uses pw-info-grp;
        }
    
        augment /ifm:ifm/ifm:interfaces/ifm:interface/tnlm:tunnel-protocol/tnlm:type/mpls-te:mpls-te/mpls-te:te-tunnel/mpls-te:sr-te {
          description
            "Operational data of L2VPN PWs using tunnels.";
          uses pw-info-grp;
        }
    
        augment /ifm:ifm/ifm:interfaces/ifm:interface/tnlm:tunnel-protocol/tnlm:type/mpls-te:mpls-te/mpls-te:te-tunnel/mpls-te-cr-static:cr-static {
          description
            "Operational data of L2VPN PWs using tunnels.";
          uses pw-info-grp;
        }
      }  // module huawei-l2vpn-extension
    

© 2023 YumaWorks, Inc. All rights reserved.