BUG-2982 : moved path-attributes container to grouping
[bgpcep.git] / bgp / parser-api / src / main / yang / bgp-message.yang
index 7d064a8f231795d609e38ba60602362d4829964b..a1f51de81f3f0a684174d90a1c29f315e478ed36 100644 (file)
@@ -5,6 +5,7 @@ module bgp-message {
 
     import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
     import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
+    import network-concepts { prefix netc; revision-date 2013-11-25; }
 
     organization "Cisco Systems, Inc.";
     contact "Dana Kutenicsova <dkutenic@cisco.com>";
@@ -69,13 +70,15 @@ module bgp-message {
             mandatory true;
         }
         list bgp-parameters {
-            reference "http://tools.ietf.org/html/rfc3392#section-4";
-            choice c-parameters {
-                case as4-bytes-case {
-                    container as4-bytes-capability {
-                        reference "http://tools.ietf.org/html/rfc6793";
-                        leaf as-number {
-                            type inet:as-number;
+            list optional-capabilities {
+                reference "http://tools.ietf.org/html/rfc5492#section-4";
+                choice c-parameters {
+                    case as4-bytes-case {
+                        container as4-bytes-capability {
+                            reference "http://tools.ietf.org/html/rfc6793";
+                            leaf as-number {
+                                type inet:as-number;
+                            }
                         }
                     }
                 }
@@ -85,60 +88,87 @@ module bgp-message {
 
     grouping path-attributes {
         reference "http://tools.ietf.org/html/rfc4271#section-5";
-        container origin {
-            reference "http://tools.ietf.org/html/rfc4271#section-5.1.1";
-            leaf value {
-                type bgp-t:bgp-origin;
-                mandatory true;
+        container attributes {
+            container origin {
+                reference "http://tools.ietf.org/html/rfc4271#section-5.1.1";
+                leaf value {
+                    type bgp-t:bgp-origin;
+                    mandatory true;
+                }
             }
-        }
-        container as-path {
-            reference "http://tools.ietf.org/html/rfc4271#section-5.1.2";
-            list segments {
-                uses bgp-t:as-path-segment;
+            container as-path {
+                reference "http://tools.ietf.org/html/rfc4271#section-5.1.2";
+                list segments {
+                    uses bgp-t:as-path-segment;
+                }
             }
-        }
-        uses bgp-t:next-hop;
-        container multi-exit-disc {
-            reference "http://tools.ietf.org/html/rfc4271#section-5.1.4";
-            leaf med {
-                type uint32;
+            uses bgp-t:next-hop;
+            container multi-exit-disc {
+                reference "http://tools.ietf.org/html/rfc4271#section-5.1.4";
+                leaf med {
+                    type uint32;
+                }
             }
-        }
-        container local-pref {
-            reference "http://tools.ietf.org/html/rfc4271#section-5.1.5";
-            leaf pref {
-                type uint32;
+            container local-pref {
+                reference "http://tools.ietf.org/html/rfc4271#section-5.1.5";
+                leaf pref {
+                    type uint32;
+                }
+            }
+            container atomic-aggregate {
+                reference "http://tools.ietf.org/html/rfc4271#section-5.1.6";
+                presence "Atomic Aggregate attribute is present.";
+            }
+            container aggregator {
+                uses bgp-t:bgp-aggregator;
+            }
+            list communities {
+                uses bgp-t:community;
+            }
+            list extended-communities {
+                uses bgp-t:extended-community;
+            }
+            container originator-id {
+                uses originator-id;
+            }
+            container cluster-id {
+                uses cluster-id;
+            }
+            container aigp {
+                container aigp-tlv {
+                    leaf metric {
+                        type netc:accumulated-igp-metric;
+                    }
+                }
+            }
+            list unrecognized-attributes {
+                key type;
+                leaf partial {
+                    type boolean;
+                    mandatory true;
+                }
+                leaf transitive {
+                    type boolean;
+                    mandatory true;
+                }
+                leaf type {
+                    type uint8;
+                    mandatory true;
+                }
+                leaf value {
+                    type binary {
+                        length 0..65535;
+                    }
+                    mandatory true;
+                }
             }
-        }
-        container atomic-aggregate {
-            reference "http://tools.ietf.org/html/rfc4271#section-5.1.6";
-            presence "Atomic Aggregate attribute is present.";
-        }
-        container aggregator {
-            uses bgp-t:bgp-aggregator;
-        }
-        list communities {
-            uses bgp-t:community;
-        }
-        list extended-communities {
-            uses bgp-t:extended-community;
-        }
-        container originator-id {
-            uses originator-id;
-        }
-        container cluster-id {
-            uses cluster-id;
         }
     }
 
     notification update {
         description "Update Message";
         reference "http://tools.ietf.org/html/rfc4271#section-4.3";
-        container path-attributes {
-            reference "http://tools.ietf.org/html/rfc4271#section-5";
-            uses path-attributes;
-        }
+        uses path-attributes;
         container withdrawn-routes {
             leaf-list withdrawn-routes {
                 type inet:ipv4-prefix;