ELAN FT Support for BE
[vpnservice.git] / elanmanager / elanmanager-api / src / main / yang / elan.yang
diff --git a/elanmanager/elanmanager-api/src/main/yang/elan.yang b/elanmanager/elanmanager-api/src/main/yang/elan.yang
new file mode 100644 (file)
index 0000000..5b4b105
--- /dev/null
@@ -0,0 +1,240 @@
+module elan {
+
+    namespace "urn:opendaylight:vpnservice:elan";
+    prefix elan;
+
+    import ietf-interfaces {
+        prefix if;
+    }
+
+    import ietf-yang-types {
+        prefix yang;
+    }
+
+
+    revision "2015-06-02" {
+        description "elan module";
+    }
+
+  /*
+   * elan instance view.
+   */
+  container elan-instances {
+    description
+      "elan instances configuration parameters.
+       elan instances support both the VLAN and VNI based elans.";
+
+    list elan-instance {
+        max-elements "unbounded";
+        min-elements "0";
+        key "elan-instance-name";
+        description
+            "Specifies the name of the elan instance. It is a string of 1 to 31
+             case-sensitive characters.";
+        leaf elan-instance-name {
+            type string;
+            description
+              "The name of the elan-instance.";
+        }
+        leaf elan-tag {
+            type    uint32;
+            description "ELAN unique identifier which is unique across all the tenants. This will be created internally and if provided, the value will be discarded.";
+        }
+        leaf mac-timeout {
+            type uint32 {
+              range "0..65535";
+            }
+            description "MAC Table entry ageing time in seconds. A value of 0 will indicate that the MAC will never expire.";
+        }
+        leaf description {
+            description
+                "A textual description of elan instance, the elan instance description
+                helps users memorize the elan instance.";
+
+            type string {
+                length "1..254";
+            }
+        }
+    }
+  }
+
+  /*
+   * Binding Interfaces to a elan Instance.
+   */
+  container elan-interfaces {
+    description
+        "elan is enabled on interfaces.";
+
+    list elan-interface  {
+        key "name";
+        max-elements "unbounded";
+        min-elements "0";
+        leaf name {
+            type leafref {
+                path "/if:interfaces/if:interface/if:name";
+            }
+        }
+        leaf elan-instance-name {
+            mandatory true;
+            type string;
+        }
+        leaf-list static-mac-entries {
+            type yang:phys-address;
+        }
+        leaf description {
+            description
+                "A textual description of elan port, the elan port description
+                helps users memorize the elan port.";
+
+            type string {
+                 length "1..254";
+            }
+        }
+    }
+  }
+
+    /* operational data stores */
+  container elan-state {
+    config false;
+    description
+      "operational state of elans.";
+
+    list elan {
+        key "name";
+        description "The list of interfaces on the device.";
+        max-elements "unbounded";
+        min-elements "0";
+        leaf name {
+            type string;
+            description
+              "The name of the elan-instance.";
+        }
+        leaf-list elan-interfaces{
+            type leafref {
+                path "/if:interfaces/if:interface/if:name";
+            }
+            description "Interfaces connected to this elan instance.";
+        }
+    }
+  }
+
+  grouping forwarding-entries {
+    description "Details of the MAC entries";
+
+    list mac-entry {
+      key "mac-address";
+      description "Details of a MAC address";
+      max-elements "unbounded";
+      min-elements "0";
+
+      leaf mac-address {
+          type yang:phys-address;
+      }
+
+      leaf interface {
+         type leafref {
+             path "/if:interfaces/if:interface/if:name";
+         }
+      }
+
+      leaf controllerLearnedForwardingEntryTimestamp {
+        type uint64;
+      }
+
+      leaf isStaticAddress {
+        type boolean;
+      }
+    }
+  }
+
+  container elan-forwarding-tables {
+    config false;
+    description
+      "MAC tables for each elan instance";
+
+    list mac-table {
+        max-elements "unbounded";
+        min-elements "0";
+        key "elan-instance-name";
+        description
+            "Specifies the name of the elan instance. It is a string of 1 to 31
+             case-sensitive characters.";
+
+        leaf elan-instance-name {
+            type string;
+            description
+              "The name of the elan-instance.";
+        }
+
+        uses forwarding-entries;
+    }
+  }
+
+    container elan-interface-forwarding-entries {
+        config false;
+
+        list elan-interface-mac {
+            key "elan-interface";
+            description "All the MAC addresses learned on a particular elan interface";
+            max-elements "unbounded";
+            min-elements "0";
+            leaf elan-interface {
+                type leafref {
+                    path "/if:interfaces/if:interface/if:name";
+                }
+            }
+
+            uses forwarding-entries;
+        }
+    }
+
+    container elan-dpn-interfaces {
+        config false;
+
+        list elan-dpn-interfaces-list {
+            key "elan-instance-name";
+            description "All the dpns of this elan and all the ports of the corresponding dpns";
+            max-elements "unbounded";
+            min-elements "0";
+
+            leaf elan-instance-name {
+                type string;
+                description "The name of the elan-instance.";
+            }
+
+            list dpn-interfaces {
+                key "dp-id";
+                description "A DPN in which the elan spans across";
+                max-elements "unbounded";
+                min-elements "0";
+
+                leaf dp-id {
+                    type uint64;
+                }
+
+                leaf-list interfaces {
+                    type leafref {
+                        path "/if:interfaces/if:interface/if:name";
+                    }
+                }
+            }
+        }
+    }
+
+    container elan-tag-name-map {
+        config false;
+
+        list elan-tag-name {
+            key elan-tag;
+            leaf elan-tag {
+                type uint32;
+            }
+
+            leaf name {
+                type string;
+                description
+                "The name of the elan-instance.";
+            }
+        }
+    }
+}
\ No newline at end of file