huawei-mplsoam

Multiprotocol Label Switching (MPLS) operations, administration and maintenance (OAM), provides the following functions: fault m...

  • Version: 2019-04-18

    huawei-mplsoam@2019-04-18


    
      module huawei-mplsoam {
    
        yang-version 1;
    
        namespace
          "urn:huawei:yang:huawei-mplsoam";
    
        prefix mplsoam;
    
        import huawei-l2vpn {
          prefix l2vpn;
        }
        import huawei-ifm {
          prefix ifm;
        }
        import huawei-tunnel-management {
          prefix tnlm;
        }
        import huawei-mpls-te {
          prefix mpls-te;
        }
        import ietf-inet-types {
          prefix inet;
        }
        import huawei-extension {
          prefix ext;
        }
        import huawei-mpls {
          prefix mpls;
        }
        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
          "Multiprotocol Label Switching (MPLS) operations, administration and maintenance (OAM), provides the following functions: fault management, performance monitoring, and protection switching.";
    
        revision "2019-04-18" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "tpoam";
    
        typedef detect-pkt-type {
          type enumeration {
            enum "cv" {
              value 0;
              description
                "The detection packet type is cv.";
            }
            enum "ffd" {
              value 1;
              description
                "The detection packet type is ffd.";
            }
          }
          description "Detect pkt type.";
        }
    
        typedef detect-mode {
          type enumeration {
            enum "manual" {
              value 0;
              description
                "The detection mode is manual.";
            }
            enum "auto" {
              value 1;
              description
                "The detection mode is adaptive.";
            }
          }
          description "Detect type.";
        }
    
        typedef l2vc-type {
          type enumeration {
            enum "atm-1to1-vcc" {
              value 12;
              description
                "The VC type is ATM-1to1-VCC.";
            }
            enum "atm-1to1-vpc" {
              value 13;
              description
                "The VC type is ATM-1to1-VPC.";
            }
            enum "atm-aal5-pdu" {
              value 14;
              description
                "The VC type is ATM-aal5-pdu.";
            }
            enum "atm-aal5-sdu" {
              value 2;
              description
                "The VC type is ATM-aal5-sdu.";
            }
            enum "atm-nto1-vcc" {
              value 9;
              description
                "The VC type is ATM-nto1-VCC.";
            }
            enum "atm-nto1-vpc" {
              value 10;
              description
                "The VC type is ATM-nto1-VPC.";
            }
            enum "atm-trans-cell" {
              value 3;
              description
                "The VC type is ATM-trans-cell.";
            }
            enum "cep" {
              value 16;
              description "The VC type is CEP.";
            }
            enum "cesopsn-basic" {
              value 21;
              description
                "The VC type is CESoPSN-basic.";
            }
            enum "ethernet" {
              value 5;
              description
                "The VC type is ethernet.";
            }
            enum "fr" {
              value 1;
              description "The VC type is FR.";
            }
            enum "hdlc" {
              value 6;
              description "The VC type is HDLC.";
            }
            enum "ip-interworking" {
              value 64;
              description
                "The VC type is IP-interworking.";
            }
            enum "ip-layer2" {
              value 11;
              description
                "The VC type is IP-Layer2.";
            }
            enum "ppp" {
              value 7;
              description "The VC type is PPP.";
            }
            enum "satop-e1" {
              value 17;
              description
                "The VC type is SAToP-E1.";
            }
            enum "satop-e3" {
              value 19;
              description
                "The VC type is SAToP-E3.";
            }
            enum "satop-t1" {
              value 18;
              description
                "The VC type is SAToP-T1.";
            }
            enum "vlan" {
              value 4;
              description "The VC type is VLAN.";
            }
          }
          description "L2vc type.";
        }
    
        typedef detect-interval {
          type enumeration {
            enum "3ms" {
              value 1;
              description
                "Interval value of 3ms.";
            }
            enum "10ms" {
              value 2;
              description
                "Interval value of 10ms.";
            }
            enum "20ms" {
              value 3;
              description
                "Interval value of 20ms.";
            }
            enum "50ms" {
              value 4;
              description
                "Interval value of 50ms.";
            }
            enum "100ms" {
              value 5;
              description
                "Interval value of 100ms.";
            }
            enum "200ms" {
              value 6;
              description
                "Interval value of 200ms.";
            }
            enum "500ms" {
              value 7;
              description
                "Interval value of 500ms.";
            }
            enum "1000ms" {
              value 8;
              description
                "Interval value of 1000ms.";
            }
          }
          description "Detect interval.";
        }
    
        typedef defect-status-type {
          type enumeration {
            enum "init" {
              value 0;
              description
                "The status of MPLS OAM is initial.";
            }
            enum "local-valid" {
              value 1;
              description "Local valid.";
            }
            enum "local-defect-valid" {
              value 2;
              description "Local defect valid.";
            }
            enum "local-defect-invalid" {
              value 3;
              description
                "Local defect invalid.";
            }
            enum "local-invalid" {
              value 4;
              description "Local invalid.";
            }
            enum "remote-valid" {
              value 5;
              description "Remote valid.";
            }
            enum "remote-defect-valid" {
              value 6;
              description "Remote defect valid.";
            }
            enum "remote-defect-invalid" {
              value 7;
              description
                "Remote defect invalid.";
            }
            enum "remote-invalid" {
              value 8;
              description "Remote invalid.";
            }
          }
          description "Defect status type.";
        }
    
        typedef defect-type {
          type enumeration {
            enum "server" {
              value 0;
              description
                "The defect type is server.";
            }
            enum "peer-me" {
              value 1;
              description
                "The defect type is peerme.";
            }
            enum "locv" {
              value 2;
              description
                "The defect type is locv.";
            }
            enum "ttsi-mismatch" {
              value 3;
              description
                "The defect type is ttsi-mismatch.";
            }
            enum "ttsi-mismerge" {
              value 4;
              description
                "The defect type is ttsi-mismerge.";
            }
            enum "excess" {
              value 5;
              description
                "The defect type is excess.";
            }
            enum "unknown" {
              value 6;
              description
                "The defect type is unknown.";
            }
          }
          description "Defect type.";
        }
    
        typedef padding-value {
          type enumeration {
            enum "0" {
              value 0;
              description
                "The padding value of delay measurement packet is 0.";
            }
            enum "1" {
              value 1;
              description
                "The padding value of delay measurement packet is 1.";
            }
          }
          description
            "Delay measurement padding value.";
        }
    
        typedef active-type {
          type enumeration {
            enum "deactive" {
              value 0;
              description
                "Deactive the MPLS OAM.";
            }
            enum "active" {
              value 1;
              description "Active the MPLS OAM.";
            }
          }
          description "Active type.";
        }
    
        typedef bdi-frequency {
          type enumeration {
            enum "per-second" {
              value 1;
              description
                "BDI frequency is per second.";
            }
            enum "detect-freq" {
              value 2;
              description
                "BDI frequency is detect-frequency.";
            }
          }
          description "Bdi frequency.";
        }
    
        typedef compatibility-mode {
          type enumeration {
            enum "route-mode" {
              value 0;
              description
                "Compatibility mode is route mode.";
            }
            enum "ptn-mode" {
              value 1;
              description
                "Compatibility mode is PTN mode.";
            }
          }
          description "Compatibility mode.";
        }
    
        typedef reverse-mode {
          type enumeration {
            enum "share" {
              value 1;
              description
                "The share type is share.";
            }
            enum "private" {
              value 2;
              description
                "The share type is private.";
            }
          }
          description "Reverse mode.";
        }
    
        typedef defect-state {
          type enumeration {
            enum "non-defect" {
              value 0;
              description
                "The defect state is non-defect.";
            }
            enum "in-defect" {
              value 1;
              description
                "The defect state is in-defect.";
            }
          }
          description "Defect state.";
        }
    
        typedef available-state {
          type enumeration {
            enum "available" {
              value 0;
              description "Available state.";
            }
            enum "unavailable" {
              value 1;
              description "Unavailable state.";
            }
          }
          description "Available state.";
        }
    
        typedef lsp-type {
          type enumeration {
            enum "ingress" {
              value 0;
              description
                "The service type is ingress.";
            }
            enum "egress-lspname" {
              value 1;
              description
                "The service type is egress which bind LSP name.";
            }
            enum "egress-ttsi" {
              value 2;
              description
                "The service type is egress which bind TTSI.";
            }
            enum "te-crlsp" {
              value 3;
              description
                "The service type is TE.";
            }
          }
          description "LSP type.";
        }
    
        typedef lsp-establish-type {
          type enumeration {
            enum "rsvp-lsp" {
              value 0;
              description "RSVP LSP.";
            }
            enum "static-cr-lsp" {
              value 1;
              description "Static CR-LSP.";
            }
          }
          description "LSP establish type.";
        }
    
        typedef vpls-pw-encap-type {
          type enumeration {
            enum "vlan" {
              value 4;
              description
                "The VPLS LDP PW encapsulation type is VLAN.";
            }
            enum "ethernet" {
              value 5;
              description
                "The VPLS LDP PW encapsulation type is ethernet.";
            }
          }
          description
            "L2VPN VPLS LDP PW encapsulation type.";
        }
    
        grouping session-status {
          description "Session status.";
          leaf bdi-defect-status {
            type defect-state;
            config false;
            description "BDI defect status.";
          }
    
          leaf bdi-defect-type {
            type string {
              length "1..15";
            }
            config false;
            description "BDI defect type.";
          }
    
          leaf available-status {
            type available-state;
            config false;
            description "Available status.";
          }
    
          leaf defect-type {
            type string {
              length "1..15";
            }
            config false;
            description "Defect type.";
          }
    
          leaf local-detect-status {
            type defect-status-type;
            default "init";
            config false;
            description
              "Local detection status.";
          }
    
          leaf local-invalid-time {
            type uint32 {
              range "0..4294967294";
            }
            config false;
            description "Local invalid time.";
          }
    
          leaf local-defect-location {
            type inet:ipv4-address-no-zone;
            config false;
            description "Local defect status.";
          }
    
          leaf local-defect-type {
            type defect-type;
            config false;
            description "Local defect type.";
          }
    
          leaf remote-detect-status {
            type defect-status-type;
            default "init";
            config false;
            description
              "Remote detection status.";
          }
    
          leaf remote-invalid-time {
            type uint32 {
              range "0..4294967294";
            }
            config false;
            description "Remote invalid time.";
          }
    
          leaf remote-defect-location {
            type inet:ipv4-address-no-zone;
            config false;
            description "Remote defect status.";
          }
    
          leaf remote-defect-type {
            type defect-type;
            config false;
            description "Remote defect type.";
          }
        }  // grouping session-status
    
        grouping l2vpn-pw {
          description "L2VPN PW.";
          leaf remote-lsr-id {
            ext:dynamic-default;
            type inet:ipv4-address-no-zone;
            description
              "Configure a remote LSR ID.";
          }
    
          leaf remote-vc-id {
            ext:dynamic-default;
            type uint32 {
              range "0..4294967295";
            }
            description
              "Configure a remote VC ID of a static PW to which MPLS OAM is bound.";
          }
    
          leaf remote-vc-type {
            ext:dynamic-default;
            type l2vc-type;
            description
              "Configure a remote VC type of a static PW to which MPLS OAM is bound.";
          }
    
          leaf detect-pkt-type {
            type detect-pkt-type;
            default "cv";
            description
              "Configure a detection packet type.";
          }
    
          leaf detect-mode {
            type detect-mode;
            default "auto";
            description
              "Configure a detection mode.";
          }
    
          leaf auto-mode-over-time {
            when "../detect-mode='auto'";
            type uint8 {
              range "0..255";
            }
            default "10";
            description
              "Configure the over time.";
          }
    
          leaf detect-frequence {
            type detect-interval;
            must
              "(../detect-pkt-type='cv' and ../detect-frequence='1000ms') or (../detect-pkt-type='ffd' and ../detect-frequence!='1000ms')";
            mandatory true;
            description
              "Configure the detection packet type.";
          }
    
          leaf bdi-frequence {
            type bdi-frequency;
            default "detect-freq";
            description
              "BDI packet frequency, detect-freq indicate the same as frequency of detecting packet.";
          }
    
          leaf compatibility-mode {
            type compatibility-mode;
            default "route-mode";
            description
              "Configure compatibility mode.";
          }
    
          leaf oam-active-status {
            type active-type;
            default "deactive";
            description
              "Whether MPLS OAM detection is enabled.";
          }
    
          leaf send-enable {
            type boolean;
            default "false";
            description
              "Enable/disable the MPLS OAM packets can be sent.";
          }
    
          leaf receive-enable {
            type boolean;
            default "false";
            description
              "Enable/disable MPLS OAM packets can be received.";
          }
    
          leaf oam-loss-sd {
            type uint32 {
              range "0..100";
            }
            default "0";
            description
              "Configure the SD threshold of OAM loss measurement.";
          }
    
          leaf oam-loss-sf {
            type uint32 {
              range "0..100";
            }
            must
              "../oam-loss-sd<=../oam-loss-sf";
            default "0";
            description
              "Configure the SF threshold of OAM loss Measurement.";
          }
    
          leaf slm-send-enable {
            type boolean;
            default "false";
            description
              "Enable/disable a device sends packets for proactive single-ended loss measurement.";
          }
    
          leaf slm-exp {
            when "../slm-send-enable='true'";
            type uint8 {
              range "0..7";
            }
            default "7";
            description
              "Configure the exp for proactive single-ended loss measurement.";
          }
    
          leaf slm-threshold1 {
            type uint32 {
              range "1..1000000";
            }
            default "1";
            description
              "Configure threshold1 of proactive single-ended loss measurement.";
          }
    
          leaf slm-threshold2 {
            type uint32 {
              range "1..1000000";
            }
            default "10";
            description
              "Configure threshold2 of proactive single-ended loss measurement.";
          }
    
          leaf two-dm-send-enable {
            type boolean;
            default "false";
            description
              "Enable/disable a device sends packets for proactive two-way delay measurement.";
          }
    
          leaf two-dm-exp {
            when "../two-dm-send-enable='true'";
            type uint8 {
              range "0..7";
            }
            default "7";
            description
              "Configure the exp value of proactive two-way delay measurement.";
          }
    
          leaf two-dm-packet-size {
            when "../two-dm-send-enable='true'";
            type uint32 {
              range "64..1500";
            }
            default "64";
            description
              "Configure the packet size of proactive two-way delay measurement.";
          }
    
          leaf two-dm-pad-value {
            when "../two-dm-send-enable='true'";
            type padding-value;
            default "0";
            description
              "Configure the padding value of proactive two-way delay measurement.";
          }
    
          leaf cc-exp {
            type uint8 {
              range "0..7";
            }
            default "7";
            description
              "Configure the exp of packet.";
          }
        }  // grouping l2vpn-pw
    
        container mplsoam {
          description "MPLS OAM.";
          container global {
            description
              "Configure global MPLS OAM attribute.";
            leaf oam-enable {
              when
                "/mpls:mpls/mpls:common/mpls:global/mpls:mpls-enable='true'";
              type boolean;
              default "false";
              description
                "Enable/disable global MPLS OAM.";
            }
    
            leaf fdi-enable {
              type boolean;
              default "false";
              description
                "Enable/disable MPLS OAM FDI.";
            }
    
            leaf itu-mode {
              when "../oam-enable='true'";
              type boolean;
              default "false";
              description
                "Enable/disable global mode of MPLS OAM.";
            }
    
            leaf oam-num {
              type uint32;
              config false;
              description
                "Total number of OAM instances, including MPLS OAM and MPLS-TP OAM instances.";
            }
          }  // container global
    
          container tunnels {
            when "../global/oam-enable='true'";
            description "Configure tunnels.";
            container egress-id-tunnels {
              description
                "List of MPLS OAM monitors egress LSP.";
              list egress-id-tunnel {
                must
                  "not(detect-mode='auto' and detect-pkt-type='ffd')";
                must
                  "(detect-mode='auto' and receive-enable='true') or detect-mode='manual'";
                key "id ingress-lsr-id";
                description
                  "Configure MPLS OAM monitors egress LSP.";
                leaf id {
                  type uint16 {
                    range "1..65535";
                  }
                  description
                    "Configure an ID of tunnel.";
                }
    
                leaf ingress-lsr-id {
                  type inet:ipv4-address-no-zone;
                  description
                    "Configure a LSR ID.";
                }
    
                leaf reverse-name {
                  type leafref {
                    path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                  }
                  must
                    "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name = current()]/tnlm:tunnel-protocol/mpls-te:te-tunnel";
                  description
                    "Configure a backward tunnel name.";
                }
    
                leaf reverse-mode {
                  type reverse-mode;
                  must
                    "../reverse-mode='share' or ../reverse-name";
                  default "share";
                  description
                    "Configure backward sharing mode.";
                }
    
                leaf oam-loss-sd {
                  type uint32 {
                    range "0..100";
                  }
                  default "0";
                  description
                    "Configure the SD threshold of OAM loss measurement.";
                }
    
                leaf oam-loss-sf {
                  type uint32 {
                    range "0..100";
                  }
                  must
                    "../oam-loss-sd<=../oam-loss-sf";
                  default "0";
                  description
                    "Configure the SF threshold of OAM loss measurement.";
                }
    
                leaf slm-threshold1 {
                  type uint32 {
                    range "1..1000000";
                  }
                  default "1";
                  description
                    "Configure threshold1 of proactive single-ended loss measurement.";
                }
    
                leaf slm-threshold2 {
                  type uint32 {
                    range "1..1000000";
                  }
                  default "10";
                  description
                    "Configure threshold2 of proactive single-ended loss measurement.";
                }
    
                leaf detect-mode {
                  type detect-mode;
                  default "auto";
                  description
                    "Configure a detection mode.";
                }
    
                leaf auto-mode-over-time {
                  when "../detect-mode='auto'";
                  type uint8 {
                    range "0..255";
                  }
                  default "10";
                  description
                    "Configure a first packet timeout coefficient, step is 30s.";
                }
    
                leaf detect-pkt-type {
                  type detect-pkt-type;
                  default "cv";
                  description
                    "Configure a type of detected packet.";
                }
    
                leaf detect-frequence {
                  type detect-interval;
                  must
                    "(../detect-pkt-type='cv' and ../detect-frequence='1000ms') or (../detect-pkt-type='ffd' and ../detect-frequence!='1000ms')";
                  mandatory true;
                  description
                    "Configure the detection packet frequency.";
                }
    
                leaf bdi-frequence {
                  type bdi-frequency;
                  default "detect-freq";
                  description
                    "BDI packet frequency, detect-freq indicate the same as frequency of detecting packet.";
                }
    
                leaf receive-enable {
                  type boolean;
                  default "false";
                  description
                    "Enable/disable MPLS OAM packets can be received.";
                }
    
                leaf oam-active-status {
                  type active-type;
                  default "deactive";
                  description
                    "Whether MPLS OAM detection is enabled.";
                }
    
                leaf description {
                  type string {
                    length "0..64";
                  }
                  config false;
                  description
                    "Description of a tunnel.";
                }
    
                leaf lsp-type {
                  type lsp-establish-type;
                  config false;
                  description "LSP type.";
                }
    
                uses session-status;
              }  // list egress-id-tunnel
            }  // container egress-id-tunnels
    
            container egress-name-tunnels {
              description
                "List of MPLS OAM monitors egress static LSP.";
              list egress-name-tunnel {
                must
                  "not(detect-mode='auto' and detect-pkt-type='ffd')";
                must
                  "(detect-mode='auto' and receive-enable='true') or detect-mode='manual'";
                key "name";
                description
                  "Configure MPLS OAM monitors egress LSP.";
                leaf name {
                  type leafref {
                    path "/mpls:mpls/mpls-te:te/mpls-te-cr-static:static-cr-lsps/mpls-te-cr-static:static-cr-lsp/mpls-te-cr-static:lsp-name";
                  }
                  must
                    "/mpls:mpls/mpls-te:te/mpls-te-cr-static:static-cr-lsps/mpls-te-cr-static:static-cr-lsp[mpls-te-cr-static:lsp-name=current()]/mpls-te-cr-static:egress";
                  description
                    "Configure a tunnel interface name.";
                }
    
                leaf reverse-name {
                  type leafref {
                    path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                  }
                  must
                    "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name = current()]/tnlm:tunnel-protocol/mpls-te:te-tunnel";
                  description
                    "Configure a backward tunnel name.";
                }
    
                leaf reverse-mode {
                  type reverse-mode;
                  must
                    "../reverse-mode='share' or ../reverse-name";
                  default "share";
                  description
                    "Configure backward sharing mode.";
                }
    
                leaf oam-loss-sd {
                  type uint32 {
                    range "0..100";
                  }
                  default "0";
                  description
                    "Configure the SD threshold of OAM loss measurement.";
                }
    
                leaf oam-loss-sf {
                  type uint32 {
                    range "0..100";
                  }
                  must
                    "../oam-loss-sd<=../oam-loss-sf";
                  default "0";
                  description
                    "Configure the SF threshold of OAM loss measurement.";
                }
    
                leaf slm-threshold1 {
                  type uint32 {
                    range "1..1000000";
                  }
                  default "1";
                  description
                    "Configure threshold1 of proactive single-ended loss measurement.";
                }
    
                leaf slm-threshold2 {
                  type uint32 {
                    range "1..1000000";
                  }
                  default "10";
                  description
                    "Configure threshold2 of proactive single-ended loss measurement.";
                }
    
                leaf detect-mode {
                  type detect-mode;
                  default "auto";
                  description
                    "Configure a detection mode.";
                }
    
                leaf auto-mode-over-time {
                  when "../detect-mode='auto'";
                  type uint8 {
                    range "0..255";
                  }
                  default "10";
                  description
                    "Configure a first packet timeout coefficient, step is 30s.";
                }
    
                leaf detect-pkt-type {
                  type detect-pkt-type;
                  default "cv";
                  description
                    "Configure a type of detected packet.";
                }
    
                leaf detect-frequence {
                  type detect-interval;
                  must
                    "(../detect-pkt-type='cv' and ../detect-frequence='1000ms') or (../detect-pkt-type='ffd' and ../detect-frequence!='1000ms')";
                  mandatory true;
                  description
                    "Configure the detection packet frequency.";
                }
    
                leaf bdi-frequence {
                  type bdi-frequency;
                  default "detect-freq";
                  description
                    "BDI packet frequency, detect-freq indicate the same as frequency of detecting packet.";
                }
    
                leaf receive-enable {
                  type boolean;
                  default "false";
                  description
                    "Enable/disable MPLS OAM packets can be received.";
                }
    
                leaf oam-active-status {
                  type active-type;
                  default "deactive";
                  description
                    "Whether MPLS OAM detection is enabled.";
                }
    
                leaf description {
                  type string {
                    length "0..64";
                  }
                  config false;
                  description
                    "Description of a tunnel.";
                }
    
                leaf lsp-type {
                  type lsp-establish-type;
                  config false;
                  description "LSP type.";
                }
    
                uses session-status;
              }  // list egress-name-tunnel
            }  // container egress-name-tunnels
    
            container ingress-tunnels {
              description
                "List of MPLS OAM monitors ingress LSP.";
              list ingress-tunnel {
                must
                  "(reverse-id and reverse-lsr-id) or (not(reverse-id) and not(reverse-lsr-id))";
                key "name";
                description
                  "Configure MPLS OAM monitors egress LSP.";
                leaf name {
                  type leafref {
                    path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                  }
                  must
                    "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name = current()]/tnlm:tunnel-protocol/mpls-te:te-tunnel";
                  description
                    "Configure a tunnel interface name.";
                }
    
                choice reverse-lsp-name-or-id {
                  default "share-mode";
                  description
                    "Configure reverse lsp name or LSR ID.";
                  case share-mode {
                    description
                      "Configure the sharing mode.";
                    leaf share {
                      type empty;
                      description
                        "Configure backward sharing mode.";
                    }
                  }  // case share-mode
    
                  case lsp-name {
                    description
                      "Configure reverse lsp name.";
                    leaf reverse-name {
                      type leafref {
                        path "/mpls:mpls/mpls-te:te/mpls-te-cr-static:static-cr-lsps/mpls-te-cr-static:static-cr-lsp/mpls-te-cr-static:lsp-name";
                      }
                      must
                        "/mpls:mpls/mpls-te:te/mpls-te-cr-static:static-cr-lsps/mpls-te-cr-static:static-cr-lsp[mpls-te-cr-static:lsp-name=current()]/mpls-te-cr-static:egress";
                      description
                        "Configure the reverse tunnel name.";
                    }
                  }  // case lsp-name
    
                  case lsp-id {
                    description
                      "Configure reverse LSR ID.";
                    leaf reverse-id {
                      type uint16 {
                        range "1..65535";
                      }
                      description
                        "Configure the remote ID of tunnel.";
                    }
    
                    leaf reverse-lsr-id {
                      type inet:ipv4-address-no-zone;
                      description
                        "Configure the remote LSR ID.";
                    }
                  }  // case lsp-id
                }  // choice reverse-lsp-name-or-id
    
                leaf oam-loss-sd {
                  type uint32 {
                    range "0..100";
                  }
                  default "0";
                  description
                    "Configure the SD threshold of OAM loss measurement.";
                }
    
                leaf oam-loss-sf {
                  type uint32 {
                    range "0..100";
                  }
                  must
                    "../oam-loss-sd<=../oam-loss-sf";
                  default "0";
                  description
                    "Configure the SF threshold of OAM loss measurement.";
                }
    
                leaf slm-send-enable {
                  type boolean;
                  default "false";
                  description
                    "Enable/disable a device sends packets for proactive single-ended loss measurement.";
                }
    
                leaf slm-exp {
                  when
                    "../slm-send-enable='true'";
                  type uint8 {
                    range "0..7";
                  }
                  default "7";
                  description
                    "Configure the exp for proactive single-ended loss measurement.";
                }
    
                leaf slm-threshold1 {
                  type uint32 {
                    range "1..1000000";
                  }
                  default "1";
                  description
                    "Configure threshold1 of proactive single-ended loss measurement.";
                }
    
                leaf slm-threshold2 {
                  type uint32 {
                    range "1..1000000";
                  }
                  default "10";
                  description
                    "Configure threshold2 of proactive single-ended loss measurement.";
                }
    
                leaf detect-pkt-type {
                  type detect-pkt-type;
                  default "cv";
                  description
                    "Configure a type of detected packet.";
                }
    
                leaf detect-frequence {
                  type detect-interval;
                  must
                    "(../detect-pkt-type='cv' and ../detect-frequence='1000ms') or (../detect-pkt-type='ffd' and ../detect-frequence!='1000ms')";
                  mandatory true;
                  description
                    "Configure the detection packet frequency.";
                }
    
                leaf bdi-frequence {
                  type bdi-frequency;
                  default "detect-freq";
                  description
                    "BDI packet frequency, detect-freq indicate the same as frequency of detecting packet.";
                }
    
                leaf compatibility-mode {
                  type compatibility-mode;
                  default "route-mode";
                  description
                    "Configure compatibility mode.";
                }
    
                leaf send-enable {
                  type boolean;
                  default "false";
                  description
                    "Enable/disable the MPLS OAM packets can be sent.";
                }
    
                leaf cc-exp {
                  type uint8 {
                    range "0..7";
                  }
                  default "7";
                  description
                    "Configure the exp of packet.";
                }
    
                leaf oam-active-status {
                  type active-type;
                  default "deactive";
                  description
                    "Whether MPLS OAM detection is enabled.";
                }
    
                leaf two-dm-send-enable {
                  type boolean;
                  default "false";
                  description
                    "Enable/disable a device sends packets for proactive two-way delay measurement.";
                }
    
                leaf two-dm-packet-size {
                  when
                    "../two-dm-send-enable='true'";
                  type uint32 {
                    range "64..1500";
                  }
                  default "64";
                  description
                    "Configure the packet size of proactive two-way delay measurement.";
                }
    
                leaf two-dm-pad-value {
                  when
                    "../two-dm-send-enable='true'";
                  type padding-value;
                  default "0";
                  description
                    "Configure the padding value of proactive two-way delay measurement.";
                }
    
                leaf two-dm-exp {
                  when
                    "../two-dm-send-enable='true'";
                  type uint8 {
                    range "0..7";
                  }
                  default "7";
                  description
                    "Configure the exp value of proactive two-way delay measurement.";
                }
    
                leaf description {
                  type string {
                    length "0..64";
                  }
                  config false;
                  description
                    "Description of a tunnel.";
                }
    
                leaf lsp-type {
                  type lsp-establish-type;
                  config false;
                  description "LSP type.";
                }
    
                uses session-status;
              }  // list ingress-tunnel
            }  // container ingress-tunnels
    
            container co-route-tunnels {
              description
                "List of MPLS OAM monitors cr static LSP.";
              list co-route-tunnel {
                must
                  "(detect-mode='auto' and send-enable='true' and receive-enable='true') or detect-mode='manual'";
                key "name";
                description
                  "Configure MPLS OAM monitors cr static LSP.";
                leaf name {
                  type leafref {
                    path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                  }
                  must
                    "/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name = current()]/tnlm:tunnel-protocol/mpls-te:te-tunnel/mpls-te-cr-static:cr-static/mpls-te-cr-static:direction";
                  description
                    "Configure a tunnel interface name.";
                }
    
                leaf oam-loss-sd {
                  type uint32 {
                    range "0..100";
                  }
                  default "0";
                  description
                    "Configure the SD threshold of OAM loss measurement.";
                }
    
                leaf oam-loss-sf {
                  type uint32 {
                    range "0..100";
                  }
                  must
                    "../oam-loss-sd<=../oam-loss-sf";
                  default "0";
                  description
                    "Configure the SF threshold of OAM loss measurement.";
                }
    
                leaf slm-send-enable {
                  type boolean;
                  default "false";
                  description
                    "Enable/disable a device sends packets for proactive single-ended loss measurement.";
                }
    
                leaf slm-exp {
                  when
                    "../slm-send-enable='true'";
                  type uint8 {
                    range "0..7";
                  }
                  default "7";
                  description
                    "Configure the exp for proactive single-ended loss measurement.";
                }
    
                leaf slm-threshold1 {
                  type uint32 {
                    range "1..1000000";
                  }
                  default "1";
                  description
                    "Configure threshold1 of proactive single-ended loss measurement.";
                }
    
                leaf slm-threshold2 {
                  type uint32 {
                    range "1..1000000";
                  }
                  default "10";
                  description
                    "Configure threshold2 of proactive single-ended loss measurement.";
                }
    
                leaf detect-mode {
                  type detect-mode;
                  default "auto";
                  description
                    "Configure a detection mode.";
                }
    
                leaf auto-mode-over-time {
                  when "../detect-mode='auto'";
                  type uint8 {
                    range "0..255";
                  }
                  default "10";
                  description
                    "Configure a first packet timeout coefficient, step is 30s.";
                }
    
                leaf detect-pkt-type {
                  type detect-pkt-type;
                  default "cv";
                  description
                    "Configure a type of detected packet.";
                }
    
                leaf detect-frequence {
                  type detect-interval;
                  must
                    "(../detect-pkt-type='cv' and ../detect-frequence='1000ms') or (../detect-pkt-type='ffd' and ../detect-frequence!='1000ms')";
                  mandatory true;
                  description
                    "Configure the detection packet frequency.";
                }
    
                leaf bdi-frequence {
                  type bdi-frequency;
                  default "detect-freq";
                  description
                    "BDI packet frequency, detect-freq indicate the same as frequency of detecting packet.";
                }
    
                leaf compatibility-mode {
                  type compatibility-mode;
                  default "route-mode";
                  description
                    "Configure compatibility mode.";
                }
    
                leaf send-enable {
                  type boolean;
                  default "false";
                  description
                    "Enable/disable the MPLS OAM packets can be sent.";
                }
    
                leaf receive-enable {
                  type boolean;
                  default "false";
                  description
                    "Enable/disable MPLS OAM packets can be received.";
                }
    
                leaf cc-exp {
                  type uint8 {
                    range "0..7";
                  }
                  default "7";
                  description
                    "Configure the exp of packet.";
                }
    
                leaf oam-active-status {
                  type active-type;
                  default "deactive";
                  description
                    "Whether MPLS OAM detection is enabled.";
                }
    
                leaf two-dm-send-enable {
                  type boolean;
                  default "false";
                  description
                    "Enable/disable a device sends packets for proactive two-way delay measurement.";
                }
    
                leaf two-dm-packet-size {
                  when
                    "../two-dm-send-enable='true'";
                  type uint32 {
                    range "64..1500";
                  }
                  default "64";
                  description
                    "Configure the packet size of proactive two-way delay measurement.";
                }
    
                leaf two-dm-pad-value {
                  when
                    "../two-dm-send-enable='true'";
                  type padding-value;
                  default "0";
                  description
                    "Configure the padding value of proactive two-way delay measurement.";
                }
    
                leaf two-dm-exp {
                  when
                    "../two-dm-send-enable='true'";
                  type uint8 {
                    range "0..7";
                  }
                  default "7";
                  description
                    "Configure the exp value of proactive two-way delay measurement.";
                }
    
                leaf description {
                  type string {
                    length "0..64";
                  }
                  config false;
                  description
                    "Description of a tunnel.";
                }
    
                leaf lsp-type {
                  type lsp-establish-type;
                  config false;
                  description "LSP type.";
                }
    
                uses session-status;
              }  // list co-route-tunnel
            }  // container co-route-tunnels
          }  // container tunnels
    
          container vll-pws {
            when "../global/oam-enable='true'";
            description
              "List of MPLS OAM monitors VLL PWs.";
            list vll-pw {
              must
                "(detect-mode='auto' and send-enable='true' and receive-enable='true') or detect-mode='manual'";
              key "l2vpn-name l2vpn-type l2vpn-role";
              description
                "Configure MPLS OAM to monitor a VLL PW.";
              leaf l2vpn-name {
                type leafref {
                  path "/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:name";
                }
                description
                  "Configure L2VPN name of MPLS OAM binded static PW.";
              }
    
              leaf l2vpn-type {
                type leafref {
                  path "/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance[l2vpn:name=current()/../l2vpn-name]/l2vpn:type";
                }
                description
                  "Configure L2VPN type of MPLS OAM binded static PW.";
              }
    
              leaf l2vpn-role {
                type leafref {
                  path "/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance[l2vpn:name = current()/../l2vpn-name][l2vpn:type = current()/../l2vpn-type]/l2vpn:vpws-ldp/l2vpn:pws/l2vpn:pw/l2vpn:role";
                }
                description
                  "Configure PW role of MPLS OAM binded static PW.";
              }
    
              uses l2vpn-pw;
    
              uses session-status;
            }  // list vll-pw
          }  // container vll-pws
    
          container vsi-pws {
            when "../global/oam-enable='true'";
            description
              "List of MPLS OAM monitors VSI PWs.";
            list vsi-pw {
              must
                "(detect-mode='auto' and send-enable='true' and receive-enable='true') or detect-mode='manual'";
              key "peer-ip vc-id vc-type";
              description
                "Configure MPLS OAM to monitor a VSI PW.";
              leaf peer-ip {
                type leafref {
                  path "/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:ldp-signaling/l2vpn:pws/l2vpn:pw/l2vpn:peer-ip";
                }
                description
                  "Configure peer IP of MPLS OAM binded static PW.";
              }
    
              leaf vc-id {
                type leafref {
                  path "/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:ldp-signaling/l2vpn:pws/l2vpn:pw[l2vpn:peer-ip=current()/../peer-ip]/l2vpn:negotiation-vc-id";
                }
                description
                  "Configure VC ID of MPLS OAM binded static PW.";
              }
    
              leaf vc-type {
                type vpls-pw-encap-type;
                description
                  "Configure remote VC type of MPLS OAM binded static PW.";
              }
    
              uses l2vpn-pw {
                refine remote-lsr-id {
                  ext:dynamic-default {
                    ext:default-value "../peer-ip";
                  }
                  description
                    "Configure a remote LSR ID.";
                }
    
                refine remote-vc-id {
                  ext:dynamic-default {
                    ext:default-value "../vc-id";
                  }
                  description
                    "Configure a remote VC ID of a static PW to which MPLS OAM is bound.";
                }
    
                refine remote-vc-type {
                  ext:dynamic-default {
                    ext:default-value "../vc-type";
                  }
                  description
                    "Configure a remote VC type of a static PW to which MPLS OAM is bound.";
                }
              }
    
              uses session-status;
            }  // list vsi-pw
          }  // container vsi-pws
        }  // container mplsoam
    
        rpc enable-co-route-tunnel {
          ext:node-ref "/mplsoam/tunnels/co-route-tunnels";
          description
            "Start connectivity verification (cv) or fast failure detection (ffd).";
          input {
            leaf tunnel-name {
              type leafref {
                path "/mplsoam/tunnels/co-route-tunnels/co-route-tunnel/name";
              }
              description
                "Tunnel interface name.";
            }
          }
        }  // rpc enable-co-route-tunnel
    
        rpc disable-co-route-tunnel {
          ext:node-ref "/mplsoam/tunnels/co-route-tunnels";
          description
            "Stop connectivity verification (cv) or fast failure detection (ffd).";
          input {
            leaf tunnel-name {
              type leafref {
                path "/mplsoam/tunnels/co-route-tunnels/co-route-tunnel/name";
              }
              description
                "Tunnel interface name.";
            }
          }
        }  // rpc disable-co-route-tunnel
    
        rpc enable-egress-id-tunnel-lsp {
          ext:node-ref "/mplsoam/tunnels/egress-id-tunnels";
          description
            "Start connectivity verification (cv) or fast failure detection (ffd).";
          input {
            leaf tunnel-id {
              type leafref {
                path "/mplsoam/tunnels/egress-id-tunnels/egress-id-tunnel/id";
              }
              description
                "Configure the ID of tunnel.";
            }
    
            leaf ingress-lsr-id {
              type leafref {
                path "/mplsoam/tunnels/egress-id-tunnels/egress-id-tunnel/ingress-lsr-id";
              }
              description
                "Configure the LSR ID.";
            }
          }
        }  // rpc enable-egress-id-tunnel-lsp
    
        rpc disable-egress-id-tunnel-lsp {
          ext:node-ref "/mplsoam/tunnels/egress-id-tunnels";
          description
            "Stop connectivity verification (cv) or fast failure detection (ffd).";
          input {
            leaf tunnel-id {
              type leafref {
                path "/mplsoam/tunnels/egress-id-tunnels/egress-id-tunnel/id";
              }
              description
                "Configure the ID of tunnel.";
            }
    
            leaf ingress-lsr-id {
              type leafref {
                path "/mplsoam/tunnels/egress-id-tunnels/egress-id-tunnel/ingress-lsr-id";
              }
              description
                "Configure the LSR ID.";
            }
          }
        }  // rpc disable-egress-id-tunnel-lsp
    
        rpc enable-egress-name-tunnel-lsp {
          ext:node-ref "/mplsoam/tunnels/egress-name-tunnels";
          description
            "Start connectivity verification (cv) or fast failure detection (ffd).";
          input {
            leaf tunnel-name {
              type leafref {
                path "/mplsoam/tunnels/egress-name-tunnels/egress-name-tunnel/name";
              }
              description "Tunnel Name.";
            }
          }
        }  // rpc enable-egress-name-tunnel-lsp
    
        rpc disable-egress-name-tunnel-lsp {
          ext:node-ref "/mplsoam/tunnels/egress-name-tunnels";
          description
            "Stop connectivity verification (cv) or fast failure detection (ffd).";
          input {
            leaf tunnel-name {
              type leafref {
                path "/mplsoam/tunnels/egress-name-tunnels/egress-name-tunnel/name";
              }
              description "Tunnel Name.";
            }
          }
        }  // rpc disable-egress-name-tunnel-lsp
    
        rpc enable-ingress-tunnel-lsp {
          ext:node-ref "/mplsoam/tunnels/ingress-tunnels";
          description
            "Start connectivity verification (cv) or fast failure detection (ffd).";
          input {
            leaf tunnel-name {
              type leafref {
                path "/mplsoam/tunnels/ingress-tunnels/ingress-tunnel/name";
              }
              description "Tunnel Name.";
            }
          }
        }  // rpc enable-ingress-tunnel-lsp
    
        rpc disable-ingress-tunnel-lsp {
          ext:node-ref "/mplsoam/tunnels/ingress-tunnels";
          description
            "Stop connectivity verification (cv) or fast failure detection (ffd).";
          input {
            leaf tunnel-name {
              type leafref {
                path "/mplsoam/tunnels/ingress-tunnels/ingress-tunnel/name";
              }
              description "Tunnel Name.";
            }
          }
        }  // rpc disable-ingress-tunnel-lsp
    
        rpc enable-co-route-tunnel-lsp {
          ext:node-ref "/mplsoam/tunnels/co-route-tunnels";
          description
            "Start connectivity verification (cv) or fast failure detection (ffd).";
          input {
            leaf tunnel-name {
              type leafref {
                path "/mplsoam/tunnels/co-route-tunnels/co-route-tunnel/name";
              }
              description "Tunnel Name.";
            }
          }
        }  // rpc enable-co-route-tunnel-lsp
    
        rpc disable-co-route-tunnel-lsp {
          ext:node-ref "/mplsoam/tunnels/co-route-tunnels";
          description
            "Stop connectivity verification (cv) or fast failure detection (ffd).";
          input {
            leaf tunnel-name {
              type leafref {
                path "/mplsoam/tunnels/co-route-tunnels/co-route-tunnel/name";
              }
              description "Tunnel Name.";
            }
          }
        }  // rpc disable-co-route-tunnel-lsp
      }  // module huawei-mplsoam
    

© 2023 YumaWorks, Inc. All rights reserved.