module hc2vpp-ietf-mpls-static { namespace "urn:ietf:params:xml:ns:yang:ietf-mpls-static"; prefix "mpls-static"; import hc2vpp-ietf-mpls { prefix mpls; } /* TODO: changed to modified version of ietf-routing that we use Set back to ietf-routing after HC2VPP-253 is resolved. */ import hc2vpp-ietf-routing { prefix "rt"; } import hc2vpp-ietf-routing-types { prefix "rt-types"; } import ietf-inet-types { prefix inet; } import ietf-interfaces { prefix "if"; } /* Import TE generic types */ /* Yangtools has some issues with ietf-te model. There is no plan to support tunnels currently, so we simply comment this out. TODO: remove comment after following issues are resolved: https://jira.opendaylight.org/browse/MDSAL-182 https://jira.opendaylight.org/browse/YANGTOOLS-677 import ietf-te { prefix te; } */ organization "IETF MPLS Working Group"; contact "WG Web: WG List: WG Chair: Loa Andersson WG Chair: Ross Callon WG Chair: George Swallow Editor: Tarek Saad Editor: Kamran Raza Editor: Rakesh Gandhi Editor: Xufeng Liu Editor: Vishnu Pavan Beeram Editor: Himanshu Shah Editor: Igor Bryskin Editor: Xia Chen Editor: Raqib Jones Editor: Bin Wen "; description "This YANG module augments the 'ietf-routing' module with basic configuration and operational state data for MPLS static"; /* TODO: 2017-07-02 defines grouping in-segment but does not use it. Bump to newer version after the issue is resolved. */ revision "2017-03-10" { description "Latest revision: - Addressed MPLS-RT review comments"; reference "RFC 3031: A YANG Data Model for Static MPLS LSPs"; } typedef static-lsp-ref { type leafref { path "/rt:routing/mpls:mpls/mpls-static:static-lsps/" + "mpls-static:static-lsp/mpls-static:name"; } description "This type is used by data models that need to reference configured static LSP."; } grouping path-basic_config { description "common definitions for statics"; leaf next-hop { type inet:ip-address; description "next hop IP address for the LSP"; } leaf outgoing-label { type rt-types:mpls-label; description "label value to push at the current hop for the LSP"; } leaf outgoing-interface { type if:interface-ref; description "The outgoing interface"; } } grouping path-properties_config { description "MPLS path properties"; leaf path-index { type uint16; description "Path identifier"; } leaf backup-path-index { type uint16; description "Backup path identifier"; } leaf next-hop { type inet:ip-address; description "The address of the next-hop"; } leaf-list outgoing-labels { type rt-types:mpls-label; ordered-by user; description "The outgoing MPLS labels to impose"; } leaf outgoing-interface { type if:interface-ref; description "The outgoing interface"; } leaf loadshare { type uint16; description "This value is used to compute a loadshare to perform un-equal load balancing when multiple outgoing path(s) are specified. A share is computed as a ratio of this number to the total under all configured path(s)."; } leaf role { type enumeration { enum PRIMARY { description "Path as primary traffic carrying"; } enum BACKUP { description "Path acts as backup"; } enum PRIMARY_AND_BACKUP { description "Path acts as primary and backup simultaneously"; } } description "The MPLS path role"; } } grouping static-lsp_config { description "common definitions for static LSPs"; container in-segment { description "MPLS incoming segment"; choice type { description "Basic FEC choice"; case ip-prefix { leaf ip-prefix { type inet:ip-prefix; description "An IP prefix"; } } case mpls-label { leaf incoming-label { type rt-types:mpls-label; description "label value on the incoming packet"; } } /* Currently not supported. Commented out due to ODL issues (MDSAL-182, YANGTOOLS-677). case tunnel { leaf tunnel { type te:tunnel-ref; description "TE tunnel FEC mapping"; } } */ } leaf incoming-interface { type if:interface-ref; description "Optional incoming interface if FEC is restricted to traffic incoming on a specific interface"; } } leaf operation { type enumeration { enum impose-and-forward { description "Operation impose outgoing label(s) and forward to next-hop"; } enum pop-and-forward { description "Operation pop incoming label and forward to next-hop"; } enum pop-impose-and-forward { description "Operation pop incoming label, impose one or more outgoing label(s) and forward to next-hop"; } enum swap-and-forward { description "Operation swap incoming label, with outgoing label and forward to next-hop"; } enum pop-and-lookup { description "Operation pop incoming label and perform a lookup"; } } description "The MPLS operation to be executed on the incoming packet"; } choice out-segment { description "The MPLS out-segment type choice"; case simple-path { uses path-basic_config; } case path-list { list paths { key path-index; description "The list of MPLS paths associated with the FEC"; uses path-properties_config; } } } } grouping static-lsp { description "grouping for top level list of static LSPs"; container config { description "Holds the intended configuration"; uses static-lsp_config; } container state { config false; description "Holds the state and inuse configuration"; uses static-lsp_config; } } augment "/rt:routing/mpls:mpls" { description "Augmentations for MPLS Static LSPs"; container static-lsps { description "Statically configured LSPs, without dynamic signaling"; list static-lsp { key name; description "list of defined static LSPs"; leaf name { type string; description "name to identify the LSP"; } uses static-lsp; } } } }