]> git.puffer.fish Git - mirror/frr.git/commitdiff
yang: add vrf model
authorChirag Shah <chirag@cumulusnetworks.com>
Fri, 6 Dec 2019 04:47:01 +0000 (20:47 -0800)
committerSantosh P K <sapk@vmware.com>
Thu, 16 Apr 2020 14:41:56 +0000 (07:41 -0700)
module: frr-vrf
  +--rw lib
     +--rw vrf* [name]
        +--rw name      string
        +--ro id?       uint32
        +--ro active?   boolean <false>
        +--rw netns {netns}?
           +--rw name?   string

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
yang/frr-vrf.yang [new file with mode: 0644]

diff --git a/yang/frr-vrf.yang b/yang/frr-vrf.yang
new file mode 100644 (file)
index 0000000..40ead7e
--- /dev/null
@@ -0,0 +1,75 @@
+module frr-vrf {
+  yang-version 1.1;
+  namespace "http://frrouting.org/yang/vrf";
+  prefix frr-vrf;
+
+  organization
+    "Free Range Routing";
+  contact
+    "FRR Users List:       <mailto:frog@lists.frrouting.org>
+     FRR Development List: <mailto:dev@lists.frrouting.org>";
+  description
+    "This module defines a model for managing FRR VRF.";
+
+  revision 2019-12-06 {
+    description
+      "Initial revision.";
+  }
+
+  /*
+   * Network namespace feature
+   */
+  feature netns {
+    description "Abstracts network namespace as VRF.";
+  }
+
+  container lib {
+    list vrf {
+      key "name";
+      description
+        "VRF.";
+      leaf name {
+        type string {
+          length "1..36";
+        }
+        description
+          "VRF name.";
+      }
+
+      leaf id {
+        type uint32 {
+          range "0..4294967295";
+        }
+        config false;
+        description
+          "VRF Id.";
+      }
+
+      leaf active {
+        type boolean;
+        default "false";
+        config false;
+        description
+          "VRF active in kernel.";
+      }
+
+      container netns {
+        if-feature "netns";
+        leaf name {
+          type string;
+          description
+            "Namespace name.";
+        }
+      }
+    }
+  }
+
+  typedef vrf-ref {
+    type leafref {
+      require-instance false;
+      path "/frr-vrf:lib/frr-vrf:vrf/frr-vrf:name";
+    }
+    description
+      "Reference to a VRF";
+  }
+}