BUG-2982 : moved path-attributes container to grouping
[bgpcep.git] / bgp / parser-api / src / main / yang / bgp-multiprotocol.yang
index c03e26e8bbb64c3f808e9947a6250b731b4867e0..920d87159e609d5d8dd9c763a31a256796d8c5ff 100644 (file)
 module bgp-multiprotocol {
-       yang-version 1;
-       namespace "urn:opendaylight:params:xml:ns:yang:bgp-multiprotocol";
-       prefix "bgp-mp";
-
-       import  ietf-inet-types { prefix inet; revision-date 2010-09-24; }
-       import bgp-message { prefix bgp-msg; revision-date 2013-09-19; }
-       import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
-
-       organization "Cisco Systems, Inc.";
-       contact "Dana Kutenicsova <dkutenic@cisco.com>";
-
-       description
-               "This module contains the base data model of a BGP message.
-               It rolls up the definitions contained in RFC4271
-               and draft-ietf-idr-ls-distribution-03.
-
-               Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
-
-               This program and the accompanying materials are made available
-               under the terms of the Eclipse Public License v1.0 which
-               accompanies this distribution, and is available at
-               http://www.eclipse.org/legal/epl-v10.html";
-
-       revision "2013-09-19" {
-               description
-                       "Split off basic types";
-       }
-
-       revision "2013-09-18" {
-               description
-                       "Initial revision.";
-               reference "RFC4760";
-       }
-
-       grouping bgp-table-type {
-               leaf afi {
-                       type identityref {
-                               base bgp-t:address-family;
-                       }
-               }
-               leaf safi {
-                       type identityref {
-                               base bgp-t:subsequent-address-family;
-                       }
-               }
-       }
-
-       grouping destination {
-               choice destination-type {
-                       case destination-ipv4 {
-                               when "../../afi = ipv4";
-                               leaf-list ipv4-prefixes {
-                                       type inet:ipv4-prefix;
-                               }
-                       }
-                       case destination-ipv6 {
-                               when "../../afi = ipv6";
-                               leaf-list ipv6-prefixes {
-                                       type inet:ipv6-prefix;
-                               }
-                       }
-               }
-       }
-
-       augment "/bgp-msg:open/bgp-msg:bgp-parameters/bgp-msg:c-parameters" {
-               case c-multiprotocol {
-                       container multiprotocol-capability {
-                               reference "http://tools.ietf.org/html/rfc4760#section-8";
-                               uses bgp-table-type;
-                       }
-               }
-               case c-graceful-restart {
-                       container graceful-restart-capability {
-                               reference "http://tools.ietf.org/html/rfc4724#section-3";
-
-                               leaf restart-flags {
-                                       type bits {
-                                               bit restart-state {
-                                                       position 0;
-                                               }
-                                       }
-                                       mandatory true;
-                               }
-
-                               leaf restart-time {
-                                       type uint16 {
-                                               range 0..4095;
-                                       }
-                                       units seconds;
-                                       mandatory true;
-                               }
-
-                               list tables {
-                                       uses bgp-table-type;
-                                       key "afi safi";
-
-                                       leaf afi-flags {
-                                               type bits {
-                                                       bit forwarding-state {
-                                                               position 0;
-                                                       }
-                                               }
-                                               mandatory true;
-                                       }
-                               }
-                       }
-               }
-       }
-
-       augment "/bgp-msg:update/bgp-msg:path-attributes" {
-               container mp-unreach-nlri {
-                       reference "http://tools.ietf.org/html/rfc4760#section-4";
-
-                       uses bgp-table-type;
-
-                       container withdrawn-routes {
-                               uses destination;
-                       }
-               }
-       }
-
-       augment "/bgp-msg:update/bgp-msg:path-attributes" {
-               container mp-reach-nlri {
-                       reference "http://tools.ietf.org/html/rfc4760#section-3";
-
-                       uses bgp-table-type;
-                       uses bgp-t:next-hop;
-
-                       container advertized-routes {
-                               uses destination;
-                       }
-               }
-       }
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:bgp-multiprotocol";
+    prefix "bgp-mp";
+
+    import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
+    import bgp-message { prefix bgp-msg; revision-date 2013-09-19; }
+    import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
+
+    organization "Cisco Systems, Inc.";
+    contact "Dana Kutenicsova <dkutenic@cisco.com>";
+
+    description
+        "This module contains the base data model of a BGP message.
+        It rolls up the definitions contained in RFC4271
+        and draft-ietf-idr-ls-distribution-03.
+
+        Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
+
+        This program and the accompanying materials are made available
+        under the terms of the Eclipse Public License v1.0 which
+        accompanies this distribution, and is available at
+        http://www.eclipse.org/legal/epl-v10.html";
+
+    revision "2013-09-19" {
+        description
+            "Split off basic types";
+    }
+
+    revision "2013-09-18" {
+        description
+            "Initial revision.";
+        reference "RFC4760";
+    }
+
+    grouping bgp-table-type {
+        leaf afi {
+            type identityref {
+                base bgp-t:address-family;
+            }
+        }
+        leaf safi {
+            type identityref {
+                base bgp-t:subsequent-address-family;
+            }
+        }
+    }
+
+    grouping destination {
+        choice destination-type {
+            // to be augmented
+        }
+    }
+
+    augment "/bgp-msg:open/bgp-msg:bgp-parameters/bgp-msg:optional-capabilities/bgp-msg:c-parameters" {
+        case multiprotocol-case {
+            container multiprotocol-capability {
+                reference "http://tools.ietf.org/html/rfc4760#section-8";
+                uses bgp-table-type;
+            }
+        }
+        case graceful-restart-case {
+            container graceful-restart-capability {
+                reference "http://tools.ietf.org/html/rfc4724#section-3";
+
+                leaf restart-flags {
+                    type bits {
+                        bit restart-state {
+                            position 0;
+                        }
+                    }
+                    mandatory true;
+                }
+
+                leaf restart-time {
+                    type uint16 {
+                        range 0..4095;
+                    }
+                    units seconds;
+                    mandatory true;
+                }
+
+                list tables {
+                    uses bgp-table-type;
+                    key "afi safi";
+
+                    leaf afi-flags {
+                        type bits {
+                            bit forwarding-state {
+                                position 0;
+                            }
+                        }
+                        mandatory true;
+                    }
+                }
+            }
+        }
+    }
+
+    augment "/bgp-msg:update/bgp-msg:attributes" {
+        container mp-reach-nlri {
+            reference "http://tools.ietf.org/html/rfc4760#section-3";
+
+            uses bgp-table-type;
+            uses bgp-t:next-hop;
+
+            container advertized-routes {
+                uses destination;
+            }
+        }
+    }
+
+    augment "/bgp-msg:update/bgp-msg:attributes" {
+        container mp-unreach-nlri {
+            reference "http://tools.ietf.org/html/rfc4760#section-4";
+
+            uses bgp-table-type;
+
+            container withdrawn-routes {
+                uses destination;
+            }
+        }
+    }
 }
-