Initial import of Microsemi Driver

Change-Id: I431d5f2c18e0b66a84c36273c3d9f0b84f223841

Added in BUCK files for building driver

Change-Id: I70681327f5b89f67e904c45d5974ab393652d51f

Corrected some syntax errors

Change-Id: I11150cc499c212005f80619e3900e747f1c23d96

Updated pom file to clean build

Change-Id: I6613ddc9e6802aa882e716cf04df210249870835

Added in utility functions for EA1000 Init

Change-Id: I51ffe0cf0daf9ffcea0e2479ee9982fcd1755440

Added YMS code to Microsemi Driver

Change-Id: I6f2a14e454c6909bf9e9f6025321c74c98c13c72

Updated driver to work with YMS and YCH

Change-Id: If7dbe3cd5bd1b6f902d09d6b2dc3895605d70f70

Implemented IetfSystemManager as a service and call on YMS as a service

Change-Id: If1c5e8482b1f53f578a3b0b770accd50024111cf

Moved YMS calls over in to Yang Service implementation

Change-Id: I044aad06f1ef7452bc48e88987787a683666cd72

improved unit test for IetfSystemManager

Change-Id: I48fbf831e7e5ca0e1ef3de8288e56da1b5ebb7a4

Major changes to IetfSystemManager to work in live system

Change-Id: I6e3aa118ba422151f314b9a666860d90905c9929

Added in retry mechanism for DeviceDescription to wait for YCH

Change-Id: If8e0f2c2f315ffd6db15627a11382a00217dd262

Added in implementation of MseaSaFiltering and unit tests

Change-Id: I34bf888e0e732bd4664d1fb8ef5abb679b1506fe

Updated driver with unit tests for MseaSaFiltering

Change-Id: I7ea2407a546622ff55d1ab21610c45697546d632

Modified removeFlowRules of Ea1000FlowRuleProgrammable

Change-Id: Ibb4a555f61887a8e6e42af588bb42f7b70f58efb

Added in manager for MseaUniEvc service with unit tests

Change-Id: Idc5853f46051548973f52a0659f7f88982ff960c

Implemented getFlowEntries() for EVCs from EA1000

Change-Id: Ie85dadfa7760f0b30a9bdf6ccd09cca9f097fff9

Added in translation of FlowRules in to EVC on EA1000

Change-Id: Icfb65171c3300c96b3ca4e18cbd327f0ed2190be

Added in handling of FlowRule deletion including complex ceVlanMaps

Change-Id: I7fd0bb0ef04d1b40e4b7d6a6db7f7ee662329780

Updated Service entries for new onos-yang-tools

Change-Id: I44e655202f3a45073e1e16f83737caed6e01afa8

Revert "Updated Service entries for new onos-yang-tools"

This reverts commit 642b550ef1de12ed59bad2eaa3a2da414d2e5e59.

Improved timeout mechanism for YANG model loading

Change-Id: If744ecd206372e822edf2b736c83226321a12256

Minor edits of EVC creation

Change-Id: Ib0a4763deaf6dce37625ba77f5095b39cd98272d

Added in CustomEvc and supporting classes

Change-Id: Iad60eb1bcd48d2aec55b894b2d419b51852c3b2f

Created CeVlanUtils to resolve loading problem

Change-Id: I0d63931ad2c5ad2725861ebc7dccc4d5fe7b9298

Modified startup check

Change-Id: I6e6bcfa7e615044cb08fe7ee2f8a6c8b89aabb21

Modified handlin of flow rules

Change-Id: I965a79c23298866122aeb94c6d9d584aafee3bd5

Fixed problem with ceVlanMap

Change-Id: If1458c35d0b95b5b25b6636f098292f9e91c06c6

Minor Pom edits

Change-Id: I5cefb18674aa04b1f50bd7e2306260c1c3ad3814

Commented out extension references in YANG files to avoid onos-yang-tools problems

Change-Id: I32fdb34c4f476f495fe28e75d0f410aaf14e2ec1

Corrected error in removing 0 in CeVlanMapUtils

Change-Id: I8cd1fd02788b81c2613364d5639ef6e090057f80

Changes in YMS to accomodate EA1000 driver

Change-Id: I6ae2b9bd2be49eae8d4ad2f929dfe3214c514550
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/ietf-system-microsemi.yang b/drivers/microsemi/ea1000yang/src/main/yang/ietf-system-microsemi.yang
new file mode 100644
index 0000000..b88ba26
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/ietf-system-microsemi.yang
@@ -0,0 +1,527 @@
+module ietf-system-microsemi {
+
+    namespace "http://www.microsemi.com/microsemi-edge-assure/msea-system";
+    prefix "sys-ms";
+
+    import ietf-yang-types {
+        prefix yang;
+        revision-date 2013-07-15;
+    }
+
+    import ietf-inet-types {
+        prefix inet;
+        revision-date 2013-07-15;
+    }
+
+    import msea-types {
+        prefix msea;
+        revision-date 2016-02-29;
+    }
+
+    import ietf-system {
+        prefix sys;
+        revision-date 2014-08-06;
+    }
+
+    import ietf-netconf-acm {
+        prefix nacm;
+        revision-date 2012-02-22;
+    }
+
+    /*** META INFORMATION ***/
+
+    organization
+    "Microsemi Inc., FTD Division";
+
+    contact
+    "Web URL: http://www.microsemi.com/
+    E-mail: info@microsemi.com
+    Postal: Microsemi Corporation Corporate Headquarters
+    One Enterprise Aliso Viejo,
+    CA 92656
+    U.S.A.
+    Phone: +1 949 380 6100
+    Fax: +1 949 215-4996";
+
+    description
+    "This YANG module extends the IETF System objects with some extra configuration attributes
+
+    Copyright 2015 Microsemi Inc.
+    All rights reserved.";
+
+    reference "RFC 7317: A YANG Data Model for System Management";
+
+    revision "2016-05-05" {
+        description
+        "Updated for ZTP support - Sean Condon, Microsemi";
+    }
+
+    revision "2015-10-01" {
+        description
+        "Initial version to augment IETF-SYSTEM YANG module - Sean Condon, Microsemi";
+    }
+
+    typedef identifier {
+        type string {
+            length "1..255";
+            pattern "[a-zA-Z0-9\-._]*";
+        }
+        description
+        "A simple string with only alphabetic or numeric and dash, dot and underscore";
+    }
+
+    grouping upgrade-file-attributes {
+        leaf file-name {
+            type string;
+            description "The name of the update TAR file as found on the device";
+        }
+
+        leaf file-date {
+            type yang:date-and-time;
+            description "The date of the update TAR file as found on the device";
+        }
+
+        leaf file-size {
+            type uint32;
+            description "The size of the update TAR file as found on the device";
+        }
+    }
+
+
+    grouping upgrade-attributes {
+        description "Attributes from the /update.tar file";
+
+        leaf version {
+            type uint32;
+            description "The version of this portion of the /update.tar";
+        }
+
+        leaf crc32 {
+            type uint32;
+            description "The CRC32 value of this portion of the /update.tar";
+        }
+
+        leaf length {
+            type uint32;
+            description "The length of this portion of the /update.tar";
+        }
+    }
+
+    grouping ddm-attributes {
+
+        leaf high-alarm-thresh {
+            description "The high alarm threshold value";
+            type decimal64 {
+                fraction-digits 6;
+            }
+        }
+
+        leaf high-warn-thresh {
+            description "The high warn threshold value";
+            type decimal64 {
+                fraction-digits 6;
+            }
+        }
+
+        leaf low-warn-thresh {
+            description "The low warn threshold value";
+            type decimal64 {
+                fraction-digits 6;
+            }
+        }
+
+        leaf low-alarm-thresh {
+            description "The low alarm threshold value";
+            type decimal64 {
+                fraction-digits 6;
+            }
+        }
+    }
+
+    feature serial-number {
+        description "Set of readonly attributes that identify the hardware";
+    }
+
+    feature remote-upgrade {
+        description
+        "Indicates that the device supports upgrade of fabric, linux and fabric header.
+        This expects a file /update.tar on the device -
+        put there through SFTP or some other file transfer method";
+    }
+
+
+    augment "/sys:system" {
+        description
+        "Extends the SYSTEM with some extra configuration attributes required for setup.";
+
+        leaf asset-tag { //Microsemi specific configuration attribute
+            type identifier;
+            description
+            "An asset tag field for the device.";
+        }
+
+        leaf description { //Microsemi specific configuration attribute
+            type string {
+                length "0..256";
+                pattern "[a-zA-Z0-9\\-_. ,]*";
+            }
+            description "A description for the device.";
+        }
+
+        leaf longitude { //Microsemi specific configuration attribute
+            type decimal64 {
+                fraction-digits 7;
+                range "-180..180";
+            }
+            description
+            "Longitude for the device expressed in decimal degrees.
+            Positive values represent East and negative values represent West";
+        }
+
+        leaf latitude { //Microsemi specific configuration attribute
+            type decimal64 {
+                fraction-digits 7;
+                range "-90..90";
+            }
+            description
+            "Latitude for the device expressed in decimal degrees
+            Positive values represent North and negative values represent South";
+        }
+    }
+
+
+    augment "/sys:system-state" {
+        description
+        "Extends the SYSTEM-STATE with some extra configuration attributes required for setup.
+
+        All attributes are automatically config=false because they extend system-state";
+
+        container remote-upgrade {
+            description "Details of the /update.tar file present on the system.
+                    These are all read-only because they are under system-state";
+
+            choice file-present-choice {
+                case not-present {
+                    leaf file-not-found {
+                        type string;
+                        description "Gives the name of the expected file. Usually /update.tar";
+                    }
+                }
+
+                case file-present {
+                    uses upgrade-file-attributes;
+
+                    leaf file-validity {
+                        type string;
+                        description "Gives an indication if the file is valid, or if not, the reason why";
+                    }
+
+                    container fabric-image {
+                        uses upgrade-attributes;
+                    }
+
+                    container linux-image {
+                        uses upgrade-attributes;
+                    }
+                }
+            }
+        }
+
+        leaf hostname {
+            type string;
+            description "The hostname of the system. When DHCP or ZTP
+                  is active the hostname will not be configured through NETCONF";
+        }
+
+        container ntp {
+          if-feature sys:ntp;
+          description "The list of NTP servers active on the system. When DHCP or ZTP
+                  is active the NTP servers will not be configured through NETCONF";
+
+          leaf-list server {
+              type string;
+              description "An NTP server active on the system";
+          }
+        }
+
+        container dns-resolver {
+          description "The list of DNS servers active on the system. When DHCP or ZTP
+                  is active the DNS servers will not be configured through NETCONF";
+
+          leaf-list server {
+              type string;
+              description "A DNS server active on the system";
+          }
+
+          leaf-list search {
+              type string;
+              description "A DNS search domain active on the system";
+          }
+
+        }
+
+        container diagnostic-monitoring {
+
+            container temperature {
+                description "The temperature and thresholds of the device";
+
+                leaf measured {
+                    description "The measured transceiver temperature at the current time";
+                    type decimal64 {
+                        fraction-digits 6;
+                    }
+                    units "°C";
+                    reference
+                    "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical 
+                    Transceivers Rev 12.1 September 12, 2014 Section 9.1";
+                }
+
+                uses ddm-attributes;
+            }
+
+            container voltage {
+                description "The core voltage and thresholds of the device";
+
+                leaf measured {
+                    description "The measured voltage at the current time";
+                    type decimal64 {
+                        fraction-digits 6;
+                    }
+                    units "V";
+                    reference
+                    "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical 
+                    Transceivers Rev 12.1 September 12, 2014 Section 9.1";
+                }
+                
+                uses ddm-attributes;
+            }
+
+            container tx-bias {
+                description "The transmit (Tx) bias and thresholds of the device";
+
+                leaf measured {
+                    description "The measured transmit (Tx) bias at the current time";
+                    type decimal64 {
+                        fraction-digits 6;
+                    }
+                    units "mA";
+                    reference
+                    "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical 
+                    Transceivers Rev 12.1 September 12, 2014 Section 9.1";
+                }
+
+                uses ddm-attributes;
+            }
+
+            container tx-power {
+                description "The transmit (Tx) power and thresholds of the device";
+
+                leaf measured {
+                    description "The measured transmit (Tx) power at the current time";
+                    type decimal64 {
+                        fraction-digits 6;
+                    }
+                    units "mV";
+                    reference
+                    "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical 
+                    Transceivers Rev 12.1 September 12, 2014 Section 9.1";
+                }
+
+                uses ddm-attributes;
+            }
+            
+            container rx-power {
+                description "The receive (Rx) power and thresholds of the device";
+
+                leaf measured {
+                    description "The measured receive (Rx) power at the current time";
+                    type decimal64 {
+                        fraction-digits 6;
+                    }
+                    units "mV";
+                    reference
+                    "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical 
+                    Transceivers Rev 12.1 September 12, 2014 Section 9.1";
+                }
+
+                uses ddm-attributes;
+            }
+        }
+    }
+
+    augment "/sys:system-state/sys:platform" {
+        description
+        "Extends the SYSTEM-STATE with some extra configuration attributes required for setup.
+
+        All attributes are automatically config=false because they extend system-state";
+
+        container device-identification {
+            if-feature serial-number;
+            config false;
+
+            leaf vendor-name {
+                type string;
+                description
+                "Device Vendor Name";
+                reference
+                "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical
+                Transceivers Rev 12.1 September 12, 2014 Table 4-1 Address A0H Bytes 20-35";
+            }
+
+            leaf vendor-part-number {
+                type string;
+                description
+                "Device Vendor Part Number";
+                reference
+                "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical
+                Transceivers Rev 12.1 September 12, 2014 Table 4-1 Address A0H Bytes 40-55";
+            }
+
+            leaf vendor-revision {
+                type string;
+                description
+                "Device Vendor Revision";
+                reference
+                "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical
+                Transceivers Rev 12.1 September 12, 2014 Table 4-1 Address A0H Bytes 56-59";
+            }
+
+            leaf serial-number {
+                type string;
+                description
+                "Device Serial Number";
+                reference
+                "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical
+                Transceivers Rev 12.1 September 12, 2014 Table 4-1 Address A0H Bytes 68-83";
+            }
+
+            container processor {
+                description "Details of the processor hardware in the device";
+
+                leaf serialnumber {
+                    type yang:hex-string;
+                    description "The serial number of the processor";
+                }
+
+                leaf x509-device-certificate-pem {
+                    type string;
+                    description "X509 Device certificate in PEM (Base 64 format)";
+                }
+            }
+        }
+    }
+
+    rpc do-upgrade-and-reboot {
+//        nacm:default-deny-all;
+        if-feature remote-upgrade;
+
+        description "Method to perform an upgrade of the device. This
+        expects a file /update.tar to have be present on the device.
+        The system-state/remote-upgrade attributes can be used to
+        verify the contents of the file before calling this action.
+        If there is a problem performing the upgrade
+        these will be described in any error thrown";
+
+        input {
+            leaf reset-option {
+                type enumeration {
+                    enum nuclear {
+                        description "Erases all configuration and resets the device to
+                                factory defaults.";
+                    }
+                    enum allnetconf {
+                        description "Reset all NETCONF data - leaves only logs and SSH keys.
+                            If a lesser reset is required use system-restart with a
+                            suitable reset-option";
+                    }
+                }
+                description "Optionally specify a parameter that can be
+                    used to reset the device to factory defaults";
+            }
+        }
+
+        output {
+            anyxml data {
+                description "A message describing the result.
+                    The result might not be seen as it schedules a reboot of the device";
+            }
+        }
+    }
+
+
+    rpc pull-update-tar-from-tftp {
+//        nacm:default-deny-all;
+        if-feature remote-upgrade;
+
+        description "Pulls a specified file from the specifed host and copies it
+                to the local device (usually at /update.tar
+                It also expects the file to be signed with GnuPG and the signature
+                file to exist on the TFTP server at <tftp-file>.asc";
+
+        input {
+            leaf tftp-file {
+                type msea:file-name;
+                mandatory true;
+                description "The name of a file to pull from the TFTP server at the host name specified";
+            }
+
+            leaf tftp-host {
+                type inet:host;
+                mandatory true;
+                description "The hostname of a TFTP server where an update TAR file can be pulled from";
+            }
+        }
+    }
+
+    rpc read-from-syslog {
+        description "A method of reading the entries from syslog. If no
+                argument is given will read the last 100 lines";
+
+        input {
+            leaf start-line {
+                type int16 {
+                    range -10000..-1;
+                }
+                default -100;
+                description "The number of lines to read from the end of syslog.";
+            }
+        }
+
+        output {
+            anyxml data {
+                description "Syslog entries represented as XML";
+            }
+        }
+    }
+
+//    notification upgrade-notification {
+//        description
+//            "Generated when a remote upgrade is in progress.";
+//
+//        leaf upgrade-stage {
+//            type enumeration {
+//                enum "check" {
+//                    description
+//                    "Checking the upgrade file is valid";
+//                }
+//                enum "erase" {
+//                    description    "Erasing old image";
+//                }
+//                enum "write" {
+//                    description "Writing new image";
+//                }
+//                enum "complete" {
+//                    description "Upgrade complete";
+//                }
+//            }
+//            mandatory true;
+//        }
+//
+//        leaf upgrade-detail {
+//            description "Textual description of the stage of upgrade";
+//            type string {
+//                length 0..100;
+//            }
+//        }
+//    } // upgrade-notification
+}
\ No newline at end of file