summaryrefslogtreecommitdiffstats
path: root/mpls/api/src/main/yang/hc2vpp-ietf-mpls-static@2017-07-02.yang
diff options
context:
space:
mode:
Diffstat (limited to 'mpls/api/src/main/yang/hc2vpp-ietf-mpls-static@2017-07-02.yang')
-rwxr-xr-xmpls/api/src/main/yang/hc2vpp-ietf-mpls-static@2017-07-02.yang435
1 files changed, 435 insertions, 0 deletions
diff --git a/mpls/api/src/main/yang/hc2vpp-ietf-mpls-static@2017-07-02.yang b/mpls/api/src/main/yang/hc2vpp-ietf-mpls-static@2017-07-02.yang
new file mode 100755
index 000000000..9da4bb942
--- /dev/null
+++ b/mpls/api/src/main/yang/hc2vpp-ietf-mpls-static@2017-07-02.yang
@@ -0,0 +1,435 @@
+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: HC2VPP-307 - Remove workarounds for ODL bugs from ietf-mpls YANG.
+ */
+ /*
+ TODO: changed to modified version of ietf-routing that we use
+ Set back to ietf-routing after HC2VPP-298 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: <http://tools.ietf.org/wg/mpls/>
+
+ WG List: <mailto:mpls@ietf.org>
+
+ WG Chair: Loa Andersson
+ <mailto:loa@pi.nu>
+
+ WG Chair: Ross Callon
+ <mailto:rcallon@juniper.net>
+ WG Chair: George Swallow
+ <mailto:swallow.ietf@gmail.com>
+
+ Editor: Tarek Saad
+ <mailto:tsaad@cisco.com>
+
+ Editor: Kamran Raza
+ <mailto:skraza@cisco.com>
+
+ Editor: Rakesh Gandhi
+ <mailto:rgandhi@cisco.com>
+
+ Editor: Xufeng Liu
+ <mailto: xufeng.liu.ietf@gmail.com>
+
+ Editor: Vishnu Pavan Beeram
+ <mailto:vbeeram@juniper.net>
+
+ Editor: Himanshu Shah
+ <mailto:hshah@ciena.com>
+
+ Editor: Igor Bryskin
+ <mailto: Igor.Bryskin@huawei.com>
+
+ Editor: Xia Chen
+ <mailto:jescia.chenxia@huawei.com>
+
+ Editor: Raqib Jones
+ <mailto:raqib@Brocade.com>
+
+ Editor: Bin Wen
+ <mailto:Bin_Wen@cable.comcast.com>";
+
+ 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 HC2VPP-306 is resolved.
+ */
+ revision "2017-07-02" {
+ 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.";
+ }
+
+ typedef mpls-operations-type {
+ 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 "MPLS operations types";
+ }
+
+ 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-outgoing-labels_config {
+ description "Path outgoing labels grouping";
+ leaf index {
+ type uint8 {
+ range "0..255";
+ }
+ description
+ "Index of the label. Index 0 indicates
+ top of the label stack";
+ }
+ leaf label {
+ type rt-types:mpls-label;
+ description
+ "The outgoing MPLS labels to impose";
+ }
+ }
+
+ grouping path-outgoing-labels {
+ description "Path outgoing labels grouping";
+ container outgoing-labels {
+ description "List of outgoing labels";
+ list outgoing-labels {
+ key "index";
+ description "Outgoing label list";
+ leaf index {
+ type leafref {
+ path "../config/index";
+ }
+ description
+ "Index of the label. Index 0 indicates
+ top of the label stack";
+ }
+ container config {
+ description
+ "Configuration intended parameters";
+ uses path-outgoing-labels_config;
+ }
+ container state {
+ config false;
+ description
+ "Configuration applied parameters and state";
+ uses path-outgoing-labels_config;
+ }
+ }
+ }
+ }
+
+ 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 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-paths {
+ description "Static LSP path grouping";
+ choice out-segment {
+ description "The MPLS out-segment type choice";
+ case simple-path {
+ container simple-path {
+ description "Simple path container";
+ container config {
+ description
+ "Holds the intended configuration";
+ uses path-basic_config;
+ }
+ container state {
+ config false;
+ description
+ "Holds the state and inuse configuration";
+ uses path-basic_config;
+ }
+ }
+ }
+ case multiple-paths {
+ container paths {
+ description "List of outgoing paths";
+ list path {
+ key path-index;
+ description
+ "The list of MPLS paths associated with the FEC";
+ leaf path-index {
+ type leafref {
+ path "../config/path-index";
+ }
+ description "Index of the path";
+ }
+ container config {
+ description
+ "Holds the intended configuration";
+ uses path-properties_config;
+ }
+ container state {
+ config false;
+ description
+ "Holds the state and inuse configuration";
+ uses path-properties_config;
+ }
+ }
+ uses path-outgoing-labels;
+ }
+ }
+ }
+ }
+
+ grouping in-segment_config {
+ description "In-segment grouping";
+ 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";
+ }
+ }
+ /* 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
+
+ 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";
+ }
+ }
+
+ grouping in-segment {
+ description "In-segment grouping";
+ container in-segment {
+ description
+ "MPLS incoming segment";
+ container config {
+ description
+ "Holds the intended configuration";
+ uses in-segment_config;
+ }
+ container state {
+ config false;
+ description
+ "Holds the state and inuse configuration";
+ uses in-segment_config;
+ }
+ }
+ }
+
+ grouping static-lsp-top_config {
+ description "Static LSP configuration grouping";
+ /*
+ TODO: 2017-07-02 defines grouping in-segment but was not used - HC2VPP-306.
+ Added it here as it was in static-lsp-config in 2017-03-10 revision.
+ This will probably be fixed in next version of this model.
+ */
+ uses in-segment;
+ leaf name {
+ type string;
+ description "name to identify the LSP";
+ }
+ leaf operation {
+ type mpls-operations-type;
+ description
+ "The MPLS operation to be executed on the incoming packet";
+ }
+ }
+
+ grouping static-lsp-top {
+ description "common definitions for static LSPs";
+ container config {
+ description
+ "Holds the intended configuration";
+ uses static-lsp-top_config;
+ }
+ container state {
+ config false;
+ description
+ "Holds the state and inuse configuration";
+ uses static-lsp-top_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 leafref {
+ path "../config/name";
+ }
+ description "name to identify the LSP";
+ }
+ uses static-lsp-top;
+ uses static-lsp-paths;
+ }
+ }
+ }
+}