common-mpls-static

YANG module describing configuration and operational data relating to MPLS Static.

  • Version: 2019-07-01

    common-mpls-static@2019-07-01


    
      module common-mpls-static {
    
        yang-version 1;
    
        namespace
          "urn:ietf:params:xml:ns:yang:common-mpls-static";
    
        prefix ms;
    
        import cisco-semver {
          prefix cisco-semver;
        }
        import ietf-inet-types {
          prefix inet;
        }
        import ietf-interfaces {
          prefix if;
        }
        import ietf-yang-types {
          prefix yang;
        }
        import common-mpls-types {
          prefix mpls;
        }
    
        organization
          "Cisco Systems
         170 West Tasman Drive
         San Jose, CA 95134-1706
         USA";
    
        contact
          "Robert Sawaya - rsawaya@cisco.com
         Vasanth Sabavat - vsabavat@cisco.com";
    
        description
          "YANG module describing configuration and
         operational data relating to MPLS Static.";
    
        revision "2019-07-01" {
          description
            "Establish semantic version baseline";
        }
    
        revision "2015-07-22" {
          description
            "Provisional model after Gov review";
          reference
            "";
    
        }
    
        cisco-semver:module-version "1.0.0";
    
        identity lsp-type {
          description
            "The type of Label Switched Path";
        }
    
        identity lsp-IPv4 {
          base lsp-type;
          description
            "The LSP is for an IPv4 prefix";
        }
    
        identity lsp-IPv6 {
          base lsp-type;
          description
            "The LSP is for an IPv6 prefix";
        }
    
        identity lsp-vrf {
          base lsp-type;
          description "The LSP is per VRF";
        }
    
        identity lsp {
          base lsp-type;
          description "The LSP is cross-connect";
        }
    
        typedef hoptype {
          type enumeration {
            enum "PRIMARY" {
              value 0;
              description "Primary next hop";
            }
            enum "BACKUP" {
              value 1;
              description "Backup next hop";
            }
          }
          description "The Nexthop type";
        }
    
        identity nexthop-resolution-type {
          description
            "The Routing Protocol from which the nexthop is resolved";
        }
    
        identity static-nexthop {
          base nexthop-resolution-type;
          description
            "The nexthop resolved from statically configured route";
        }
    
        identity bgp-route-nexthop {
          base nexthop-resolution-type;
          description
            "The nexthop resolved from a BGP route";
        }
    
        identity ospf-route-nexthop {
          base nexthop-resolution-type;
          description
            "The nexthop resolved from an OSPF route";
        }
    
        identity isis-route-nexthop {
          base nexthop-resolution-type;
          description
            "The nexthop resolved from an ISIS route";
        }
    
        container mpls-static {
          description "MPLS Static module";
          container mpls-static-cfg {
            description
              "MPLS Static configuration commands";
            container interfaces {
              description
                "The list of interfaces configured with mpls";
              list interface {
                key "name";
                description
                  "List of interfaces that can be enabled under
                 mpls static";
                leaf name {
                  type if:interface-ref;
                  mandatory true;
                  description "Interface name";
                }
    
                leaf enabled {
                  type uint32;
                  mandatory true;
                  description
                    "Interface Enabled boolean";
                }
              }  // list interface
            }  // container interfaces
    
            container ipv4-ingress-lsps {
              description
                "The LSPs indexed by ipv4 prefix";
              list ipv4-ingress-lsp {
                key "vrf-name prefix";
                description
                  "MPLS Static IPv4 Label Switched
                 Path Configuration at Ingress";
                leaf vrf-name {
                  type string;
                  description "Name of the VRF";
                }
    
                leaf prefix {
                  type inet:ipv4-prefix;
                  description
                    "IPv4 prefix of packets that will ingress on this LSP";
                }
    
                leaf name {
                  type string;
                  description "Name of the LSP";
                }
    
                leaf in-label {
                  type mpls:ietf-mpls-label;
                  description
                    "Value of the local label. Optional for ingress";
                }
    
                container path {
                  description "Fowarding path";
                  choice resolution {
                    description
                      "Forwarding path choice";
                    case auto-next-hops {
                      description
                        "Nexthops are determined from the routing table";
                      container operations {
                        description
                          "The incoming label processing";
                        choice operation {
                          description
                            "The type of mpls operation on incoming label";
                          case preserve-stack {
                            description
                              "Do not modify the incoming label stack";
                            leaf preserve {
                              type empty;
                              mandatory true;
                              description
                                "preserve incoming label stack";
                            }
                          }  // case preserve-stack
    
                          case swap-with-label-stack {
                            description
                              "Pop the incoming label and push a label stack";
                            container swap {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container swap
                          }  // case swap-with-label-stack
    
                          case push-label-stack {
                            description
                              "Push a label stack";
                            container push {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container push
                          }  // case push-label-stack
    
                          case pop-and-forward {
                            description
                              "Pop the incoming label and forward";
                            leaf pop-and-forward {
                              type empty;
                              mandatory true;
                              description
                                "Pop the incoming label and forward";
                            }
                          }  // case pop-and-forward
                        }  // choice operation
                      }  // container operations
    
                      leaf auto-protect {
                        type boolean;
                        default "false";
                        description
                          "Enables automatic protection if true";
                      }
                    }  // case auto-next-hops
                    list next-hop {
                      key "index";
                      description
                        "next-hops list";
                      leaf index {
                        type uint32;
                        mandatory true;
                        description
                          "Index of the nexthop";
                      }
    
                      leaf type {
                        type hoptype;
                        mandatory true;
                        description
                          "The forwarding path's hoptype";
                      }
    
                      leaf protected-by {
                        type uint32;
                        description
                          "Index of the nexthop that protects this nexthop";
                      }
    
                      container next-hop-type {
                        description "Next-hop";
                        choice address-type {
                          description
                            "Next-hop type";
                          leaf if-index {
                            type uint32;
                            mandatory true;
                            description
                              "The interface index";
                          }
                          leaf ipv4-address {
                            type inet:ipv4-address-no-zone;
                            mandatory true;
                            description
                              "IPv4 Address of the nexthop";
                          }
                          leaf ipv6-address {
                            type inet:ipv6-address-no-zone;
                            mandatory true;
                            description
                              "IPv6 Address of the nexthop";
                          }
                          leaf mac-address {
                            type yang:mac-address;
                            mandatory true;
                            description
                              "MAC address of the nexthop";
                          }
                        }  // choice address-type
    
                        leaf out-interface-name {
                          type if:interface-ref;
                          description
                            "Name of the outgoing interface";
                        }
                      }  // container next-hop-type
    
                      container operations {
                        description
                          "The incoming label processing";
                        choice operation {
                          description
                            "The type of mpls operation on incoming label";
                          case preserve-stack {
                            description
                              "Do not modify the incoming label stack";
                            leaf preserve {
                              type empty;
                              mandatory true;
                              description
                                "preserve incoming label stack";
                            }
                          }  // case preserve-stack
    
                          case swap-with-label-stack {
                            description
                              "Pop the incoming label and push a label stack";
                            container swap {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container swap
                          }  // case swap-with-label-stack
    
                          case push-label-stack {
                            description
                              "Push a label stack";
                            container push {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container push
                          }  // case push-label-stack
    
                          case pop-and-forward {
                            description
                              "Pop the incoming label and forward";
                            leaf pop-and-forward {
                              type empty;
                              mandatory true;
                              description
                                "Pop the incoming label and forward";
                            }
                          }  // case pop-and-forward
                        }  // choice operation
                      }  // container operations
                    }  // list next-hop
                  }  // choice resolution
                }  // container path
              }  // list ipv4-ingress-lsp
            }  // container ipv4-ingress-lsps
    
            container ipv6-ingress-lsps {
              description
                "The LSPs indexed by ipv6 prefix";
              list ipv6-ingress-lsp {
                key "vrf-name prefix";
                description
                  "MPLS Static IPv6 Label Switched Path
                 Configuration at Ingress";
                leaf prefix {
                  type inet:ipv6-prefix;
                  description
                    "IPv6 prefix of packets that will ingress on this LSP";
                }
    
                leaf name {
                  type string;
                  description "Name of the LSP";
                }
    
                leaf in-label {
                  type mpls:ietf-mpls-label;
                  description
                    "Value of the local label. Optional for ingress";
                }
    
                leaf vrf-name {
                  type string;
                  description "Name of the VRF";
                }
    
                container path {
                  description "Fowarding path";
                  choice resolution {
                    description
                      "Forwarding path choice";
                    case auto-next-hops {
                      description
                        "Nexthops are determined from the routing table";
                      container operations {
                        description
                          "The incoming label processing";
                        choice operation {
                          description
                            "The type of mpls operation on incoming label";
                          case preserve-stack {
                            description
                              "Do not modify the incoming label stack";
                            leaf preserve {
                              type empty;
                              mandatory true;
                              description
                                "preserve incoming label stack";
                            }
                          }  // case preserve-stack
    
                          case swap-with-label-stack {
                            description
                              "Pop the incoming label and push a label stack";
                            container swap {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container swap
                          }  // case swap-with-label-stack
    
                          case push-label-stack {
                            description
                              "Push a label stack";
                            container push {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container push
                          }  // case push-label-stack
    
                          case pop-and-forward {
                            description
                              "Pop the incoming label and forward";
                            leaf pop-and-forward {
                              type empty;
                              mandatory true;
                              description
                                "Pop the incoming label and forward";
                            }
                          }  // case pop-and-forward
                        }  // choice operation
                      }  // container operations
    
                      leaf auto-protect {
                        type boolean;
                        default "false";
                        description
                          "Enables automatic protection if true";
                      }
                    }  // case auto-next-hops
                    list next-hop {
                      key "index";
                      description
                        "next-hops list";
                      leaf index {
                        type uint32;
                        mandatory true;
                        description
                          "Index of the nexthop";
                      }
    
                      leaf type {
                        type hoptype;
                        mandatory true;
                        description
                          "The forwarding path's hoptype";
                      }
    
                      leaf protected-by {
                        type uint32;
                        description
                          "Index of the nexthop that protects this nexthop";
                      }
    
                      container next-hop-type {
                        description "Next-hop";
                        choice address-type {
                          description
                            "Next-hop type";
                          leaf if-index {
                            type uint32;
                            mandatory true;
                            description
                              "The interface index";
                          }
                          leaf ipv4-address {
                            type inet:ipv4-address-no-zone;
                            mandatory true;
                            description
                              "IPv4 Address of the nexthop";
                          }
                          leaf ipv6-address {
                            type inet:ipv6-address-no-zone;
                            mandatory true;
                            description
                              "IPv6 Address of the nexthop";
                          }
                          leaf mac-address {
                            type yang:mac-address;
                            mandatory true;
                            description
                              "MAC address of the nexthop";
                          }
                        }  // choice address-type
    
                        leaf out-interface-name {
                          type if:interface-ref;
                          description
                            "Name of the outgoing interface";
                        }
                      }  // container next-hop-type
    
                      container operations {
                        description
                          "The incoming label processing";
                        choice operation {
                          description
                            "The type of mpls operation on incoming label";
                          case preserve-stack {
                            description
                              "Do not modify the incoming label stack";
                            leaf preserve {
                              type empty;
                              mandatory true;
                              description
                                "preserve incoming label stack";
                            }
                          }  // case preserve-stack
    
                          case swap-with-label-stack {
                            description
                              "Pop the incoming label and push a label stack";
                            container swap {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container swap
                          }  // case swap-with-label-stack
    
                          case push-label-stack {
                            description
                              "Push a label stack";
                            container push {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container push
                          }  // case push-label-stack
    
                          case pop-and-forward {
                            description
                              "Pop the incoming label and forward";
                            leaf pop-and-forward {
                              type empty;
                              mandatory true;
                              description
                                "Pop the incoming label and forward";
                            }
                          }  // case pop-and-forward
                        }  // choice operation
                      }  // container operations
                    }  // list next-hop
                  }  // choice resolution
                }  // container path
              }  // list ipv6-ingress-lsp
            }  // container ipv6-ingress-lsps
    
            container in-label-lsps {
              description
                "The LSPs indexed by in-label";
              list in-label-lsp {
                key "vrf-name in-label";
                description
                  "Non-ingress MPLS Static LSPs,
                 keyed on the incoming label";
                leaf in-label {
                  type mpls:ietf-mpls-label;
                  description
                    "Value of the local label";
                }
    
                leaf vrf-name {
                  type string;
                  description "Name of the VRF";
                }
    
                container path {
                  description "Fowarding path";
                  choice resolution {
                    description
                      "Forwarding path choice";
                    case auto-next-hops {
                      description
                        "Nexthops are determined from the routing table";
                      container operations {
                        description
                          "The incoming label processing";
                        choice operation {
                          description
                            "The type of mpls operation on incoming label";
                          case preserve-stack {
                            description
                              "Do not modify the incoming label stack";
                            leaf preserve {
                              type empty;
                              mandatory true;
                              description
                                "preserve incoming label stack";
                            }
                          }  // case preserve-stack
    
                          case swap-with-label-stack {
                            description
                              "Pop the incoming label and push a label stack";
                            container swap {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container swap
                          }  // case swap-with-label-stack
    
                          case push-label-stack {
                            description
                              "Push a label stack";
                            container push {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container push
                          }  // case push-label-stack
    
                          case pop-and-forward {
                            description
                              "Pop the incoming label and forward";
                            leaf pop-and-forward {
                              type empty;
                              mandatory true;
                              description
                                "Pop the incoming label and forward";
                            }
                          }  // case pop-and-forward
                        }  // choice operation
                      }  // container operations
    
                      leaf auto-protect {
                        type boolean;
                        default "false";
                        description
                          "Enables automatic protection if true";
                      }
                    }  // case auto-next-hops
                    list next-hop {
                      key "index";
                      description
                        "next-hops list";
                      leaf index {
                        type uint32;
                        mandatory true;
                        description
                          "Index of the nexthop";
                      }
    
                      leaf type {
                        type hoptype;
                        mandatory true;
                        description
                          "The forwarding path's hoptype";
                      }
    
                      leaf protected-by {
                        type uint32;
                        description
                          "Index of the nexthop that protects this nexthop";
                      }
    
                      container next-hop-type {
                        description "Next-hop";
                        choice address-type {
                          description
                            "Next-hop type";
                          leaf if-index {
                            type uint32;
                            mandatory true;
                            description
                              "The interface index";
                          }
                          leaf ipv4-address {
                            type inet:ipv4-address-no-zone;
                            mandatory true;
                            description
                              "IPv4 Address of the nexthop";
                          }
                          leaf ipv6-address {
                            type inet:ipv6-address-no-zone;
                            mandatory true;
                            description
                              "IPv6 Address of the nexthop";
                          }
                          leaf mac-address {
                            type yang:mac-address;
                            mandatory true;
                            description
                              "MAC address of the nexthop";
                          }
                        }  // choice address-type
    
                        leaf out-interface-name {
                          type if:interface-ref;
                          description
                            "Name of the outgoing interface";
                        }
                      }  // container next-hop-type
    
                      container operations {
                        description
                          "The incoming label processing";
                        choice operation {
                          description
                            "The type of mpls operation on incoming label";
                          case preserve-stack {
                            description
                              "Do not modify the incoming label stack";
                            leaf preserve {
                              type empty;
                              mandatory true;
                              description
                                "preserve incoming label stack";
                            }
                          }  // case preserve-stack
    
                          case swap-with-label-stack {
                            description
                              "Pop the incoming label and push a label stack";
                            container swap {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container swap
                          }  // case swap-with-label-stack
    
                          case push-label-stack {
                            description
                              "Push a label stack";
                            container push {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container push
                          }  // case push-label-stack
    
                          case pop-and-forward {
                            description
                              "Pop the incoming label and forward";
                            leaf pop-and-forward {
                              type empty;
                              mandatory true;
                              description
                                "Pop the incoming label and forward";
                            }
                          }  // case pop-and-forward
                        }  // choice operation
                      }  // container operations
                    }  // list next-hop
                  }  // choice resolution
                }  // container path
              }  // list in-label-lsp
            }  // container in-label-lsps
    
            container named-lsps {
              description
                "The LSPs indexed by name";
              list named-lsp {
                key "vrf-name name";
                description
                  "MPLS Static Label Switched Path Configuration.
                 The LSPs in this list are referenced by a string name.
                 The LSPs may be ingress/egress/crossconnect,
                 may have v4/v6 prefixes and may be associated with any
                 VRF. The other specialized lists above are for
                 implemetations that are keyed on prefixes or in-labels
                 instead of the LSP name.";
                leaf name {
                  type string;
                  mandatory true;
                  description "Name of the LSP";
                }
    
                leaf lsp-type {
                  type identityref {
                    base lsp-type;
                  }
                  mandatory true;
                  description "lsp type";
                }
    
                leaf vrf-name {
                  type string;
                  description "Name of the VRF";
                }
    
                leaf in-label {
                  type mpls:ietf-mpls-label;
                  description
                    "Value of the local label";
                }
    
                leaf ipv4-prefix {
                  when
                    "../lsp-type = 'lsp-IPv4'" {
                    description "ipv4 prefix";
                  }
                  type inet:ipv4-prefix;
                  description "ipv4 prefix";
                }
    
                leaf ipv6-prefix {
                  when
                    "../lsp-type = 'lsp-IPv6'" {
                    description "ipv6 prefix";
                  }
                  type inet:ipv6-prefix;
                  description "ipv6 prefix";
                }
    
                container path {
                  description "Fowarding path";
                  choice resolution {
                    description
                      "Forwarding path choice";
                    case auto-next-hops {
                      description
                        "Nexthops are determined from the routing table";
                      container operations {
                        description
                          "The incoming label processing";
                        choice operation {
                          description
                            "The type of mpls operation on incoming label";
                          case preserve-stack {
                            description
                              "Do not modify the incoming label stack";
                            leaf preserve {
                              type empty;
                              mandatory true;
                              description
                                "preserve incoming label stack";
                            }
                          }  // case preserve-stack
    
                          case swap-with-label-stack {
                            description
                              "Pop the incoming label and push a label stack";
                            container swap {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container swap
                          }  // case swap-with-label-stack
    
                          case push-label-stack {
                            description
                              "Push a label stack";
                            container push {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container push
                          }  // case push-label-stack
    
                          case pop-and-forward {
                            description
                              "Pop the incoming label and forward";
                            leaf pop-and-forward {
                              type empty;
                              mandatory true;
                              description
                                "Pop the incoming label and forward";
                            }
                          }  // case pop-and-forward
                        }  // choice operation
                      }  // container operations
    
                      leaf auto-protect {
                        type boolean;
                        default "false";
                        description
                          "Enables automatic protection if true";
                      }
                    }  // case auto-next-hops
                    list next-hop {
                      key "index";
                      description
                        "next-hops list";
                      leaf index {
                        type uint32;
                        mandatory true;
                        description
                          "Index of the nexthop";
                      }
    
                      leaf type {
                        type hoptype;
                        mandatory true;
                        description
                          "The forwarding path's hoptype";
                      }
    
                      leaf protected-by {
                        type uint32;
                        description
                          "Index of the nexthop that protects this nexthop";
                      }
    
                      container next-hop-type {
                        description "Next-hop";
                        choice address-type {
                          description
                            "Next-hop type";
                          leaf if-index {
                            type uint32;
                            mandatory true;
                            description
                              "The interface index";
                          }
                          leaf ipv4-address {
                            type inet:ipv4-address-no-zone;
                            mandatory true;
                            description
                              "IPv4 Address of the nexthop";
                          }
                          leaf ipv6-address {
                            type inet:ipv6-address-no-zone;
                            mandatory true;
                            description
                              "IPv6 Address of the nexthop";
                          }
                          leaf mac-address {
                            type yang:mac-address;
                            mandatory true;
                            description
                              "MAC address of the nexthop";
                          }
                        }  // choice address-type
    
                        leaf out-interface-name {
                          type if:interface-ref;
                          description
                            "Name of the outgoing interface";
                        }
                      }  // container next-hop-type
    
                      container operations {
                        description
                          "The incoming label processing";
                        choice operation {
                          description
                            "The type of mpls operation on incoming label";
                          case preserve-stack {
                            description
                              "Do not modify the incoming label stack";
                            leaf preserve {
                              type empty;
                              mandatory true;
                              description
                                "preserve incoming label stack";
                            }
                          }  // case preserve-stack
    
                          case swap-with-label-stack {
                            description
                              "Pop the incoming label and push a label stack";
                            container swap {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container swap
                          }  // case swap-with-label-stack
    
                          case push-label-stack {
                            description
                              "Push a label stack";
                            container push {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container push
                          }  // case push-label-stack
    
                          case pop-and-forward {
                            description
                              "Pop the incoming label and forward";
                            leaf pop-and-forward {
                              type empty;
                              mandatory true;
                              description
                                "Pop the incoming label and forward";
                            }
                          }  // case pop-and-forward
                        }  // choice operation
                      }  // container operations
                    }  // list next-hop
                  }  // choice resolution
                }  // container path
              }  // list named-lsp
            }  // container named-lsps
          }  // container mpls-static-cfg
    
          container mpls-static-state {
            config false;
            description
              "MPLS static operational data";
            container label-switched-paths {
              description
                "MPLS Static Label Switched Paths";
              list label-switched-path {
                key "vrf-name prefix";
                description "MPLS LSPs list";
                leaf name {
                  type string;
                  description "Name of the LSP";
                }
    
                leaf vrf-name {
                  type string;
                  description "Name of the VRF";
                }
    
                leaf in-label-value {
                  type mpls:ietf-mpls-label;
                  description
                    "Value of the local label";
                }
    
                leaf prefix {
                  type inet:ip-prefix;
                  description "IP v4/v6 prefix";
                }
    
                container ingress-stats {
                  description "ingress stats";
                  container stats {
                    description "Statistics";
                    leaf packets {
                      type uint64;
                      description
                        "stats for packet count";
                    }
    
                    leaf bytes {
                      type uint64;
                      description
                        "stats for byte count";
                    }
    
                    leaf dropped-packets {
                      type uint64;
                      description
                        "stats for dropped-packets";
                    }
    
                    leaf dropped-bytes {
                      type uint64;
                      description
                        "stats for dropped-bytes";
                    }
                  }  // container stats
                }  // container ingress-stats
    
                container egress-stats {
                  description "egress stats";
                  container stats {
                    description "Statistics";
                    leaf packets {
                      type uint64;
                      description
                        "stats for packet count";
                    }
    
                    leaf bytes {
                      type uint64;
                      description
                        "stats for byte count";
                    }
    
                    leaf dropped-packets {
                      type uint64;
                      description
                        "stats for dropped-packets";
                    }
    
                    leaf dropped-bytes {
                      type uint64;
                      description
                        "stats for dropped-bytes";
                    }
                  }  // container stats
                }  // container egress-stats
    
                container path {
                  description "Fowarding path";
                  choice resolution {
                    description
                      "Forwarding path choice";
                    case auto-next-hops {
                      description
                        "Nexthops are determined from the routing table";
                      container operations {
                        description
                          "The incoming label processing";
                        choice operation {
                          description
                            "The type of mpls operation on incoming label";
                          case preserve-stack {
                            description
                              "Do not modify the incoming label stack";
                            leaf preserve {
                              type empty;
                              mandatory true;
                              description
                                "preserve incoming label stack";
                            }
                          }  // case preserve-stack
    
                          case swap-with-label-stack {
                            description
                              "Pop the incoming label and push a label stack";
                            container swap {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container swap
                          }  // case swap-with-label-stack
    
                          case push-label-stack {
                            description
                              "Push a label stack";
                            container push {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container push
                          }  // case push-label-stack
    
                          case pop-and-forward {
                            description
                              "Pop the incoming label and forward";
                            leaf pop-and-forward {
                              type empty;
                              mandatory true;
                              description
                                "Pop the incoming label and forward";
                            }
                          }  // case pop-and-forward
                        }  // choice operation
                      }  // container operations
    
                      leaf auto-protect {
                        type boolean;
                        default "false";
                        description
                          "Enables automatic protection if true";
                      }
                    }  // case auto-next-hops
                    list next-hop {
                      key "index";
                      description
                        "next-hops list";
                      leaf index {
                        type uint32;
                        mandatory true;
                        description
                          "Index of the nexthop";
                      }
    
                      leaf type {
                        type hoptype;
                        mandatory true;
                        description
                          "The forwarding path's hoptype";
                      }
    
                      leaf protected-by {
                        type uint32;
                        description
                          "Index of the nexthop that protects this nexthop";
                      }
    
                      container next-hop-type {
                        description "Next-hop";
                        choice address-type {
                          description
                            "Next-hop type";
                          leaf if-index {
                            type uint32;
                            mandatory true;
                            description
                              "The interface index";
                          }
                          leaf ipv4-address {
                            type inet:ipv4-address-no-zone;
                            mandatory true;
                            description
                              "IPv4 Address of the nexthop";
                          }
                          leaf ipv6-address {
                            type inet:ipv6-address-no-zone;
                            mandatory true;
                            description
                              "IPv6 Address of the nexthop";
                          }
                          leaf mac-address {
                            type yang:mac-address;
                            mandatory true;
                            description
                              "MAC address of the nexthop";
                          }
                        }  // choice address-type
    
                        leaf out-interface-name {
                          type if:interface-ref;
                          description
                            "Name of the outgoing interface";
                        }
                      }  // container next-hop-type
    
                      container operations {
                        description
                          "The incoming label processing";
                        choice operation {
                          description
                            "The type of mpls operation on incoming label";
                          case preserve-stack {
                            description
                              "Do not modify the incoming label stack";
                            leaf preserve {
                              type empty;
                              mandatory true;
                              description
                                "preserve incoming label stack";
                            }
                          }  // case preserve-stack
    
                          case swap-with-label-stack {
                            description
                              "Pop the incoming label and push a label stack";
                            container swap {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container swap
                          }  // case swap-with-label-stack
    
                          case push-label-stack {
                            description
                              "Push a label stack";
                            container push {
                              description
                                "Push outgoing label stack";
                              container stack {
                                description
                                  "The label stack";
                                leaf-list label-stack {
                                  type ietf-mpls-label;
                                  min-elements
                                    1;
                                  ordered-by
                                    user;
                                  description
                                    "First label in the list is the top of the stack";
                                }
                              }  // container stack
                            }  // container push
                          }  // case push-label-stack
    
                          case pop-and-forward {
                            description
                              "Pop the incoming label and forward";
                            leaf pop-and-forward {
                              type empty;
                              mandatory true;
                              description
                                "Pop the incoming label and forward";
                            }
                          }  // case pop-and-forward
                        }  // choice operation
                      }  // container operations
    
                      leaf origin {
                        type identityref {
                          base nexthop-resolution-type;
                        }
                        description
                          "The origin of this nexthop";
                      }
    
                      container nexthop-stats {
                        description "lsp stats";
                        container stats {
                          description
                            "Statistics";
                          leaf packets {
                            type uint64;
                            description
                              "stats for packet count";
                          }
    
                          leaf bytes {
                            type uint64;
                            description
                              "stats for byte count";
                          }
    
                          leaf dropped-packets {
                            type uint64;
                            description
                              "stats for dropped-packets";
                          }
    
                          leaf dropped-bytes {
                            type uint64;
                            description
                              "stats for dropped-bytes";
                          }
                        }  // container stats
                      }  // container nexthop-stats
                    }  // list next-hop
                  }  // choice resolution
                }  // container path
              }  // list label-switched-path
            }  // container label-switched-paths
          }  // container mpls-static-state
        }  // container mpls-static
      }  // module common-mpls-static
    

© 2023 YumaWorks, Inc. All rights reserved.