netconfcentral logo

l2vpn@2014-08-21



  module l2vpn {

    yang-version 1;

    namespace
      "urn:huawei:params:xml:ns:yang:l2vpn";

    prefix l2vpn;

    import ietf-inet-types {
      prefix inet;
    }
    import ietf-interfaces {
      prefix if;
    }
    import ietf-yang-types {
      prefix yang;
    }

    description
      "This YANG module defines the generic configuration data for
         L2VPN services.

         Terms and Acronyms
         L2VPN: Layer 2 Virtual Private Network
         VPLS: Virtual Private LAN Service
         VPWS: Virtual Private Wire Service
         ...
         ";

    revision "2014-08-21" {
      description "Initial revision.";
    }


    typedef pw-encapsulation {
      type enumeration {
        enum "fr" {
          value 0;
          description "fr:";
        }
        enum "atm-aal5-sdu" {
          value 1;
          description "atm-aal5-sdu:";
        }
        enum "atm-trans-cell" {
          value 2;
          description "atm-trans-cell:";
        }
        enum "vlan" {
          value 3;
          description "vlan:";
        }
        enum "ethernet" {
          value 4;
          description "ethernet:";
        }
        enum "hdlc" {
          value 5;
          description "hdlc:";
        }
        enum "ppp" {
          value 6;
          description "ppp:";
        }
        enum "cem" {
          value 7;
          description "cem:";
        }
        enum "atm-nto1-vcc" {
          value 8;
          description "atm-nto1-vcc:";
        }
        enum "atm-nto1-vpc" {
          value 9;
          description "atm-nto1-vpc:";
        }
        enum "ip-layer2" {
          value 10;
          description "ip-layer2:";
        }
        enum "atm-1to1-vcc" {
          value 11;
          description "atm-1to1-vcc:";
        }
        enum "atm-1to1-vpc" {
          value 12;
          description "atm-1to1-vpc:";
        }
        enum "atm-aal5-pdu" {
          value 13;
          description "atm-aal5-pdu:";
        }
        enum "fr-port-mode" {
          value 14;
          description "fr-port-mode:";
        }
        enum "cesop" {
          value 15;
          description "cesop:";
        }
        enum "satop-e1" {
          value 16;
          description "satop-e1:";
        }
        enum "satop-t1" {
          value 17;
          description "satop-t1:";
        }
        enum "satop-e3" {
          value 18;
          description "satop-e3:";
        }
        enum "satop-t3" {
          value 19;
          description "satop-t3:";
        }
        enum "cesopsn-basic" {
          value 20;
          description "cesopsn-basic:";
        }
        enum "tdmoip_aal1" {
          value 21;
          description "tdmoip_aal1:";
        }
        enum "cesopsn_tdm" {
          value 22;
          description "cesopsn_tdm:";
        }
        enum "tdmoip_aal2" {
          value 23;
          description "tdmoip_aal2:";
        }
        enum "fr_dlci" {
          value 24;
          description "fr_dlci:";
        }
        enum "ip-interworking" {
          value 25;
          description "ip-interworking:";
        }
        enum "unsupport" {
          value 26;
          description "unsupport:";
        }
      }
      description "PW encapsulation type.";
    }

    typedef pw-role {
      type enumeration {
        enum "primary" {
          value 0;
          description "primary:";
        }
        enum "backup" {
          value 1;
          description "backup:";
        }
        enum "bypass" {
          value 2;
          description "bypass:";
        }
        enum "multiHopOneSidePrimary" {
          value 3;
          description
            "multiHopOneSidePrimary:";
        }
        enum "multiHopOtherSidePrimary" {
          value 4;
          description
            "multiHopOtherSidePrimary:";
        }
        enum "multiHopOtherSideBackup" {
          value 5;
          description
            "multiHopOtherSideBackup:";
        }
      }
      description "pw role.";
    }

    typedef tunnelType {
      type enumeration {
        enum "invalid" {
          value 0;
          description "invalid tunnel type";
        }
        enum "ldp" {
          value 1;
          description "LDP LSP";
        }
        enum "bgp" {
          value 2;
          description "BGP LSP";
        }
        enum "te" {
          value 3;
          description "TE tunnel";
        }
        enum "static_lsp" {
          value 4;
          description "static lsp";
        }
        enum "gre" {
          value 5;
          description "GRE tunnel";
        }
        enum "uni" {
          value 6;
          description "uni tunnel";
        }
        enum "tnl_group" {
          value 7;
          description "tnl-group";
        }
        enum "sub_te" {
          value 8;
          description "TE sub tunnel";
        }
        enum "sub_group" {
          value 9;
          description "sub tunnel group";
        }
        enum "6over4" {
          value 10;
          description
            "manual IPv6 tunnel carry IPv4 traffic";
        }
        enum "6to4" {
          value 11;
          description
            "automatic IPv6 tunnel carry IPv4 traffic";
        }
        enum "bgp_local_ifnet" {
          value 12;
          description
            "BGP created mpls localifnet tunnel";
        }
        enum "ldp6" {
          value 13;
          description "IPv6 LDP LSP";
        }
      }
      description
        "Indicates the type of tunnel used by the PW.";
    }

    typedef ifState {
      type enumeration {
        enum "down" {
          value 0;
          description "down:";
        }
        enum "up" {
          value 1;
          description "up:";
        }
        enum "plugOut" {
          value 2;
          description "plugOut:";
        }
        enum "notifyDown" {
          value 3;
          description "notifyDown:";
        }
        enum "downNotify" {
          value 4;
          description "downNotify:";
        }
      }
      description "Interface state.";
    }

    typedef pwState {
      type enumeration {
        enum "down" {
          value 0;
          description "down:";
        }
        enum "up" {
          value 1;
          description "up:";
        }
        enum "backup" {
          value 2;
          description "backup:";
        }
      }
      description
        "Indicates the status of the PW.";
    }

    typedef instanceType {
      type enumeration {
        enum "vpwsLocalccc" {
          value 0;
          description "vpwsLocalccc:";
        }
        enum "vpwsRemoteccc" {
          value 1;
          description "vpwsRemoteccc:";
        }
        enum "vpwsSvc" {
          value 2;
          description "vpwsSvc:";
        }
        enum "vpwsLdp" {
          value 3;
          description "vpwsLdp:";
        }
        enum "vpwsSwitch" {
          value 4;
          description "vpwsSwitch:";
        }
        enum "vpls" {
          value 5;
          description "vpls:";
        }
      }
      description "Instance type. ";
    }

    grouping tdmParameter {
      description "Configure TDM parameter.";
      leaf tdmEncapsulateNumber {
        type uint8 {
          range "1..40";
        }
        description
          "Number of encapsulated TDM frames.";
      }

      leaf jitterBuffer {
        type uint16 {
          range "1000..64000";
        }
        description
          "Depth of the TDM jitter buffer.";
      }

      leaf rtpHeader {
        type boolean;
        description
          "Whether or not the RTP header is added into the
                 transparently transported TDM frame.";
      }

      leaf idleCode {
        type string {
          length "1..2";
          pattern
            "^((([1-9]|[a-f]|[A-F])([0-9]|[a-f]|[A-F])?)|
                         (0([0-9]|[a-f]|[A-F])?))$";
        }
        description
          "Specifies the value of the idle code that is filled
                 manually when the jitter buffer underflow occurs.";
      }

      leaf tdmSequenceNumber {
        type boolean;
        description
          "Enable the seq-number option.";
      }

      leaf payloadCompression {
        type boolean;
        description
          "Specifies the dynamic bandwidth allocation for payload
                 compression.";
      }

      leaf timeSlot {
        type uint8 {
          range "1..32";
        }
        description
          "Specifies the time slot of the serial interface.";
      }
    }  // grouping tdmParameter

    grouping atmParameter {
      description "Configure ATM parameter.";
      leaf maxAtmCells {
        type uint8 {
          range "1..28";
        }
        description
          "Maximum number of transmitted ATM cells.";
      }

      leaf atmPackOvertime {
        type uint16 {
          range "100..10000";
        }
        description
          "Delay in packing ATM cells.";
      }

      leaf atmTransmitCell {
        type uint8 {
          range "1..28";
        }
        description "ATM transmit cell.";
      }

      leaf sequenceNumber {
        type boolean;
        description
          "Enable the seq-number option.";
      }
    }  // grouping atmParameter

    grouping speInfos {
      leaf speCount {
        type uint32;
        config false;
        description "Number of Spe.";
      }

      list speInfo {
        key "spePwId spePeerIp";
        config false;
        leaf spePwId {
          type uint32;
          description
            "Indicates the identifier of the PW.";
        }

        leaf spePeerIp {
          type inet:ip-address;
          description
            "Specifies the LSR ID of the peer PE.";
        }
      }  // list speInfo
    }  // grouping speInfos

    grouping vpwsPws {
      list vpwsPw {
        key "pwRole pwId";
        description "L2vpn vpws pw class.";
        leaf pwRole {
          type pw-role;
          description
            "VPWS pw role:primary, backup,bypass.";
        }

        leaf pwId {
          type uint32 {
            range "1..4294967295";
          }
          description
            "Indicates the identifier of the PW.";
        }

        leaf peerIp {
          type inet:ip-address;
          description
            "Specifies the LSR ID of the peer PE.";
        }

        leaf transmitLabel {
          type uint32 {
            range "0..1048575";
          }
          description
            "Indicates the label value of sent packets.";
        }

        leaf receiveLabel {
          type uint32 {
            range "16..32767";
          }
          description
            "Indicates the label value of received packets.";
        }

        leaf ctrlWord {
          type enumeration {
            enum "default" {
              value 0;
              description "default:";
            }
            enum "disable" {
              value 1;
              description "disable:";
            }
            enum "enable" {
              value 2;
              description "enable:";
            }
          }
          description
            "Enables the control word function. The control word
                    function is usually enabled on PWs with encapsulation
                    types being TDM, ATM or FR.

                    By default:
                    The control word function is enabled for TDM-, ATM-, or
                    Frame Relay-encapsulated PWs if PW profiles are not used.
                    If a PW profile is used, the control word function can
                    be enabled only after the control word is explicitly
                    specified. The control word function can be enabled for
                    PWs that use other types of encapsulation only after
                    the control word is explicitly specified.";
        }

        leaf vccvAbility {
          type boolean;
          default "true";
          description
            "Configures VC connectivity detection. VC connectivity
                    detection supports two modes: control word mode and
                    label alert mode.";
        }

        leaf tnlPolicyName {
          type string {
            length "1..39";
          }
          description
            "Specifies a tunnel policy name for the L2VC. If no name
                    is specified for a tunnel policy, the default tunnel
                    policy is adopted. The LSP tunnel is preferred and only
                    one LSP is used for load balancing in the default tunnel
                    policy. If the name of the tunnel policy is specified but
                    no tunnel policy is configured, the default tunnel policy
                    is still adopted.";
        }

        leaf pwTemplateName {
          type string {
            length "1..19";
          }
          description
            "Specifies the name of a PW template. You can set
                     attributes for a PW template, including the remote
                     peer, tunnel policy, and control word. When configuring
                     an LDP PW, you can directly apply the PW template rather
                     than specifying attributes for the PW.";
        }

        leaf requestVlanId {
          type uint16 {
            range "1..4094";
          }
          description
            "Indicates the requested VLAN ID.";
        }

        leaf vlanTpId {
          type string {
            length "1..4";
            pattern
              "^([0-9]|[a-f]|[A-F]){0,4}$";
          }
          description
            "Indicates the TPID of requested VLAN ID.";
        }

        leaf pwTtl {
          type uint8 {
            range "1..255";
          }
          description
            "Specify the TTL for PW.";
        }

        container tdmParameters {
          uses tdmParameter;
        }  // container tdmParameters

        container atmParameters {
          uses atmParameter;
        }  // container atmParameters

        container vpwsLdpPwInfo {
          leaf interfaceName {
            type leafref {
              path
                "/if:interfaces/if:interface/if:name";
            }
            config false;
            description
              "Indicates the type and number of the AC
                         interface.";
          }

          leaf ifState {
            type ifState;
            config false;
            description
              "Indicates  status of the AC interface.";
          }

          leaf sessionState {
            type enumeration {
              enum "default" {
                value 0;
                description "default:";
              }
              enum "down" {
                value 1;
                description "down:";
              }
              enum "up" {
                value 2;
                description "up:";
              }
            }
            config false;
            description
              "Indicates the status of the LDP session established
                         between both ends of the VC.";
          }

          leaf integrativeAcState {
            type ifState;
            config false;
            description
              "The integrative status of the AC.";
          }

          leaf acState {
            type ifState;
            config false;
            description
              "Indicates the status of the AC.";
          }

          leaf pwState {
            type pwState;
            config false;
            description
              "Indicates the status of the PW.";
          }

          leaf pwId {
            type uint32;
            config false;
            description
              "Indicates the identifier of the PW.";
          }

          leaf encapType {
            type pw-encapsulation;
            config false;
            description
              "Indicates the encapsulation type of the PW.";
          }

          leaf destination {
            type inet:ip-address;
            config false;
            description
              "Indicates the LSR ID of the VC peer device.";
          }

          leaf localGroupId {
            type uint32;
            config false;
            description
              "Indicates the local group ID.";
          }

          leaf remoteGroupId {
            type uint32;
            config false;
            description
              "Indicates the remote group ID.";
          }

          leaf localVcLabel {
            type uint32;
            config false;
            description
              "Indicates the local VC label.";
          }

          leaf remoteVcLabel {
            type uint32;
            config false;
            description
              "Indicates the remote VC label.";
          }

          container tdmInfo {
            config false;
            description "TDM info";
            leaf localTdmEncapsulateNum {
              type uint8;
              config false;
              description
                "Number of encapsulated TDM frames.";
            }

            leaf remoteTdmEncapsulateNum {
              type uint8;
              config false;
              description
                "Number of encapsulated TDM frames.";
            }

            leaf jitterBuffer {
              type uint8;
              config false;
              description
                "Depth of the TDM jitter buffer.";
            }

            leaf idleCode {
              type string {
                length "0..3";
              }
              config false;
              description
                "Indicates the idle code that is filled manually
                              when the jitter buffer underflow occurs.";
            }

            leaf localRtpHeaderEnable {
              type boolean;
              config false;
              description
                "Whether or not the RTP header is added into
                              the transparently transported TDM frame.";
            }

            leaf remoteRtpHeaderEnable {
              type boolean;
              config false;
              description
                "Whether or not the RTP header is added into the
                              transparently transported TDM frame.";
            }

            leaf localBitRate {
              type uint16;
              config false;
              description
                "Indicates the bit-rate of the local VC.";
            }

            leaf remoteBitRate {
              type uint16;
              config false;
              description
                "Indicates the bit-rate of the remoteVC.";
            }
          }  // container tdmInfo

          container atmInfo {
            config false;
            description "TDM info";
            leaf maxAtmCells {
              type uint8 {
                range "1..28";
              }
              config false;
              description
                "Maximum number of transmitted ATM cells.";
            }

            leaf remoteMaxAtmCells {
              type uint8 {
                range "0..28";
              }
              config false;
              description
                "Maximum number of transmitted ATM cells.";
            }

            leaf atmPackOvertime {
              type uint16 {
                range "100..10000";
              }
              config false;
              description
                "Delay in packing ATM cells.";
            }

            leaf atmTransmitCell {
              type uint16 {
                range "1..28";
              }
              config false;
              description
                "ATM transmit cell.";
            }

            leaf sequenceNumber {
              type boolean;
              config false;
              description
                "Enable the seq-number option.By default, the
                              seq-number option is disabled.";
            }
          }  // container atmInfo

          leaf localFwdState {
            type enumeration {
              enum "notForwarding" {
                value 0;
                description "notForwarding:";
              }
              enum "forwarding" {
                value 1;
                description "forwarding:";
              }
            }
            config false;
            description
              "Indicates the status of the local forwarding table.";
          }

          leaf localStateCode {
            type uint32;
            config false;
            description
              "Indicates the status code of the local PW:
                        0x0: indicates that the local PW functioning as the
                             master PW is in the Up state.
                        0x20: indicates that the local PW functioning as the
                              backup PW is in the Up state.
                        0x1: indicates that the PW functioning as the master
                             PW and is in the Down state.
                        0x21: indicates that the PW functioning as the backup
                             PW and is in the Down state.";
          }

          leaf remoteFwdState {
            type enumeration {
              enum "notForwarding" {
                value 0;
                description "notForwarding:";
              }
              enum "forwarding" {
                value 1;
                description "forwarding:";
              }
            }
            config false;
            description
              "Indicates the status of the remote forwarding
                         table.";
          }

          leaf remoteStateCode {
            type uint32;
            config false;
            description
              " Indicates the status code of the remote PW:
                        0x0: indicates that the remote PW functioning as the
                             master PW is in the Up state.
                        0x20: indicates that the remote PW functioning as the
                              backup PW is in the Up state.
                        0x1: indicates that the PW functioning as the master
                             PW and is in the Down state.
                        0x21: indicates that the PW functioning as the backup
                              PW and is in the Down state.";
          }

          leaf isActive {
            type boolean;
            config false;
            description
              "Indicates whether or not the PW is in active state
                        (if so, user packets can be forwarded).";
          }

          leaf isForwardExist {
            type boolean;
            config false;
            description
              "Indicates whether or not forwarding entries exist.";
          }

          leaf linkState {
            type enumeration {
              enum "default" {
                value 0;
                description "default:";
              }
              enum "down" {
                value 1;
                description "down:";
              }
              enum "up" {
                value 2;
                description "up:";
              }
            }
            config false;
            description
              "Indicates the link status of the AC interface:
                        Up: indicates that the physical layer status of
                            the interface is functional.
                        Down: indicates that the physical layer of the
                              interface fails.";
          }

          leaf localVcMtu {
            type uint16;
            config false;
            description
              "Indicates the MTU of the local VC.";
          }

          leaf remoteVcMtu {
            type uint16;
            config false;
            description
              "Indicates the MTU of the remote VC.";
          }

          leaf localVCCV {
            type string {
              length "0..40";
            }
            config false;
            description
              "Indicates the type of VCCV that is supported
                         locally. By default, the control word function
                         is not enabled, and the supported VCCV type is
                         alert lsp-ping bfd, indicating that LSP ping
                         and BFD are supported for the alert channel.
                         If the control word function is enabled, the
                         VCCV type is cw alert lsp-ping bfd, indicating
                         that LSP ping and BFD are supported both for the
                         control word channel and the alert channel.";
          }

          leaf remoteVCCV {
            type string {
              length "0..40";
            }
            config false;
            description
              "Indicates the type of VCCV that is supported
                         remotely. By default, the control word function
                         is not enabled, and the supported VCCV type is
                         alert lsp-ping bfd, indicating that LSP ping and
                         BFD are supported for the alert channel. If the
                         control word function is enabled, the VCCV type
                         is cw alert lsp-ping bfd, indicating that LSP ping
                         and BFD are supported both for the control word
                         channel and the alert channel.";
          }

          leaf localCtrlWord {
            type enumeration {
              enum "default" {
                value 0;
                description "default:";
              }
              enum "disable" {
                value 1;
                description "disable:";
              }
              enum "enable" {
                value 2;
                description "enable:";
              }
            }
            config false;
            description
              "Indicates whether or not the control word is enabled
                        on the local end.";
          }

          leaf remoteCtrlWord {
            type enumeration {
              enum "default" {
                value 0;
                description "default:";
              }
              enum "disable" {
                value 1;
                description "disable:";
              }
              enum "enable" {
                value 2;
                description "enable:";
              }
            }
            config false;
            description
              "Indicates whether or not the control word is enabled
                         on the remote end.";
          }

          leaf tnlPolicyName {
            type string {
              length "1..39";
            }
            config false;
            description
              "Indicates the name of the tunnel policy.";
          }

          leaf pwTemplateName {
            type string {
              length "1..19";
            }
            config false;
            description
              "Indicates the name of the PW template.";
          }

          leaf priOrSec {
            type enumeration {
              enum "primary" {
                value 0;
                description "primary:";
              }
              enum "secondary" {
                value 1;
                description "secondary:";
              }
              enum "bypass" {
                value 2;
                description "bypass:";
              }
            }
            config false;
            description
              "Indicates whether the local status of the VC is
                         primary or secondary.";
          }

          leaf tunnelCount {
            type uint8;
            config false;
            description
              "Indicates that the PW uses one tunnel or token";
          }

          container tunnelInfos {
            config false;
            list tunnelInfo {
              key "tunnelKey";
              leaf tunnelKey {
                type string {
                  length "0..21";
                }
                description
                  "Indicates the ID of the tunnel used by the
                                 PW.";
              }

              leaf tunnelType {
                type tunnelType;
                config false;
                description
                  "Indicates the type of tunnel used by the
                                 PW.";
              }

              leaf tunnelName {
                type string {
                  length "0..64";
                }
                config false;
                description
                  "Indicates the name of the tunnel used by the
                                 PW.";
              }

              leaf publicNextHop {
                type inet:ip-address;
                config false;
                description
                  "Indicates public next hop of a tunnel.";
              }
            }  // list tunnelInfo
          }  // container tunnelInfos

          container speInfos {
            config false;
            uses speInfos;
          }  // container speInfos

          leaf createTime {
            type string {
              length "1..80";
            }
            config false;
            description
              "Indicates how long the VC has been created for.";
          }

          leaf upTime {
            type string {
              length "1..80";
            }
            config false;
            description
              "Indicates how long the VC keeps the Up state.
                         If the PW is currently in the Down state, the
                         value is 0.";
          }

          leaf lastChgTime {
            type string {
              length "1..80";
            }
            config false;
            description
              "Indicates how long the VC status has remained
                         unchanged.";
          }

          leaf pwLastUpTime {
            type yang:date-and-time;
            config false;
            description
              "Indicates the last time the VC was Up.";
          }

          leaf pwTotalUpTime {
            type string {
              length "1..80";
            }
            config false;
            description
              "Indicates the total duration the VC is Up.";
          }

          leaf supportNotification {
            type boolean;
            config false;
            description
              "Indicates whether or not the Notification
                         message is supported.";
          }
        }  // container vpwsLdpPwInfo
      }  // list vpwsPw
    }  // grouping vpwsPws

    grouping vplsPwInfo {
      leaf peerIp {
        type inet:ip-address;
        config false;
        description
          "Indicates the LSR ID of the VC peer device.";
      }

      leaf pwId {
        type uint32;
        config false;
        description
          "Indicates the identifier of the PW.";
      }

      leaf pwType {
        type enumeration {
          enum "label" {
            value 0;
            description "label:";
          }
          enum "QinQ" {
            value 1;
            description "QinQ:";
          }
          enum "MEHVPLS" {
            value 2;
            description "MEHVPLS:";
          }
        }
        config false;
        description
          "Type of the PW.label, QinQ,MEHVPLS";
      }

      leaf sessionState {
        type enumeration {
          enum "default" {
            value 0;
            description "default:";
          }
          enum "down" {
            value 1;
            description "down:";
          }
          enum "up" {
            value 2;
            description "up:";
          }
        }
        config false;
        description
          "Indicates the status of the LDP session established
                 between both ends of the VC.";
      }

      leaf pwState {
        type enumeration {
          enum "down" {
            value 0;
            description "down:";
          }
          enum "up" {
            value 1;
            description "up:";
          }
          enum "backup" {
            value 2;
            description "backup:";
          }
        }
        config false;
        description
          "Indicates the status of the PW.";
      }

      leaf localVcLabel {
        type uint32;
        config false;
        description
          "Indicates the local VC label.";
      }

      leaf remoteVcLabel {
        type uint32;
        config false;
        description
          "Indicates the remote VC label.";
      }

      leaf tnlPolicyName {
        type string {
          length "1..39";
        }
        config false;
        description
          "Indicates the name of the tunnel policy.";
      }

      leaf pwLastUpTime {
        type yang:date-and-time;
        config false;
        description
          "Indicates the last time the VC was Up.";
      }

      leaf pwTotalUpTime {
        type string {
          length "1..80";
        }
        config false;
        description
          "Indicates the total duration the VC is Up.";
      }

      container tunnelInfos {
        config false;
        list tunnelInfo {
          key "tunnelKey";
          leaf tunnelKey {
            type string {
              length "0..21";
            }
            description
              "Indicates the ID of the tunnel used by the PW.";
          }

          leaf tunnelType {
            type tunnelType;
            config false;
            description
              "Indicates the type of tunnel used by the PW.";
          }

          leaf outIntf {
            type string {
              length "0..256";
            }
            config false;
            description
              "Outbound interface.";
          }

          leaf tunnelName {
            type string {
              length "0..64";
            }
            config false;
            description
              "Indicates the name of the tunnel used by the PW.";
          }

          leaf publicNextHop {
            type inet:ip-address;
            config false;
            description
              "Assign public next hop of a tunnel.";
          }
        }  // list tunnelInfo
      }  // container tunnelInfos

      container speInfos {
        config false;
        uses speInfos;
      }  // container speInfos

      leaf remoteGroupId {
        type uint32;
        config false;
        description
          "ID of the remote group.";
      }

      leaf remoteMtu {
        type uint16;
        config false;
        description
          "Indicates the MTU of a remote VC.";
      }

      leaf remoteVCCVcode {
        type string {
          length "0..40";
        }
        config false;
        description
          "Indicates the VCCV of a remote VC.";
      }

      leaf remoteStateCode {
        type enumeration {
          enum "forward" {
            value 0;
            description "forward:";
          }
          enum "not-forward" {
            value 1;
            description "not forward:";
          }
          enum "standby" {
            value 2;
            description "standby:";
          }
          enum "ac-fault" {
            value 3;
            description "ac fault:";
          }
          enum "psn-fault" {
            value 4;
            description "psn fault:";
          }
        }
        config false;
        description
          "Indicates the status of a remote VC, which can be:
                FORWARD: The remote VC is in the forwarding state.
                STANDBY: The remote VC is in the standby state.
                AC FAULT: The remote AC interface is faulty.
                PSN FAULT: The remote VC is faulty.
                NO FORWRD: The remote VC interface cannot forward packets
                           owing to other reasons. ";
      }
    }  // grouping vplsPwInfo

    container l2vpncommon {
      container l2vpnGlobal {
        description
          "L2VPN golbal attribute.";
        leaf l2vpnEnable {
          type boolean;
          mandatory true;
          description "L2vpn enable flag.";
        }

        leaf vplsLoopDetectEnable {
          type boolean;
          description
            "Vpls mac withdraw loop detect enable flag.";
        }
      }  // container l2vpnGlobal

      container pwTemplates {
        list pwTemplate {
          key "pwTemplateName";
          description
            "L2VPN pw template class.";
          leaf pwTemplateName {
            type string {
              length "1..19";
            }
            description
              "Specifies the PW template name. The value is a
                         case-sensitive string of 1 to 19 characters without
                         blank space.";
          }

          leaf peerAddr {
            type inet:ip-address;
            description
              "Assign a peer IP address to a PW template.";
          }

          leaf mtu {
            type uint16 {
              range "46..9600";
            }
            default "1500";
            description
              "Configure the mtu value for PW template, 46 to 9600.";
          }

          leaf ctrlWord {
            type enumeration {
              enum "default" {
                value 0;
                description "default:";
              }
              enum "disable" {
                value 1;
                description "disable:";
              }
              enum "enable" {
                value 2;
                description "enable:";
              }
            }
            description
              "Enable the control word in a PW template.";
          }

          leaf tunnelPolicy {
            type string {
              length "1..39";
            }
            description
              "Configure a tunnel policy for a PW template.";
          }

          uses tdmParameter;

          uses atmParameter;
        }  // list pwTemplate
      }  // container pwTemplates

      container notMatchRemoteLdpInfos {
        config false;
        list notMatchRemoteLdpInfo {
          key "pwId peerIp encapsulateType";
          leaf pwId {
            type uint32;
            description
              "After an ID is set for a VC, it cannot be changed.
                         Different VCs have different IDs.";
          }

          leaf peerIp {
            type inet:ip-address;
            description
              "Indicates the peer ip of the VC peer device.";
          }

          leaf encapsulateType {
            type pw-encapsulation;
            description
              "Indicates the encapsualtion VC peer device.";
          }

          leaf remoteLabel {
            type uint32;
            config false;
            description
              "Indicates the remote VC label.";
          }

          leaf remoteGroupId {
            type uint32;
            config false;
            description
              "ID of the remote group.";
          }

          leaf remoteMtu {
            type uint16;
            config false;
            description
              "Indicates the MTU of a remote VC.";
          }

          leaf remoteStateCode {
            type enumeration {
              enum "forward" {
                value 0;
                description "forward:";
              }
              enum "not-forward" {
                value 1;
                description "not forward:";
              }
              enum "standby" {
                value 2;
                description "standby:";
              }
              enum "ac-fault" {
                value 3;
                description "ac fault:";
              }
              enum "psn-fault" {
                value 4;
                description "psn fault:";
              }
            }
            config false;
            description
              "Indicates the status of a remote VC, which can be:
                            FORWARD: The remote VC is in the forwarding state.
                            STANDBY: The remote VC is in the standby state.
                            AC FAULT: The remote AC interface is faulty.
                            PSN FAULT: The remote VC is faulty.
                            NO FORWRD: The remote VC interface cannot forward
                                       packets owing to other reasons.";
          }
        }  // list notMatchRemoteLdpInfo
      }  // container notMatchRemoteLdpInfos
    }  // container l2vpncommon

    container l2vpnvpws {
      container vpwsStatisticInfo {
        container vpwsLdpAcStatInfo {
          leaf totalLdpAcNum {
            type uint32;
            config false;
            description
              "Total number of L2VPN VPWS LDP AC.";
          }

          leaf upLdpAcNum {
            type uint32;
            config false;
            description
              "Up number of L2VPN VPWS LDP AC.";
          }

          leaf downLdpAcNum {
            type uint32;
            config false;
            description
              "Down number of L2VPN VPWS LDP AC.";
          }
        }  // container vpwsLdpAcStatInfo

        container vpwsLdpPwStatInfo {
          leaf totalLdpPwNum {
            type uint32;
            config false;
            description
              "Indicates the total number of established LDP PWs";
          }

          leaf upLdpPwNum {
            type uint32;
            config false;
            description
              "Number of LDP PWs in the up state.";
          }

          leaf downLdpPwNum {
            type uint32;
            config false;
            description
              "Number of LDP PWs in the down state.";
          }
        }  // container vpwsLdpPwStatInfo

        container vpwsLdpPwRemoteStatInfo {
          leaf remoteVcNum {
            type uint32;
            config false;
            description
              "Indicates the total number of created remote LDP
                         PWs.";
          }
        }  // container vpwsLdpPwRemoteStatInfo

        container vpwsSwitchInstanceStatInfo {
          leaf totalSwitchInstanceNum {
            type uint32;
            config false;
            description
              "Indicates the total number of established switch-vc";
          }

          leaf upSwitchInstanceNum {
            type uint32;
            config false;
            description
              "Number of switch-vc in the up state.";
          }

          leaf downSwitchInstanceNum {
            type uint32;
            config false;
            description
              "Number of switch-vc in the down state.";
          }
        }  // container vpwsSwitchInstanceStatInfo
      }  // container vpwsStatisticInfo

      container vpwsInstances {
        list vpwsInstance {
          key "instanceName instanceType";
          description
            "L2vpn vpws instance class.";
          leaf instanceName {
            type leafref {
              path "/if:interfaces/if:interface/if:name";
            }
            description
              "Specifies VPWS instance name.";
          }

          leaf instanceType {
            type instanceType;
            description
              "VPWS instance type:ldp,localccc.";
          }

          leaf encapsulateType {
            type pw-encapsulation;
          }

          leaf description {
            type string {
              length "1..64";
            }
            description
              "Specifies a description for the VC.";
          }

          leaf instanceState {
            type enumeration {
              enum "down" {
                value 0;
                description "down:";
              }
              enum "up" {
                value 1;
                description "up:";
              }
              enum "adminDown" {
                value 2;
                description "adminDown:";
              }
            }
            config false;
            description
              "VPWS instance state.";
          }

          leaf lastUpTime {
            type yang:date-and-time;
            config false;
            description
              "Indicates how long the instance keeps the Up state.
                         If the PW is currently in the Down state, the value
                         is 0.";
          }

          leaf totalUpTime {
            type string {
              length "1..80";
            }
            config false;
            description
              "Indicates the total duration the instance is Up.";
          }

          container tdmParameters {
            uses tdmParameter;
          }  // container tdmParameters

          container atmParameters {
            uses atmParameter;
          }  // container atmParameters

          container l2vpnAcs {
            list l2vpnAc {
              key "interfaceName";
              description "L2VPN ac class.";
              leaf interfaceName {
                type leafref {
                  path "/if:interfaces/if:interface/if:name";
                }
                description
                  "Specifies the AC interface name.";
              }

              leaf state {
                type enumeration {
                  enum "default" {
                    value 0;
                    description "default:";
                  }
                  enum "down" {
                    value 1;
                    description "down:";
                  }
                  enum "up" {
                    value 2;
                    description "up:";
                  }
                }
                config false;
                description
                  "Indicates the status of the AC.";
              }

              container l2vpnPipe {
                description
                  "L2VPN pipe mode.";
                leaf pipeMode {
                  type enumeration {
                    enum "pipe" {
                      value 0;
                      description "pipe:";
                    }
                    enum "shortPipe" {
                      value 1;
                      description
                        "shortPipe:";
                    }
                    enum "uniform" {
                      value 2;
                      description "uniform:";
                    }
                  }
                  default "uniform";
                  description "Pipe mode.";
                }
              }  // container l2vpnPipe

              container ifLinkProtocolTran {
                description "lacp status";
                leaf protocolLacp {
                  type enumeration {
                    enum "enable" {
                      value 0;
                      description "enable:";
                    }
                    enum "disable" {
                      value 1;
                      description "disable:";
                    }
                  }
                  description "lacp status";
                }

                leaf protocolLldp {
                  type enumeration {
                    enum "enable" {
                      value 0;
                      description "enable:";
                    }
                    enum "disable" {
                      value 1;
                      description "disable:";
                    }
                  }
                  description "lldp status";
                }

                leaf protocolBpdu {
                  type enumeration {
                    enum "enable" {
                      value 0;
                      description "enable:";
                    }
                    enum "disable" {
                      value 1;
                      description "disable:";
                    }
                  }
                  description "bpdu status";
                }

                leaf protocolCdp {
                  type enumeration {
                    enum "enable" {
                      value 0;
                      description "enable:";
                    }
                    enum "disable" {
                      value 1;
                      description "disable:";
                    }
                  }
                  description "cdp status";
                }

                leaf protocolUdld {
                  type enumeration {
                    enum "enable" {
                      value 0;
                      description "enable:";
                    }
                    enum "disable" {
                      value 1;
                      description "disable:";
                    }
                  }
                  description "udld status";
                }
              }  // container ifLinkProtocolTran
            }  // list l2vpnAc
          }  // container l2vpnAcs

          container vpwsPws {
            uses vpwsPws;
          }  // container vpwsPws

          container reliabilitys {
            list reliability {
              key "pwRedundancyMode";
              leaf pwRedundancyMode {
                type enumeration {
                  enum "frr" {
                    value 0;
                    description "frr:";
                  }
                  enum "masterSlave" {
                    value 1;
                    description
                      "masterSlave:";
                  }
                  enum "independent" {
                    value 2;
                    description
                      "independent:";
                  }
                }
                description
                  "Specifies the redundancy mode of VPWS
                                 instance.";
              }

              leaf switchover {
                type boolean;
                description
                  "Specifies switches traffic from the primary
                                 PW to the secondary PW.";
              }

              leaf dualReceive {
                type boolean;
                description
                  "Specifies enables a UPE interface to receive
                                 packets from both the primary and secondary
                                 PWs.";
              }

              container reRoute {
                description
                  "L2vpn vpws pw reroute class.";
                leaf reRoutePolicy {
                  type enumeration {
                    enum "delay" {
                      value 0;
                      description "delay:";
                    }
                    enum "immediately" {
                      value 1;
                      description
                        "immediately:";
                    }
                    enum "never" {
                      value 2;
                      description "never:";
                    }
                  }
                  description
                    "Specifies the Policy of Reroute.";
                }

                leaf delayTime {
                  type uint16 {
                    range "10..600";
                  }
                  description
                    "Specifies the delay for switching traffic
                                     back to the primary PW. ";
                }

                leaf resumeTime {
                  type uint16 {
                    range "0..600";
                  }
                  description
                    "Specifies the time after which the peer PE
                                     on the secondary PW is notified that the
                                     local PE is recovered from the fault. ";
                }

                leaf lastReRouteReason {
                  type string {
                    length "0..100";
                  }
                  config false;
                  description
                    "Specifies the reason of Last Reroute.";
                }

                leaf lastReRouteTime {
                  type string {
                    length "1..60";
                  }
                  config false;
                  description
                    "Specifies the time of Last Reroute.";
                }

                leaf delayResidual {
                  type uint32;
                  config false;
                  description
                    "Specifies the residual delay time for
                                     switching traffic back to the primary PW.
                                    ";
                }

                leaf resumeResidual {
                  type uint32;
                  config false;
                  description
                    "Specifies the residual time after which
                                     the peer PE on the secondary PW is
                                     notified that the local PE is recovered
                                     from the fault. ";
                }
              }  // container reRoute
            }  // list reliability
          }  // container reliabilitys
        }  // list vpwsInstance
      }  // container vpwsInstances

      container vpwsSwitchInstances {
        list vpwsSwitchInstance {
          key "instanceName instanceType";
          description
            "L2vpn vpws instance class.";
          leaf instanceName {
            type string {
              length "1..31";
            }
            description
              "Specifies VPWS instance name.";
          }

          leaf instanceType {
            type instanceType;
            description
              "VPWS instance type:vpwsSwitch.";
          }

          leaf encapsulateType {
            type pw-encapsulation;
            default "ethernet";
            description
              "VPWS instance encapsulation type.";
          }

          leaf switchType {
            type enumeration {
              enum "svc2svc" {
                value 0;
                description "svc2svc:";
              }
              enum "ldp2svc" {
                value 1;
                description "ldp2svc:";
              }
              enum "ldp2ldp" {
                value 2;
                description "ldp2ldp:";
              }
              enum "upe" {
                value 3;
                description "upe:";
              }
            }
            default "ldp2ldp";
            description
              "VPWS switch instance type:ldp2ldp,ldp2svc.";
          }

          leaf ctrlWordTrans {
            type boolean;
            default "false";
            description
              "Transparent transmission of control word If BFD
                         is enabled to monitor dynamic multi-hop PWs,
                         transparent transmission of control word needs
                         to be configured on the SPE. Otherwise, the BFD
                         negotiation fails. By default, transparent
                         transmission of control word is disabled.";
          }

          leaf controlWord {
            type enumeration {
              enum "default" {
                value 0;
                description "default:";
              }
              enum "disable" {
                value 1;
                description "disable:";
              }
              enum "enable" {
                value 2;
                description "enable:";
              }
            }
            description
              "Enables the control word function. The control
                         word function is usually enabled on PWs with
                         encapsulation types being TDM, ATM or FR.
                         By default:
                         The control word function is enabled for TDM-,
                         ATM-, or Frame Relay-encapsulated PWs if PW
                         profiles are not used. If a PW profile
                         is used, the control word function can be
                         enabled only after the control word is explicitly
                         specified. The control word function can be enabled
                         for PWs that use other types of encapsulation only
                         after the control word is explicitly specified.";
          }

          leaf instanceState {
            type enumeration {
              enum "down" {
                value 0;
                description "down:";
              }
              enum "up" {
                value 1;
                description "up:";
              }
              enum "adminDown" {
                value 2;
                description "adminDown:";
              }
            }
            config false;
            description
              "VPWS instance state.";
          }

          leaf createTime {
            type string {
              length "1..80";
            }
            config false;
            description
              "Indicates how long the VC has been created for.";
          }

          leaf upTime {
            type string {
              length "1..80";
            }
            config false;
            description
              "Indicates how long the VC keeps the Up state. If the
                         PW is currently in the Down state, the value is 0.";
          }

          leaf lastChgTime {
            type string {
              length "1..80";
            }
            config false;
            description
              "Indicates how long the VC status has remained
                         unchanged.";
          }

          leaf lastUpTime {
            type yang:date-and-time;
            config false;
            description
              "Indicates how long the instance keeps the Up state.
                         If the PW is currently in the Down state, the value
                         is 0.";
          }

          leaf totalUpTime {
            type string {
              length "1..80";
            }
            config false;
            description
              "Indicates the total duration the instance is Up.";
          }

          container vpwsPws {
            uses vpwsPws;
          }  // container vpwsPws
        }  // list vpwsSwitchInstance
      }  // container vpwsSwitchInstances
    }  // container l2vpnvpws

    container l2vpnvpls {
      container vplsStatisticInfo {
        container vplsInstStatisticsInfo {
          leaf totalVsiNum {
            type uint32;
            config false;
            description "None";
          }

          leaf vsiUpNum {
            type uint32;
            config false;
          }

          leaf vsiDownNum {
            type uint32;
            config false;
          }

          leaf ldpModeNum {
            type uint32;
            config false;
          }

          leaf bgpVsiNum {
            type uint32;
            config false;
          }

          leaf bgpAdVsiNum {
            type uint32;
            config false;
          }

          leaf unspecifiedNum {
            type uint32;
            config false;
          }
        }  // container vplsInstStatisticsInfo

        container vplsPwStatisticsInfo {
          leaf totalPwNum {
            type uint32;
            config false;
            description "None";
          }

          leaf upPwNum {
            type uint32;
            config false;
          }

          leaf downPwNum {
            type uint32;
            config false;
          }

          leaf ldpPwNum {
            type uint32;
            config false;
          }

          leaf bgpPwNum {
            type uint32;
            config false;
          }

          leaf bgpAdPwNum {
            type uint32;
            config false;
          }
        }  // container vplsPwStatisticsInfo

        container vplsAcStatisticsInfo {
          leaf totalVplsAcNum {
            type uint32;
            config false;
          }

          leaf upVplsAcNum {
            type uint32;
            config false;
          }

          leaf downVplsAcNum {
            type uint32;
            config false;
          }
        }  // container vplsAcStatisticsInfo

        container vplsTnlRefInfos {
          config false;
          list vplsTnlRefInfo {
            key "tnlPolicyName";
            leaf tnlPolicyName {
              type string {
                length "1..39";
              }
              config false;
              description "None";
            }

            container tnlVsiRefInfos {
              list tnlVsiRefInfo {
                key "instanceName";
                leaf instanceName {
                  type string {
                    length "1..31";
                  }
                  config false;
                }
              }  // list tnlVsiRefInfo
            }  // container tnlVsiRefInfos
          }  // list vplsTnlRefInfo
        }  // container vplsTnlRefInfos

        container vplsLoopDetectStaticInfo {
          leaf totalVplsLoopDetectNum {
            type uint32;
            config false;
          }
        }  // container vplsLoopDetectStaticInfo
      }  // container vplsStatisticInfo

      container vplsInstances {
        list vplsInstance {
          key "instanceName";
          leaf instanceName {
            type string {
              length "1..31";
            }
            description
              "Specifies VPLS instance name.";
          }

          leaf description {
            type string {
              length "1..64";
            }
            description
              "Specify the VPLS instance description.";
          }

          leaf memberDiscoveryMode {
            type enumeration {
              enum "default" {
                value 0;
                description "default:";
              }
              enum "auto" {
                value 1;
                description "auto:";
              }
              enum "static" {
                value 2;
                description "static:";
              }
              enum "bdmode" {
                value 3;
                description "bd mode:";
              }
            }
            default "default";
            description
              "The VPLS member discovery mode for a created VSI.";
          }

          leaf encapsulateType {
            type pw-encapsulation;
            default "vlan";
            description
              "VPWS instance encapsulation type.";
          }

          leaf mtuValue {
            type uint16 {
              range "328..65535";
            }
            default "1500";
            description
              "MTU specified in dynamic PW signaling negotiation.";
          }

          leaf tnlPolicyName {
            type string {
              length "1..39";
            }
            description
              "Specifies a tunnel policy name for the VSI. If no
                         name is specified for a tunnel policy, the default
                         tunnel policy is adopted. The LSP tunnel is
                         preferred and only one LSP is used for load balancing
                         in the default tunnel policy. If the name of the
                         tunnel policy is specified but no tunnel policy is
                         configured, the default tunnel policy is still adopted.
                         ";
          }

          leaf shutdown {
            type boolean;
            default "false";
            description
              "Sometimes, because of service debugging or service
                         halt, a VSI can be disabled for function
                         modification.";
          }

          leaf isolateSpoken {
            type boolean;
            default "false";
            description
              "The isolate spoken command enables forwarding
                         isolation between AC interfaces, between UPE
                         PWs, and between ACs and UPE PWs on a VSI. The
                         undo isolate spoken command disables forwarding
                         isolation";
          }

          leaf unknownUnicastAction {
            type enumeration {
              enum "broadcast" {
                value 0;
                description "broadcast:";
              }
              enum "drop" {
                value 1;
                description "drop:";
              }
              enum "local-handle" {
                value 2;
                description "local-handle:";
              }
              enum "drop-learn" {
                value 3;
                description "drop-learn:";
              }
            }
            description
              "Specifies the processing mode for received unknown
                         unicast frames.";
          }

          leaf macLearnEnable {
            type boolean;
            default "true";
            description
              "Enables MAC address learning on a VSI.";
          }

          leaf macLearnStyle {
            type enumeration {
              enum "qualify" {
                value 0;
                description "qualify:";
              }
              enum "unqualify" {
                value 1;
                description "unqualify:";
              }
            }
            default "unqualify";
            description
              "Sets the MAC address learning style of a VSI.By
                         default, MAC address learning style is unqualify.
                         Currently, the VRP supports only the unqualified
                         mode.";
          }

          leaf macAgeTimer {
            type uint32 {
              range "0..1000000";
            }
            description
              "Sets the aging time of MAC address entries in a VSI.
                         By default, the aging time of MAC address entries in
                         a VSI is the global aging time. You can set the global
                         aging time by the command mac-address aging-time
                         (system view).";
          }

          leaf totalAcService {
            type uint32;
            config false;
            description
              "Total number of interface in the instance.";
          }

          leaf createTime {
            type string {
              length "1..60";
            }
            config false;
            description
              "Indicates how long the VSI has been created for.";
          }

          leaf vsiState {
            type enumeration {
              enum "down" {
                value 0;
                description "down:";
              }
              enum "up" {
                value 1;
                description "up:";
              }
              enum "adminDown" {
                value 2;
                description "adminDown:";
              }
            }
            config false;
            description
              "VPLS instance state.";
          }

          leaf ignoreAcStateEffect {
            type boolean;
            default "false";
            config false;
            description
              "After the ignore-ac-state command is configured,
                         the VSI status is not subject to changes in the
                         status of the AC. That is, a VSI can go Up even
                         if no AC is connected to the VSI.";
          }

          container vsiPipe {
            leaf pipeMode {
              type enumeration {
                enum "pipe" {
                  value 0;
                  description "pipe:";
                }
                enum "shortPipe" {
                  value 1;
                  description "shortPipe:";
                }
                enum "uniform" {
                  value 2;
                  description "uniform:";
                }
              }
              default "uniform";
              description "Pipe mode";
            }

            leaf serviceClass {
              type enumeration {
                enum "be" {
                  value 0;
                  description "be:";
                }
                enum "af1" {
                  value 1;
                  description "af1:";
                }
                enum "af2" {
                  value 2;
                  description "af2:";
                }
                enum "af3" {
                  value 3;
                  description "af3:";
                }
                enum "af4" {
                  value 4;
                  description "af4:";
                }
                enum "ef" {
                  value 5;
                  description "ef:";
                }
                enum "cs6" {
                  value 6;
                  description "cs6:";
                }
                enum "cs7" {
                  value 7;
                  description "cs7:";
                }
              }
              default "be";
              description "service class";
            }

            leaf color {
              type enumeration {
                enum "green" {
                  value 0;
                  description "green:";
                }
                enum "yellow" {
                  value 1;
                  description "yellow:";
                }
                enum "red" {
                  value 2;
                  description "red:";
                }
              }
              default "green";
              description "service color";
            }

            leaf dsName {
              type string {
                length "1..31";
              }
              description "domain name";
            }
          }  // container vsiPipe

          container vplsLdpInst {
            leaf vsiId {
              type uint32 {
                range "1..4294967295";
              }
              description
                "After an ID is set for a VSI, it cannot be
                             changed. Different VSIs have different IDs.";
            }

            leaf macWithdraw {
              type boolean;
              default "false";
              description
                "Configures a VSI to delete the local MAC
                             addresses and informs all the remote peers
                             of the deletion when an AC fault or a UPE
                             fault occurs and the VSI remains Up.";
            }

            leaf ifChgWithdraw {
              type boolean;
              default "false";
              description
                "Configures PEs to send LDP MAC Withdraw
                             messages to all peers when the status of
                             the AC interface bound to the VSI changes.";
            }

            leaf upeUpeMacWithdraw {
              type boolean;
              default "false";
              description
                "Configures an NPE to forward the LDP MAC
                             Withdraw messages received from a UPE to
                             other UPEs.";
            }

            leaf upeNpeMacWithdraw {
              type boolean;
              default "false";
              description
                "Configures an NPE to forward the LDP MAC
                             Withdraw messages received from UPEs to
                             other NPEs.";
            }

            leaf npeUpeMacWithdraw {
              type boolean;
              description
                "Configures an NPE to forward the LDP MAC
                             Withdraw messages received from other NPEs
                             to UPEs.";
            }

            container vplsLdpPws {
              list vplsLdpPw {
                key "peerIp pwId pwEncapType";
                leaf peerIp {
                  type inet:ip-address;
                  description
                    "Specifies the LSR ID of the peer PE.";
                }

                leaf pwId {
                  type uint32 {
                    range "1..4294967295";
                  }
                  description
                    "Indicates the identifier of the PW. Default,
                                     we may use vsiId as the pwId. Sometimes we may
                                     create pw to different pw that the pwId not
                                     match our vsiId, so it must specify the pwId.";
                }

                leaf pwEncapType {
                  type pw-encapsulation;
                  description
                    "Indicates the encapsulation of the PW.
                                     Default, we may use encapsulateType as
                                     the pwEncapType. Sometimes we may create
                                     pw that the pwEncapType not match our
                                     encapsulateType, so it must specify the
                                     pwEncapType.";
                }

                leaf pwRole {
                  type pw-role;
                  default "primary";
                  description
                    "VPLS pw role:primary, secondary.";
                }

                leaf pwName {
                  type string {
                    length "1..15";
                  }
                  description
                    "Specifies the name of a PW, which is used
                                     to distinguish the PW from other PWs. The
                                     PW name must be unique in the same VSI,
                                     but can be the same as the PW names in
                                     other VSIs. ";
                }

                leaf ifParaVCCV {
                  type boolean;
                  default "true";
                  description
                    "Deletes the VCCV byte (an interface
                                     parameter) in the Mapping packet.";
                }

                leaf isUpe {
                  type boolean;
                  default "false";
                  description
                    "set VPLS PW as upe.";
                }

                leaf tnlPolicyName {
                  type string {
                    length "1..39";
                  }
                  description
                    "Specifies a tunnel policy name for the
                                     VPLS PW. If no name is specified for a
                                     tunnel policy, the default tunnel policy
                                     is adopted. The LSP tunnel is preferred
                                     and only one LSP is used for load
                                     balancing in the default tunnel policy.
                                     If the name of the tunnel policy is
                                     specified but no tunnel policy is
                                     configured, the default tunnel policy is
                                     still adopted.";
                }

                container vplsLdpPwInfo {
                  config false;
                  uses vplsPwInfo;
                }  // container vplsLdpPwInfo
              }  // list vplsLdpPw
            }  // container vplsLdpPws
          }  // container vplsLdpInst

          container vplsBgpAdInst {
            leaf vplsId {
              type string {
                length "1..21";
              }
              description
                "Specifies the vpls id. The value is a
                             case-sensitive string of 3 to 21 characters
                             without blank space.";
            }

            leaf bgpAdRd {
              type string {
                length "1..21";
              }
              config false;
              description
                "Specifies the Route Distinguisher. The value is
                             a case-sensitive string of 3 to 21 characters
                             without blank space.";
            }

            leaf vsiId {
              type inet:ip-address;
              config false;
              description
                "Specifies the negotiation ip address of the
                             local PE.";
            }

            container vpnTargets {
              description
                "BGP-AD vpn-targets.";
              list vpnTarget {
                key "vpnRTValue";
                description
                  "BGP AD vpn targets.";
                leaf vpnRTValue {
                  type string {
                    length "3..21";
                  }
                  mandatory true;
                  description
                    "Vpn-target:
                                 adds VPN target extended community attribute
                                 to the export or import VPN target extended
                                 community list. The vpn-target can be
                                 expressed in either of the following formats:
                                 (1)16-bit AS number:32-bit user-defined number
                                    For example, 1:3. The AS number ranges from
                                    0 to 65535. The user-defined number ranges
                                    from 0 to 4294967295. The AS number and the
                                    user-defined number cannot be 0s at the same
                                    time. That is, a VPN target cannot be 0:0.
                                 (2)32-bit IP address:16-bit user-defined number
                                    For example, 192.168.122.15:1. The IP address
                                    ranges from 0.0.0.0 to 255.255.255.255. The
                                    user-defined number ranges from 0 to 65535.";
                }

                leaf vrfRTType {
                  type enumeration {
                    enum
                      "export_extcommunity" {
                      value 0;
                      description
                        "export-extcommunity:";
                    }
                    enum
                      "import_extcommunity" {
                      value 1;
                      description
                        "import-extcommunity:";
                    }
                    enum "both" {
                      value 2;
                      description
                        "export-extcommunity &
                                    import-extcommunity:";
                    }
                  }
                  mandatory true;
                  description
                    "Specifies the vpn target type,
                                 export-extcommunity: specifies the extended
                                 community attributes carried in routing
                                 information to be sent. import-extcommunity:
                                 receives routing information carrying
                                 specified extended community attributes.";
                }
              }  // list vpnTarget
            }  // container vpnTargets

            container bgpAdPeerInfos {
              config false;
              list bgpAdPeerInfo {
                key "peerRouterID";
                leaf peerRouterID {
                  type inet:ip-address;
                  description
                    "The Router ID of the remote router.";
                }

                leaf vplsId {
                  type string {
                    length "1..21";
                  }
                  description
                    "The vpls id. The value is a case-sensitive
                                     string of 3 to 21 characters without blank
                                     space.";
                }

                leaf sourceAII {
                  type inet:ip-address;
                  description
                    "The source AII of the remote PE.";
                }

                leaf targetAII {
                  type inet:ip-address;
                  description
                    "The target AII of the remote PE.";
                }

                leaf peerType {
                  type enumeration {
                    enum "static" {
                      value 0;
                      description
                        "Static pw";
                    }
                    enum "dynamic" {
                      value 1;
                      description
                        "Dynamic pw";
                    }
                  }
                  description
                    "Specifies the peer type.Static,Dynamic.";
                }

                container bgpAdPwInfo {
                  config false;
                  uses vplsPwInfo;
                }  // container bgpAdPwInfo
              }  // list bgpAdPeerInfo
            }  // container bgpAdPeerInfos
          }  // container vplsBgpAdInst

          container vplsBgpInst {
            leaf bgpRd {
              type string {
                length "1..21";
              }
              description
                "Specifies the Route Distinguisher. The value is a
                            case-sensitive string of 3 to 21 characters without
                            blank space.";
            }

            leaf ignoreMtu {
              type boolean;
              description
                "Ignore the mtu when negotiate pw.";
            }

            container vpnTargets {
              description "BGP vpn-targets";
              list vpnTarget {
                key "vpnRTValue";
                description
                  "BGP vpn targets";
                leaf vpnRTValue {
                  type string {
                    length "3..21";
                  }
                  mandatory true;
                  description
                    "Vpn-target: adds VPN target extended community
                                 attribute to the export or import VPN target
                                 extended community list. The vpn-target can be
                                 expressed in either of the following formats:
                                (1)16-bit AS number:32-bit user-defined number
                                   For example, 1:3. The AS number ranges from
                                   0 to 65535. The user-defined number ranges
                                   from 0 to 4294967295. The AS number and the
                                   user-defined number cannot be 0s at the same
                                   time. That is, a VPN target cannot be 0:0.
                                (2)32-bit IP address:16-bit user-defined number
                                   For example, 192.168.122.15:1. The IP address
                                   ranges from 0.0.0.0 to 255.255.255.255. The
                                   user-defined number ranges from 0 to 65535.";
                }

                leaf vrfRTType {
                  type enumeration {
                    enum
                      "export_extcommunity" {
                      value 0;
                      description
                        "export-extcommunity:";
                    }
                    enum
                      "import_extcommunity" {
                      value 1;
                      description
                        "import-extcommunity:";
                    }
                    enum "both" {
                      value 2;
                      description
                        "export-extcommunity &
                                                   import-extcommunity:";
                    }
                  }
                  mandatory true;
                  description
                    "Specifies the vpn target type,
                                 export-extcommunity: specifies the extended
                                 community attributes carried in routing
                                 information to be sent.
                                 import-extcommunity: receives routing
                                 information carrying specified extended
                                 community attributes.";
                }
              }  // list vpnTarget
            }  // container vpnTargets

            container bgpSite {
              leaf siteId {
                type uint16 {
                  range "1..65535";
                }
                mandatory true;
                description
                  "Specifies the ID of the site.";
              }

              leaf siteRange {
                type uint16 {
                  range "1..65535";
                }
                description
                  "Specifies the ID of the site range.";
              }

              leaf defaultOffset {
                type uint8 {
                  range "0..1";
                }
                description
                  "Specifies the default offset of the site ID.";
              }
            }  // container bgpSite

            container bgpPeerInfos {
              config false;
              list bgpPeerInfo {
                key "siteId";
                leaf siteId {
                  type uint16 {
                    range "1..65535";
                  }
                  description
                    "The site id of the peer.";
                }

                container bgpPwInfo {
                  config false;
                  uses vplsPwInfo;
                }  // container bgpPwInfo
              }  // list bgpPeerInfo
            }  // container bgpPeerInfos
          }  // container vplsBgpInst

          container vplsAcs {
            list vplsAc {
              key "interfaceName";
              leaf interfaceName {
                type leafref {
                  path "/if:interfaces/if:interface/if:name";
                }
                description
                  "Specifies the AC interface name. ";
              }

              leaf hubModeEnable {
                type boolean;
                default "false";
                description
                  "Change the VSI attribute of the local
                                 interface from spoke to hub.By default,
                                 the AC side of a VSI has the attribute
                                 of spoke, and the PW side of a VSI has
                                 the attribute of hub.";
              }

              leaf state {
                type ifState;
                config false;
                description
                  "Indicates the status of the AC.";
              }

              leaf lastUpTime {
                type yang:date-and-time;
                config false;
                description
                  "Indicates how long the AC keeps the Up state.
                                 If the AC is currently in the Down state, the
                                 value is 0.";
              }

              leaf totalUpTime {
                type string {
                  length "1..60";
                }
                config false;
                description
                  "Indicates the total duration the AC is Up.";
              }

              container ifLinkProtocolTran {
                description "lacp status";
                leaf protocolLacp {
                  type enumeration {
                    enum "enable" {
                      value 0;
                      description "enable:";
                    }
                    enum "disable" {
                      value 1;
                      description "disable:";
                    }
                  }
                  description "lacp status";
                }

                leaf protocolLldp {
                  type enumeration {
                    enum "enable" {
                      value 0;
                      description "enable:";
                    }
                    enum "disable" {
                      value 1;
                      description "disable:";
                    }
                  }
                  description "lldp status";
                }

                leaf protocolBpdu {
                  type enumeration {
                    enum "enable" {
                      value 0;
                      description "enable:";
                    }
                    enum "disable" {
                      value 1;
                      description "disable:";
                    }
                  }
                  description "bpdu status";
                }

                leaf protocolCdp {
                  type enumeration {
                    enum "enable" {
                      value 0;
                      description "enable:";
                    }
                    enum "disable" {
                      value 1;
                      description "disable:";
                    }
                  }
                  description "cdp status";
                }

                leaf protocolUdld {
                  type enumeration {
                    enum "enable" {
                      value 0;
                      description "enable:";
                    }
                    enum "disable" {
                      value 1;
                      description "disable:";
                    }
                  }
                  description "udld status";
                }
              }  // container ifLinkProtocolTran
            }  // list vplsAc
          }  // container vplsAcs

          container vplsLoopDetectInfo {
            description
              "L2vpn admin vsi binding class.";
            leaf lastLoopType {
              type enumeration {
                enum "detect-loop" {
                  value 0;
                  description "detect loop:";
                }
                enum "exceed-max-hop" {
                  value 1;
                  description
                    "exceed max hop:";
                }
              }
              config false;
              description
                "Indicates the last mac withdraw loop type.";
            }

            leaf sendPeer {
              type inet:ip-address;
              config false;
              description
                "Indicates the mac withdraw send peer.";
            }

            leaf receivePeer {
              type inet:ip-address;
              config false;
              description
                "Indicates the mac withdrawreceive peer.";
            }

            leaf lastLoopTime {
              type string {
                length "1..80";
              }
              config false;
              description
                "Indicates the last mac withdraw loop time.";
            }
          }  // container vplsLoopDetectInfo
        }  // list vplsInstance
      }  // container vplsInstances
    }  // container l2vpnvpls
  }  // module l2vpn