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/BUCK.ignore b/drivers/microsemi/ea1000yang/BUCK.ignore
new file mode 100644
index 0000000..73d20c0
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/BUCK.ignore
@@ -0,0 +1,36 @@
+YANG_DEPS = [
+ '//lib:CORE_DEPS',
+ '//lib:onos-yang-datamodel',
+ '//lib:onos-yang-utils-generator',
+]
+
+COMPILE_DEPS = [
+ '//lib:CORE_DEPS',
+ '//apps/yms/api:onos-apps-yms-api',
+ '//protocols/netconf/api:onos-protocols-netconf-api',
+ '//lib:onos-yang-datamodel',
+ '//lib:onos-yang-utils-generator',
+ '//lib:org.apache.servicemix.bundles.dom4j',
+ '//drivers/microsemi/ea1000yang:onos-drivers-microsemi-ea1000yang-gen',
+]
+
+TEST_DEPS = [
+ '//lib:TEST_ADAPTERS',
+ '//apps/yms/app:onos-apps-yms-app',
+ '//drivers/netconf:onos-drivers-netconf-tests',
+ '//protocols/netconf/ctl:onos-protocols-netconf-ctl',
+]
+
+yang_osgi_jar(
+ deps = YANG_DEPS,
+ name = 'onos-drivers-microsemi-ea1000yang-gen',
+ srcs = glob(['src/main/yang/**/*.yang']),
+ visibility = [ 'PUBLIC' ],
+)
+
+osgi_jar_with_tests(
+ deps = COMPILE_DEPS,
+ test_deps = TEST_DEPS,
+ visibility = [ 'PUBLIC' ],
+ srcs = glob(['src/main/**/*.java'])
+)
diff --git a/drivers/microsemi/ea1000yang/pom.xml b/drivers/microsemi/ea1000yang/pom.xml
new file mode 100644
index 0000000..31beff0
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/pom.xml
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ~ Copyright 2016 Open Networking Laboratory ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>onos-drivers-microsemi</artifactId>
+ <groupId>org.onosproject</groupId>
+ <version>1.10.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>onos-drivers-microsemi-ea1000yang</artifactId>
+ <packaging>bundle</packaging>
+
+ <description>Microsemi YANG model for EA1000</description>
+ <url>http://www.microsemi.com</url>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <onos.version>1.10.0-SNAPSHOT</onos.version>
+ <onos.app.name>org.onosproject.drivers.microsemi.yang</onos.app.name>
+ <onos.app.title>Microsemi Device Drivers YANG</onos.app.title>
+ <onos.app.origin>Microsemi, Inc.</onos.app.origin>
+ <onos.app.category>Drivers</onos.app.category>
+ <onos.app.url>http://onosproject.org</onos.app.url>
+ <onos.app.readme>For various Microsemi Devices including EdgeAssure
+ 1000 SFP-NID</onos.app.readme>
+ </properties>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-netconf-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-yang-utils-generator</artifactId>
+ <version>1.11</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-yang-datamodel</artifactId>
+ <version>1.11</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-app-yms-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onlab-junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-app-yms</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-drivers-netconf</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-yang-maven-plugin</artifactId>
+ <version>1.11</version>
+ <executions>
+ <execution>
+ <configuration>
+ <classFileDir>target/generated-sources</classFileDir>
+ </configuration>
+ <goals>
+ <goal>yang2java</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Include-Resource>yang/resources/YangMetaData.ser=target/classes/yang/resources/YangMetaData.ser</Include-Resource>
+ </instructions>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/delaymeasurement/*</exclude>
+ <exclude>**/lossmeasurement/*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/IetfSystemNetconfService.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/IetfSystemNetconfService.java
new file mode 100644
index 0000000..7554350
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/IetfSystemNetconfService.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang;
+
+import java.time.OffsetDateTime;
+
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.netconf.TargetConfig;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.ietfsystemmicrosemi.doupgradeandreboot.DoUpgradeAndRebootInput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.ietfsystemmicrosemi.doupgradeandreboot.DoUpgradeAndRebootOutput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.ietfsystemmicrosemi.pullupdatetarfromtftp.PullUpdateTarFromTftpInput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.ietfsystemmicrosemi.readfromsyslog.ReadFromSyslogInput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.ietfsystemmicrosemi.readfromsyslog.ReadFromSyslogOutput;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.IetfSystem;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.IetfSystemOpParam;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.ietfsystem.systemrestart.SystemRestartInput;
+
+/**
+ * Extension of ietfSystemService to include NETCONF sessions.
+ *
+ * This is manually extended and should be revised if the ietf-system.yang file changes
+ */
+public interface IetfSystemNetconfService {
+ /**
+ * Returns the attribute ietfSystem.
+ *
+ * @param ietfSystem value of ietfSystem
+ * @param session An active NETCONF session
+ * @return ietfSystem
+ * @throws NetconfException if the session has any error
+ */
+ IetfSystem getIetfSystem(IetfSystemOpParam ietfSystem, NetconfSession session) throws NetconfException;
+
+ /**
+ * Returns the result of the init query.
+ *
+ * @param session An active NETCONF session
+ * @return ietfSystem
+ * @throws NetconfException if the session has any error
+ */
+ IetfSystem getIetfSystemInit(NetconfSession session) throws NetconfException;
+
+ /**
+ * Sets the value to attribute ietfSystem.
+ *
+ * @param ietfSystem value of ietfSystem
+ * @param session An active NETCONF session
+ * @param ncDs datastore type running, startup or candidate
+ * @throws NetconfException if the session has any error
+ */
+ void setIetfSystem(IetfSystemOpParam ietfSystem, NetconfSession session, TargetConfig ncDs)
+ throws NetconfException;
+
+ /**
+ * Service interface of setCurrentDatetime.
+ *
+ * @param date input of service interface setCurrentDatetime
+ * @param session An active NETCONF session
+ * @throws NetconfException if the session has any error
+ */
+ void setCurrentDatetime(OffsetDateTime date, NetconfSession session) throws NetconfException;
+
+ /**
+ * Service interface of systemRestart.
+ *
+ * @param inputVar input of service interface systemRestart
+ * @param session An active NETCONF session
+ * @throws NetconfException if the session has any error
+ */
+ void systemRestart(SystemRestartInput inputVar, NetconfSession session) throws NetconfException;
+
+ /**
+ * Service interface of systemShutdown.
+ *
+ * @param session An active NETCONF session
+ * @throws NetconfException if the session has any error
+ */
+ void systemShutdown(NetconfSession session) throws NetconfException;
+
+ /**
+ * Service interface of doUpgradeAndReboot.
+ *
+ * @param inputVar input of service interface doUpgradeAndReboot
+ * @param session An active NETCONF session
+ * @return doUpgradeAndRebootOutput output of service interface doUpgradeAndReboot
+ * @throws NetconfException if the session has any error
+ */
+ DoUpgradeAndRebootOutput doUpgradeAndReboot(DoUpgradeAndRebootInput inputVar, NetconfSession session)
+ throws NetconfException;
+
+ /**
+ * Service interface of pullUpdateTarFromTftp.
+ *
+ * @param inputVar input of service interface pullUpdateTarFromTftp
+ * @param session An active NETCONF session
+ * @throws NetconfException if the session has any error
+ */
+ void pullUpdateTarFromTftp(PullUpdateTarFromTftpInput inputVar, NetconfSession session)
+ throws NetconfException;
+
+ /**
+ * Service interface of readFromSyslog.
+ *
+ * @param inputVar input of service interface readFromSyslog
+ * @param session An active NETCONF session
+ * @return readFromSyslogOutput output of service interface readFromSyslog
+ * @throws NetconfException if the session has any error
+ */
+ ReadFromSyslogOutput readFromSyslog(ReadFromSyslogInput inputVar, NetconfSession session)
+ throws NetconfException;
+
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/MseaCfmNetconfService.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/MseaCfmNetconfService.java
new file mode 100644
index 0000000..cf391fa
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/MseaCfmNetconfService.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang;
+
+import org.onosproject.event.ListenerService;
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.netconf.TargetConfig;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.MseaCfm;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.MseaCfmOpParam;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.MseaCfmEvent;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.MseaCfmEventListener;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.abortloopback.AbortLoopbackInput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.transmitlinktrace.TransmitLinktraceInput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.transmitlinktrace.TransmitLinktraceOutput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.transmitloopback.TransmitLoopbackInput;
+
+/**
+ * Extension of mseaCfmService to include NETCONF sessions.
+ *
+ * This is manually extended and should be revised if the msea-cfm.yang,
+ * msea-soam-pm.yang or msea-soam-fm.yang files change
+ */
+public interface MseaCfmNetconfService extends ListenerService<MseaCfmEvent, MseaCfmEventListener> {
+
+ /**
+ * Returns attributes of MEP.
+ *
+ * @param mdName The name of the MD
+ * @param maName The name of the MA
+ * @param mepId The ID of the MEP
+ * @param session An active NETCONF session
+ * @return mseaCfm
+ * @throws NetconfException if the session has any error
+ */
+ MseaCfm getMepEssentials(String mdName, String maName, int mepId,
+ NetconfSession session) throws NetconfException;
+
+
+ /**
+ * Returns attributes of DM.
+ *
+ * @param mdName The name of the MD
+ * @param maName The name of the MA
+ * @param mepId The ID of the MEP
+ * @param dmId The Id of the Delay Measurement
+ * @param session An active NETCONF session
+ * @return mseaCfm
+ * @throws NetconfException if the session has any error
+ */
+ MseaCfm getSoamDm(String mdName, String maName, int mepId,
+ int dmId, NetconfSession session) throws NetconfException;
+
+ /**
+ * Sets the value to attribute mseaCfm.
+ *
+ * @param mseaCfm value of mseaCfm
+ * @param session An active NETCONF session
+ * @param targetDs one of running, candidate or startup
+ * @throws NetconfException if the session has any error
+ */
+ void setMseaCfm(MseaCfmOpParam mseaCfm, NetconfSession session, TargetConfig targetDs) throws NetconfException;
+
+ /**
+ * Service interface of transmitLoopback.
+ *
+ * @param inputVar input of service interface transmitLoopback
+ * @param session An active NETCONF session
+ * @throws NetconfException if the session has any error
+ */
+ void transmitLoopback(TransmitLoopbackInput inputVar, NetconfSession session) throws NetconfException;
+
+ /**
+ * Service interface of abortLoopback.
+ *
+ * @param inputVar input of service interface abortLoopback
+ * @param session An active NETCONF session
+ * @throws NetconfException if the session has any error
+ */
+ void abortLoopback(AbortLoopbackInput inputVar, NetconfSession session) throws NetconfException;
+
+ /**
+ * Service interface of transmitLinktrace.
+ *
+ * @param inputVar input of service interface transmitLinktrace
+ * @param session An active NETCONF session
+ * @return transmitLinktraceOutput output of service interface transmitLinktrace
+ * @throws NetconfException if the session has any error
+ */
+ TransmitLinktraceOutput transmitLinktrace(TransmitLinktraceInput inputVar, NetconfSession session)
+ throws NetconfException;
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/MseaSaFilteringNetconfService.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/MseaSaFilteringNetconfService.java
new file mode 100644
index 0000000..9e35df0
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/MseaSaFilteringNetconfService.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.drivers.microsemi.yang;
+
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.netconf.TargetConfig;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.MseaSaFiltering;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.MseaSaFilteringOpParam;
+
+/**
+ * Extension of mseaSaFilteringService to include NETCONF sessions.
+ *
+ * This is manually extended and should be revised if the msea-sa-filtering.yang file changes
+ */
+public interface MseaSaFilteringNetconfService {
+ /**
+ * Returns the attribute mseaSaFiltering.
+ *
+ * @param mseaSaFiltering value of mseaSaFiltering
+ * @param session An active NETCONF session
+ * @return mseaSaFiltering
+ * @throws NetconfException if the session has any error
+ */
+ MseaSaFiltering getMseaSaFiltering(
+ MseaSaFilteringOpParam mseaSaFiltering, final NetconfSession session)
+ throws NetconfException;
+
+ /**
+ * Sets the value to attribute mseaSaFiltering.
+ *
+ * @param mseaSaFiltering value of mseaSaFiltering
+ * @param session An active NETCONF session
+ * @param targetDs The NETCONF datastore to edit
+ * @throws NetconfException if the session has any error
+ */
+ void setMseaSaFiltering(MseaSaFilteringOpParam mseaSaFiltering, NetconfSession session, TargetConfig targetDs)
+ throws NetconfException;
+
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/MseaUniEvcServiceNetconfService.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/MseaUniEvcServiceNetconfService.java
new file mode 100644
index 0000000..38ccbf6
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/MseaUniEvcServiceNetconfService.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.drivers.microsemi.yang;
+
+import java.util.List;
+import java.util.Map;
+
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.netconf.TargetConfig;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.MseaUniEvcService;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.MseaUniEvcServiceOpParam;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.UniSideInterfaceAssignmentEnum;
+
+/**
+ * Extension of mseaUniEvcServiceService to include NETCONF sessions.
+ *
+ * This is manually extended and should be revised if the msea-uni-evc-service.yang
+ * file changes
+ */
+public interface MseaUniEvcServiceNetconfService {
+ /**
+ * Returns the configuration and state attributes of the running mseaUniEvcService.
+ *
+ * @param mseaUniEvcService value of mseaUniEvcService
+ * @param session The NETCONF session
+ * @return mseaUniEvcService
+ * @throws NetconfException if the session has any error
+ */
+ MseaUniEvcService getMseaUniEvcService(
+ MseaUniEvcServiceOpParam mseaUniEvcService, NetconfSession session)
+ throws NetconfException;
+
+ /**
+ * Returns the configuration only attributes of mseaUniEvcService.
+ *
+ * @param mseaUniEvcService value of mseaUniEvcService
+ * @param session The NETCONF session
+ * @param targetDs one of running, candidate or startup
+ * @return mseaUniEvcService
+ * @throws NetconfException if the session has any error
+ */
+ MseaUniEvcService getConfigMseaUniEvcService(
+ MseaUniEvcServiceOpParam mseaUniEvcService, NetconfSession session, TargetConfig targetDs)
+ throws NetconfException;
+
+ /**
+ * Sets the value to attribute mseaUniEvcService.
+ *
+ * @param mseaUniEvcService value of mseaUniEvcService
+ * @param session The NETCONF session
+ * @param targetDs one of running, candidate or startup
+ * @throws NetconfException if the session has any error
+ */
+ void setMseaUniEvcService(MseaUniEvcServiceOpParam mseaUniEvcService,
+ NetconfSession session, TargetConfig targetDs)
+ throws NetconfException;
+
+ /**
+ * Returns a list of the CeVlanMaps on both sides of the EVC.
+ *
+ * @param session A NETCONF Session
+ * @param ncDs The datastore to affect - running, candidate or startup
+ * @return The Object Model with the VLans
+ * @throws NetconfException if the session has any error
+ */
+ MseaUniEvcService getmseaUniEvcCeVlanMaps(
+ NetconfSession session, TargetConfig ncDs)
+ throws NetconfException;
+
+ /**
+ * Replace ceVlans or delete EVCs from a device.
+ *
+ * It is necessary to have a custom command for this as the YCH cannot
+ * handle the intricacies of putting a replace operation on the
+ * ceVlanMap leaf at present
+ *
+ * @param ceVlanUpdates A Map of CeVlanMap entries to change, as flows are deleted
+ * @param flowVlanIds The IDs of flows that are being removed
+ * @param session A NETCONF Session
+ * @param targetDs The datastore to affect - running, candidate or startup
+ * @param portAssign The port assignment of the device
+ * @throws NetconfException if the session has any error
+ */
+ void removeEvcUniFlowEntries(
+ Map<Integer, String> ceVlanUpdates,
+ Map<Integer, List<Short>> flowVlanIds,
+ NetconfSession session,
+ TargetConfig targetDs,
+ UniSideInterfaceAssignmentEnum portAssign)
+ throws NetconfException;
+
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/UniSide.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/UniSide.java
new file mode 100644
index 0000000..8ced81c
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/UniSide.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang;
+
+/**
+ * An enumeration to describe the side of a UNI - Customer or Network.
+ * For reference see MEF 6.2
+ */
+public enum UniSide {
+ CUSTOMER,
+ NETWORK
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/AbstractYangServiceImpl.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/AbstractYangServiceImpl.java
new file mode 100644
index 0000000..7b65a75
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/AbstractYangServiceImpl.java
@@ -0,0 +1,185 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang.impl;
+
+import static org.onosproject.yms.ych.YangProtocolEncodingFormat.XML;
+import static org.onosproject.yms.ydt.YmsOperationType.EDIT_CONFIG_REQUEST;
+import static org.onosproject.yms.ydt.YmsOperationType.QUERY_REPLY;
+import static org.onosproject.yms.ydt.YmsOperationType.QUERY_REQUEST;
+
+import java.util.List;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.Service;
+import org.onosproject.core.ApplicationId;
+import org.onosproject.core.CoreService;
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.netconf.TargetConfig;
+import org.onosproject.yms.ych.YangCodecHandler;
+import org.onosproject.yms.ych.YangCompositeEncoding;
+import org.onosproject.yms.ymsm.YmsService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Abstract class that implements some of the core functions of a YANG model service.
+ *
+ */
+@Component(immediate = true)
+@Service
+public abstract class AbstractYangServiceImpl {
+ protected final Logger log = LoggerFactory.getLogger(getClass());
+ protected boolean alreadyLoaded = false;
+
+ @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+ protected CoreService coreService;
+
+ @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+ protected YmsService ymsService;
+
+ protected ApplicationId appId;
+
+ // YCH is not a service and is a class variable. Can be lost on deactivate.
+ // Must be recreated on activate
+ protected YangCodecHandler ych;
+
+ @Activate
+ public abstract void activate();
+
+ @Deactivate
+ public void deactivate() {
+ alreadyLoaded = false;
+ }
+
+ /**
+ * Internal method to generically make a NETCONF get query from YANG objects.
+ * @param yangObjectOpParamFilter A YANG object model
+ * @param session A NETCONF session
+ * @return YangObjectModel
+ * @throws NetconfException if the session has any error
+ */
+ protected final Object getNetconfObject(
+ Object yangObjectOpParamFilter, NetconfSession session)
+ throws NetconfException {
+ if (session == null) {
+ throw new NetconfException("Session is null when calling getNetconfObject()");
+ }
+ if (yangObjectOpParamFilter == null) {
+ throw new NetconfException("Query object cannot be null");
+ }
+ //Convert the param to XML to use as a filter
+ YangCompositeEncoding xmlQuery =
+ ych.encodeCompositeOperation(null, null,
+ yangObjectOpParamFilter, XML, QUERY_REQUEST);
+
+ String xmlQueryStr = xmlQuery.getResourceInformation().replace("<>", "").replace("</>", "").trim();
+ log.debug("Sending <get> query on NETCONF session " + session.getSessionId() +
+ ":\n" + xmlQueryStr);
+
+ String xmlResult = session.get(xmlQueryStr, null);
+
+ List<Object> objectList = ych.decode(xmlResult, XML, QUERY_REPLY);
+ if (objectList != null && objectList.size() > 0) {
+ Object systemObject = objectList.get(0);
+ return systemObject;
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Internal method to generically make a NETCONF get-config query from YANG objects.
+ *
+ * @param yangObjectOpParamFilter A YANG object model
+ * @param session A NETCONF session
+ * @param targetDs - running,candidate or startup
+ * @return YangObjectModel
+ * @throws NetconfException if the session has any error
+ */
+ protected final Object getConfigNetconfObject(
+ Object yangObjectOpParamFilter, NetconfSession session, TargetConfig targetDs)
+ throws NetconfException {
+ if (session == null) {
+ throw new NetconfException("Session is null when calling getConfigNetconfObject()");
+ }
+
+ if (yangObjectOpParamFilter == null) {
+ throw new NetconfException("Query object cannot be null");
+ }
+ //Convert the param to XML to use as a filter
+ YangCompositeEncoding xmlQuery =
+ ych.encodeCompositeOperation(null, null,
+ yangObjectOpParamFilter, XML, QUERY_REQUEST);
+
+ String xmlQueryStr = xmlQuery.getResourceInformation().replace("<>", "").replace("</>", "").trim();
+ log.debug("Sending <get-config> for " + targetDs +
+ " query on NETCONF session " + session.getSessionId() +
+ ":\n" + xmlQueryStr);
+
+ String xmlResult = session.getConfig(targetDs, xmlQueryStr);
+
+ List<Object> objectList = ych.decode(xmlResult, XML, QUERY_REPLY);
+ if (objectList != null && objectList.size() > 0) {
+ Object systemObject = objectList.get(0);
+ return systemObject;
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Internal method to generically make a NETCONF edit-config call from a set of YANG objects.
+ *
+ * @param yangObjectOpParamFilter A YANG object model
+ * @param session A NETCONF session
+ * @param targetDs - running,candidate or startup
+ * @throws NetconfException if the session has any error
+ */
+ protected final void setNetconfObject(
+ Object yangObjectOpParamFilter, NetconfSession session, TargetConfig targetDs)
+ throws NetconfException {
+ if (yangObjectOpParamFilter == null) {
+ throw new NetconfException("Query object cannot be null");
+ } else if (session == null) {
+ throw new NetconfException("Session is null when calling getMseaSaFiltering()");
+ }
+ //Convert the param to XML to use as a filter
+ YangCompositeEncoding xmlContent =
+ ych.encodeCompositeOperation(null, null,
+ yangObjectOpParamFilter, XML, EDIT_CONFIG_REQUEST);
+
+ String xmlContentStr = xmlContent.getResourceInformation()
+ .replace("<>", "").replace("</>", "")
+ //FIXME: Necessary for MEP ccmInterval
+ .replaceAll("yangAutoPrefix", "")
+ .trim();
+
+ log.debug("Sending XML <edit-config> on NETCONF session " + session.getSessionId() +
+ ":\n" + xmlContentStr);
+
+ boolean succeeded = session.editConfig(targetDs, null, xmlContentStr);
+ if (succeeded) {
+ log.debug("<edit-config> succeeded through NETCONF");
+ } else {
+ throw new NetconfException("Failed to run edit-config through NETCONF");
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/IetfSystemManager.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/IetfSystemManager.java
new file mode 100644
index 0000000..4c61143
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/IetfSystemManager.java
@@ -0,0 +1,207 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang.impl;
+
+import static org.onosproject.yms.ych.YangProtocolEncodingFormat.XML;
+import static org.onosproject.yms.ydt.YmsOperationType.QUERY_REPLY;
+
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Service;
+import org.onosproject.drivers.microsemi.yang.IetfSystemNetconfService;
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.netconf.TargetConfig;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.IetfSystemMicrosemiService;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.ietfsystemmicrosemi.doupgradeandreboot.DoUpgradeAndRebootInput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.ietfsystemmicrosemi.doupgradeandreboot.DoUpgradeAndRebootOutput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.ietfsystemmicrosemi.pullupdatetarfromtftp.PullUpdateTarFromTftpInput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.ietfsystemmicrosemi.readfromsyslog.ReadFromSyslogInput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.ietfsystemmicrosemi.readfromsyslog.ReadFromSyslogOutput;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.IetfSystem;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.IetfSystemOpParam;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.IetfSystemService;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.ietfsystem.systemrestart.SystemRestartInput;
+
+/**
+ * Implementation of the IetfService YANG model service.
+ */
+@Component(immediate = true, inherit = true)
+@Service
+public class IetfSystemManager extends AbstractYangServiceImpl
+ implements IetfSystemNetconfService {
+
+ protected final Pattern regexRemoveSystem =
+ Pattern.compile("(<system).*(</system>)", Pattern.DOTALL);
+ protected final Pattern regexRemoveSystemState =
+ Pattern.compile("(<system-state).*(</system-state>)", Pattern.DOTALL);
+
+ protected static final String IETF_SYSTEM = "org.onosproject.drivers.microsemi.yang.ietfsystem";
+
+ @Activate
+ public void activate() {
+ appId = coreService.registerApplication(IETF_SYSTEM);
+ ych = ymsService.getYangCodecHandler();
+ ych.addDeviceSchema(IetfSystemService.class);
+ ych.addDeviceSchema(IetfSystemMicrosemiService.class);
+ log.info("IetfSystemManager Started");
+ }
+
+ @Deactivate
+ public void deactivate() {
+ super.deactivate();
+ ymsService.unRegisterService(this, IetfSystemService.class);
+ ymsService.unRegisterService(this, IetfSystemMicrosemiService.class);
+ ych = null;
+ log.info("IetfSystemManager Stopped");
+ }
+
+ /**
+ * Get a filtered subset of the model.
+ * This is meant to filter the current live model
+ * against the attribute(s) given in the argument
+ * and return the filtered model.
+ * @throws NetconfException if the session has any error
+ */
+ @Override
+ public IetfSystem getIetfSystem(IetfSystemOpParam ietfSystemFilter, NetconfSession session)
+ throws NetconfException {
+ return (IetfSystem) getNetconfObject(ietfSystemFilter, session);
+ }
+
+ @Override
+ public IetfSystem getIetfSystemInit(NetconfSession session) throws NetconfException {
+ if (session == null) {
+ throw new NetconfException("Session is null when calling getIetfSystemInit()");
+ }
+
+ String xmlResult = session.get(getInitRequestBuilder(), null);
+
+ //The result will be a <system> followed by <system-state>
+ //YCH can decode only one at a time - split it and send half each time
+ IetfSystem.IetfSystemBuilder iBuilder = new IetfSystemOpParam.IetfSystemBuilder();
+
+ String xmlResultSystem = regexRemoveSystemState.matcher(xmlResult).replaceFirst("");
+ List<Object> objectListState = ych.decode(xmlResultSystem, XML, QUERY_REPLY);
+ if (objectListState != null && objectListState.size() > 0) {
+ IetfSystem system = (IetfSystem) objectListState.get(0);
+ iBuilder.system(system.system());
+ }
+
+ String xmlResultSystemState = regexRemoveSystem.matcher(xmlResult).replaceFirst("");
+ List<Object> objectListSystemState = ych.decode(xmlResultSystemState, XML, QUERY_REPLY);
+ if (objectListSystemState != null && objectListSystemState.size() > 0) {
+ IetfSystem system = (IetfSystem) objectListSystemState.get(0);
+ iBuilder.systemState(system.systemState());
+ }
+
+ return iBuilder.build();
+ }
+
+ /**
+ * Call NETCONF edit-config with a configuration.
+ */
+ @Override
+ public void setIetfSystem(IetfSystemOpParam ietfSystem, NetconfSession session, TargetConfig ncDs)
+ throws NetconfException {
+ setNetconfObject(ietfSystem, session, ncDs);
+ }
+
+ @Override
+ public void setCurrentDatetime(OffsetDateTime date, NetconfSession session)
+ throws NetconfException {
+ String xmlQueryStr = getSetCurrentDatetimeBuilder(date);
+ log.info("Sending <get> query on NETCONF session " + session.getSessionId() +
+ ":\n" + xmlQueryStr);
+
+ String xmlResult = session.doWrappedRpc(xmlQueryStr);
+ log.info("Result from NETCONF RPC <set-current-datetime>: {}", xmlResult);
+ }
+
+ @Override
+ public void systemRestart(SystemRestartInput inputVar, NetconfSession session) {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ @Override
+ public void systemShutdown(NetconfSession session) {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ @Override
+ public DoUpgradeAndRebootOutput doUpgradeAndReboot(DoUpgradeAndRebootInput inputVar, NetconfSession session)
+ throws NetconfException {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ @Override
+ public void pullUpdateTarFromTftp(PullUpdateTarFromTftpInput inputVar, NetconfSession session)
+ throws NetconfException {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ @Override
+ public ReadFromSyslogOutput readFromSyslog(ReadFromSyslogInput inputVar, NetconfSession session)
+ throws NetconfException {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+
+ /**
+ * Builds a request crafted to get the configuration required to create
+ * details descriptions for the device.
+ *
+ * @return The request string.
+ */
+ private static String getInitRequestBuilder() {
+ StringBuilder rpc = new StringBuilder();
+ rpc.append("<system-state xmlns=\"urn:ietf:params:xml:ns:yang:ietf-system\" ");
+ rpc.append("xmlns:sysms=\"http://www.microsemi.com/microsemi-edge-assure/msea-system\">");
+ rpc.append("<platform>");
+ rpc.append("<os-release/>");
+ rpc.append("<sysms:device-identification>");
+ rpc.append("<sysms:serial-number/>");
+ rpc.append("</sysms:device-identification>");
+ rpc.append("</platform>");
+ rpc.append("<clock>");
+ rpc.append("<current-datetime/>");
+ rpc.append("</clock>");
+ rpc.append("</system-state>");
+ rpc.append("<system xmlns=\"urn:ietf:params:xml:ns:yang:ietf-system\" ");
+ rpc.append("xmlns:sysms=\"http://www.microsemi.com/microsemi-edge-assure/msea-system\">");
+ rpc.append("<sysms:longitude/>");
+ rpc.append("<sysms:latitude/>");
+ rpc.append("</system>");
+ return rpc.toString();
+ }
+
+ private static String getSetCurrentDatetimeBuilder(OffsetDateTime date) {
+ StringBuilder rpc = new StringBuilder();
+ rpc.append("<set-current-datetime xmlns=\"urn:ietf:params:xml:ns:yang:ietf-system\">");
+ rpc.append("<current-datetime>");
+ rpc.append(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx")));
+ rpc.append("</current-datetime>");
+ rpc.append("</set-current-datetime>");
+
+ return rpc.toString();
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaCfmManager.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaCfmManager.java
new file mode 100644
index 0000000..c2359ab
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaCfmManager.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang.impl;
+
+import static org.onosproject.yms.ych.YangProtocolEncodingFormat.XML;
+import static org.onosproject.yms.ydt.YmsOperationType.QUERY_REPLY;
+
+import java.util.List;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Service;
+import org.onosproject.drivers.microsemi.yang.MseaCfmNetconfService;
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.netconf.TargetConfig;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.MseaCfm;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.MseaCfmOpParam;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.MseaCfmService;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.MseaCfmEventListener;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.abortloopback.AbortLoopbackInput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.transmitlinktrace.TransmitLinktraceInput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.transmitlinktrace.TransmitLinktraceOutput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.transmitloopback.TransmitLoopbackInput;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.soam.fm.rev20160229.MseaSoamFmService;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.soam.pm.rev20160229.MseaSoamPmService;
+
+/**
+ * Implementation of the MseaCfmServiceNetconf YANG model service.
+ */
+@Component(immediate = true, inherit = true)
+@Service
+public class MseaCfmManager extends AbstractYangServiceImpl
+ implements MseaCfmNetconfService {
+
+ public static final String MSEA_CFM = "org.onosproject.drivers.microsemi.yang.mseacfmservice";
+
+ @Activate
+ public void activate() {
+ appId = coreService.registerApplication(MSEA_CFM);
+ ych = ymsService.getYangCodecHandler();
+ ych.addDeviceSchema(MseaCfmService.class);
+ ych.addDeviceSchema(MseaSoamFmService.class);
+ ych.addDeviceSchema(MseaSoamPmService.class);
+ log.info("MseaCfmService Started");
+ }
+
+ @Deactivate
+ public void deactivate() {
+ super.deactivate();
+ ymsService.unRegisterService(this, MseaCfmService.class);
+ ymsService.unRegisterService(this, MseaSoamFmService.class);
+ ymsService.unRegisterService(this, MseaSoamPmService.class);
+ ych = null;
+ log.info("MseaCfmService Stopped");
+ }
+
+ @Override
+ public MseaCfm getMepEssentials(String mdName, String maName, int mepId,
+ NetconfSession session) throws NetconfException {
+ if (session == null) {
+ throw new NetconfException("Session is null when calling getMepEssentials()");
+ }
+
+ String xmlQueryStr = buildMepQueryString(mdName, maName, mepId);
+ log.debug("Sending <get> for " +
+ " query on NETCONF session " + session.getSessionId() +
+ ":\n" + xmlQueryStr);
+
+ String xmlResult = session.get(xmlQueryStr, null);
+ //FIXME Line is removed because YCH decode does not know how to handle it
+ xmlResult = xmlResult.replaceAll("(<ccm-interval>)(3.3ms|10ms|100ms|1s)(</ccm-interval>)", "");
+ xmlResult = xmlResult.replaceAll("(<active-defects/>)", "");
+
+ List<Object> objectList = ych.decode(xmlResult, XML, QUERY_REPLY);
+ if (objectList != null && objectList.size() > 0) {
+ Object systemObject = objectList.get(0);
+ return (MseaCfm) systemObject;
+ } else {
+ throw new NetconfException("Failure of YCH decode - could not parse as MseaCfm: " + xmlResult);
+ }
+ }
+
+ @Override
+ public MseaCfm getSoamDm(String mdName, String maName, int mepId,
+ int dmId, NetconfSession session) throws NetconfException {
+ String xmlQueryStr = buildDmQueryString(mdName, maName, mepId, dmId);
+ log.debug("Sending <get> for " +
+ " query on NETCONF session " + session.getSessionId() +
+ ":\n" + xmlQueryStr);
+
+ String xmlResult = session.get(xmlQueryStr, null);
+
+ List<Object> objectList = ych.decode(xmlResult, XML, QUERY_REPLY);
+ if (objectList != null && objectList.size() > 0) {
+ Object systemObject = objectList.get(0);
+ return (MseaCfm) systemObject;
+ } else {
+ throw new NetconfException("Failure of YCH decode - could not parse as MseaCfm: " + xmlResult);
+ }
+ }
+
+ @Override
+ public void setMseaCfm(MseaCfmOpParam mseaCfm, NetconfSession session, TargetConfig targetDs)
+ throws NetconfException {
+ setNetconfObject(mseaCfm, session, targetDs);
+ }
+
+ /**
+ * Call RPCs on the device through NETCONF.
+ */
+ @Override
+ public void transmitLoopback(TransmitLoopbackInput inputVar, NetconfSession session) throws NetconfException {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ @Override
+ public void abortLoopback(AbortLoopbackInput inputVar, NetconfSession session) throws NetconfException {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ @Override
+ public TransmitLinktraceOutput transmitLinktrace(TransmitLinktraceInput inputVar, NetconfSession session)
+ throws NetconfException {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ @Override
+ public void addListener(MseaCfmEventListener listener) {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ @Override
+ public void removeListener(MseaCfmEventListener listener) {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ private String buildMepQueryString(String mdName, String maName, int mepId) {
+ StringBuilder rpc = new StringBuilder();
+
+ rpc.append("<mef-cfm xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-cfm\" ");
+ rpc.append(" xmlns:msea-soam-fm=\"http://www.microsemi.com/microsemi-edge-assure/msea-soam-fm\" ");
+ rpc.append("xmlns:msea-soam-pm=\"http://www.microsemi.com/microsemi-edge-assure/msea-soam-pm\">\n");
+ rpc.append("<maintenance-domain>\n");
+ rpc.append("<id/>\n");
+ rpc.append("<name>" + mdName + "</name>\n");
+ rpc.append("<md-level/>\n");
+ rpc.append("<maintenance-association>\n");
+ rpc.append("<id/>\n");
+ rpc.append("<name>" + maName + "</name>\n");
+// rpc.append("<ccm-interval>10ms</ccm-interval>\n"); //Have to omit for the moment - YMS problem
+ rpc.append("<remote-meps/>\n");
+ rpc.append("<component-list/>\n");
+ rpc.append("<maintenance-association-end-point>\n");
+ rpc.append("<mep-identifier>" + mepId + "</mep-identifier>\n");
+ rpc.append("<interface/>\n");
+ rpc.append("<primary-vid/>\n");
+ rpc.append("<administrative-state/>\n");
+ rpc.append("<ccm-ltm-priority/>\n");
+ rpc.append("<continuity-check/>\n");
+ rpc.append("<mac-address/>\n");
+ rpc.append("<msea-soam-fm:port-status/>\n");
+ rpc.append("<msea-soam-fm:interface-status/>\n");
+// rpc.append("<msea-soam-fm:last-defect-sent/>\n");//Have to omit for the moment - YMS problem
+ rpc.append("<msea-soam-fm:rdi-transmit-status/>\n");
+ rpc.append("<loopback/>\n");
+ rpc.append("<remote-mep-database/>\n");
+ rpc.append("<linktrace/>\n");
+ rpc.append("</maintenance-association-end-point>\n");
+ rpc.append("</maintenance-association>\n");
+ rpc.append("</maintenance-domain>\n");
+ rpc.append("</mef-cfm>");
+
+ return rpc.toString();
+ }
+
+
+ private String buildDmQueryString(String mdName, String maName, int mepId, int dmId) {
+ StringBuilder rpc = new StringBuilder();
+
+ rpc.append("<mef-cfm xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-cfm\" ");
+ rpc.append(" xmlns:msea-soam-fm=\"http://www.microsemi.com/microsemi-edge-assure/msea-soam-fm\" ");
+ rpc.append("xmlns:msea-soam-pm=\"http://www.microsemi.com/microsemi-edge-assure/msea-soam-pm\">\n");
+ rpc.append("<maintenance-domain>\n");
+ rpc.append("<id/>\n");
+ rpc.append("<name>" + mdName + "</name>\n");
+ rpc.append("<md-level/>\n");
+ rpc.append("<maintenance-association>\n");
+ rpc.append("<id/>\n");
+ rpc.append("<name>" + maName + "</name>\n");
+// rpc.append("<ccm-interval>10ms</ccm-interval>\n"); //Have to omit for the moment - YMS problem
+ rpc.append("<maintenance-association-end-point>\n");
+ rpc.append("<mep-identifier>" + mepId + "</mep-identifier>\n");
+ rpc.append("<msea-soam-pm:delay-measurements>");
+ rpc.append("<msea-soam-pm:delay-measurement>");
+ rpc.append("<msea-soam-pm:dm-id>" + dmId + "</msea-soam-pm:dm-id>");
+ rpc.append("</msea-soam-pm:delay-measurement>");
+ rpc.append("</msea-soam-pm:delay-measurements>");
+ rpc.append("</maintenance-association-end-point>\n");
+ rpc.append("</maintenance-association>\n");
+ rpc.append("</maintenance-domain>\n");
+ rpc.append("</mef-cfm>");
+
+ return rpc.toString();
+ }
+
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaSaFilteringManager.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaSaFilteringManager.java
new file mode 100644
index 0000000..eeba11e
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaSaFilteringManager.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang.impl;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Service;
+import org.onosproject.drivers.microsemi.yang.MseaSaFilteringNetconfService;
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.netconf.TargetConfig;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.MseaSaFiltering;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.MseaSaFilteringOpParam;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.MseaSaFilteringService;
+
+/**
+ * Implementation of the MseaSaFiltering YANG model service.
+ */
+@Component(immediate = true, inherit = true)
+@Service
+public class MseaSaFilteringManager extends AbstractYangServiceImpl
+ implements MseaSaFilteringNetconfService {
+ public static final String MSEA_SA_FILTERING = "org.onosproject.drivers.microsemi.yang.mseasafiltering";
+
+ @Activate
+ public void activate() {
+ appId = coreService.registerApplication(MSEA_SA_FILTERING);
+ ych = ymsService.getYangCodecHandler();
+ ych.addDeviceSchema(MseaSaFilteringService.class);
+ log.info("MseaSaFilteringManager Started");
+ }
+
+ @Deactivate
+ public void deactivate() {
+ super.deactivate();
+ ymsService.unRegisterService(this, MseaSaFilteringService.class);
+ ych = null;
+ log.info("MseaSaFilteringManager Stopped");
+ }
+
+ /**
+ * Get a filtered subset of the model.
+ * This is meant to filter the current live model
+ * against the attribute(s) given in the argument
+ * and return the filtered model.
+ */
+ @Override
+ public MseaSaFiltering getMseaSaFiltering(MseaSaFilteringOpParam mseaSaFilteringFilter, NetconfSession session)
+ throws NetconfException {
+ return (MseaSaFiltering) getNetconfObject(mseaSaFilteringFilter, session);
+ }
+
+ /**
+ * Call NETCONF edit-config with a configuration.
+ */
+ @Override
+ public void setMseaSaFiltering(
+ MseaSaFilteringOpParam mseaSaFiltering, NetconfSession session, TargetConfig ncDs)
+ throws NetconfException {
+ setNetconfObject(mseaSaFiltering, session, ncDs);
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaUniEvcServiceManager.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaUniEvcServiceManager.java
new file mode 100644
index 0000000..82b6116
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaUniEvcServiceManager.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang.impl;
+
+import static org.onosproject.yms.ych.YangProtocolEncodingFormat.XML;
+import static org.onosproject.yms.ydt.YmsOperationType.QUERY_CONFIG_REPLY;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Service;
+import org.onosproject.drivers.microsemi.yang.MseaUniEvcServiceNetconfService;
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.netconf.TargetConfig;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.MseaUniEvcService;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.MseaUniEvcServiceOpParam;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.MseaUniEvcServiceService;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.UniSideInterfaceAssignmentEnum;
+
+/**
+ * Implementation of the MseaUniEvcServiceService YANG model service.
+ */
+@Component(immediate = true, inherit = true)
+@Service
+public class MseaUniEvcServiceManager extends AbstractYangServiceImpl
+ implements MseaUniEvcServiceNetconfService {
+ public static final String MSEA_SA_FILTERING = "org.onosproject.drivers.microsemi.yang.mseaunievcservice";
+
+ @Activate
+ public void activate() {
+ appId = coreService.registerApplication(MSEA_SA_FILTERING);
+ ych = ymsService.getYangCodecHandler();
+ ych.addDeviceSchema(MseaUniEvcServiceService.class);
+ log.info("MseaUniEvcServiceManager Started");
+ }
+
+ @Deactivate
+ public void deactivate() {
+ super.deactivate();
+ ymsService.unRegisterService(this, MseaUniEvcServiceService.class);
+ ych = null;
+ log.info("MseaUniEvcServiceManager Stopped");
+ }
+
+ @Override
+ public MseaUniEvcService getMseaUniEvcService(
+ MseaUniEvcServiceOpParam mseaUniEvcService, NetconfSession session) throws NetconfException {
+ return (MseaUniEvcService) getNetconfObject(mseaUniEvcService, session);
+ }
+
+ @Override
+ public MseaUniEvcService getConfigMseaUniEvcService(
+ MseaUniEvcServiceOpParam mseaUniEvcService, NetconfSession session, TargetConfig targetDs)
+ throws NetconfException {
+ return (MseaUniEvcService) getConfigNetconfObject(mseaUniEvcService, session, targetDs);
+ }
+
+ /**
+ * Modify the configuration.
+ */
+ @Override
+ public void setMseaUniEvcService(
+ MseaUniEvcServiceOpParam mseaUniEvcService, NetconfSession session, TargetConfig ncDs)
+ throws NetconfException {
+ setNetconfObject(mseaUniEvcService, session, ncDs);
+ }
+
+ @Override
+ public MseaUniEvcService getmseaUniEvcCeVlanMaps(
+ NetconfSession session, TargetConfig ncDs)
+ throws NetconfException {
+ if (session == null) {
+ throw new NetconfException("Session is null when calling getMseaSaFiltering()");
+ }
+
+ String xmlResult = session.getConfig(ncDs, evcFilterQuery());
+
+ List<Object> objectList = ych.decode(xmlResult, XML, QUERY_CONFIG_REPLY);
+ if (objectList != null && objectList.size() > 0) {
+ return (MseaUniEvcService) objectList.get(0);
+ }
+
+ return null;
+ }
+
+ @Override
+ public void removeEvcUniFlowEntries(
+ Map<Integer, String> ceVlanUpdates,
+ Map<Integer, List<Short>> flowVlanIds,
+ NetconfSession session, TargetConfig targetDs,
+ UniSideInterfaceAssignmentEnum portAssign) throws NetconfException {
+
+ List<Integer> evcAlreadyHandled = new ArrayList<>();
+ StringBuilder xmlEvcUpdate = new StringBuilder(evcUniOpener());
+ for (Integer evcKey:ceVlanUpdates.keySet()) {
+ int evcId = (evcKey & ((1 << 8) - 100)) >> 2;
+ if (evcAlreadyHandled.contains(new Integer(evcId))) {
+ continue;
+ }
+ evcAlreadyHandled.add(evcId);
+ int port = (evcKey & 3);
+ String ceVlanMapThis = ceVlanUpdates.get(evcKey);
+ String ceVlanMapOpposite = ceVlanUpdates.get(evcKey ^ 1);
+
+ if ((ceVlanMapThis == null || ceVlanMapThis.isEmpty()) &&
+ (ceVlanMapOpposite == null || ceVlanMapOpposite.isEmpty())) {
+ xmlEvcUpdate.append("<evc nc:operation=\"delete\">\n<evc-index>");
+ xmlEvcUpdate.append(Integer.toString(evcId));
+ xmlEvcUpdate.append("</evc-index>\n</evc>\n");
+ } else {
+ xmlEvcUpdate.append("<evc>\n<evc-index>");
+ xmlEvcUpdate.append(Integer.toString(evcId));
+ xmlEvcUpdate.append("</evc-index>\n<evc-per-uni>\n");
+ if (port == 0 && portAssign == UniSideInterfaceAssignmentEnum.UNI_C_ON_OPTICS ||
+ port == 1 && portAssign == UniSideInterfaceAssignmentEnum.UNI_C_ON_HOST) {
+ if (ceVlanMapThis != null) {
+ xmlEvcUpdate.append("<evc-per-uni-c>\n<ce-vlan-map nc:operation=\"replace\">");
+ xmlEvcUpdate.append(ceVlanMapThis);
+ xmlEvcUpdate.append("</ce-vlan-map>\n");
+ xmlEvcUpdate.append(deleteFlowMapping(flowVlanIds.get(evcKey)));
+ xmlEvcUpdate.append("</evc-per-uni-c>\n");
+ }
+ if (ceVlanMapOpposite != null) {
+ xmlEvcUpdate.append("<evc-per-uni-n>\n<ce-vlan-map nc:operation=\"replace\">");
+ xmlEvcUpdate.append(ceVlanMapOpposite);
+ xmlEvcUpdate.append("</ce-vlan-map>\n");
+ xmlEvcUpdate.append(deleteFlowMapping(flowVlanIds.get(evcKey ^ 1)));
+ xmlEvcUpdate.append("</evc-per-uni-n>\n");
+ }
+ } else {
+ if (ceVlanMapThis != null) {
+ xmlEvcUpdate.append("<evc-per-uni-n>\n<ce-vlan-map nc:operation=\"replace\">");
+ xmlEvcUpdate.append(ceVlanMapThis);
+ xmlEvcUpdate.append("</ce-vlan-map>\n");
+ xmlEvcUpdate.append(deleteFlowMapping(flowVlanIds.get(evcKey)));
+ xmlEvcUpdate.append("</evc-per-uni-n>\n");
+ }
+ if (ceVlanMapOpposite != null) {
+ xmlEvcUpdate.append("<evc-per-uni-c>\n<ce-vlan-map nc:operation=\"replace\">");
+ xmlEvcUpdate.append(ceVlanMapOpposite);
+ xmlEvcUpdate.append("</ce-vlan-map>\n");
+ xmlEvcUpdate.append(deleteFlowMapping(flowVlanIds.get(evcKey ^ 1)));
+ xmlEvcUpdate.append("</evc-per-uni-c>\n");
+ }
+ }
+
+ xmlEvcUpdate.append("</evc-per-uni>\n</evc>\n");
+ }
+ }
+ xmlEvcUpdate.append("</uni>\n</mef-services>");
+
+ log.info("Sending XML <edit-config> on NETCONF session " + session.getSessionId() +
+ ":\n" + xmlEvcUpdate.toString());
+
+
+ session.editConfig(targetDs, null, xmlEvcUpdate.toString());
+ }
+
+
+ private static String deleteFlowMapping(List<Short> vlanIds) {
+ if (vlanIds == null || vlanIds.size() == 0) {
+ return "";
+ }
+ StringBuilder fmXmlBuilder = new StringBuilder();
+ for (long vlanId:vlanIds) {
+ fmXmlBuilder.append("<flow-mapping nc:operation=\"delete\">\n");
+ fmXmlBuilder.append("<ce-vlan-id>");
+ fmXmlBuilder.append(String.valueOf(vlanId));
+ fmXmlBuilder.append("</ce-vlan-id>\n");
+ fmXmlBuilder.append("</flow-mapping>\n");
+ }
+
+ return fmXmlBuilder.toString();
+ }
+
+ private String evcFilterQuery() {
+ StringBuilder sb = new StringBuilder("<mef-services "
+ + "xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-uni-evc-service\">");
+ sb.append("<uni>");
+ sb.append("<evc>");
+ sb.append("<evc-index/>");
+ sb.append("<evc-per-uni>");
+ sb.append("<evc-per-uni-c>");
+ sb.append("<ce-vlan-map/>");
+ sb.append("<flow-mapping/>");
+ sb.append("<ingress-bwp-group-index/>");
+ sb.append("</evc-per-uni-c>");
+ sb.append("<evc-per-uni-n>");
+ sb.append("<ce-vlan-map/>");
+ sb.append("<flow-mapping/>");
+ sb.append("<ingress-bwp-group-index/>");
+ sb.append("</evc-per-uni-n>");
+ sb.append("</evc-per-uni>");
+ sb.append("</evc>");
+ sb.append("</uni>");
+ sb.append("</mef-services>");
+
+ return sb.toString();
+ }
+
+ private String evcUniOpener() {
+ StringBuilder sb = new StringBuilder("<mef-services ");
+ sb.append("xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-uni-evc-service\">\n");
+ sb.append("<uni>\n");
+
+ return sb.toString();
+ }
+}
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/package-info.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/package-info.java
new file mode 100644
index 0000000..ccf0dd2
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/impl/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Package for Microsemi device drivers support for NETCONF for EA1000.
+ */
+package org.onosproject.drivers.microsemi.yang.impl;
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/package-info.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/package-info.java
new file mode 100644
index 0000000..d886c69
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Package for Microsemi device drivers support for NETCONF for EA1000.
+ */
+package org.onosproject.drivers.microsemi.yang;
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/utils/CeVlanMapUtils.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/utils/CeVlanMapUtils.java
new file mode 100644
index 0000000..52ede6d
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/utils/CeVlanMapUtils.java
@@ -0,0 +1,196 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang.utils;
+
+import java.util.Arrays;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.commons.lang.ArrayUtils;
+
+/**
+ * A set of static utilities that allow a ce-vlan-map to be decomposed.
+ *
+ * This is an implementation specific to Microsemi that encodes ce-vlan-map
+ * in a similar way to Section 7.9 in the MEF 10.2 specification. That specification
+ * suggests comma delimited lists of VIDs - this implementation adds on colons to
+ * specify a contiguous range of IDs
+ */
+public final class CeVlanMapUtils {
+
+ private CeVlanMapUtils() {
+ //Do not allow this utility class to be instantiated
+ }
+
+ /**
+ * Calculate the ceVlanMap in to a Set of values.
+ *
+ * From Yang description
+ * "This object indicates the CE-VLANs associated with the specific
+ * EVC on a UNI. CE-VLAN IDs have value of 0 to 4095. The CE-VLAN ID
+ * list can be a single value or multiple values separated by a delimiter.
+ * Some valid values are: '100', '1:10', '10,20,30', '1:4095'. In the
+ * first example only CE-VLAN ID 100 is associated with the VLAN map.
+ * In the second example the CE-VLAN map includes CE-VLAN IDs 1 through
+ * 10 (range of values). The third example indicates three separate values
+ * that make up the CE-VLAN map. The last example indicates all CE-VLAN IDs
+ * are included in the map (range of values). ";
+ * reference
+ * "[MEF 6.1] 6.1; [MEF 7.2] 6.2.1.3";
+ * @param ceVlanMap A list of vlan id's in the format described above
+ * @return A set of vlan ids
+ */
+ public static Short[] getVlanSet(String ceVlanMap) {
+ if (ceVlanMap == null || ceVlanMap.isEmpty()) {
+ return new Short[0];
+ }
+ Set<Short> ceVlanSet = new TreeSet<Short>();
+
+ String[] ceVlanMapCommas = ceVlanMap.split(",");
+ for (String ceVlanMapComma:ceVlanMapCommas) {
+ String[] ceVlanMapColon = ceVlanMapComma.split(":");
+ if (ceVlanMapColon.length == 1) {
+ ceVlanSet.add(Short.decode(ceVlanMapColon[0]));
+ } else {
+ short start = Short.decode(ceVlanMapColon[0]);
+ short end = Short.decode(ceVlanMapColon[1]);
+ if ((start < 0 || end > 4095)) {
+ return null;
+ } else {
+ for (short i = start; i <= end; i++) {
+ ceVlanSet.add(i);
+ }
+ }
+ }
+ }
+
+ return ceVlanSet.toArray(new Short[ceVlanSet.size()]);
+ }
+
+ /**
+ * Convert an array of vlan ids in to a string representation.
+ * @param vlanArray An array of vlan ids
+ * @return A string representation delimited by commas and colons
+ */
+ public static String vlanListAsString(Short[] vlanArray) {
+ boolean colonPending = false;
+ StringBuilder ceVlanMapBuilder = new StringBuilder();
+ if (vlanArray.length == 0) {
+ return "";
+ } else if (vlanArray.length == 1 && vlanArray[0] == 0) {
+ return "0";
+ }
+
+ //To ensure that there are no repeated or out-of-order elements we must convert to TreeSet
+ TreeSet<Short> vlanSet = new TreeSet<>(Arrays.asList(vlanArray));
+
+ if (vlanSet.first() == 0) {
+ vlanSet.remove(vlanSet.first());
+ }
+ short prev = vlanSet.first();
+ for (short s:vlanSet) {
+ if (s == prev) {
+ ceVlanMapBuilder.append(Short.valueOf(s));
+ continue;
+ } else if (prev == (s - 1)) {
+ colonPending = true;
+ } else {
+ if (colonPending) {
+ ceVlanMapBuilder.append(":" + Short.valueOf(prev));
+ colonPending = false;
+ }
+ ceVlanMapBuilder.append("," + Short.valueOf(s));
+ }
+ prev = s;
+ }
+ if (colonPending) {
+ ceVlanMapBuilder.append(":" + Short.valueOf(prev));
+ }
+
+ return ceVlanMapBuilder.toString();
+ }
+
+ /**
+ * Add an additional vlan id to an existing string representation.
+ * @param existingMap An array of vlan ids
+ * @param newVlan The new vlan ID to add
+ * @return A string representation delimited by commas and colons
+ */
+ public static String addtoCeVlanMap(String existingMap, Short newVlan) {
+ Short[] vlanArray = getVlanSet(existingMap);
+ TreeSet<Short> vlanSet = new TreeSet<>();
+ for (Short vlan:vlanArray) {
+ vlanSet.add(vlan);
+ }
+
+ vlanSet.add(newVlan);
+
+ return vlanListAsString(vlanSet.toArray(new Short[vlanSet.size()]));
+ }
+
+ /**
+ * If a string representation contains a '0' then remove it.
+ *
+ * Zero is an invalid VLAN id, and is used here as a place holder for null. Null can't
+ * be used in the EA1000 device. Once any other vlan ids are added then the zero should
+ * be removed. It is safe to call this method even if no zero is present - the method will
+ * make no change in that case.
+ *
+ * @param existingMap An string representation of vlan ids, possibly containing a zero
+ * @return A string representation delimited by commas and colons without zero
+ */
+ public static String removeZeroIfPossible(String existingMap) {
+ if (existingMap == null || existingMap.isEmpty()) {
+ return "0";
+ } else if (existingMap == "0") {
+ return existingMap;
+ }
+ return removeFromCeVlanMap(existingMap, (short) 0);
+ }
+
+ /**
+ * Remove a vlan id from an existing string representation.
+ * @param existingMap An array of vlan ids
+ * @param vlanRemove The vlan ID to remove
+ * @return A string representation delimited by commas and colons
+ */
+ public static String removeFromCeVlanMap(String existingMap, Short vlanRemove) {
+ Short[] vlanArray = getVlanSet(existingMap);
+ TreeSet<Short> vlanSet = new TreeSet<>();
+ for (Short vlan:vlanArray) {
+ if (vlan.shortValue() != vlanRemove.shortValue()) {
+ vlanSet.add(vlan);
+ }
+ }
+
+ return vlanListAsString(vlanSet.toArray(new Short[vlanSet.size()]));
+ }
+
+ /**
+ * Combine vlan ids from two existing string representations.
+ *
+ * If there are overlapping elements and ranges, these are consolidated in to one.
+ *
+ * @param set1 A string containing a set of vlan ids
+ * @param set2 A string containing a set of vlan ids
+ * @return A string representation delimited by commas and colons
+ */
+ public static String combineVlanSets(String set1, String set2) {
+ Short[] set1Array = getVlanSet(set1);
+ Short[] set2Array = getVlanSet(set2);
+ return vlanListAsString((Short[]) ArrayUtils.addAll(set1Array, set2Array));
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/utils/IetfYangTypesUtils.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/utils/IetfYangTypesUtils.java
new file mode 100644
index 0000000..4b706b6
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/utils/IetfYangTypesUtils.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang.utils;
+
+import java.time.LocalDateTime;
+import java.time.OffsetDateTime;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev20130715.ietfyangtypes.DateAndTime;
+
+/**
+ * A utility class to change various YANG types to general purpose classes.
+ */
+public final class IetfYangTypesUtils {
+ private IetfYangTypesUtils() {
+ //Hiding the public constructor for this utility class
+ }
+
+ /**
+ * Convert from Date and Time in a ietf-yang-types format to the Java Time API.
+ * @param dateAndTime A date and time from a YANG object
+ * @return A Date and Time with a Time Zone offset
+ */
+ public static OffsetDateTime fromYangDateTime(DateAndTime dateAndTime) {
+ return OffsetDateTime.parse(dateAndTime.toString(), DateTimeFormatter.ISO_OFFSET_DATE_TIME);
+ }
+
+ /**
+ * Convert a from Date and Time in a ietf-yang-types format to the Java Time API and rezone to a given Time Zone.
+ * @param dateAndTime A date and time from a YANG object
+ * @param zoneId The time zone to rezone the time and date to
+ * @return The rezoned time and date
+ */
+ public static ZonedDateTime fromYangDateTimeZoned(DateAndTime dateAndTime, ZoneId zoneId) {
+ return OffsetDateTime.parse(dateAndTime.toString(),
+ DateTimeFormatter.ISO_OFFSET_DATE_TIME).atZoneSameInstant(zoneId);
+ }
+
+ /**
+ * Convert a from Date and Time in a ietf-yang-types format to the Java Time API rezoned to the local Time Zone.
+ * @param dateAndTime A date and time from a YANG object
+ * @return The date and time in the zone of this local machine
+ */
+ public static LocalDateTime fromYangDateTimeToLocal(DateAndTime dateAndTime) {
+ OffsetDateTime odt = OffsetDateTime.parse(dateAndTime.toString(), DateTimeFormatter.ISO_OFFSET_DATE_TIME);
+
+ return LocalDateTime.ofInstant(odt.toInstant(), ZoneId.systemDefault());
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/utils/package-info.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/utils/package-info.java
new file mode 100644
index 0000000..0c03c46
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/drivers/microsemi/yang/utils/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Package for general utilities and helpers.
+ */
+package org.onosproject.drivers.microsemi.yang.utils;
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/CustomEvc.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/CustomEvc.java
new file mode 100644
index 0000000..722fe78
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/CustomEvc.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service
+ .rev20160317.mseaunievcservice.mefservices.uni;
+
+import org.onosproject.drivers.microsemi.yang.UniSide;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.types
+ .rev20160229.mseatypes.ServiceListType;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.evcperuniextensionattributes.FlowMapping;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service
+ .rev20160317.mseaunievcservice.mefservices.uni.evc.CustomEvcPerUni;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni.EvcPerUnic;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni.EvcPerUnin;
+
+/**
+ * A custom implementation of the DefaultEvc - especially its Builder.
+ *
+ * This allows the Evc to be modified after creation. These additions to the
+ * builder are necessary because in the EA1000 YANG model many different Open Flow
+ * flows can be associated with one EVC - each one has its own Ce-Vlan-Id and
+ * Flow Reference
+ */
+public class CustomEvc extends DefaultEvc {
+
+ public static EvcBuilder builder(Evc evc) {
+ return new EvcBuilder(evc);
+ }
+
+ public static class EvcBuilder extends DefaultEvc.EvcBuilder {
+
+ /**
+ * Allow a builder to be constructed from an existing EVC
+ * @param evc An existing EVC
+ */
+ public EvcBuilder(Evc evc) {
+ this.evcPerUni = evc.evcPerUni();
+ this.evcStatus = evc.evcStatus();
+ this.evcIndex = evc.evcIndex();
+ this.mtuSize = evc.mtuSize();
+ this.cevlanCosPreservation = evc.cevlanCosPreservation();
+ this.cevlanIdPreservation = evc.cevlanIdPreservation();
+ this.name = evc.name();
+ this.yangEvcOpType = evc.yangEvcOpType();
+ this.yangAugmentedInfoMap = evc.yangAugmentedInfoMap();
+ this.name = evc.name();
+ this.serviceType = evc.serviceType();
+ this.selectLeafFlags = evc.selectLeafFlags();
+ this.uniEvcId = evc.uniEvcId();
+ this.valueLeafFlags = evc.valueLeafFlags();
+ }
+
+ /**
+ * Method to allow ceVlanMap to be modified.
+ * @param additionalCeVlanMap An addition to the existing ceVlanMap
+ * @param side The Uni Side - Customer or Network
+ * @return The updated builder
+ */
+ public EvcBuilder addToCeVlanMap(ServiceListType additionalCeVlanMap, UniSide side) {
+ evcPerUni = CustomEvcPerUni.builder(evcPerUni).addToCeVlanMap(additionalCeVlanMap, side).build();
+ return this;
+ }
+
+ /**
+ * Method to allow the Flow Mapping list to be modified.
+ * @param fm the flow mapping
+ * @param side The Uni Side - Customer or Network
+ * @return The updated builder
+ */
+ public EvcBuilder addToFlowMapping(FlowMapping fm, UniSide side) {
+ evcPerUni = CustomEvcPerUni.builder(evcPerUni).addToFlowMapping(fm, side).build();
+ return this;
+ }
+
+ /**
+ * Method to allow an EVC side to be added.
+ * @param evcUniN An EVCPerUni object
+ * @return The updated builder
+ */
+ public EvcBuilder addUniN(EvcPerUnin evcUniN) {
+ evcPerUni = CustomEvcPerUni.builder(evcPerUni).addUniN(evcUniN).build();
+ return this;
+ }
+
+ /**
+ * Method to allow an EVC side to be added.
+ * @param evcUniC An EVCPerUni object
+ * @return The updated builder
+ */
+ public EvcBuilder addUniC(EvcPerUnic evcUniC) {
+ evcPerUni = CustomEvcPerUni.builder(evcPerUni).addUniC(evcUniC).build();
+ return this;
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/CustomEvcPerUni.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/CustomEvcPerUni.java
new file mode 100644
index 0000000..ed53593
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/CustomEvcPerUni.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service
+ .rev20160317.mseaunievcservice.mefservices.uni.evc;
+
+import org.onosproject.drivers.microsemi.yang.UniSide;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.types
+ .rev20160229.mseatypes.ServiceListType;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.evcperuniextensionattributes.FlowMapping;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service
+ .rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni.CustomEvcPerUnic;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service
+ .rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni.CustomEvcPerUnin;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni.EvcPerUnic;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni.EvcPerUnin;
+
+/**
+ * A custom implementation of the DefaultEvcPerUni - especially its Builder.
+ *
+ * This allows the EvcPerUni to be modified after creation. These additions to the
+ * builder are necessary because in the EA1000 YANG model the EvcPerUni side can
+ * be added at separate stages
+ */
+public class CustomEvcPerUni extends DefaultEvcPerUni {
+
+ public static EvcPerUniBuilder builder(EvcPerUni evcPerUni) {
+ return new EvcPerUniBuilder(evcPerUni);
+ }
+
+ public static class EvcPerUniBuilder extends DefaultEvcPerUni.EvcPerUniBuilder {
+
+ /**
+ * Allow a builder to be constructed from an existing EvcPerUni
+ * @param evcPerUni An existing EvcPerUni
+ */
+ public EvcPerUniBuilder(EvcPerUni evcPerUni) {
+ this.evcPerUnic = evcPerUni.evcPerUnic();
+ this.evcPerUnin = evcPerUni.evcPerUnin();
+ this.evcUniType = evcPerUni.evcUniType();
+ this.yangEvcPerUniOpType = evcPerUni.yangEvcPerUniOpType();
+ this.valueLeafFlags = evcPerUni.valueLeafFlags();
+ this.selectLeafFlags = evcPerUni.selectLeafFlags();
+ this.yangAugmentedInfoMap = evcPerUni.yangAugmentedInfoMap();
+ }
+
+ /**
+ * Method to allow ceVlanMap to be modified.
+ * @param additionalCeVlanMap An addition to the existing ceVlanMap
+ * @param side The Uni Side - Customer or Network
+ * @return The updated builder
+ */
+ public EvcPerUniBuilder addToCeVlanMap(ServiceListType additionalCeVlanMap, UniSide side) {
+ if (side == UniSide.NETWORK) {
+ evcPerUnin = CustomEvcPerUnin.builder(evcPerUnin).addToCeVlanMap(additionalCeVlanMap).build();
+ } else {
+ evcPerUnic = CustomEvcPerUnic.builder(evcPerUnic).addToCeVlanMap(additionalCeVlanMap).build();
+ }
+
+ return this;
+ }
+
+ /**
+ * Method to allow the Flow Mapping list to be modified.
+ * @param fm the flow mapping
+ * @param side The Uni Side - Customer or Network
+ * @return The updated builder
+ */
+ public EvcPerUniBuilder addToFlowMapping(FlowMapping fm, UniSide side) {
+ if (side == UniSide.NETWORK) {
+ evcPerUnin = CustomEvcPerUnin.builder(evcPerUnin).addToFlowMapping(fm).build();
+ } else {
+ evcPerUnic = CustomEvcPerUnic.builder(evcPerUnic).addToFlowMapping(fm).build();
+ }
+ return this;
+ }
+
+ /**
+ * Method to allow an EVC side to be added.
+ * @param evcUniN An EVCPerUni object
+ * @return The updated builder
+ */
+ public EvcPerUniBuilder addUniN(EvcPerUnin evcUniN) {
+ this.evcPerUnin = evcUniN;
+ return this;
+ }
+
+ /**
+ * Method to allow an EVC side to be added.
+ * @param evcUniC An EVCPerUni object
+ * @return The updated builder
+ */
+ public EvcPerUniBuilder addUniC(EvcPerUnic evcUniC) {
+ this.evcPerUnic = evcUniC;
+ return this;
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/evcperuni/CustomEvcPerUnic.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/evcperuni/CustomEvcPerUnic.java
new file mode 100644
index 0000000..2e8dfc6
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/evcperuni/CustomEvcPerUnic.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service
+ .rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni;
+
+import org.onosproject.drivers.microsemi.yang.utils.CeVlanMapUtils;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.types
+ .rev20160229.mseatypes.ServiceListType;
+
+/**
+ * A custom implementation of the DefaultEvcPerUnic - especially its Builder.
+ *
+ * This allows the EvcPerUniC to be modified after creation. These additions to the
+ * builder are necessary because in the EA1000 YANG model the EvcPerUniC can
+ * be added at separate stages
+ */
+public class CustomEvcPerUnic extends DefaultEvcPerUnic {
+ public static EvcPerUnicBuilder builder(EvcPerUnic evcPerUnic) {
+ return new EvcPerUnicBuilder(evcPerUnic);
+ }
+
+ public static EvcPerUnicBuilder builder() {
+ return new EvcPerUnicBuilder();
+ }
+
+ public static class EvcPerUnicBuilder extends DefaultEvcPerUnic.EvcPerUnicBuilder {
+
+ /**
+ * Allow a new builder to be constructed
+ */
+ public EvcPerUnicBuilder() {
+ valueLeafFlags.set(LeafIdentifier.CEVLANMAP.getLeafIndex());
+ this.ceVlanMap = new ServiceListType("0");
+ valueLeafFlags.set(LeafIdentifier.INGRESSBWPGROUPINDEX.getLeafIndex());
+ this.ingressBwpGroupIndex = 0;
+ }
+
+ /**
+ * Allow a builder to be constructed from an existing EvcPerUnic
+ * @param evcPerUnic An existing EvcPerUnic
+ */
+ public EvcPerUnicBuilder(EvcPerUnic evcPerUnic) {
+ this.ceVlanMap = evcPerUnic.ceVlanMap();
+ this.evcPerUniServiceType = evcPerUnic.evcPerUniServiceType();
+ this.ingressBwpGroupIndex = evcPerUnic.ingressBwpGroupIndex();
+ this.tagManipulation = evcPerUnic.tagManipulation();
+ this.flowMapping = evcPerUnic.flowMapping();
+ this.yangEvcPerUnicOpType = evcPerUnic.yangEvcPerUnicOpType();
+ this.yangAugmentedInfoMap = evcPerUnic.yangAugmentedInfoMap();
+ this.selectLeafFlags = evcPerUnic.selectLeafFlags();
+ this.valueLeafFlags = evcPerUnic.valueLeafFlags();
+ }
+
+ /**
+ * Method to allow ceVlanMap to be modified.
+ * @param additionalCeVlanMap An addition to the existing ceVlanMap
+ * @return The updated builder
+ */
+ public EvcPerUnicBuilder addToCeVlanMap(ServiceListType additionalCeVlanMap) {
+ String combinedCeVlanMap =
+ CeVlanMapUtils.combineVlanSets(ceVlanMap.string(), additionalCeVlanMap.string());
+ //If it contains 0 we should remove it
+ ceVlanMap = new ServiceListType(
+ CeVlanMapUtils.removeZeroIfPossible(combinedCeVlanMap));
+
+ return this;
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/evcperuni/CustomEvcPerUnin.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/evcperuni/CustomEvcPerUnin.java
new file mode 100644
index 0000000..47b438e
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/evcperuni/CustomEvcPerUnin.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service
+ .rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni;
+
+import org.onosproject.drivers.microsemi.yang.utils.CeVlanMapUtils;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.types
+ .rev20160229.mseatypes.ServiceListType;
+
+/**
+ * A custom implementation of the DefaultEvcPerUnin - especially its Builder.
+ *
+ * This allows the EvcPerUniN to be modified after creation. These additions to the
+ * builder are necessary because in the EA1000 YANG model the EvcPerUniN can
+ * be added at separate stages
+ */
+public class CustomEvcPerUnin extends DefaultEvcPerUnin {
+ public static EvcPerUninBuilder builder(EvcPerUnin evcPerUnin) {
+ return new EvcPerUninBuilder(evcPerUnin);
+ }
+
+ public static EvcPerUninBuilder builder() {
+ return new EvcPerUninBuilder();
+ }
+
+ public static class EvcPerUninBuilder extends DefaultEvcPerUnin.EvcPerUninBuilder {
+
+ /**
+ * Allow a new builder to be constructed
+ */
+ public EvcPerUninBuilder() {
+ valueLeafFlags.set(LeafIdentifier.CEVLANMAP.getLeafIndex());
+ this.ceVlanMap = new ServiceListType("0");
+ valueLeafFlags.set(LeafIdentifier.INGRESSBWPGROUPINDEX.getLeafIndex());
+ this.ingressBwpGroupIndex = 0;
+ }
+
+ /**
+ * Allow a builder to be constructed from an existing EvcPerUnin
+ * @param evcPerUnin An existing EvcPerUnin
+ */
+ public EvcPerUninBuilder(EvcPerUnin evcPerUnin) {
+ this.ceVlanMap = evcPerUnin.ceVlanMap();
+ this.evcPerUniServiceType = evcPerUnin.evcPerUniServiceType();
+ this.ingressBwpGroupIndex = evcPerUnin.ingressBwpGroupIndex();
+ this.tagManipulation = evcPerUnin.tagManipulation();
+ this.flowMapping = evcPerUnin.flowMapping();
+ this.yangEvcPerUninOpType = evcPerUnin.yangEvcPerUninOpType();
+ this.yangAugmentedInfoMap = evcPerUnin.yangAugmentedInfoMap();
+ this.selectLeafFlags = evcPerUnin.selectLeafFlags();
+ this.valueLeafFlags = evcPerUnin.valueLeafFlags();
+ }
+
+ /**
+ * Method to allow ceVlanMap to be modified.
+ * @param additionalCeVlanMap An addition to the existing ceVlanMap
+ * @return The updated builder
+ */
+ public EvcPerUninBuilder addToCeVlanMap(ServiceListType additionalCeVlanMap) {
+ String combinedCeVlanMap =
+ CeVlanMapUtils.combineVlanSets(ceVlanMap.string(), additionalCeVlanMap.string());
+ //If it contains 0 we should remove it
+ ceVlanMap = new ServiceListType(
+ CeVlanMapUtils.removeZeroIfPossible(combinedCeVlanMap));
+ return this;
+ }
+ }
+}
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/evcperuni/package-info.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/evcperuni/package-info.java
new file mode 100644
index 0000000..3617d86
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/evcperuni/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Package for Microsemi device drivers support for NETCONF for EA1000.
+ */
+package org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service
+ .rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni;
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/package-info.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/package-info.java
new file mode 100644
index 0000000..7813b61
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/evc/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Package for Microsemi device drivers support for NETCONF for EA1000.
+ */
+package org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service
+ .rev20160317.mseaunievcservice.mefservices.uni.evc;
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/package-info.java b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/package-info.java
new file mode 100644
index 0000000..3bdeda0
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/java/org/onosproject/yang/gen/v1/http/www/microsemi/com/microsemi/edge/assure/msea/uni/evc/service/rev20160317/mseaunievcservice/mefservices/uni/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Package for Microsemi device drivers support for NETCONF for EA1000.
+ */
+package org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service
+ .rev20160317.mseaunievcservice.mefservices.uni;
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/main/resources/YangMetaData.ser b/drivers/microsemi/ea1000yang/src/main/resources/YangMetaData.ser
new file mode 100644
index 0000000..581bd77
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/resources/YangMetaData.ser
Binary files differ
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/ENTITY-STATE-TC-MIB.yang b/drivers/microsemi/ea1000yang/src/main/yang/ENTITY-STATE-TC-MIB.yang
new file mode 100644
index 0000000..c2d8a59
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/ENTITY-STATE-TC-MIB.yang
@@ -0,0 +1,184 @@
+/*
+ * This module has been generated by smidump 0.4.8:
+ *
+ * smidump -f yang ENTITY-STATE-TC-MIB
+ *
+ * Do not edit. Edit the source file instead!
+ */
+
+module ENTITY-STATE-TC-MIB {
+
+ /*** NAMESPACE / PREFIX DEFINITION ***/
+
+ namespace "urn:ietf:params:xml:ns:yang:smiv2:ENTITY-STATE-TC-MIB";
+ prefix "entity-state";
+
+ /*** LINKAGE (IMPORTS / INCLUDES) ***/
+
+
+ /*** META INFORMATION ***/
+
+ organization
+ "IETF Entity MIB Working Group";
+
+ contact
+ "General Discussion: entmib@ietf.org
+ To Subscribe:
+ http://www.ietf.org/mailman/listinfo/entmib
+
+ http://www.ietf.org/html.charters/entmib-charter.html
+
+ Sharon Chisholm
+ Nortel Networks
+ PO Box 3511 Station C
+ Ottawa, Ont. K1Y 4H7
+ Canada
+ schishol@nortel.com
+
+ David T. Perkins
+ 548 Qualbrook Ct
+ San Jose, CA 95110
+ USA
+ Phone: 408 394-8702
+ dperkins@snmpinfo.com";
+
+ description
+ "This MIB defines state textual conventions.
+
+ Copyright (C) The Internet Society 2005. This version
+ of this MIB module is part of RFC 4268; see the RFC
+ itself for full legal notices.";
+
+ revision "2005-11-22" {
+ description
+ "Initial version, published as RFC 4268.";
+ }
+
+ /*** TYPE DEFINITIONS ***/
+
+ typedef EntityAdminState {
+ type enumeration {
+ enum unknown { value 1; }
+ enum locked { value 2; }
+ enum shuttingDown { value 3; }
+ enum unlocked { value 4; }
+ }
+ description
+ " Represents the various possible administrative states.
+
+
+
+
+
+ A value of 'locked' means the resource is administratively
+ prohibited from use. A value of 'shuttingDown' means that
+ usage is administratively limited to current instances of
+ use. A value of 'unlocked' means the resource is not
+ administratively prohibited from use. A value of
+ 'unknown' means that this resource is unable to
+ report administrative state.";
+ }
+
+ typedef EntityOperState {
+ type enumeration {
+ enum unknown { value 1; }
+ enum disabled { value 2; }
+ enum enabled { value 3; }
+ enum testing { value 4; }
+ }
+ description
+ " Represents the possible values of operational states.
+
+ A value of 'disabled' means the resource is totally
+ inoperable. A value of 'enabled' means the resource
+ is partially or fully operable. A value of 'testing'
+ means the resource is currently being tested
+ and cannot therefore report whether it is operational
+ or not. A value of 'unknown' means that this
+ resource is unable to report operational state.";
+ }
+
+ typedef EntityUsageState {
+ type enumeration {
+ enum unknown { value 1; }
+ enum idle { value 2; }
+ enum active { value 3; }
+ enum busy { value 4; }
+ }
+ description
+ " Represents the possible values of usage states.
+ A value of 'idle' means the resource is servicing no
+ users. A value of 'active' means the resource is
+ currently in use and it has sufficient spare capacity
+ to provide for additional users. A value of 'busy'
+ means the resource is currently in use, but it
+ currently has no spare capacity to provide for
+ additional users. A value of 'unknown' means
+ that this resource is unable to report usage state.";
+ }
+
+ typedef EntityAlarmStatus {
+ type bits {
+ bit unknown { position 0; }
+ bit underRepair { position 1; }
+ bit critical { position 2; }
+ bit major { position 3; }
+ bit minor { position 4; }
+ bit warning { position 5; }
+ bit indeterminate { position 6; }
+ }
+ description
+ " Represents the possible values of alarm status.
+ An Alarm [RFC3877] is a persistent indication
+ of an error or warning condition.
+
+ When no bits of this attribute are set, then no active
+ alarms are known against this entity and it is not under
+ repair.
+
+ When the 'value of underRepair' is set, the resource is
+ currently being repaired, which, depending on the
+ implementation, may make the other values in this bit
+ string not meaningful.
+
+ When the value of 'critical' is set, one or more critical
+ alarms are active against the resource. When the value
+ of 'major' is set, one or more major alarms are active
+ against the resource. When the value of 'minor' is set,
+ one or more minor alarms are active against the resource.
+ When the value of 'warning' is set, one or more warning
+ alarms are active against the resource. When the value
+ of 'indeterminate' is set, one or more alarms of whose
+ perceived severity cannot be determined are active
+ against this resource.
+
+ A value of 'unknown' means that this resource is
+ unable to report alarm state.";
+ }
+
+ typedef EntityStandbyStatus {
+ type enumeration {
+ enum unknown { value 1; }
+ enum hotStandby { value 2; }
+ enum coldStandby { value 3; }
+ enum providingService { value 4; }
+ }
+ description
+ " Represents the possible values of standby status.
+
+ A value of 'hotStandby' means the resource is not
+ providing service, but it will be immediately able to
+ take over the role of the resource to be backed up,
+ without the need for initialization activity, and will
+ contain the same information as the resource to be
+ backed up. A value of 'coldStandy' means that the
+ resource is to back up another resource, but will not
+ be immediately able to take over the role of a resource
+ to be backed up, and will require some initialization
+ activity. A value of 'providingService' means the
+ resource is providing service. A value of
+ 'unknown' means that this resource is unable to
+ report standby state.";
+ }
+
+} /* end of module ENTITY-STATE-TC-MIB */
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/fpga-internal.yang b/drivers/microsemi/ea1000yang/src/main/yang/fpga-internal.yang
new file mode 100644
index 0000000..87fabb1
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/fpga-internal.yang
@@ -0,0 +1,266 @@
+module fpga-internal {
+
+ /*** NAMESPACE / PREFIX DEFINITION ***/
+
+ namespace "http://www.microsemi.com/fpga-int";
+ prefix "fpga-int";
+
+ /*** 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 add internal procedures to access FPAA hardware
+
+ Copyright 2015 Microsemi Inc.
+ All rights reserved.";
+
+ revision "2015-11-30" {
+ description
+ "Initial version - Sean Condon, Microsemi";
+ }
+
+ typedef sixteen-bit-hex {
+ type string {
+ pattern '0x[0-9a-fA-F]{4}';
+ }
+
+ description
+ "A 16-bit address represented as a hexadecimal number";
+ }
+
+ typedef thirtytwo-bit-hex {
+ type string {
+ pattern '0x[0-9a-fA-F]{8}';
+ }
+
+ description
+ "A 32-bit address represented as a hexadecimal number";
+ }
+
+ typedef thirtytwobit-data {
+ type string {
+ pattern '([0-9a-fA-F]{8}(:[0-9a-fA-F]{8})*)?';
+ }
+
+ description
+ "A set of 32 bit data values represented as colon separated
+ hex strings e.g. 'A1B2C3D4:B2C3D4F5:C3D4E5F6'";
+ }
+
+ typedef select-ram-enum {
+ type enumeration {
+ enum pkt-store-sel {value 0;}
+ enum probe-store-sel {value 1;}
+ enum xconn-store-sel {value 2;}
+ enum rmep-err-store-sel {value 3;}
+ enum rx-lmep-map-sel {value 4;}
+ enum cpu-sys-capt-fifo-sel {value 5;}
+ enum rmep-ram-sel {value 6;}
+ enum xconn-ram-sel {value 7;}
+ enum rmep-err-ram-sel {value 8;}
+ enum tx-lmep-map-sel {value 9;}
+ enum ext-sram-sel {value 10;}
+ enum car-rmac-sel {value 11;}
+ enum sys-mac-sel {value 12;}
+ enum rx-carr-data-fifo-sel {value 13;}
+ enum line-stats-ram-sel {value 14;}
+ enum cpu-sys-capt-info-fifo-sel {value 15;}
+ enum vlan-info-ram-sel {value 16;}
+ enum lbm-store-sel {value 17;}
+ enum lbr-ram-sel {value 18;}
+ enum mc-lbr-store-sel {value 19;}
+ enum port-mac-ram-sel {value 20;}
+ enum pm-db-ram-sel {value 22;}
+ enum tx-lb-ram-sel {value 24;}
+ enum tlv-ram-sel {value 25;}
+ enum cpu-capt-fifo-sel {value 26;}
+ enum cpu-capt-info-fifo-sel {value 27;}
+ enum policer-cfg-ram-sel {value 28;}
+ enum policer-ctxt-ram-sel {value 29;}
+ enum cpu-sys-tx-ram-sel {value 30;}
+ enum policer-stats-ram-sel {value 31;}
+ }
+ }
+
+
+ container fpga-internal {
+ presence "Supports FPGA direct access";
+ }
+
+ rpc read-registers {
+
+ description "Method to read directly from hardware registers";
+ input {
+ choice hex-or-dec {
+
+ description "Enter the starting address in either decimal (0-65535)
+ or hexadecimal (preceeded with 0x)";
+ mandatory true;
+
+ case hex {
+ leaf start-address-hex {
+ type sixteen-bit-hex;
+ }
+ }
+
+ case decimal {
+ leaf start-address-dec {
+ type uint16;
+ }
+ }
+ }
+
+ leaf num-locations {
+ type uint8 {
+ range 1..max;
+ }
+ description "The number of following locations (addresses) to read from";
+ default 1;
+ }
+ }
+
+ output {
+ anyxml data {
+ description "A set of 32 bit data values represented
+ as colon separated 8 character hexadecimal values";
+ }
+ }
+ }
+
+
+ rpc write-registers {
+
+ description "Method to write directly to hardware registers.
+ If a number of data values are given then subsequent
+ locations are written to";
+ input {
+ choice hex-or-dec {
+
+ description "Enter the starting address in either decimal (0-65535)
+ or hexadecimal (preceeded with 0x)";
+
+ case hex {
+ leaf start-address-hex {
+ type sixteen-bit-hex;
+ }
+ }
+
+ case decimal {
+ leaf start-address-dec {
+ type uint16;
+ }
+ }
+ }
+
+ leaf value-hex-32 {
+ type thirtytwobit-data;
+ description "A set of 32 bit data values represented
+ as colon separated 8 character hexadecimal values
+ e.g. ffffffff:ffffffff:ffffffff
+ The number of locations written to will be
+ determinted by the number of such values given";
+ }
+ }
+ }
+
+ rpc read-ram {
+
+ description "Method to read directly from hardware RAM";
+ input {
+ leaf ram {
+ type select-ram-enum;
+ mandatory true;
+ description "The type of RAM to read from";
+ }
+
+ choice hex-or-dec {
+
+ description "Enter the starting address in either decimal (0-65535)
+ or hexadecimal (preceeded with 0x)";
+ mandatory true;
+
+ case hex {
+ leaf start-address-hex {
+ type thirtytwo-bit-hex;
+ }
+ }
+
+ case decimal {
+ leaf start-address-dec {
+ type uint32;
+ }
+ }
+ }
+
+ leaf num-locations {
+ type uint8 {
+ range 1..max;
+ }
+ description "The number of following locations (addresses) to read from";
+ default 1;
+ }
+ }
+
+ output {
+ anyxml data {
+ description "A set of 32 bit data values represented
+ as colon separated 8 character hexadecimal values";
+ }
+ }
+ }
+
+ rpc write-ram {
+
+ description "Method to write directly to RAM registers.
+ If a number of data values are given then subsequent
+ locations are written to";
+ input {
+ leaf ram {
+ type select-ram-enum;
+ mandatory true;
+ description "The type of RAM to read from";
+ }
+
+ choice hex-or-dec {
+
+ description "Enter the starting address in either decimal (0-65535)
+ or hexadecimal (preceeded with 0x)";
+ mandatory true;
+
+ case hex {
+ leaf start-address-hex {
+ type thirtytwo-bit-hex;
+ }
+ }
+
+ case decimal {
+ leaf start-address-dec {
+ type uint32;
+ }
+ }
+ }
+
+ leaf value-hex-32 {
+ type thirtytwobit-data;
+ description "A set of 32 bit data values represented
+ as colon separated 8 character hexadecimal values
+ e.g. ffffffff:ffffffff:ffffffff
+ The number of locations written to will be
+ determinted by the number of such values given";
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/iana-crypt-hash.yang b/drivers/microsemi/ea1000yang/src/main/yang/iana-crypt-hash.yang
new file mode 100644
index 0000000..3a9ef55
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/iana-crypt-hash.yang
@@ -0,0 +1,121 @@
+module iana-crypt-hash {
+ namespace "urn:ietf:params:xml:ns:yang:iana-crypt-hash";
+ prefix ianach;
+
+ organization "IANA";
+ contact
+ " Internet Assigned Numbers Authority
+
+ Postal: ICANN
+ 12025 Waterfront Drive, Suite 300
+ Los Angeles, CA 90094-2536
+ United States
+
+ Tel: +1 310 301 5800
+ E-Mail: iana@iana.org>";
+ description
+ "This YANG module defines a type for storing passwords
+ using a hash function and features to indicate which hash
+ functions are supported by an implementation.
+
+ The latest revision of this YANG module can be obtained from
+ the IANA web site.
+
+ Requests for new values should be made to IANA via
+ email (iana@iana.org).
+
+ Copyright (c) 2014 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ The initial version of this YANG module is part of RFC 7317;
+ see the RFC itself for full legal notices.";
+
+ revision 2014-08-06 {
+ description
+ "Initial revision.";
+ reference
+ "RFC 7317: A YANG Data Model for System Management";
+ }
+
+ typedef crypt-hash {
+ type string {
+ pattern
+ '$0$.*' //Escaped all $ as Java Pattern matcher will interpret them otherwise
+ + '|$1$[a-zA-Z0-9./]{1,8}$[a-zA-Z0-9./]{22}'
+ + '|$5$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{43}'
+ + '|$6$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{86}';
+ }
+ description
+ "The crypt-hash type is used to store passwords using
+ a hash function. The algorithms for applying the hash
+ function and encoding the result are implemented in
+ various UNIX systems as the function crypt(3).
+
+ A value of this type matches one of the forms:
+
+ $0$<clear text password>
+ $<id>$<salt>$<password hash>
+ $<id>$<parameter>$<salt>$<password hash>
+
+ The '$0$' prefix signals that the value is clear text. When
+ such a value is received by the server, a hash value is
+ calculated, and the string '$<id>$<salt>$' or
+ $<id>$<parameter>$<salt>$ is prepended to the result. This
+ value is stored in the configuration data store.
+
+ If a value starting with '$<id>$', where <id> is not '0', is
+ received, the server knows that the value already represents a
+ hashed value and stores it 'as is' in the data store.
+
+ When a server needs to verify a password given by a user, it
+ finds the stored password hash string for that user, extracts
+ the salt, and calculates the hash with the salt and given
+ password as input. If the calculated hash value is the same
+ as the stored value, the password given by the client is
+ accepted.
+
+ This type defines the following hash functions:
+
+ id | hash function | feature
+ ---+---------------+-------------------
+ 1 | MD5 | crypt-hash-md5
+ 5 | SHA-256 | crypt-hash-sha-256
+ 6 | SHA-512 | crypt-hash-sha-512
+
+ The server indicates support for the different hash functions
+ by advertising the corresponding feature.";
+ reference
+ "IEEE Std 1003.1-2008 - crypt() function
+ RFC 1321: The MD5 Message-Digest Algorithm
+ FIPS.180-4.2012: Secure Hash Standard (SHS)";
+ }
+
+ feature crypt-hash-md5 {
+ description
+ "Indicates that the device supports the MD5
+ hash function in 'crypt-hash' values.";
+ reference "RFC 1321: The MD5 Message-Digest Algorithm";
+ }
+
+ feature crypt-hash-sha-256 {
+ description
+ "Indicates that the device supports the SHA-256
+ hash function in 'crypt-hash' values.";
+ reference "FIPS.180-4.2012: Secure Hash Standard (SHS)";
+ }
+
+ feature crypt-hash-sha-512 {
+ description
+ "Indicates that the device supports the SHA-512
+ hash function in 'crypt-hash' values.";
+ reference "FIPS.180-4.2012: Secure Hash Standard (SHS)";
+ }
+
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/iana-if-type.yang b/drivers/microsemi/ea1000yang/src/main/yang/iana-if-type.yang
new file mode 100644
index 0000000..fb48b6b
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/iana-if-type.yang
@@ -0,0 +1,1507 @@
+ module iana-if-type {
+ namespace "urn:ietf:params:xml:ns:yang:iana-if-type";
+ prefix ianaift;
+
+ import ietf-interfaces {
+ prefix if;
+ }
+
+ organization "IANA";
+ contact
+ " Internet Assigned Numbers Authority
+
+ Postal: ICANN
+ 4676 Admiralty Way, Suite 330
+ Marina del Rey, CA 90292
+
+ Tel: +1 310 823 9358
+ <mailto:iana@iana.org>";
+
+ description
+ "This YANG module defines YANG identities for IANA-registered
+ interface types.
+
+ This YANG module is maintained by IANA and reflects the
+ 'ifType definitions' registry.
+
+ The latest revision of this YANG module can be obtained from
+ the IANA web site.
+
+ Requests for new values should be made to IANA via
+ email (iana@iana.org).
+
+ Copyright (c) 2014 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ The initial version of this YANG module is part of RFC 7224;
+ see the RFC itself for full legal notices.";
+ reference
+ "IANA 'ifType definitions' registry.
+ <http://www.iana.org/assignments/smi-numbers>";
+
+ revision 2014-05-08 {
+ description
+ "Initial revision.";
+ reference
+ "RFC 7224: IANA Interface Type YANG Module";
+ }
+
+ identity iana-interface-type {
+ base if:interface-type;
+ description
+ "This identity is used as a base for all interface types
+ defined in the 'ifType definitions' registry.";
+ }
+ identity other {
+ base iana-interface-type;
+ }
+ identity regular1822 {
+ base iana-interface-type;
+ }
+ identity hdh1822 {
+ base iana-interface-type;
+ }
+ identity ddnX25 {
+ base iana-interface-type;
+ }
+ identity rfc877x25 {
+ base iana-interface-type;
+ reference
+ "RFC 1382 - SNMP MIB Extension for the X.25 Packet Layer";
+ }
+ identity ethernetCsmacd {
+ base iana-interface-type;
+ description
+ "For all Ethernet-like interfaces, regardless of speed,
+ as per RFC 3635.";
+ reference
+ "RFC 3635 - Definitions of Managed Objects for the
+ Ethernet-like Interface Types";
+ }
+ identity iso88023Csmacd {
+ base iana-interface-type;
+ status deprecated;
+ description
+ "Deprecated via RFC 3635.
+ Use ethernetCsmacd(6) instead.";
+ reference
+ "RFC 3635 - Definitions of Managed Objects for the
+ Ethernet-like Interface Types";
+ }
+ identity iso88024TokenBus {
+ base iana-interface-type;
+ }
+ identity iso88025TokenRing {
+ base iana-interface-type;
+ }
+ identity iso88026Man {
+ base iana-interface-type;
+ }
+ identity starLan {
+ base iana-interface-type;
+ status deprecated;
+ description
+ "Deprecated via RFC 3635.
+ Use ethernetCsmacd(6) instead.";
+ reference
+ "RFC 3635 - Definitions of Managed Objects for the
+ Ethernet-like Interface Types";
+ }
+ identity proteon10Mbit {
+ base iana-interface-type;
+ }
+ identity proteon80Mbit {
+ base iana-interface-type;
+ }
+ identity hyperchannel {
+ base iana-interface-type;
+ }
+ identity fddi {
+ base iana-interface-type;
+ reference
+ "RFC 1512 - FDDI Management Information Base";
+ }
+ identity lapb {
+ base iana-interface-type;
+ reference
+ "RFC 1381 - SNMP MIB Extension for X.25 LAPB";
+ }
+ identity sdlc {
+ base iana-interface-type;
+ }
+ identity ds1 {
+ base iana-interface-type;
+ description
+ "DS1-MIB.";
+ reference
+ "RFC 4805 - Definitions of Managed Objects for the
+ DS1, J1, E1, DS2, and E2 Interface Types";
+ }
+ identity e1 {
+ base iana-interface-type;
+ status obsolete;
+ description
+ "Obsolete; see DS1-MIB.";
+ reference
+ "RFC 4805 - Definitions of Managed Objects for the
+ DS1, J1, E1, DS2, and E2 Interface Types";
+ }
+ identity basicISDN {
+ base iana-interface-type;
+ description
+ "No longer used. See also RFC 2127.";
+ }
+ identity primaryISDN {
+ base iana-interface-type;
+ description
+ "No longer used. See also RFC 2127.";
+ }
+ identity propPointToPointSerial {
+ base iana-interface-type;
+ description
+ "Proprietary serial.";
+ }
+ identity ppp {
+ base iana-interface-type;
+ }
+ identity softwareLoopback {
+ base iana-interface-type;
+ }
+ identity eon {
+ base iana-interface-type;
+ description
+ "CLNP over IP.";
+ }
+ identity ethernet3Mbit {
+ base iana-interface-type;
+ }
+ identity nsip {
+ base iana-interface-type;
+ description
+ "XNS over IP.";
+ }
+ identity slip {
+ base iana-interface-type;
+ description
+ "Generic SLIP.";
+ }
+ identity ultra {
+ base iana-interface-type;
+ description
+ "Ultra Technologies.";
+ }
+ identity ds3 {
+ base iana-interface-type;
+ description
+ "DS3-MIB.";
+ reference
+ "RFC 3896 - Definitions of Managed Objects for the
+ DS3/E3 Interface Type";
+ }
+ identity sip {
+ base iana-interface-type;
+ description
+ "SMDS, coffee.";
+ reference
+ "RFC 1694 - Definitions of Managed Objects for SMDS
+ Interfaces using SMIv2";
+ }
+ identity frameRelay {
+ base iana-interface-type;
+ description
+ "DTE only.";
+ reference
+ "RFC 2115 - Management Information Base for Frame Relay
+ DTEs Using SMIv2";
+ }
+ identity rs232 {
+ base iana-interface-type;
+ reference
+ "RFC 1659 - Definitions of Managed Objects for RS-232-like
+ Hardware Devices using SMIv2";
+ }
+ identity para {
+ base iana-interface-type;
+ description
+ "Parallel-port.";
+ reference
+ "RFC 1660 - Definitions of Managed Objects for
+ Parallel-printer-like Hardware Devices using
+ SMIv2";
+ }
+ identity arcnet {
+ base iana-interface-type;
+ description
+ "ARCnet.";
+ }
+ identity arcnetPlus {
+ base iana-interface-type;
+ description
+ "ARCnet Plus.";
+ }
+ identity atm {
+ base iana-interface-type;
+ description
+ "ATM cells.";
+ }
+ identity miox25 {
+ base iana-interface-type;
+ reference
+ "RFC 1461 - SNMP MIB extension for Multiprotocol
+ Interconnect over X.25";
+ }
+ identity sonet {
+ base iana-interface-type;
+ description
+ "SONET or SDH.";
+ }
+ identity x25ple {
+ base iana-interface-type;
+ reference
+ "RFC 2127 - ISDN Management Information Base using SMIv2";
+ }
+ identity iso88022llc {
+ base iana-interface-type;
+ }
+ identity localTalk {
+ base iana-interface-type;
+ }
+ identity smdsDxi {
+ base iana-interface-type;
+ }
+ identity frameRelayService {
+ base iana-interface-type;
+ description
+ "FRNETSERV-MIB.";
+ reference
+ "RFC 2954 - Definitions of Managed Objects for Frame
+ Relay Service";
+ }
+ identity v35 {
+ base iana-interface-type;
+ }
+ identity hssi {
+ base iana-interface-type;
+ }
+ identity hippi {
+ base iana-interface-type;
+ }
+ identity modem {
+ base iana-interface-type;
+ description
+ "Generic modem.";
+ }
+ identity aal5 {
+ base iana-interface-type;
+ description
+ "AAL5 over ATM.";
+ }
+ identity sonetPath {
+ base iana-interface-type;
+ }
+ identity sonetVT {
+ base iana-interface-type;
+ }
+ identity smdsIcip {
+ base iana-interface-type;
+ description
+ "SMDS InterCarrier Interface.";
+ }
+ identity propVirtual {
+ base iana-interface-type;
+ description
+ "Proprietary virtual/internal.";
+ reference
+ "RFC 2863 - The Interfaces Group MIB";
+ }
+ identity propMultiplexor {
+ base iana-interface-type;
+ description
+ "Proprietary multiplexing.";
+ reference
+ "RFC 2863 - The Interfaces Group MIB";
+ }
+ identity ieee80212 {
+ base iana-interface-type;
+ description
+ "100BaseVG.";
+ }
+ identity fibreChannel {
+ base iana-interface-type;
+ description
+ "Fibre Channel.";
+ }
+ identity hippiInterface {
+ base iana-interface-type;
+ description
+ "HIPPI interfaces.";
+ }
+ identity frameRelayInterconnect {
+ base iana-interface-type;
+ status obsolete;
+ description
+ "Obsolete; use either
+ frameRelay(32) or frameRelayService(44).";
+ }
+ identity aflane8023 {
+ base iana-interface-type;
+ description
+ "ATM Emulated LAN for 802.3.";
+ }
+ identity aflane8025 {
+ base iana-interface-type;
+ description
+ "ATM Emulated LAN for 802.5.";
+ }
+ identity cctEmul {
+ base iana-interface-type;
+ description
+ "ATM Emulated circuit.";
+ }
+ identity fastEther {
+ base iana-interface-type;
+ status deprecated;
+ description
+ "Obsoleted via RFC 3635.
+ ethernetCsmacd(6) should be used instead.";
+ reference
+ "RFC 3635 - Definitions of Managed Objects for the
+ Ethernet-like Interface Types";
+ }
+ identity isdn {
+ base iana-interface-type;
+ description
+ "ISDN and X.25.";
+ reference
+ "RFC 1356 - Multiprotocol Interconnect on X.25 and ISDN
+ in the Packet Mode";
+ }
+ identity v11 {
+ base iana-interface-type;
+ description
+ "CCITT V.11/X.21.";
+ }
+ identity v36 {
+ base iana-interface-type;
+ description
+ "CCITT V.36.";
+ }
+ identity g703at64k {
+ base iana-interface-type;
+ description
+ "CCITT G703 at 64Kbps.";
+ }
+ identity g703at2mb {
+ base iana-interface-type;
+ status obsolete;
+ description
+ "Obsolete; see DS1-MIB.";
+ }
+ identity qllc {
+ base iana-interface-type;
+ description
+ "SNA QLLC.";
+ }
+ identity fastEtherFX {
+ base iana-interface-type;
+ status deprecated;
+ description
+ "Obsoleted via RFC 3635.
+ ethernetCsmacd(6) should be used instead.";
+ reference
+ "RFC 3635 - Definitions of Managed Objects for the
+ Ethernet-like Interface Types";
+ }
+ identity channel {
+ base iana-interface-type;
+ description
+ "Channel.";
+ }
+ identity ieee80211 {
+ base iana-interface-type;
+ description
+ "Radio spread spectrum.";
+ }
+ identity ibm370parChan {
+ base iana-interface-type;
+ description
+ "IBM System 360/370 OEMI Channel.";
+ }
+ identity escon {
+ base iana-interface-type;
+ description
+ "IBM Enterprise Systems Connection.";
+ }
+ identity dlsw {
+ base iana-interface-type;
+ description
+ "Data Link Switching.";
+ }
+ identity isdns {
+ base iana-interface-type;
+ description
+ "ISDN S/T interface.";
+ }
+ identity isdnu {
+ base iana-interface-type;
+ description
+ "ISDN U interface.";
+ }
+ identity lapd {
+ base iana-interface-type;
+ description
+ "Link Access Protocol D.";
+ }
+ identity ipSwitch {
+ base iana-interface-type;
+ description
+ "IP Switching Objects.";
+ }
+ identity rsrb {
+ base iana-interface-type;
+ description
+ "Remote Source Route Bridging.";
+ }
+ identity atmLogical {
+ base iana-interface-type;
+ description
+ "ATM Logical Port.";
+ reference
+ "RFC 3606 - Definitions of Supplemental Managed Objects
+ for ATM Interface";
+ }
+ identity ds0 {
+ base iana-interface-type;
+ description
+ "Digital Signal Level 0.";
+ reference
+ "RFC 2494 - Definitions of Managed Objects for the DS0
+ and DS0 Bundle Interface Type";
+ }
+ identity ds0Bundle {
+ base iana-interface-type;
+ description
+ "Group of ds0s on the same ds1.";
+ reference
+ "RFC 2494 - Definitions of Managed Objects for the DS0
+ and DS0 Bundle Interface Type";
+ }
+ identity bsc {
+ base iana-interface-type;
+ description
+ "Bisynchronous Protocol.";
+ }
+ identity async {
+ base iana-interface-type;
+ description
+ "Asynchronous Protocol.";
+ }
+ identity cnr {
+ base iana-interface-type;
+ description
+ "Combat Net Radio.";
+ }
+ identity iso88025Dtr {
+ base iana-interface-type;
+ description
+ "ISO 802.5r DTR.";
+ }
+ identity eplrs {
+ base iana-interface-type;
+ description
+ "Ext Pos Loc Report Sys.";
+ }
+ identity arap {
+ base iana-interface-type;
+ description
+ "Appletalk Remote Access Protocol.";
+ }
+ identity propCnls {
+ base iana-interface-type;
+ description
+ "Proprietary Connectionless Protocol.";
+ }
+ identity hostPad {
+ base iana-interface-type;
+ description
+ "CCITT-ITU X.29 PAD Protocol.";
+ }
+ identity termPad {
+ base iana-interface-type;
+ description
+ "CCITT-ITU X.3 PAD Facility.";
+ }
+ identity frameRelayMPI {
+ base iana-interface-type;
+ description
+ "Multiproto Interconnect over FR.";
+ }
+ identity x213 {
+ base iana-interface-type;
+ description
+ "CCITT-ITU X213.";
+ }
+ identity adsl {
+ base iana-interface-type;
+ description
+ "Asymmetric Digital Subscriber Loop.";
+ }
+ identity radsl {
+ base iana-interface-type;
+ description
+ "Rate-Adapt. Digital Subscriber Loop.";
+ }
+ identity sdsl {
+ base iana-interface-type;
+ description
+ "Symmetric Digital Subscriber Loop.";
+ }
+ identity vdsl {
+ base iana-interface-type;
+ description
+ "Very H-Speed Digital Subscrib. Loop.";
+ }
+ identity iso88025CRFPInt {
+ base iana-interface-type;
+ description
+ "ISO 802.5 CRFP.";
+ }
+ identity myrinet {
+ base iana-interface-type;
+ description
+ "Myricom Myrinet.";
+ }
+ identity voiceEM {
+ base iana-interface-type;
+ description
+ "Voice recEive and transMit.";
+ }
+ identity voiceFXO {
+ base iana-interface-type;
+ description
+ "Voice Foreign Exchange Office.";
+ }
+ identity voiceFXS {
+ base iana-interface-type;
+ description
+ "Voice Foreign Exchange Station.";
+ }
+ identity voiceEncap {
+ base iana-interface-type;
+ description
+ "Voice encapsulation.";
+ }
+ identity voiceOverIp {
+ base iana-interface-type;
+ description
+ "Voice over IP encapsulation.";
+ }
+ identity atmDxi {
+ base iana-interface-type;
+ description
+ "ATM DXI.";
+ }
+ identity atmFuni {
+ base iana-interface-type;
+ description
+ "ATM FUNI.";
+ }
+ identity atmIma {
+ base iana-interface-type;
+ description
+ "ATM IMA.";
+ }
+ identity pppMultilinkBundle {
+ base iana-interface-type;
+ description
+ "PPP Multilink Bundle.";
+ }
+ identity ipOverCdlc {
+ base iana-interface-type;
+ description
+ "IBM ipOverCdlc.";
+ }
+ identity ipOverClaw {
+ base iana-interface-type;
+ description
+ "IBM Common Link Access to Workstn.";
+ }
+ identity stackToStack {
+ base iana-interface-type;
+ description
+ "IBM stackToStack.";
+ }
+ identity virtualIpAddress {
+ base iana-interface-type;
+ description
+ "IBM VIPA.";
+ }
+ identity mpc {
+ base iana-interface-type;
+ description
+ "IBM multi-protocol channel support.";
+ }
+ identity ipOverAtm {
+ base iana-interface-type;
+ description
+ "IBM ipOverAtm.";
+ reference
+ "RFC 2320 - Definitions of Managed Objects for Classical IP
+ and ARP Over ATM Using SMIv2 (IPOA-MIB)";
+ }
+ identity iso88025Fiber {
+ base iana-interface-type;
+ description
+ "ISO 802.5j Fiber Token Ring.";
+ }
+ identity tdlc {
+ base iana-interface-type;
+ description
+ "IBM twinaxial data link control.";
+ }
+ identity gigabitEthernet {
+ base iana-interface-type;
+ status deprecated;
+ description
+ "Obsoleted via RFC 3635.
+ ethernetCsmacd(6) should be used instead.";
+ reference
+ "RFC 3635 - Definitions of Managed Objects for the
+ Ethernet-like Interface Types";
+ }
+ identity hdlc {
+ base iana-interface-type;
+ description
+ "HDLC.";
+ }
+ identity lapf {
+ base iana-interface-type;
+ description
+ "LAP F.";
+ }
+ identity v37 {
+ base iana-interface-type;
+ description
+ "V.37.";
+ }
+ identity x25mlp {
+ base iana-interface-type;
+ description
+ "Multi-Link Protocol.";
+ }
+ identity x25huntGroup {
+ base iana-interface-type;
+ description
+ "X25 Hunt Group.";
+ }
+ identity transpHdlc {
+ base iana-interface-type;
+ description
+ "Transp HDLC.";
+ }
+ identity interleave {
+ base iana-interface-type;
+ description
+ "Interleave channel.";
+ }
+ identity fast {
+ base iana-interface-type;
+ description
+ "Fast channel.";
+ }
+ identity ip {
+ base iana-interface-type;
+ description
+ "IP (for APPN HPR in IP networks).";
+ }
+ identity docsCableMaclayer {
+ base iana-interface-type;
+ description
+ "CATV Mac Layer.";
+ }
+ identity docsCableDownstream {
+ base iana-interface-type;
+ description
+ "CATV Downstream interface.";
+ }
+ identity docsCableUpstream {
+ base iana-interface-type;
+ description
+ "CATV Upstream interface.";
+ }
+ identity a12MppSwitch {
+ base iana-interface-type;
+ description
+ "Avalon Parallel Processor.";
+ }
+ identity tunnel {
+ base iana-interface-type;
+ description
+ "Encapsulation interface.";
+ }
+ identity coffee {
+ base iana-interface-type;
+ description
+ "Coffee pot.";
+ reference
+ "RFC 2325 - Coffee MIB";
+ }
+ identity ces {
+ base iana-interface-type;
+ description
+ "Circuit Emulation Service.";
+ }
+ identity atmSubInterface {
+ base iana-interface-type;
+ description
+ "ATM Sub Interface.";
+ }
+ identity l2vlan {
+ base iana-interface-type;
+ description
+ "Layer 2 Virtual LAN using 802.1Q.";
+ }
+ identity l3ipvlan {
+ base iana-interface-type;
+ description
+ "Layer 3 Virtual LAN using IP.";
+ }
+ identity l3ipxvlan {
+ base iana-interface-type;
+ description
+ "Layer 3 Virtual LAN using IPX.";
+ }
+ identity digitalPowerline {
+ base iana-interface-type;
+ description
+ "IP over Power Lines.";
+ }
+ identity mediaMailOverIp {
+ base iana-interface-type;
+ description
+ "Multimedia Mail over IP.";
+ }
+ identity dtm {
+ base iana-interface-type;
+ description
+ "Dynamic synchronous Transfer Mode.";
+ }
+ identity dcn {
+ base iana-interface-type;
+ description
+ "Data Communications Network.";
+ }
+ identity ipForward {
+ base iana-interface-type;
+ description
+ "IP Forwarding Interface.";
+ }
+ identity msdsl {
+ base iana-interface-type;
+ description
+ "Multi-rate Symmetric DSL.";
+ }
+ identity ieee1394 {
+ base iana-interface-type;
+ description
+ "IEEE1394 High Performance Serial Bus.";
+ }
+ identity if-gsn {
+ base iana-interface-type;
+ description
+ "HIPPI-6400.";
+ }
+ identity dvbRccMacLayer {
+ base iana-interface-type;
+ description
+ "DVB-RCC MAC Layer.";
+ }
+ identity dvbRccDownstream {
+ base iana-interface-type;
+ description
+ "DVB-RCC Downstream Channel.";
+ }
+ identity dvbRccUpstream {
+ base iana-interface-type;
+ description
+ "DVB-RCC Upstream Channel.";
+ }
+ identity atmVirtual {
+ base iana-interface-type;
+ description
+ "ATM Virtual Interface.";
+ }
+ identity mplsTunnel {
+ base iana-interface-type;
+ description
+ "MPLS Tunnel Virtual Interface.";
+ }
+ identity srp {
+ base iana-interface-type;
+ description
+ "Spatial Reuse Protocol.";
+ }
+ identity voiceOverAtm {
+ base iana-interface-type;
+ description
+ "Voice over ATM.";
+ }
+ identity voiceOverFrameRelay {
+ base iana-interface-type;
+ description
+ "Voice Over Frame Relay.";
+ }
+ identity idsl {
+ base iana-interface-type;
+ description
+ "Digital Subscriber Loop over ISDN.";
+ }
+ identity compositeLink {
+ base iana-interface-type;
+ description
+ "Avici Composite Link Interface.";
+ }
+ identity ss7SigLink {
+ base iana-interface-type;
+ description
+ "SS7 Signaling Link.";
+ }
+ identity propWirelessP2P {
+ base iana-interface-type;
+ description
+ "Prop. P2P wireless interface.";
+ }
+ identity frForward {
+ base iana-interface-type;
+ description
+ "Frame Forward Interface.";
+ }
+ identity rfc1483 {
+ base iana-interface-type;
+ description
+ "Multiprotocol over ATM AAL5.";
+ reference
+ "RFC 1483 - Multiprotocol Encapsulation over ATM
+ Adaptation Layer 5";
+ }
+ identity usb {
+ base iana-interface-type;
+ description
+ "USB Interface.";
+ }
+ identity ieee8023adLag {
+ base iana-interface-type;
+ description
+ "IEEE 802.3ad Link Aggregate.";
+ }
+ identity bgppolicyaccounting {
+ base iana-interface-type;
+ description
+ "BGP Policy Accounting.";
+ }
+ identity frf16MfrBundle {
+ base iana-interface-type;
+ description
+ "FRF.16 Multilink Frame Relay.";
+ }
+ identity h323Gatekeeper {
+ base iana-interface-type;
+ description
+ "H323 Gatekeeper.";
+ }
+ identity h323Proxy {
+ base iana-interface-type;
+ description
+ "H323 Voice and Video Proxy.";
+ }
+ identity mpls {
+ base iana-interface-type;
+ description
+ "MPLS.";
+ }
+ identity mfSigLink {
+ base iana-interface-type;
+ description
+ "Multi-frequency signaling link.";
+ }
+ identity hdsl2 {
+ base iana-interface-type;
+ description
+ "High Bit-Rate DSL - 2nd generation.";
+ }
+ identity shdsl {
+ base iana-interface-type;
+ description
+ "Multirate HDSL2.";
+ }
+ identity ds1FDL {
+ base iana-interface-type;
+ description
+ "Facility Data Link (4Kbps) on a DS1.";
+ }
+ identity pos {
+ base iana-interface-type;
+ description
+ "Packet over SONET/SDH Interface.";
+ }
+ identity dvbAsiIn {
+ base iana-interface-type;
+ description
+ "DVB-ASI Input.";
+ }
+ identity dvbAsiOut {
+ base iana-interface-type;
+ description
+ "DVB-ASI Output.";
+ }
+ identity plc {
+ base iana-interface-type;
+ description
+ "Power Line Communications.";
+ }
+ identity nfas {
+ base iana-interface-type;
+ description
+ "Non-Facility Associated Signaling.";
+ }
+ identity tr008 {
+ base iana-interface-type;
+ description
+ "TR008.";
+ }
+ identity gr303RDT {
+ base iana-interface-type;
+ description
+ "Remote Digital Terminal.";
+ }
+ identity gr303IDT {
+ base iana-interface-type;
+ description
+ "Integrated Digital Terminal.";
+ }
+ identity isup {
+ base iana-interface-type;
+ description
+ "ISUP.";
+ }
+ identity propDocsWirelessMaclayer {
+ base iana-interface-type;
+ description
+ "Cisco proprietary Maclayer.";
+ }
+ identity propDocsWirelessDownstream {
+ base iana-interface-type;
+ description
+ "Cisco proprietary Downstream.";
+ }
+ identity propDocsWirelessUpstream {
+ base iana-interface-type;
+ description
+ "Cisco proprietary Upstream.";
+ }
+ identity hiperlan2 {
+ base iana-interface-type;
+ description
+ "HIPERLAN Type 2 Radio Interface.";
+ }
+ identity propBWAp2Mp {
+ base iana-interface-type;
+ description
+ "PropBroadbandWirelessAccesspt2Multipt (use of this value
+ for IEEE 802.16 WMAN interfaces as per IEEE Std 802.16f
+ is deprecated, and ieee80216WMAN(237) should be used
+ instead).";
+ }
+ identity sonetOverheadChannel {
+ base iana-interface-type;
+ description
+ "SONET Overhead Channel.";
+ }
+ identity digitalWrapperOverheadChannel {
+ base iana-interface-type;
+ description
+ "Digital Wrapper.";
+ }
+ identity aal2 {
+ base iana-interface-type;
+ description
+ "ATM adaptation layer 2.";
+ }
+ identity radioMAC {
+ base iana-interface-type;
+ description
+ "MAC layer over radio links.";
+ }
+ identity atmRadio {
+ base iana-interface-type;
+ description
+ "ATM over radio links.";
+ }
+ identity imt {
+ base iana-interface-type;
+ description
+ "Inter-Machine Trunks.";
+ }
+ identity mvl {
+ base iana-interface-type;
+ description
+ "Multiple Virtual Lines DSL.";
+ }
+ identity reachDSL {
+ base iana-interface-type;
+ description
+ "Long Reach DSL.";
+ }
+ identity frDlciEndPt {
+ base iana-interface-type;
+ description
+ "Frame Relay DLCI End Point.";
+ }
+ identity atmVciEndPt {
+ base iana-interface-type;
+ description
+ "ATM VCI End Point.";
+ }
+ identity opticalChannel {
+ base iana-interface-type;
+ description
+ "Optical Channel.";
+ }
+ identity opticalTransport {
+ base iana-interface-type;
+ description
+ "Optical Transport.";
+ }
+ identity propAtm {
+ base iana-interface-type;
+ description
+ "Proprietary ATM.";
+ }
+ identity voiceOverCable {
+ base iana-interface-type;
+ description
+ "Voice Over Cable Interface.";
+ }
+ identity infiniband {
+ base iana-interface-type;
+ description
+ "Infiniband.";
+ }
+ identity teLink {
+ base iana-interface-type;
+ description
+ "TE Link.";
+ }
+ identity q2931 {
+ base iana-interface-type;
+ description
+ "Q.2931.";
+ }
+ identity virtualTg {
+ base iana-interface-type;
+ description
+ "Virtual Trunk Group.";
+ }
+ identity sipTg {
+ base iana-interface-type;
+ description
+ "SIP Trunk Group.";
+ }
+ identity sipSig {
+ base iana-interface-type;
+ description
+ "SIP Signaling.";
+ }
+ identity docsCableUpstreamChannel {
+ base iana-interface-type;
+ description
+ "CATV Upstream Channel.";
+ }
+ identity econet {
+ base iana-interface-type;
+ description
+ "Acorn Econet.";
+ }
+ identity pon155 {
+ base iana-interface-type;
+ description
+ "FSAN 155Mb Symetrical PON interface.";
+ }
+ identity pon622 {
+ base iana-interface-type;
+ description
+ "FSAN 622Mb Symetrical PON interface.";
+ }
+ identity bridge {
+ base iana-interface-type;
+ description
+ "Transparent bridge interface.";
+ }
+ identity linegroup {
+ base iana-interface-type;
+ description
+ "Interface common to multiple lines.";
+ }
+ identity voiceEMFGD {
+ base iana-interface-type;
+ description
+ "Voice E&M Feature Group D.";
+ }
+ identity voiceFGDEANA {
+ base iana-interface-type;
+ description
+ "Voice FGD Exchange Access North American.";
+ }
+ identity voiceDID {
+ base iana-interface-type;
+ description
+ "Voice Direct Inward Dialing.";
+ }
+ identity mpegTransport {
+ base iana-interface-type;
+ description
+ "MPEG transport interface.";
+ }
+ identity sixToFour {
+ base iana-interface-type;
+ status deprecated;
+ description
+ "6to4 interface (DEPRECATED).";
+ reference
+ "RFC 4087 - IP Tunnel MIB";
+ }
+ identity gtp {
+ base iana-interface-type;
+ description
+ "GTP (GPRS Tunneling Protocol).";
+ }
+ identity pdnEtherLoop1 {
+ base iana-interface-type;
+ description
+ "Paradyne EtherLoop 1.";
+ }
+ identity pdnEtherLoop2 {
+ base iana-interface-type;
+ description
+ "Paradyne EtherLoop 2.";
+ }
+ identity opticalChannelGroup {
+ base iana-interface-type;
+ description
+ "Optical Channel Group.";
+ }
+ identity homepna {
+ base iana-interface-type;
+ description
+ "HomePNA ITU-T G.989.";
+ }
+ identity gfp {
+ base iana-interface-type;
+ description
+ "Generic Framing Procedure (GFP).";
+ }
+ identity ciscoISLvlan {
+ base iana-interface-type;
+ description
+ "Layer 2 Virtual LAN using Cisco ISL.";
+ }
+ identity actelisMetaLOOP {
+ base iana-interface-type;
+ description
+ "Acteleis proprietary MetaLOOP High Speed Link.";
+ }
+ identity fcipLink {
+ base iana-interface-type;
+ description
+ "FCIP Link.";
+ }
+ identity rpr {
+ base iana-interface-type;
+ description
+ "Resilient Packet Ring Interface Type.";
+ }
+ identity qam {
+ base iana-interface-type;
+ description
+ "RF Qam Interface.";
+ }
+ identity lmp {
+ base iana-interface-type;
+ description
+ "Link Management Protocol.";
+ reference
+ "RFC 4327 - Link Management Protocol (LMP) Management
+ Information Base (MIB)";
+ }
+ identity cblVectaStar {
+ base iana-interface-type;
+ description
+ "Cambridge Broadband Networks Limited VectaStar.";
+ }
+ identity docsCableMCmtsDownstream {
+ base iana-interface-type;
+ description
+ "CATV Modular CMTS Downstream Interface.";
+ }
+ identity adsl2 {
+ base iana-interface-type;
+ status deprecated;
+ description
+ "Asymmetric Digital Subscriber Loop Version 2
+ (DEPRECATED/OBSOLETED - please use adsl2plus(238)
+ instead).";
+ reference
+ "RFC 4706 - Definitions of Managed Objects for Asymmetric
+ Digital Subscriber Line 2 (ADSL2)";
+ }
+ identity macSecControlledIF {
+ base iana-interface-type;
+ description
+ "MACSecControlled.";
+ }
+ identity macSecUncontrolledIF {
+ base iana-interface-type;
+ description
+ "MACSecUncontrolled.";
+ }
+ identity aviciOpticalEther {
+ base iana-interface-type;
+ description
+ "Avici Optical Ethernet Aggregate.";
+ }
+ identity atmbond {
+ base iana-interface-type;
+ description
+ "atmbond.";
+ }
+ identity voiceFGDOS {
+ base iana-interface-type;
+ description
+ "Voice FGD Operator Services.";
+ }
+ identity mocaVersion1 {
+ base iana-interface-type;
+ description
+ "MultiMedia over Coax Alliance (MoCA) Interface
+ as documented in information provided privately to IANA.";
+ }
+ identity ieee80216WMAN {
+ base iana-interface-type;
+ description
+ "IEEE 802.16 WMAN interface.";
+ }
+ identity adsl2plus {
+ base iana-interface-type;
+ description
+ "Asymmetric Digital Subscriber Loop Version 2 -
+ Version 2 Plus and all variants.";
+ }
+ identity dvbRcsMacLayer {
+ base iana-interface-type;
+ description
+ "DVB-RCS MAC Layer.";
+ reference
+ "RFC 5728 - The SatLabs Group DVB-RCS MIB";
+ }
+ identity dvbTdm {
+ base iana-interface-type;
+ description
+ "DVB Satellite TDM.";
+ reference
+ "RFC 5728 - The SatLabs Group DVB-RCS MIB";
+ }
+ identity dvbRcsTdma {
+ base iana-interface-type;
+ description
+ "DVB-RCS TDMA.";
+ reference
+ "RFC 5728 - The SatLabs Group DVB-RCS MIB";
+ }
+ identity x86Laps {
+ base iana-interface-type;
+ description
+ "LAPS based on ITU-T X.86/Y.1323.";
+ }
+ identity wwanPP {
+ base iana-interface-type;
+ description
+ "3GPP WWAN.";
+ }
+ identity wwanPP2 {
+ base iana-interface-type;
+ description
+ "3GPP2 WWAN.";
+ }
+ identity voiceEBS {
+ base iana-interface-type;
+ description
+ "Voice P-phone EBS physical interface.";
+ }
+ identity ifPwType {
+ base iana-interface-type;
+ description
+ "Pseudowire interface type.";
+ reference
+ "RFC 5601 - Pseudowire (PW) Management Information Base (MIB)";
+ }
+ identity ilan {
+ base iana-interface-type;
+ description
+ "Internal LAN on a bridge per IEEE 802.1ap.";
+ }
+ identity pip {
+ base iana-interface-type;
+ description
+ "Provider Instance Port on a bridge per IEEE 802.1ah PBB.";
+ }
+ identity aluELP {
+ base iana-interface-type;
+ description
+ "Alcatel-Lucent Ethernet Link Protection.";
+ }
+ identity gpon {
+ base iana-interface-type;
+ description
+ "Gigabit-capable passive optical networks (G-PON) as per
+ ITU-T G.948.";
+ }
+ identity vdsl2 {
+ base iana-interface-type;
+ description
+ "Very high speed digital subscriber line Version 2
+ (as per ITU-T Recommendation G.993.2).";
+ reference
+ "RFC 5650 - Definitions of Managed Objects for Very High
+ Speed Digital Subscriber Line 2 (VDSL2)";
+ }
+ identity capwapDot11Profile {
+ base iana-interface-type;
+ description
+ "WLAN Profile Interface.";
+ reference
+ "RFC 5834 - Control and Provisioning of Wireless Access
+ Points (CAPWAP) Protocol Binding MIB for
+ IEEE 802.11";
+ }
+ identity capwapDot11Bss {
+ base iana-interface-type;
+ description
+ "WLAN BSS Interface.";
+ reference
+ "RFC 5834 - Control and Provisioning of Wireless Access
+ Points (CAPWAP) Protocol Binding MIB for
+ IEEE 802.11";
+ }
+ identity capwapWtpVirtualRadio {
+ base iana-interface-type;
+ description
+ "WTP Virtual Radio Interface.";
+ reference
+ "RFC 5833 - Control and Provisioning of Wireless Access
+ Points (CAPWAP) Protocol Base MIB";
+ }
+ identity bits {
+ base iana-interface-type;
+ description
+ "bitsport.";
+ }
+ identity docsCableUpstreamRfPort {
+ base iana-interface-type;
+ description
+ "DOCSIS CATV Upstream RF Port.";
+ }
+ identity cableDownstreamRfPort {
+ base iana-interface-type;
+ description
+ "CATV downstream RF Port.";
+ }
+ identity vmwareVirtualNic {
+ base iana-interface-type;
+ description
+ "VMware Virtual Network Interface.";
+ }
+ identity ieee802154 {
+ base iana-interface-type;
+ description
+ "IEEE 802.15.4 WPAN interface.";
+ reference
+ "IEEE 802.15.4-2006";
+ }
+ identity otnOdu {
+ base iana-interface-type;
+ description
+ "OTN Optical Data Unit.";
+ }
+ identity otnOtu {
+ base iana-interface-type;
+ description
+ "OTN Optical channel Transport Unit.";
+ }
+ identity ifVfiType {
+ base iana-interface-type;
+ description
+ "VPLS Forwarding Instance Interface Type.";
+ }
+ identity g9981 {
+ base iana-interface-type;
+ description
+ "G.998.1 bonded interface.";
+ }
+ identity g9982 {
+ base iana-interface-type;
+ description
+ "G.998.2 bonded interface.";
+ }
+ identity g9983 {
+ base iana-interface-type;
+ description
+ "G.998.3 bonded interface.";
+ }
+ identity aluEpon {
+ base iana-interface-type;
+ description
+ "Ethernet Passive Optical Networks (E-PON).";
+ }
+ identity aluEponOnu {
+ base iana-interface-type;
+ description
+ "EPON Optical Network Unit.";
+ }
+ identity aluEponPhysicalUni {
+ base iana-interface-type;
+ description
+ "EPON physical User to Network interface.";
+ }
+ identity aluEponLogicalLink {
+ base iana-interface-type;
+ description
+ "The emulation of a point-to-point link over the EPON
+ layer.";
+ }
+ identity aluGponOnu {
+ base iana-interface-type;
+ description
+ "GPON Optical Network Unit.";
+ reference
+ "ITU-T G.984.2";
+ }
+ identity aluGponPhysicalUni {
+ base iana-interface-type;
+ description
+ "GPON physical User to Network interface.";
+ reference
+ "ITU-T G.984.2";
+ }
+ identity vmwareNicTeam {
+ base iana-interface-type;
+ description
+ "VMware NIC Team.";
+ }
+ }
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/ieee-types.yang b/drivers/microsemi/ea1000yang/src/main/yang/ieee-types.yang
new file mode 100644
index 0000000..5ff5c1d
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/ieee-types.yang
@@ -0,0 +1,79 @@
+ module ieee-types {
+
+ // XXX namespace to be allocated by IANA
+
+ namespace "urn:ietf:params:xml:ns:yang:ieee-types";
+ prefix "ieee";
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+
+ organization
+ "YANG Language Design Team";
+
+ contact
+ "Juergen Schoenwaelder (Editor)
+ <j.schoenwaelder@jacobs-university.de>";
+
+ description
+ "This module contains standard derived YANG types
+ for IEEE 802 addresses and related things.";
+
+ revision 2008-05-22 {
+ description "Initial revision.";
+ }
+
+ /*
+ * collection of IEEE address type definitions
+ */
+
+ typedef mac-address {
+ type yang:phys-address {
+ pattern '([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}';
+ }
+ description
+ "The mac-address type represents an 802 MAC address
+ represented in the `canonical' order defined by
+ IEEE 802.1a, i.e., as if it were transmitted least
+ significant bit first, even though 802.5 (in contrast
+ to other 802.x protocols) requires MAC addresses to
+ be transmitted most significant bit first.";
+ reference
+ "RFC 2579 STD 58";
+ }
+
+ /*
+ * collection of IEEE 802 related identifier types
+ */
+
+ typedef bridgeid {
+ type string {
+ pattern '[0-9a-fA-F]{4}:'
+ + '([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}';
+ }
+ description
+ "The bridgeid type represents identifers that uniquely
+ identify a bridge. Its first four hexadecimal digits
+ contain a priority value followed by a colon. The
+ remaining characters contain the MAC address used to
+ refer to a bridge in a unique fashion (typically, the
+ numerically smallest MAC address of all ports on the
+ bridge).";
+ reference
+ "RFC 4188";
+ }
+
+ typedef vlanid {
+ type uint16 {
+ range "1..4094";
+ }
+ description
+ "The vlanid type uniquely identifies a VLAN. This is
+ the 12-bit VLAN-ID used in the VLAN Tag header. The
+ range is defined by the referenced specification.";
+ reference
+ "IEEE Std 802.1Q 2003 Edition, Virtual Bridged Local
+ Area Networks.";
+ }
+ }
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/ietf-inet-types.yang b/drivers/microsemi/ea1000yang/src/main/yang/ietf-inet-types.yang
new file mode 100644
index 0000000..5388b03
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/ietf-inet-types.yang
@@ -0,0 +1,461 @@
+module ietf-inet-types {
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types";
+ prefix "inet";
+
+ organization
+ "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/netmod/>
+ WG List: <mailto:netmod@ietf.org>
+
+ WG Chair: David Kessens
+ <mailto:david.kessens@nsn.com>
+
+ WG Chair: Juergen Schoenwaelder
+ <mailto:j.schoenwaelder@jacobs-university.de>
+
+ Editor: Juergen Schoenwaelder
+ <mailto:j.schoenwaelder@jacobs-university.de>";
+
+ description
+ "This module contains a collection of generally useful derived
+ YANG data types for Internet addresses and related things.
+
+ Copyright (c) 2013 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC 6991; see
+ the RFC itself for full legal notices.";
+
+ revision 2013-07-15 {
+ description
+ "This revision adds the following new data types:
+ - ip-address-no-zone
+ - ipv4-address-no-zone
+ - ipv6-address-no-zone";
+ reference
+ "RFC 6991: Common YANG Data Types";
+ }
+
+ revision 2010-09-24 {
+ description
+ "Initial revision.";
+ reference
+ "RFC 6021: Common YANG Data Types";
+ }
+
+ /*** collection of types related to protocol fields ***/
+
+ typedef ip-version {
+ type enumeration {
+ enum unknown {
+ value "0";
+ description
+ "An unknown or unspecified version of the Internet
+ protocol.";
+ }
+ enum ipv4 {
+ value "1";
+ description
+ "The IPv4 protocol as defined in RFC 791.";
+ }
+ enum ipv6 {
+ value "2";
+ description
+ "The IPv6 protocol as defined in RFC 2460.";
+ }
+ }
+ description
+ "This value represents the version of the IP protocol.
+
+ In the value set and its semantics, this type is equivalent
+ to the InetVersion textual convention of the SMIv2.";
+ reference
+ "RFC 791: Internet Protocol
+ RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
+ RFC 4001: Textual Conventions for Internet Network Addresses";
+ }
+
+ typedef dscp {
+ type uint8 {
+ range "0..63";
+ }
+ description
+ "The dscp type represents a Differentiated Services Code Point
+ that may be used for marking packets in a traffic stream.
+ In the value set and its semantics, this type is equivalent
+ to the Dscp textual convention of the SMIv2.";
+ reference
+ "RFC 3289: Management Information Base for the Differentiated
+ Services Architecture
+ RFC 2474: Definition of the Differentiated Services Field
+ (DS Field) in the IPv4 and IPv6 Headers
+ RFC 2780: IANA Allocation Guidelines For Values In
+ the Internet Protocol and Related Headers";
+ }
+
+ typedef ipv6-flow-label {
+ type uint32 {
+ range "0..1048575";
+ }
+ description
+ "The ipv6-flow-label type represents the flow identifier or Flow
+ Label in an IPv6 packet header that may be used to
+ discriminate traffic flows.
+
+ In the value set and its semantics, this type is equivalent
+ to the IPv6FlowLabel textual convention of the SMIv2.";
+ reference
+ "RFC 3595: Textual Conventions for IPv6 Flow Label
+ RFC 2460: Internet Protocol, Version 6 (IPv6) Specification";
+ }
+
+ typedef port-number {
+ type uint16 {
+ range "0..65535";
+ }
+ description
+ "The port-number type represents a 16-bit port number of an
+ Internet transport-layer protocol such as UDP, TCP, DCCP, or
+ SCTP. Port numbers are assigned by IANA. A current list of
+ all assignments is available from <http://www.iana.org/>.
+
+ Note that the port number value zero is reserved by IANA. In
+ situations where the value zero does not make sense, it can
+ be excluded by subtyping the port-number type.
+ In the value set and its semantics, this type is equivalent
+ to the InetPortNumber textual convention of the SMIv2.";
+ reference
+ "RFC 768: User Datagram Protocol
+ RFC 793: Transmission Control Protocol
+ RFC 4960: Stream Control Transmission Protocol
+ RFC 4340: Datagram Congestion Control Protocol (DCCP)
+ RFC 4001: Textual Conventions for Internet Network Addresses";
+ }
+
+ /*** collection of types related to autonomous systems ***/
+
+ typedef as-number {
+ type uint32;
+ description
+ "The as-number type represents autonomous system numbers
+ which identify an Autonomous System (AS). An AS is a set
+ of routers under a single technical administration, using
+ an interior gateway protocol and common metrics to route
+ packets within the AS, and using an exterior gateway
+ protocol to route packets to other ASes. IANA maintains
+ the AS number space and has delegated large parts to the
+ regional registries.
+
+ Autonomous system numbers were originally limited to 16
+ bits. BGP extensions have enlarged the autonomous system
+ number space to 32 bits. This type therefore uses an uint32
+ base type without a range restriction in order to support
+ a larger autonomous system number space.
+
+ In the value set and its semantics, this type is equivalent
+ to the InetAutonomousSystemNumber textual convention of
+ the SMIv2.";
+ reference
+ "RFC 1930: Guidelines for creation, selection, and registration
+ of an Autonomous System (AS)
+ RFC 4271: A Border Gateway Protocol 4 (BGP-4)
+ RFC 4001: Textual Conventions for Internet Network Addresses
+ RFC 6793: BGP Support for Four-Octet Autonomous System (AS)
+ Number Space";
+ }
+
+ /*** collection of types related to IP addresses and hostnames ***/
+
+ typedef ip-address {
+ type union {
+ type inet:ipv4-address;
+ type inet:ipv6-address;
+ }
+ description
+ "The ip-address type represents an IP address and is IP
+ version neutral. The format of the textual representation
+ implies the IP version. This type supports scoped addresses
+ by allowing zone identifiers in the address format.";
+ reference
+ "RFC 4007: IPv6 Scoped Address Architecture";
+ }
+
+ typedef ipv4-address {
+ type string {
+ pattern
+ '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+ + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+ + '(%[\p{N}\p{L}]+)?';
+ }
+ description
+ "The ipv4-address type represents an IPv4 address in
+ dotted-quad notation. The IPv4 address may include a zone
+ index, separated by a % sign.
+
+ The zone index is used to disambiguate identical address
+ values. For link-local addresses, the zone index will
+ typically be the interface index number or the name of an
+ interface. If the zone index is not present, the default
+ zone of the device will be used.
+
+ The canonical format for the zone index is the numerical
+ format";
+ }
+
+ typedef ipv6-address {
+ type string {
+ pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
+ + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
+ + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
+ + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
+ + '(%[\p{N}\p{L}]+)?';
+ pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+ + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
+ + '(%.+)?';
+ }
+ description
+ "The ipv6-address type represents an IPv6 address in full,
+ mixed, shortened, and shortened-mixed notation. The IPv6
+ address may include a zone index, separated by a % sign.
+
+ The zone index is used to disambiguate identical address
+ values. For link-local addresses, the zone index will
+ typically be the interface index number or the name of an
+ interface. If the zone index is not present, the default
+ zone of the device will be used.
+
+
+
+ The canonical format of IPv6 addresses uses the textual
+ representation defined in Section 4 of RFC 5952. The
+ canonical format for the zone index is the numerical
+ format as described in Section 11.2 of RFC 4007.";
+ reference
+ "RFC 4291: IP Version 6 Addressing Architecture
+ RFC 4007: IPv6 Scoped Address Architecture
+ RFC 5952: A Recommendation for IPv6 Address Text
+ Representation";
+ }
+
+ typedef ip-address-no-zone {
+ type union {
+ type inet:ipv4-address-no-zone;
+ type inet:ipv6-address-no-zone;
+ }
+ description
+ "The ip-address-no-zone type represents an IP address and is
+ IP version neutral. The format of the textual representation
+ implies the IP version. This type does not support scoped
+ addresses since it does not allow zone identifiers in the
+ address format.";
+ reference
+ "RFC 4007: IPv6 Scoped Address Architecture";
+ }
+
+ typedef ipv4-address-no-zone {
+ type inet:ipv4-address {
+ pattern '[0-9\.]*';
+ }
+ description
+ "An IPv4 address without a zone index. This type, derived from
+ ipv4-address, may be used in situations where the zone is
+ known from the context and hence no zone index is needed.";
+ }
+
+ typedef ipv6-address-no-zone {
+ type inet:ipv6-address {
+ pattern '[0-9a-fA-F:\.]*';
+ }
+ description
+ "An IPv6 address without a zone index. This type, derived from
+ ipv6-address, may be used in situations where the zone is
+ known from the context and hence no zone index is needed.";
+ reference
+ "RFC 4291: IP Version 6 Addressing Architecture
+ RFC 4007: IPv6 Scoped Address Architecture
+ RFC 5952: A Recommendation for IPv6 Address Text
+ Representation";
+ }
+
+ typedef ip-prefix {
+ type union {
+ type inet:ipv4-prefix;
+ type inet:ipv6-prefix;
+ }
+ description
+ "The ip-prefix type represents an IP prefix and is IP
+ version neutral. The format of the textual representations
+ implies the IP version.";
+ }
+
+ typedef ipv4-prefix {
+ type string {
+ pattern
+ '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+ + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+ + '/(([0-9])|([1-2][0-9])|(3[0-2]))';
+ }
+ description
+ "The ipv4-prefix type represents an IPv4 address prefix.
+ The prefix length is given by the number following the
+ slash character and must be less than or equal to 32.
+
+ A prefix length value of n corresponds to an IP address
+ mask that has n contiguous 1-bits from the most
+ significant bit (MSB) and all other bits set to 0.
+
+ The canonical format of an IPv4 prefix has all bits of
+ the IPv4 address set to zero that are not part of the
+ IPv4 prefix.";
+ }
+
+ typedef ipv6-prefix {
+ type string {
+ pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
+ + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
+ + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
+ + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
+ + '(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))';
+ pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+ + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
+ + '(/.+)';
+ }
+
+
+ description
+ "The ipv6-prefix type represents an IPv6 address prefix.
+ The prefix length is given by the number following the
+ slash character and must be less than or equal to 128.
+
+ A prefix length value of n corresponds to an IP address
+ mask that has n contiguous 1-bits from the most
+ significant bit (MSB) and all other bits set to 0.
+
+ The IPv6 address should have all bits that do not belong
+ to the prefix set to zero.
+
+ The canonical format of an IPv6 prefix has all bits of
+ the IPv6 address set to zero that are not part of the
+ IPv6 prefix. Furthermore, the IPv6 address is represented
+ as defined in Section 4 of RFC 5952.";
+ reference
+ "RFC 5952: A Recommendation for IPv6 Address Text
+ Representation";
+ }
+
+ /*** collection of domain name and URI types ***/
+
+ typedef domain-name {
+ type string {
+ pattern
+ '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*'
+ + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)'
+ + '|\.';
+ length "1..253";
+ }
+ description
+ "The domain-name type represents a DNS domain name. The
+ name SHOULD be fully qualified whenever possible.
+
+ Internet domain names are only loosely specified. Section
+ 3.5 of RFC 1034 recommends a syntax (modified in Section
+ 2.1 of RFC 1123). The pattern above is intended to allow
+ for current practice in domain name use, and some possible
+ future expansion. It is designed to hold various types of
+ domain names, including names used for A or AAAA records
+ (host names) and other records, such as SRV records. Note
+ that Internet host names have a stricter syntax (described
+ in RFC 952) than the DNS recommendations in RFCs 1034 and
+ 1123, and that systems that want to store host names in
+ schema nodes using the domain-name type are recommended to
+ adhere to this stricter standard to ensure interoperability.
+
+ The encoding of DNS names in the DNS protocol is limited
+ to 255 characters. Since the encoding consists of labels
+ prefixed by a length bytes and there is a trailing NULL
+ byte, only 253 characters can appear in the textual dotted
+ notation.
+
+ The description clause of schema nodes using the domain-name
+ type MUST describe when and how these names are resolved to
+ IP addresses. Note that the resolution of a domain-name value
+ may require to query multiple DNS records (e.g., A for IPv4
+ and AAAA for IPv6). The order of the resolution process and
+ which DNS record takes precedence can either be defined
+ explicitly or may depend on the configuration of the
+ resolver.
+
+ Domain-name values use the US-ASCII encoding. Their canonical
+ format uses lowercase US-ASCII characters. Internationalized
+ domain names MUST be A-labels as per RFC 5890.";
+ reference
+ "RFC 952: DoD Internet Host Table Specification
+ RFC 1034: Domain Names - Concepts and Facilities
+ RFC 1123: Requirements for Internet Hosts -- Application
+ and Support
+ RFC 2782: A DNS RR for specifying the location of services
+ (DNS SRV)
+ RFC 5890: Internationalized Domain Names in Applications
+ (IDNA): Definitions and Document Framework";
+ }
+
+ typedef host {
+ type union {
+ type inet:ip-address;
+ type inet:domain-name;
+ }
+ description
+ "The host type represents either an IP address or a DNS
+ domain name.";
+ }
+
+ typedef uri {
+ type string;
+ description
+ "The uri type represents a Uniform Resource Identifier
+ (URI) as defined by STD 66.
+
+ Objects using the uri type MUST be in US-ASCII encoding,
+ and MUST be normalized as described by RFC 3986 Sections
+ 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary
+ percent-encoding is removed, and all case-insensitive
+ characters are set to lowercase except for hexadecimal
+ digits, which are normalized to uppercase as described in
+ Section 6.2.2.1.
+
+ The purpose of this normalization is to help provide
+ unique URIs. Note that this normalization is not
+ sufficient to provide uniqueness. Two URIs that are
+ textually distinct after this normalization may still be
+ equivalent.
+
+ Objects using the uri type may restrict the schemes that
+ they permit. For example, 'data:' and 'urn:' schemes
+ might not be appropriate.
+
+ A zero-length URI is not a valid URI. This can be used to
+ express 'URI absent' where required.
+
+ In the value set and its semantics, this type is equivalent
+ to the Uri SMIv2 textual convention defined in RFC 5017.";
+ reference
+ "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
+ RFC 3305: Report from the Joint W3C/IETF URI Planning Interest
+ Group: Uniform Resource Identifiers (URIs), URLs,
+ and Uniform Resource Names (URNs): Clarifications
+ and Recommendations
+ RFC 5017: MIB Textual Conventions for Uniform Resource
+ Identifiers (URIs)";
+ }
+
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/ietf-interfaces.yang b/drivers/microsemi/ea1000yang/src/main/yang/ietf-interfaces.yang
new file mode 100644
index 0000000..b18d5d3
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/ietf-interfaces.yang
@@ -0,0 +1,731 @@
+module ietf-interfaces {
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces";
+ prefix if;
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+
+ organization
+ "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/netmod/>
+ WG List: <mailto:netmod@ietf.org>
+
+ WG Chair: Thomas Nadeau
+ <mailto:tnadeau@lucidvision.com>
+
+ WG Chair: Juergen Schoenwaelder
+ <mailto:j.schoenwaelder@jacobs-university.de>
+
+ Editor: Martin Bjorklund
+ <mailto:mbj@tail-f.com>";
+
+ description
+ "This module contains a collection of YANG definitions for
+ managing network interfaces.
+
+ Copyright (c) 2014 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC 7223; see
+ the RFC itself for full legal notices.";
+
+ revision 2014-05-08 {
+ description
+ "Initial revision.";
+ reference
+ "RFC 7223: A YANG Data Model for Interface Management";
+ }
+
+ /*
+ * Typedefs
+ */
+
+ typedef interface-ref {
+ type leafref {
+ path "/if:interfaces/if:interface/if:name";
+ }
+ description
+ "This type is used by data models that need to reference
+ configured interfaces.";
+ }
+
+ typedef interface-state-ref {
+ type leafref {
+ path "/if:interfaces-state/if:interface/if:name";
+ }
+ description
+ "This type is used by data models that need to reference
+ the operationally present interfaces.";
+ }
+
+ /*
+ * Identities
+ */
+
+ identity interface-type {
+ description
+ "Base identity from which specific interface types are
+ derived.";
+ }
+
+ /*
+ * Features
+ */
+
+ feature arbitrary-names {
+ description
+ "This feature indicates that the device allows user-controlled
+ interfaces to be named arbitrarily.";
+ }
+ feature pre-provisioning {
+ description
+ "This feature indicates that the device supports
+ pre-provisioning of interface configuration, i.e., it is
+ possible to configure an interface whose physical interface
+ hardware is not present on the device.";
+ }
+
+ feature if-mib {
+ description
+ "This feature indicates that the device implements
+ the IF-MIB.";
+ reference
+ "RFC 2863: The Interfaces Group MIB";
+ }
+
+ /*
+ * Configuration data nodes
+ */
+
+ container interfaces {
+ description
+ "Interface configuration parameters.";
+
+ list interface {
+ key "name";
+
+ description
+ "The list of configured interfaces on the device.
+
+ The operational state of an interface is available in the
+ /interfaces-state/interface list. If the configuration of a
+ system-controlled interface cannot be used by the system
+ (e.g., the interface hardware present does not match the
+ interface type), then the configuration is not applied to
+ the system-controlled interface shown in the
+ /interfaces-state/interface list. If the configuration
+ of a user-controlled interface cannot be used by the system,
+ the configured interface is not instantiated in the
+ /interfaces-state/interface list.";
+
+ leaf name {
+ type yang:yang-identifier;
+
+ must ".='eth0' or .='eth1' or .='lo'" {
+ error-app-tag "if-must-1";
+ error-message "Interface name must only be eth0, eth1 or lo";
+ }
+
+ description
+ "The name of the interface.
+
+ A device MAY restrict the allowed values for this leaf,
+ possibly depending on the type of the interface.
+ For system-controlled interfaces, this leaf is the
+ device-specific name of the interface. The 'config false'
+ list /interfaces-state/interface contains the currently
+ existing interfaces on the device.
+
+ If a client tries to create configuration for a
+ system-controlled interface that is not present in the
+ /interfaces-state/interface list, the server MAY reject
+ the request if the implementation does not support
+ pre-provisioning of interfaces or if the name refers to
+ an interface that can never exist in the system. A
+ NETCONF server MUST reply with an rpc-error with the
+ error-tag 'invalid-value' in this case.
+
+ If the device supports pre-provisioning of interface
+ configuration, the 'pre-provisioning' feature is
+ advertised.
+
+ If the device allows arbitrarily named user-controlled
+ interfaces, the 'arbitrary-names' feature is advertised.
+
+ When a configured user-controlled interface is created by
+ the system, it is instantiated with the same name in the
+ /interface-state/interface list.";
+ }
+
+ leaf description {
+ type string;
+ description
+ "A textual description of the interface.
+
+ A server implementation MAY map this leaf to the ifAlias
+ MIB object. Such an implementation needs to use some
+ mechanism to handle the differences in size and characters
+ allowed between this leaf and ifAlias. The definition of
+ such a mechanism is outside the scope of this document.
+
+ Since ifAlias is defined to be stored in non-volatile
+ storage, the MIB implementation MUST map ifAlias to the
+ value of 'description' in the persistently stored
+ datastore.
+
+ Specifically, if the device supports ':startup', when
+ ifAlias is read the device MUST return the value of
+ 'description' in the 'startup' datastore, and when it is
+ written, it MUST be written to the 'running' and 'startup'
+ datastores. Note that it is up to the implementation to
+
+ decide whether to modify this single leaf in 'startup' or
+ perform an implicit copy-config from 'running' to
+ 'startup'.
+
+ If the device does not support ':startup', ifAlias MUST
+ be mapped to the 'description' leaf in the 'running'
+ datastore.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifAlias";
+ }
+
+ leaf type {
+ type identityref {
+ base interface-type;
+ }
+ mandatory true;
+ description
+ "The type of the interface.
+
+ When an interface entry is created, a server MAY
+ initialize the type leaf with a valid value, e.g., if it
+ is possible to derive the type from the name of the
+ interface.
+
+ If a client tries to set the type of an interface to a
+ value that can never be used by the system, e.g., if the
+ type is not supported or if the type does not match the
+ name of the interface, the server MUST reject the request.
+ A NETCONF server MUST reply with an rpc-error with the
+ error-tag 'invalid-value' in this case.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifType";
+ }
+
+// leaf enabled { //Removed as per EAG-32 we never want to disable the whole interface
+// type boolean;
+// default "true";
+// description
+// "This leaf contains the configured, desired state of the
+// interface.
+//
+// Systems that implement the IF-MIB use the value of this
+// leaf in the 'running' datastore to set
+// IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry
+// has been initialized, as described in RFC 2863.
+//
+//
+//
+// Changes in this leaf in the 'running' datastore are
+// reflected in ifAdminStatus, but if ifAdminStatus is
+// changed over SNMP, this leaf is not affected.";
+// reference
+// "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
+// }
+
+ leaf link-up-down-trap-enable {
+ if-feature if-mib;
+ type enumeration {
+ enum enabled {
+ value 1;
+ }
+ enum disabled {
+ value 2;
+ }
+ }
+ description
+ "Controls whether linkUp/linkDown SNMP notifications
+ should be generated for this interface.
+
+ If this node is not configured, the value 'enabled' is
+ operationally used by the server for interfaces that do
+ not operate on top of any other interface (i.e., there are
+ no 'lower-layer-if' entries), and 'disabled' otherwise.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifLinkUpDownTrapEnable";
+ }
+ }
+ }
+
+ /*
+ * Operational state data nodes
+ */
+
+ container interfaces-state {
+ config false;
+ description
+ "Data nodes for the operational state of interfaces.";
+
+ list interface {
+ key "name";
+
+
+
+
+
+ description
+ "The list of interfaces on the device.
+
+ System-controlled interfaces created by the system are
+ always present in this list, whether they are configured or
+ not.";
+
+ leaf name {
+ type string;
+ description
+ "The name of the interface.
+
+ A server implementation MAY map this leaf to the ifName
+ MIB object. Such an implementation needs to use some
+ mechanism to handle the differences in size and characters
+ allowed between this leaf and ifName. The definition of
+ such a mechanism is outside the scope of this document.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifName";
+ }
+
+ leaf type {
+ type identityref {
+ base interface-type;
+ }
+ mandatory true;
+ description
+ "The type of the interface.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifType";
+ }
+
+ leaf admin-status {
+ if-feature if-mib;
+ type enumeration {
+ enum up {
+ value 1;
+ description
+ "Ready to pass packets.";
+ }
+ enum down {
+ value 2;
+ description
+ "Not ready to pass packets and not in some test mode.";
+ }
+
+
+
+ enum testing {
+ value 3;
+ description
+ "In some test mode.";
+ }
+ }
+ mandatory true;
+ description
+ "The desired state of the interface.
+
+ This leaf has the same read semantics as ifAdminStatus.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
+ }
+
+ leaf oper-status {
+ type enumeration {
+ enum up {
+ value 1;
+ description
+ "Ready to pass packets.";
+ }
+ enum down {
+ value 2;
+ description
+ "The interface does not pass any packets.";
+ }
+ enum testing {
+ value 3;
+ description
+ "In some test mode. No operational packets can
+ be passed.";
+ }
+ enum unknown {
+ value 4;
+ description
+ "Status cannot be determined for some reason.";
+ }
+ enum dormant {
+ value 5;
+ description
+ "Waiting for some external event.";
+ }
+ enum not-present {
+ value 6;
+ description
+ "Some component (typically hardware) is missing.";
+ }
+ enum lower-layer-down {
+ value 7;
+ description
+ "Down due to state of lower-layer interface(s).";
+ }
+ }
+ mandatory true;
+ description
+ "The current operational state of the interface.
+
+ This leaf has the same semantics as ifOperStatus.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifOperStatus";
+ }
+
+ leaf last-change {
+ type yang:date-and-time;
+ description
+ "The time the interface entered its current operational
+ state. If the current state was entered prior to the
+ last re-initialization of the local network management
+ subsystem, then this node is not present.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifLastChange";
+ }
+
+ leaf if-index {
+ if-feature if-mib;
+ type int32 {
+ range "1..2147483647";
+ }
+ mandatory true;
+ description
+ "The ifIndex value for the ifEntry represented by this
+ interface.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifIndex";
+ }
+
+ leaf phys-address {
+ type yang:phys-address;
+ description
+ "The interface's address at its protocol sub-layer. For
+ example, for an 802.x interface, this object normally
+ contains a Media Access Control (MAC) address. The
+ interface's media-specific modules must define the bit
+
+
+ and byte ordering and the format of the value of this
+ object. For interfaces that do not have such an address
+ (e.g., a serial line), this node is not present.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifPhysAddress";
+ }
+
+ leaf-list higher-layer-if {
+ type interface-state-ref;
+ description
+ "A list of references to interfaces layered on top of this
+ interface.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifStackTable";
+ }
+
+ leaf-list lower-layer-if {
+ type interface-state-ref;
+ description
+ "A list of references to interfaces layered underneath this
+ interface.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifStackTable";
+ }
+
+ leaf speed {
+ type yang:gauge64;
+ units "bits/second";
+ description
+ "An estimate of the interface's current bandwidth in bits
+ per second. For interfaces that do not vary in
+ bandwidth or for those where no accurate estimation can
+ be made, this node should contain the nominal bandwidth.
+ For interfaces that have no concept of bandwidth, this
+ node is not present.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifSpeed, ifHighSpeed";
+ }
+
+
+
+
+
+
+
+
+
+ container statistics {
+ description
+ "A collection of interface-related statistics objects.";
+
+ leaf discontinuity-time {
+ type yang:date-and-time;
+ mandatory true;
+ description
+ "The time on the most recent occasion at which any one or
+ more of this interface's counters suffered a
+ discontinuity. If no such discontinuities have occurred
+ since the last re-initialization of the local management
+ subsystem, then this node contains the time the local
+ management subsystem re-initialized itself.";
+ }
+
+ leaf in-octets {
+ type yang:counter64;
+ description
+ "The total number of octets received on the interface,
+ including framing characters.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCInOctets";
+ }
+
+ leaf in-unicast-pkts {
+ type yang:counter64;
+ description
+ "The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, that were not addressed to a
+ multicast or broadcast address at this sub-layer.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts";
+ }
+
+
+
+
+ leaf in-broadcast-pkts {
+ type yang:counter64;
+ description
+ "The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, that were addressed to a broadcast
+ address at this sub-layer.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCInBroadcastPkts";
+ }
+
+ leaf in-multicast-pkts {
+ type yang:counter64;
+ description
+ "The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, that were addressed to a multicast
+ address at this sub-layer. For a MAC-layer protocol,
+ this includes both Group and Functional addresses.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCInMulticastPkts";
+ }
+
+ leaf in-discards {
+ type yang:counter32;
+ description
+ "The number of inbound packets that were chosen to be
+ discarded even though no errors had been detected to
+ prevent their being deliverable to a higher-layer
+ protocol. One possible reason for discarding such a
+ packet could be to free up buffer space.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+
+
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifInDiscards";
+ }
+
+ leaf in-errors {
+ type yang:counter32;
+ description
+ "For packet-oriented interfaces, the number of inbound
+ packets that contained errors preventing them from being
+ deliverable to a higher-layer protocol. For character-
+ oriented or fixed-length interfaces, the number of
+ inbound transmission units that contained errors
+ preventing them from being deliverable to a higher-layer
+ protocol.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifInErrors";
+ }
+
+ leaf in-unknown-protos {
+ type yang:counter32;
+ description
+ "For packet-oriented interfaces, the number of packets
+ received via the interface that were discarded because
+ of an unknown or unsupported protocol. For
+ character-oriented or fixed-length interfaces that
+ support protocol multiplexing, the number of
+ transmission units received via the interface that were
+ discarded because of an unknown or unsupported protocol.
+ For any interface that does not support protocol
+ multiplexing, this counter is not present.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos";
+ }
+
+
+
+
+
+ leaf out-octets {
+ type yang:counter64;
+ description
+ "The total number of octets transmitted out of the
+ interface, including framing characters.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCOutOctets";
+ }
+
+ leaf out-unicast-pkts {
+ type yang:counter64;
+ description
+ "The total number of packets that higher-level protocols
+ requested be transmitted, and that were not addressed
+ to a multicast or broadcast address at this sub-layer,
+ including those that were discarded or not sent.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts";
+ }
+
+ leaf out-broadcast-pkts {
+ type yang:counter64;
+ description
+ "The total number of packets that higher-level protocols
+ requested be transmitted, and that were addressed to a
+ broadcast address at this sub-layer, including those
+ that were discarded or not sent.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCOutBroadcastPkts";
+ }
+
+
+ leaf out-multicast-pkts {
+ type yang:counter64;
+ description
+ "The total number of packets that higher-level protocols
+ requested be transmitted, and that were addressed to a
+ multicast address at this sub-layer, including those
+ that were discarded or not sent. For a MAC-layer
+ protocol, this includes both Group and Functional
+ addresses.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB -
+ ifHCOutMulticastPkts";
+ }
+
+ leaf out-discards {
+ type yang:counter32;
+ description
+ "The number of outbound packets that were chosen to be
+ discarded even though no errors had been detected to
+ prevent their being transmitted. One possible reason
+ for discarding such a packet could be to free up buffer
+ space.
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifOutDiscards";
+ }
+
+ leaf out-errors {
+ type yang:counter32;
+ description
+ "For packet-oriented interfaces, the number of outbound
+ packets that could not be transmitted because of errors.
+ For character-oriented or fixed-length interfaces, the
+ number of outbound transmission units that could not be
+ transmitted because of errors.
+
+
+
+
+ Discontinuities in the value of this counter can occur
+ at re-initialization of the management system, and at
+ other times as indicated by the value of
+ 'discontinuity-time'.";
+ reference
+ "RFC 2863: The Interfaces Group MIB - ifOutErrors";
+ }
+ }
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf-acm.yang b/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf-acm.yang
new file mode 100644
index 0000000..f0c6fe3
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf-acm.yang
@@ -0,0 +1,449 @@
+module ietf-netconf-acm {
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-acm";
+
+ prefix "nacm";
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+
+ organization
+ "IETF NETCONF (Network Configuration) Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ WG Chair: Mehmet Ersue
+ <mailto:mehmet.ersue@nsn.com>
+
+ WG Chair: Bert Wijnen
+ <mailto:bertietf@bwijnen.net>
+
+ Editor: Andy Bierman
+ <mailto:andy@yumaworks.com>
+
+ Editor: Martin Bjorklund
+ <mailto:mbj@tail-f.com>";
+
+ description
+ "NETCONF Access Control Model.
+
+ Copyright (c) 2012 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD
+ License set forth in Section 4.c of the IETF Trust's
+ Legal Provisions Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC 6536; see
+ the RFC itself for full legal notices.";
+
+ revision "2012-02-22" {
+ description
+ "Initial version";
+ reference
+ "RFC 6536: Network Configuration Protocol (NETCONF)
+ Access Control Model";
+ }
+
+ /*
+ * Extension statements
+ */
+
+ extension default-deny-write {
+ description
+ "Used to indicate that the data model node
+ represents a sensitive security system parameter.
+
+ If present, and the NACM module is enabled (i.e.,
+ /nacm/enable-nacm object equals 'true'), the NETCONF server
+ will only allow the designated 'recovery session' to have
+ write access to the node. An explicit access control rule is
+ required for all other users.
+
+ The 'default-deny-write' extension MAY appear within a data
+ definition statement. It is ignored otherwise.";
+ }
+
+ extension default-deny-all {
+ description
+ "Used to indicate that the data model node
+ controls a very sensitive security system parameter.
+
+ If present, and the NACM module is enabled (i.e.,
+ /nacm/enable-nacm object equals 'true'), the NETCONF server
+ will only allow the designated 'recovery session' to have
+ read, write, or execute access to the node. An explicit
+ access control rule is required for all other users.
+
+ The 'default-deny-all' extension MAY appear within a data
+ definition statement, 'rpc' statement, or 'notification'
+ statement. It is ignored otherwise.";
+ }
+
+ /*
+ * Derived types
+ */
+
+ typedef user-name-type {
+ type string {
+ length "1..max";
+ }
+ description
+ "General Purpose Username string.";
+ }
+
+ typedef matchall-string-type {
+ type string {
+ pattern "\*";
+ }
+ description
+ "The string containing a single asterisk '*' is used
+ to conceptually represent all possible values
+ for the particular leaf using this data type.";
+ }
+
+ typedef access-operations-type {
+ type bits {
+ bit create {
+ description
+ "Any protocol operation that creates a
+ new data node.";
+ }
+ bit read {
+ description
+ "Any protocol operation or notification that
+ returns the value of a data node.";
+ }
+ bit update {
+ description
+ "Any protocol operation that alters an existing
+ data node.";
+ }
+ bit delete {
+ description
+ "Any protocol operation that removes a data node.";
+ }
+ bit exec {
+ description
+ "Execution access to the specified protocol operation.";
+ }
+ }
+ description
+ "NETCONF Access Operation.";
+ }
+
+ typedef group-name-type {
+ type string {
+ length "1..max";
+ pattern "[^\*].*";
+ }
+ description
+ "Name of administrative group to which
+ users can be assigned.";
+ }
+
+ typedef action-type {
+ type enumeration {
+ enum permit {
+ description
+ "Requested action is permitted.";
+ }
+ enum deny {
+ description
+ "Requested action is denied.";
+ }
+ }
+ description
+ "Action taken by the server when a particular
+ rule matches.";
+ }
+
+ typedef node-instance-identifier {
+ type yang:xpath1.0;
+ description
+ "Path expression used to represent a special
+ data node instance identifier string.
+
+ A node-instance-identifier value is an
+ unrestricted YANG instance-identifier expression.
+ All the same rules as an instance-identifier apply
+ except predicates for keys are optional. If a key
+ predicate is missing, then the node-instance-identifier
+ represents all possible server instances for that key.
+
+ This XPath expression is evaluated in the following context:
+
+ o The set of namespace declarations are those in scope on
+ the leaf element where this type is used.
+
+ o The set of variable bindings contains one variable,
+ 'USER', which contains the name of the user of the current
+ session.
+
+ o The function library is the core function library, but
+ note that due to the syntax restrictions of an
+ instance-identifier, no functions are allowed.
+
+ o The context node is the root node in the data tree.";
+ }
+
+ /*
+ * Data definition statements
+ */
+
+ container nacm {
+// nacm:default-deny-all;
+
+ description
+ "Parameters for NETCONF Access Control Model.";
+
+ leaf enable-nacm {
+ type boolean;
+ default true;
+ description
+ "Enables or disables all NETCONF access control
+ enforcement. If 'true', then enforcement
+ is enabled. If 'false', then enforcement
+ is disabled.";
+ }
+
+ leaf read-default {
+ type action-type;
+ default "permit";
+ description
+ "Controls whether read access is granted if
+ no appropriate rule is found for a
+ particular read request.";
+ }
+
+ leaf write-default {
+ type action-type;
+ default "deny";
+ description
+ "Controls whether create, update, or delete access
+ is granted if no appropriate rule is found for a
+ particular write request.";
+ }
+
+ leaf exec-default {
+ type action-type;
+ default "permit";
+ description
+ "Controls whether exec access is granted if no appropriate
+ rule is found for a particular protocol operation request.";
+ }
+
+ leaf enable-external-groups {
+ type boolean;
+ default true;
+ description
+ "Controls whether the server uses the groups reported by the
+ NETCONF transport layer when it assigns the user to a set of
+ NACM groups. If this leaf has the value 'false', any group
+ names reported by the transport layer are ignored by the
+ server.";
+ }
+
+ leaf denied-operations {
+ type yang:zero-based-counter32;
+ config false;
+ mandatory true;
+ description
+ "Number of times since the server last restarted that a
+ protocol operation request was denied.";
+ }
+
+ leaf denied-data-writes {
+ type yang:zero-based-counter32;
+ config false;
+ mandatory true;
+ description
+ "Number of times since the server last restarted that a
+ protocol operation request to alter
+ a configuration datastore was denied.";
+ }
+
+ leaf denied-notifications {
+ type yang:zero-based-counter32;
+ config false;
+ mandatory true;
+ description
+ "Number of times since the server last restarted that
+ a notification was dropped for a subscription because
+ access to the event type was denied.";
+ }
+
+ container groups {
+ description
+ "NETCONF Access Control Groups.";
+
+ list group {
+ key name;
+
+ description
+ "One NACM Group Entry. This list will only contain
+ configured entries, not any entries learned from
+ any transport protocols.";
+
+ leaf name {
+ type group-name-type;
+ description
+ "Group name associated with this entry.";
+ }
+
+ leaf-list user-name {
+ type user-name-type;
+ description
+ "Each entry identifies the username of
+ a member of the group associated with
+ this entry.";
+ }
+ }
+ }
+
+ list rule-list {
+ key "name";
+ ordered-by user;
+ description
+ "An ordered collection of access control rules.";
+
+ leaf name {
+ type string {
+ length "1..max";
+ }
+ description
+ "Arbitrary name assigned to the rule-list.";
+ }
+ leaf-list group {
+ type union {
+ type matchall-string-type;
+ type group-name-type;
+ }
+ description
+ "List of administrative groups that will be
+ assigned the associated access rights
+ defined by the 'rule' list.
+
+ The string '*' indicates that all groups apply to the
+ entry.";
+ }
+
+ list rule {
+ key "name";
+ ordered-by user;
+ description
+ "One access control rule.
+
+ Rules are processed in user-defined order until a match is
+ found. A rule matches if 'module-name', 'rule-type', and
+ 'access-operations' match the request. If a rule
+ matches, the 'action' leaf determines if access is granted
+ or not.";
+
+ leaf name {
+ type string {
+ length "1..max";
+ }
+ description
+ "Arbitrary name assigned to the rule.";
+ }
+
+ leaf module-name {
+ type union {
+ type matchall-string-type;
+ type string;
+ }
+ default "*";
+ description
+ "Name of the module associated with this rule.
+
+ This leaf matches if it has the value '*' or if the
+ object being accessed is defined in the module with the
+ specified module name.";
+ }
+ choice rule-type {
+ description
+ "This choice matches if all leafs present in the rule
+ match the request. If no leafs are present, the
+ choice matches all requests.";
+ case protocol-operation {
+ leaf rpc-name {
+ type union {
+ type matchall-string-type;
+ type string;
+ }
+ description
+ "This leaf matches if it has the value '*' or if
+ its value equals the requested protocol operation
+ name.";
+ }
+ }
+ case notification {
+ leaf notification-name {
+ type union {
+ type matchall-string-type;
+ type string;
+ }
+ description
+ "This leaf matches if it has the value '*' or if its
+ value equals the requested notification name.";
+ }
+ }
+ case data-node {
+ leaf path {
+ type node-instance-identifier;
+ mandatory true;
+ description
+ "Data Node Instance Identifier associated with the
+ data node controlled by this rule.
+
+ Configuration data or state data instance
+ identifiers start with a top-level data node. A
+ complete instance identifier is required for this
+ type of path value.
+
+ The special value '/' refers to all possible
+ datastore contents.";
+ }
+ }
+ }
+
+ leaf access-operations {
+ type union {
+ type matchall-string-type;
+ type access-operations-type;
+ }
+ default "*";
+ description
+ "Access operations associated with this rule.
+
+ This leaf matches if it has the value '*' or if the
+ bit corresponding to the requested operation is set.";
+ }
+
+ leaf action {
+ type action-type;
+ mandatory true;
+ description
+ "The access control action associated with the
+ rule. If a rule is determined to match a
+ particular request, then this object is used
+ to determine whether to permit or deny the
+ request.";
+ }
+
+ leaf comment {
+ type string;
+ description
+ "A textual description of the access rule.";
+ }
+ }
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf-monitoring.yang b/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf-monitoring.yang
new file mode 100644
index 0000000..8130bfd
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf-monitoring.yang
@@ -0,0 +1,559 @@
+
+module ietf-netconf-monitoring {
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring";
+ prefix "ncm";
+
+ import ietf-yang-types { prefix yang; }
+ import ietf-inet-types { prefix inet; }
+
+ organization
+ "IETF NETCONF (Network Configuration) Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ WG Chair: Mehmet Ersue
+ <mailto:mehmet.ersue@nsn.com>
+
+ WG Chair: Bert Wijnen
+ <mailto:bertietf@bwijnen.net>
+
+ Editor: Mark Scott
+ <mailto:mark.scott@ericsson.com>
+
+ Editor: Martin Bjorklund
+ <mailto:mbj@tail-f.com>";
+
+ description
+ "NETCONF Monitoring Module.
+ All elements in this module are read-only.
+
+ Copyright (c) 2010 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD
+ License set forth in Section 4.c of the IETF Trust's
+ Legal Provisions Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC 6022; see
+ the RFC itself for full legal notices.";
+
+ revision 2010-10-04 {
+ description
+ "Initial revision.";
+ reference
+ "RFC 6022: YANG Module for NETCONF Monitoring";
+ }
+
+ typedef netconf-datastore-type {
+ type enumeration {
+ enum running;
+ enum candidate;
+ enum startup;
+ }
+ description
+ "Enumeration of possible NETCONF datastore types.";
+ reference
+ "RFC 4741: NETCONF Configuration Protocol";
+ }
+
+ identity transport {
+ description
+ "Base identity for NETCONF transport types.";
+ }
+
+ identity netconf-ssh {
+ base transport;
+ description
+ "NETCONF over Secure Shell (SSH).";
+ reference
+ "RFC 4742: Using the NETCONF Configuration Protocol
+ over Secure SHell (SSH)";
+ }
+
+ identity netconf-soap-over-beep {
+ base transport;
+ description
+ "NETCONF over Simple Object Access Protocol (SOAP) over
+ Blocks Extensible Exchange Protocol (BEEP).";
+ reference
+ "RFC 4743: Using NETCONF over the Simple Object
+ Access Protocol (SOAP)";
+ }
+
+ identity netconf-soap-over-https {
+ base transport;
+ description
+ "NETCONF over Simple Object Access Protocol (SOAP)
+ over Hypertext Transfer Protocol Secure (HTTPS).";
+ reference
+ "RFC 4743: Using NETCONF over the Simple Object
+ Access Protocol (SOAP)";
+ }
+
+ identity netconf-beep {
+ base transport;
+ description
+ "NETCONF over Blocks Extensible Exchange Protocol (BEEP).";
+ reference
+ "RFC 4744: Using the NETCONF Protocol over the
+ Blocks Extensible Exchange Protocol (BEEP)";
+ }
+
+ identity netconf-tls {
+ base transport;
+ description
+ "NETCONF over Transport Layer Security (TLS).";
+ reference
+ "RFC 5539: NETCONF over Transport Layer Security (TLS)";
+ }
+
+ identity schema-format {
+ description
+ "Base identity for data model schema languages.";
+ }
+
+ identity xsd {
+ base schema-format;
+ description
+ "W3C XML Schema Definition.";
+ reference
+ "W3C REC REC-xmlschema-1-20041028:
+ XML Schema Part 1: Structures";
+ }
+
+ identity yang {
+ base schema-format;
+ description
+ "The YANG data modeling language for NETCONF.";
+ reference
+ "RFC 6020: YANG - A Data Modeling Language for the
+ Network Configuration Protocol (NETCONF)";
+ }
+
+ identity yin {
+ base schema-format;
+ description
+ "The YIN syntax for YANG.";
+ reference
+ "RFC 6020: YANG - A Data Modeling Language for the
+ Network Configuration Protocol (NETCONF)";
+ }
+
+ identity rng {
+ base schema-format;
+ description
+ "Regular Language for XML Next Generation (RELAX NG).";
+ reference
+ "ISO/IEC 19757-2:2008: RELAX NG";
+ }
+
+ identity rnc {
+ base schema-format;
+ description
+ "Relax NG Compact Syntax";
+ reference
+ "ISO/IEC 19757-2:2008: RELAX NG";
+ }
+
+ grouping common-counters {
+ description
+ "Counters that exist both per session, and also globally,
+ accumulated from all sessions.";
+
+ leaf in-rpcs {
+ type yang:zero-based-counter32;
+ description
+ "Number of correct <rpc> messages received.";
+ }
+ leaf in-bad-rpcs {
+ type yang:zero-based-counter32;
+ description
+ "Number of messages received when an <rpc> message was expected,
+ that were not correct <rpc> messages. This includes XML parse
+ errors and errors on the rpc layer.";
+ }
+ leaf out-rpc-errors {
+ type yang:zero-based-counter32;
+ description
+ "Number of <rpc-reply> messages sent that contained an
+ <rpc-error> element.";
+ }
+ leaf out-notifications {
+ type yang:zero-based-counter32;
+ description
+ "Number of <notification> messages sent.";
+ }
+ }
+
+ container netconf-state {
+ config false;
+ description
+ "The netconf-state container is the root of the monitoring
+ data model.";
+
+ container capabilities {
+ description
+ "Contains the list of NETCONF capabilities supported by the
+ server.";
+
+ leaf-list capability {
+ type inet:uri;
+ description
+ "List of NETCONF capabilities supported by the server.";
+ }
+ }
+
+ container datastores {
+ description
+ "Contains the list of NETCONF configuration datastores.";
+
+ list datastore {
+ key name;
+ description
+ "List of NETCONF configuration datastores supported by
+ the NETCONF server and related information.";
+
+ leaf name {
+ type netconf-datastore-type;
+ description
+ "Name of the datastore associated with this list entry.";
+ }
+ container locks {
+ presence
+ "This container is present only if the datastore
+ is locked.";
+ description
+ "The NETCONF <lock> and <partial-lock> operations allow
+ a client to lock specific resources in a datastore. The
+ NETCONF server will prevent changes to the locked
+ resources by all sessions except the one that acquired
+ the lock(s).
+
+ Monitoring information is provided for each datastore
+ entry including details such as the session that acquired
+ the lock, the type of lock (global or partial) and the
+ list of locked resources. Multiple locks per datastore
+ are supported.";
+
+ grouping lock-info {
+ description
+ "Lock related parameters, common to both global and
+ partial locks.";
+
+ leaf locked-by-session {
+ type uint32;
+ mandatory true;
+ description
+ "The session ID of the session that has locked
+ this resource. Both a global lock and a partial
+ lock MUST contain the NETCONF session-id.
+
+ If the lock is held by a session that is not managed
+ by the NETCONF server (e.g., a CLI session), a session
+ id of 0 (zero) is reported.";
+ reference
+ "RFC 4741: NETCONF Configuration Protocol";
+ }
+ leaf locked-time {
+ type yang:date-and-time;
+ mandatory true;
+ description
+ "The date and time of when the resource was
+ locked.";
+ }
+ }
+
+ choice lock-type {
+ description
+ "Indicates if a global lock or a set of partial locks
+ are set.";
+
+ container global-lock {
+ description
+ "Present if the global lock is set.";
+ uses lock-info;
+ }
+
+ list partial-lock {
+ key lock-id;
+ description
+ "List of partial locks.";
+ reference
+ "RFC 5717: Partial Lock Remote Procedure Call (RPC) for
+ NETCONF";
+
+ leaf lock-id {
+ type uint32;
+ description
+ "This is the lock id returned in the <partial-lock>
+ response.";
+ }
+ uses lock-info;
+ leaf-list select {
+ type yang:xpath1.0;
+ min-elements 1;
+ description
+ "The xpath expression that was used to request
+ the lock. The select expression indicates the
+ original intended scope of the lock.";
+ }
+ leaf-list locked-node {
+ type instance-identifier;
+ description
+ "The list of instance-identifiers (i.e., the
+ locked nodes).
+
+ The scope of the partial lock is defined by the list
+ of locked nodes.";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ container schemas {
+ description
+ "Contains the list of data model schemas supported by the
+ server.";
+
+ list schema {
+ key "identifier version format";
+
+ description
+ "List of data model schemas supported by the server.";
+
+ leaf identifier {
+ type string;
+ description
+ "Identifier to uniquely reference the schema. The
+ identifier is used in the <get-schema> operation and may
+ be used for other purposes such as file retrieval.
+
+ For modeling languages that support or require a data
+ model name (e.g., YANG module name) the identifier MUST
+ match that name. For YANG data models, the identifier is
+ the name of the module or submodule. In other cases, an
+ identifier such as a filename MAY be used instead.";
+ }
+ leaf version {
+ type string;
+ description
+ "Version of the schema supported. Multiple versions MAY be
+ supported simultaneously by a NETCONF server. Each
+ version MUST be reported individually in the schema list,
+ i.e., with same identifier, possibly different location,
+ but different version.
+
+ For YANG data models, version is the value of the most
+ recent YANG 'revision' statement in the module or
+ submodule, or the empty string if no 'revision' statement
+ is present.";
+ }
+ leaf format {
+ type identityref {
+ base schema-format;
+ }
+ description
+ "The data modeling language the schema is written
+ in (currently xsd, yang, yin, rng, or rnc).
+ For YANG data models, 'yang' format MUST be supported and
+ 'yin' format MAY also be provided.";
+ }
+ leaf namespace {
+ type inet:uri;
+ mandatory true;
+ description
+ "The XML namespace defined by the data model.
+
+ For YANG data models, this is the module's namespace.
+ If the list entry describes a submodule, this field
+ contains the namespace of the module to which the
+ submodule belongs.";
+ }
+ leaf-list location {
+ type union {
+ type enumeration {
+ enum "NETCONF";
+ }
+ type inet:uri;
+ }
+ description
+ "One or more locations from which the schema can be
+ retrieved. This list SHOULD contain at least one
+ entry per schema.
+
+ A schema entry may be located on a remote file system
+ (e.g., reference to file system for ftp retrieval) or
+ retrieved directly from a server supporting the
+ <get-schema> operation (denoted by the value 'NETCONF').";
+ }
+ }
+ }
+
+ container sessions {
+ description
+ "The sessions container includes session-specific data for
+ NETCONF management sessions. The session list MUST include
+ all currently active NETCONF sessions.";
+
+ list session {
+ key session-id;
+ description
+ "All NETCONF sessions managed by the NETCONF server
+ MUST be reported in this list.";
+
+ leaf session-id {
+ type uint32 {
+ range "1..max";
+ }
+ description
+ "Unique identifier for the session. This value is the
+ NETCONF session identifier, as defined in RFC 4741.";
+ reference
+ "RFC 4741: NETCONF Configuration Protocol";
+ }
+ leaf transport {
+ type identityref {
+ base transport;
+ }
+ mandatory true;
+ description
+ "Identifies the transport for each session, e.g.,
+ 'netconf-ssh', 'netconf-soap', etc.";
+ }
+ leaf username {
+ type string;
+ mandatory true;
+ description
+ "The username is the client identity that was authenticated
+ by the NETCONF transport protocol. The algorithm used to
+ derive the username is NETCONF transport protocol specific
+ and in addition specific to the authentication mechanism
+ used by the NETCONF transport protocol.";
+ }
+ leaf source-host {
+ type inet:host;
+ description
+ "Host identifier of the NETCONF client. The value
+ returned is implementation specific (e.g., hostname,
+ IPv4 address, IPv6 address)";
+ }
+ leaf login-time {
+ type yang:date-and-time;
+ mandatory true;
+ description
+ "Time at the server at which the session was established.";
+ }
+ uses common-counters {
+ description
+ "Per-session counters. Zero based with following reset
+ behaviour:
+ - at start of a session
+ - when max value is reached";
+ }
+ }
+ }
+
+ container statistics {
+ description
+ "Statistical data pertaining to the NETCONF server.";
+
+ leaf netconf-start-time {
+ type yang:date-and-time;
+ description
+ "Date and time at which the management subsystem was
+ started.";
+ }
+ leaf in-bad-hellos {
+ type yang:zero-based-counter32;
+ description
+ "Number of sessions silently dropped because an
+ invalid <hello> message was received. This includes <hello>
+ messages with a 'session-id' attribute, bad namespace, and
+ bad capability declarations.";
+ }
+ leaf in-sessions {
+ type yang:zero-based-counter32;
+ description
+ "Number of sessions started. This counter is incremented
+ when a <hello> message with a <session-id> is sent.
+
+ 'in-sessions' - 'in-bad-hellos' =
+ 'number of correctly started netconf sessions'";
+ }
+ leaf dropped-sessions {
+ type yang:zero-based-counter32;
+ description
+ "Number of sessions that were abnormally terminated, e.g.,
+ due to idle timeout or transport close. This counter is not
+ incremented when a session is properly closed by a
+ <close-session> operation, or killed by a <kill-session>
+ operation.";
+ }
+ uses common-counters {
+ description
+ "Global counters, accumulated from all sessions.
+ Zero based with following reset behaviour:
+ - re-initialization of NETCONF server
+ - when max value is reached";
+ }
+ }
+ }
+
+ rpc get-schema {
+ description
+ "This operation is used to retrieve a schema from the
+ NETCONF server.
+
+ Positive Response:
+ The NETCONF server returns the requested schema.
+
+ Negative Response:
+ If requested schema does not exist, the <error-tag> is
+ 'invalid-value'.
+
+ If more than one schema matches the requested parameters, the
+ <error-tag> is 'operation-failed', and <error-app-tag> is
+ 'data-not-unique'.";
+
+ input {
+ leaf identifier {
+ type string;
+ mandatory true;
+ description
+ "Identifier for the schema list entry.";
+ }
+ leaf version {
+ type string;
+ description
+ "Version of the schema requested. If this parameter is not
+ present, and more than one version of the schema exists on
+ the server, a 'data-not-unique' error is returned, as
+ described above.";
+ }
+ leaf format {
+ type identityref {
+ base schema-format;
+ }
+ description
+ "The data modeling language of the schema. If this
+ parameter is not present, and more than one formats of
+ the schema exists on the server, a 'data-not-unique' error
+ is returned, as described above.";
+ }
+ }
+ output {
+ anyxml data {
+ description
+ "Contains the schema content.";
+ }
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf-notifications.yang b/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf-notifications.yang
new file mode 100644
index 0000000..4ec1dea
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf-notifications.yang
@@ -0,0 +1,337 @@
+module ietf-netconf-notifications {
+
+ namespace
+ "urn:ietf:params:xml:ns:yang:ietf-netconf-notifications";
+
+ prefix ncn;
+
+ import ietf-inet-types { prefix inet; }
+ import ietf-netconf { prefix nc; }
+
+ organization
+ "IETF NETCONF (Network Configuration Protocol) Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ WG Chair: Bert Wijnen
+ <mailto:bertietf@bwijnen.net>
+
+ WG Chair: Mehmet Ersue
+ <mailto:mehmet.ersue@nsn.com>
+
+ Editor: Andy Bierman
+ <mailto:andy@netconfcentral.org>";
+
+ description
+ "This module defines a YANG data model for use with the
+ NETCONF protocol that allows the NETCONF client to
+ receive common NETCONF base event notifications.
+
+ Copyright (c) 2012 IETF Trust and the persons identified as
+ the document authors. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC 6470; see
+ the RFC itself for full legal notices.";
+
+ revision "2012-02-06" {
+ description
+ "Initial version.";
+ reference
+ "RFC 6470: NETCONF Base Notifications";
+ }
+
+ grouping common-session-parms {
+ description
+ "Common session parameters to identify a
+ management session.";
+
+ leaf username {
+ type string;
+ mandatory true;
+ description
+ "Name of the user for the session.";
+ }
+
+ leaf session-id {
+ type nc:session-id-or-zero-type;
+ mandatory true;
+ description
+ "Identifier of the session.
+ A NETCONF session MUST be identified by a non-zero value.
+ A non-NETCONF session MAY be identified by the value zero.";
+ }
+
+ leaf source-host {
+ type inet:ip-address;
+ description
+ "Address of the remote host for the session.";
+ }
+ }
+
+ grouping changed-by-parms {
+ description
+ "Common parameters to identify the source
+ of a change event, such as a configuration
+ or capability change.";
+
+ container changed-by {
+ description
+ "Indicates the source of the change.
+ If caused by internal action, then the
+ empty leaf 'server' will be present.
+ If caused by a management session, then
+ the name, remote host address, and session ID
+ of the session that made the change will be reported.";
+ choice server-or-user {
+ mandatory true;
+ leaf server {
+ type empty;
+ description
+ "If present, the change was caused
+ by the server.";
+ }
+
+ case by-user {
+ uses common-session-parms;
+ }
+ } // choice server-or-user
+ } // container changed-by-parms
+ }
+
+
+ notification netconf-config-change {
+ description
+ "Generated when the NETCONF server detects that the
+ <running> or <startup> configuration datastore
+ has been changed by a management session.
+ The notification summarizes the edits that
+ have been detected.
+
+ The server MAY choose to also generate this
+ notification while loading a datastore during the
+ boot process for the device.";
+
+ uses changed-by-parms;
+
+ leaf datastore {
+ type enumeration {
+ enum running {
+ description "The <running> datastore has changed.";
+ }
+ enum startup {
+ description "The <startup> datastore has changed";
+ }
+ }
+ default "running";
+ description
+ "Indicates which configuration datastore has changed.";
+ }
+
+ list edit {
+ description
+ "An edit record SHOULD be present for each distinct
+ edit operation that the server has detected on
+ the target datastore. This list MAY be omitted
+ if the detailed edit operations are not known.
+ The server MAY report entries in this list for
+ changes not made by a NETCONF session (e.g., CLI).";
+
+ leaf target {
+ type instance-identifier;
+ description
+ "Topmost node associated with the configuration change.
+ A server SHOULD set this object to the node within
+ the datastore that is being altered. A server MAY
+ set this object to one of the ancestors of the actual
+ node that was changed, or omit this object, if the
+ exact node is not known.";
+ }
+
+ leaf operation {
+ type nc:edit-operation-type;
+ description
+ "Type of edit operation performed.
+ A server MUST set this object to the NETCONF edit
+ operation performed on the target datastore.";
+ }
+ } // list edit
+ } // notification netconf-config-change
+
+ notification netconf-capability-change {
+ description
+ "Generated when the NETCONF server detects that
+ the server capabilities have changed.
+ Indicates which capabilities have been added, deleted,
+ and/or modified. The manner in which a server
+ capability is changed is outside the scope of this
+ document.";
+
+ uses changed-by-parms;
+
+ leaf-list added-capability {
+ type inet:uri;
+ description
+ "List of capabilities that have just been added.";
+ }
+
+ leaf-list deleted-capability {
+ type inet:uri;
+ description
+ "List of capabilities that have just been deleted.";
+ }
+
+ leaf-list modified-capability {
+ type inet:uri;
+ description
+ "List of capabilities that have just been modified.
+ A capability is considered to be modified if the
+ base URI for the capability has not changed, but
+ one or more of the parameters encoded at the end of
+ the capability URI have changed.
+ The new modified value of the complete URI is returned.";
+ }
+ } // notification netconf-capability-change
+
+
+ notification netconf-session-start {
+ description
+ "Generated when a NETCONF server detects that a
+ NETCONF session has started. A server MAY generate
+ this event for non-NETCONF management sessions.
+ Indicates the identity of the user that started
+ the session.";
+ uses common-session-parms;
+ } // notification netconf-session-start
+
+ notification netconf-session-end {
+ description
+ "Generated when a NETCONF server detects that a
+ NETCONF session has terminated.
+ A server MAY optionally generate this event for
+ non-NETCONF management sessions. Indicates the
+ identity of the user that owned the session,
+ and why the session was terminated.";
+
+ uses common-session-parms;
+
+ leaf killed-by {
+ when "../termination-reason = 'killed'";
+ type nc:session-id-type;
+ description
+ "The ID of the session that directly caused this session
+ to be abnormally terminated. If this session was abnormally
+ terminated by a non-NETCONF session unknown to the server,
+ then this leaf will not be present.";
+ }
+
+ leaf termination-reason {
+ type enumeration {
+ enum "closed" {
+ description
+ "The session was terminated by the client in normal
+ fashion, e.g., by the NETCONF <close-session>
+ protocol operation.";
+ }
+ enum "killed" {
+ description
+ "The session was terminated in abnormal
+ fashion, e.g., by the NETCONF <kill-session>
+ protocol operation.";
+ }
+ enum "dropped" {
+ description
+ "The session was terminated because the transport layer
+ connection was unexpectedly closed.";
+ }
+ enum "timeout" {
+ description
+ "The session was terminated because of inactivity,
+ e.g., waiting for the <hello> message or <rpc>
+ messages.";
+ }
+ enum "bad-hello" {
+ description
+ "The client's <hello> message was invalid.";
+ }
+ enum "other" {
+ description
+ "The session was terminated for some other reason.";
+ }
+ }
+ mandatory true;
+ description
+ "Reason the session was terminated.";
+ }
+ } // notification netconf-session-end
+
+
+ notification netconf-confirmed-commit {
+ description
+ "Generated when a NETCONF server detects that a
+ confirmed-commit event has occurred. Indicates the event
+ and the current state of the confirmed-commit procedure
+ in progress.";
+ reference
+ "RFC 6241, Section 8.4";
+
+ uses common-session-parms {
+ when "../confirm-event != 'timeout'";
+ }
+
+ leaf confirm-event {
+ type enumeration {
+ enum "start" {
+ description
+ "The confirmed-commit procedure has started.";
+ }
+ enum "cancel" {
+ description
+ "The confirmed-commit procedure has been canceled,
+ e.g., due to the session being terminated, or an
+ explicit <cancel-commit> operation.";
+ }
+ enum "timeout" {
+ description
+ "The confirmed-commit procedure has been canceled
+ due to the confirm-timeout interval expiring.
+ The common session parameters will not be present
+ in this sub-mode.";
+ }
+ enum "extend" {
+ description
+ "The confirmed-commit timeout has been extended,
+ e.g., by a new <confirmed-commit> operation.";
+ }
+ enum "complete" {
+ description
+ "The confirmed-commit procedure has been completed.";
+ }
+ }
+ mandatory true;
+ description
+ "Indicates the event that caused the notification.";
+ }
+
+ leaf timeout {
+ when
+ "../confirm-event = 'start' or ../confirm-event = 'extend'";
+ type uint32;
+ units "seconds";
+ description
+ "The configured timeout value if the event type
+ is 'start' or 'extend'. This value represents
+ the approximate number of seconds from the event
+ time when the 'timeout' event might occur.";
+ }
+ } // notification netconf-confirmed-commit
+
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf-with-defaults.yang b/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf-with-defaults.yang
new file mode 100644
index 0000000..1c569a2
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf-with-defaults.yang
@@ -0,0 +1,165 @@
+ module ietf-netconf-with-defaults {
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults";
+
+ prefix ncwd;
+
+ import ietf-netconf { prefix nc; }
+
+ organization
+ "IETF NETCONF (Network Configuration Protocol) Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ WG Chair: Bert Wijnen
+ <mailto:bertietf@bwijnen.net>
+
+ WG Chair: Mehmet Ersue
+ <mailto:mehmet.ersue@nsn.com>
+
+ Editor: Andy Bierman
+ <mailto:andy.bierman@brocade.com>
+
+ Editor: Balazs Lengyel
+ <mailto:balazs.lengyel@ericsson.com>";
+
+ description
+ "This module defines an extension to the NETCONF protocol
+ that allows the NETCONF client to control how default
+ values are handled by the server in particular NETCONF operations.
+
+ Copyright (c) 2010 IETF Trust and the persons identified as
+ the document authors. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC XXXX; see
+ the RFC itself for full legal notices.";
+ // RFC Ed.: replace XXXX with actual RFC number and remove this note
+
+ // RFC Ed.: remove this note
+ // Note: extracted from draft-ietf-netmod-with-defaults-10.txt
+
+ revision 2010-06-09 {
+ description
+ "Initial version.";
+ reference
+ "RFC XXXX: With-defaults capability for NETCONF";
+ }
+ // RFC Ed.: replace XXXX with actual
+ // RFC number and remove this note
+
+ typedef with-defaults-mode {
+ description
+ "Possible modes to report default data.";
+ reference
+ "RFC XXXX; section 3.";
+ // RFC Ed.: replace XXXX with actual
+ // RFC number and remove this note
+
+ type enumeration {
+ enum report-all {
+ description
+ "All default data is reported.";
+ reference
+ "RFC XXXX; section 3.1";
+ // RFC Ed.: replace XXXX with actual
+ // RFC number and remove this note
+
+ }
+ enum report-all-tagged {
+ description
+ "All default data is reported.
+ Any nodes considered to be default data
+ will contain a 'wd:default' XML attribute,
+ set to 'true'.";
+ reference
+ "RFC XXXX; section 3.4";
+ // RFC Ed.: replace XXXX with actual
+ // RFC number and remove this note
+ }
+ enum trim {
+ description
+ "Values are not reported if they contain the default.";
+ reference
+ "RFC XXXX; section 3.2";
+ // RFC Ed.: replace XXXX with actual
+ // RFC number and remove this note
+
+ }
+ enum explicit {
+ description
+ "Report values that contain the definition of
+ explicitly set data.";
+ reference
+ "RFC XXXX; section 3.3";
+ // RFC Ed.: replace XXXX with actual
+ // RFC number and remove this note
+ }
+ }
+ }
+
+ grouping with-defaults-parameters {
+ description
+ "Contains the <with-defaults> parameter for control
+ of defaults in NETCONF retrieval operations.";
+
+ leaf with-defaults {
+ description
+ "The explicit defaults processing mode requested.";
+ reference
+ "RFC XXXX; section 4.6.1";
+ // RFC Ed.: replace XXXX with actual
+ // RFC number and remove this note
+
+ type with-defaults-mode;
+ }
+ }
+
+ // extending the get-config operation
+ augment /nc:get-config/nc:input {
+ description
+ "Adds the <with-defaults> parameter to the
+ input of the NETCONF <get-config> operation.";
+ reference
+ "RFC XXXX; section 4.6.1";
+ // RFC Ed.: replace XXXX with actual
+ // RFC number and remove this note
+
+ uses with-defaults-parameters;
+ }
+
+ // extending the get operation
+ augment /nc:get/nc:input {
+ description
+ "Adds the <with-defaults> parameter to
+ the input of the NETCONF <get> operation.";
+ reference
+ "RFC XXXX; section 4.6.1";
+ // RFC Ed.: replace XXXX with actual
+ // RFC number and remove this note
+
+ uses with-defaults-parameters;
+ }
+
+ // extending the copy-config operation
+ augment /nc:copy-config/nc:input {
+ description
+ "Adds the <with-defaults> parameter to
+ the input of the NETCONF <copy-config> operation.";
+ reference
+ "RFC XXXX; section 4.6.1";
+ // RFC Ed.: replace XXXX with actual
+ // RFC number and remove this note
+
+ uses with-defaults-parameters;
+ }
+
+ }
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf.yang b/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf.yang
new file mode 100644
index 0000000..2595a12
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/ietf-netconf.yang
@@ -0,0 +1,980 @@
+module ietf-netconf {
+
+ // the namespace for NETCONF XML definitions is unchanged
+ // from RFC 4741, which this document replaces
+ namespace "urn:ietf:params:xml:ns:netconf:base:1.0";
+
+ prefix nc;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ organization
+ "IETF NETCONF (Network Configuration) Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/netconf/>
+ WG List: <netconf@ietf.org>
+
+ WG Chair: Bert Wijnen
+ <bertietf@bwijnen.net>
+
+ WG Chair: Mehmet Ersue
+ <mehmet.ersue@nsn.com>
+
+ Editor: Martin Bjorklund
+ <mbj@tail-f.com>
+
+ Editor: Juergen Schoenwaelder
+ <j.schoenwaelder@jacobs-university.de>
+
+ Editor: Andy Bierman
+ <andy.bierman@brocade.com>";
+ description
+ "NETCONF Protocol Data Types and Protocol Operations.
+
+ Copyright (c) 2011 IETF Trust and the persons identified as
+ the document authors. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC 6241; see
+ the RFC itself for full legal notices.";
+
+ revision 2011-06-01 {
+ description
+ "Initial revision;";
+ reference
+ "RFC 6241: Network Configuration Protocol";
+ }
+
+ extension get-filter-element-attributes {
+ description
+ "If this extension is present within an 'anyxml'
+ statement named 'filter', which must be conceptually
+ defined within the RPC input section for the <get>
+ and <get-config> protocol operations, then the
+ following unqualified XML attribute is supported
+ within the <filter> element, within a <get> or
+ <get-config> protocol operation:
+
+ type : optional attribute with allowed
+ value strings 'subtree' and 'xpath'.
+ If missing, the default value is 'subtree'.
+
+ If the 'xpath' feature is supported, then the
+ following unqualified XML attribute is
+ also supported:
+
+ select: optional attribute containing a
+ string representing an XPath expression.
+ The 'type' attribute must be equal to 'xpath'
+ if this attribute is present.";
+ }
+
+ // NETCONF capabilities defined as features
+ feature writable-running {
+ description
+ "NETCONF :writable-running capability;
+ If the server advertises the :writable-running
+ capability for a session, then this feature must
+ also be enabled for that session. Otherwise,
+ this feature must not be enabled.";
+ reference "RFC 6241, Section 8.2";
+ }
+
+ feature candidate {
+ description
+ "NETCONF :candidate capability;
+ If the server advertises the :candidate
+ capability for a session, then this feature must
+ also be enabled for that session. Otherwise,
+ this feature must not be enabled.";
+ reference "RFC 6241, Section 8.3";
+ }
+
+ feature confirmed-commit {
+ if-feature candidate;
+ description
+ "NETCONF :confirmed-commit:1.1 capability;
+ If the server advertises the :confirmed-commit:1.1
+ capability for a session, then this feature must
+ also be enabled for that session. Otherwise,
+ this feature must not be enabled.";
+
+ reference "RFC 6241, Section 8.4";
+ }
+
+ feature rollback-on-error {
+ description
+ "NETCONF :rollback-on-error capability;
+ If the server advertises the :rollback-on-error
+ capability for a session, then this feature must
+ also be enabled for that session. Otherwise,
+ this feature must not be enabled.";
+ reference "RFC 6241, Section 8.5";
+ }
+
+ feature validate {
+ description
+ "NETCONF :validate:1.1 capability;
+ If the server advertises the :validate:1.1
+ capability for a session, then this feature must
+ also be enabled for that session. Otherwise,
+ this feature must not be enabled.";
+ reference "RFC 6241, Section 8.6";
+ }
+
+ feature startup {
+ description
+ "NETCONF :startup capability;
+ If the server advertises the :startup
+ capability for a session, then this feature must
+ also be enabled for that session. Otherwise,
+ this feature must not be enabled.";
+ reference "RFC 6241, Section 8.7";
+ }
+
+ feature url {
+ description
+ "NETCONF :url capability;
+ If the server advertises the :url
+ capability for a session, then this feature must
+ also be enabled for that session. Otherwise,
+ this feature must not be enabled.";
+ reference "RFC 6241, Section 8.8";
+ }
+
+ feature xpath {
+ description
+ "NETCONF :xpath capability;
+ If the server advertises the :xpath
+ capability for a session, then this feature must
+ also be enabled for that session. Otherwise,
+ this feature must not be enabled.";
+ reference "RFC 6241, Section 8.9";
+ }
+
+ // NETCONF Simple Types
+
+ typedef session-id-type {
+ type uint32 {
+ range "1..max";
+ }
+ description
+ "NETCONF Session Id";
+ }
+
+ typedef session-id-or-zero-type {
+ type uint32;
+ description
+ "NETCONF Session Id or Zero to indicate none";
+ }
+ typedef error-tag-type {
+ type enumeration {
+ enum in-use {
+ description
+ "The request requires a resource that
+ already is in use.";
+ }
+ enum invalid-value {
+ description
+ "The request specifies an unacceptable value for one
+ or more parameters.";
+ }
+ enum too-big {
+ description
+ "The request or response (that would be generated) is
+ too large for the implementation to handle.";
+ }
+ enum missing-attribute {
+ description
+ "An expected attribute is missing.";
+ }
+ enum bad-attribute {
+ description
+ "An attribute value is not correct; e.g., wrong type,
+ out of range, pattern mismatch.";
+ }
+ enum unknown-attribute {
+ description
+ "An unexpected attribute is present.";
+ }
+ enum missing-element {
+ description
+ "An expected element is missing.";
+ }
+ enum bad-element {
+ description
+ "An element value is not correct; e.g., wrong type,
+ out of range, pattern mismatch.";
+ }
+ enum unknown-element {
+ description
+ "An unexpected element is present.";
+ }
+ enum unknown-namespace {
+ description
+ "An unexpected namespace is present.";
+ }
+ enum access-denied {
+ description
+ "Access to the requested protocol operation or
+ data model is denied because authorization failed.";
+ }
+ enum lock-denied {
+ description
+ "Access to the requested lock is denied because the
+ lock is currently held by another entity.";
+ }
+ enum resource-denied {
+ description
+ "Request could not be completed because of
+ insufficient resources.";
+ }
+ enum rollback-failed {
+ description
+ "Request to roll back some configuration change (via
+ rollback-on-error or <discard-changes> operations)
+ was not completed for some reason.";
+
+ }
+ enum data-exists {
+ description
+ "Request could not be completed because the relevant
+ data model content already exists. For example,
+ a 'create' operation was attempted on data that
+ already exists.";
+ }
+ enum data-missing {
+ description
+ "Request could not be completed because the relevant
+ data model content does not exist. For example,
+ a 'delete' operation was attempted on
+ data that does not exist.";
+ }
+ enum operation-not-supported {
+ description
+ "Request could not be completed because the requested
+ operation is not supported by this implementation.";
+ }
+ enum operation-failed {
+ description
+ "Request could not be completed because the requested
+ operation failed for some reason not covered by
+ any other error condition.";
+ }
+ enum partial-operation {
+ description
+ "This error-tag is obsolete, and SHOULD NOT be sent
+ by servers conforming to this document.";
+ }
+ enum malformed-message {
+ description
+ "A message could not be handled because it failed to
+ be parsed correctly. For example, the message is not
+ well-formed XML or it uses an invalid character set.";
+ }
+ }
+ description "NETCONF Error Tag";
+ reference "RFC 6241, Appendix A";
+ }
+
+ typedef error-severity-type {
+ type enumeration {
+ enum error {
+ description "Error severity";
+ }
+ enum warning {
+ description "Warning severity";
+ }
+ }
+ description "NETCONF Error Severity";
+ reference "RFC 6241, Section 4.3";
+ }
+
+ typedef edit-operation-type {
+ type enumeration {
+ enum merge {
+ description
+ "The configuration data identified by the
+ element containing this attribute is merged
+ with the configuration at the corresponding
+ level in the configuration datastore identified
+ by the target parameter.";
+ }
+ enum replace {
+ description
+ "The configuration data identified by the element
+ containing this attribute replaces any related
+ configuration in the configuration datastore
+ identified by the target parameter. If no such
+ configuration data exists in the configuration
+ datastore, it is created. Unlike a
+ <copy-config> operation, which replaces the
+ entire target configuration, only the configuration
+ actually present in the config parameter is affected.";
+ }
+ enum create {
+ description
+ "The configuration data identified by the element
+ containing this attribute is added to the
+ configuration if and only if the configuration
+ data does not already exist in the configuration
+ datastore. If the configuration data exists, an
+ <rpc-error> element is returned with an
+ <error-tag> value of 'data-exists'.";
+ }
+ enum delete {
+ description
+ "The configuration data identified by the element
+ containing this attribute is deleted from the
+ configuration if and only if the configuration
+ data currently exists in the configuration
+ datastore. If the configuration data does not
+ exist, an <rpc-error> element is returned with
+ an <error-tag> value of 'data-missing'.";
+ }
+ enum remove {
+ description
+ "The configuration data identified by the element
+ containing this attribute is deleted from the
+ configuration if the configuration
+ data currently exists in the configuration
+ datastore. If the configuration data does not
+ exist, the 'remove' operation is silently ignored
+ by the server.";
+ }
+ }
+ default "merge";
+ description "NETCONF 'operation' attribute values";
+ reference "RFC 6241, Section 7.2";
+ }
+
+ // NETCONF Standard Protocol Operations
+
+ rpc get-config {
+ description
+ "Retrieve all or part of a specified configuration.";
+
+ reference "RFC 6241, Section 7.1";
+
+ input {
+ container source {
+ description
+ "Particular configuration to retrieve.";
+
+ choice config-source {
+ mandatory true;
+ description
+ "The configuration to retrieve.";
+ case candidate {
+ leaf candidate {
+ if-feature candidate;
+ type empty;
+ description
+ "The candidate configuration is the config source.";
+ }
+ }
+ case running {
+ leaf running {
+ type empty;
+ description
+ "The running configuration is the config source.";
+ }
+ }
+ case startup {
+ leaf startup {
+ if-feature startup;
+ type empty;
+ description
+ "The startup configuration is the config source.
+ This is optional-to-implement on the server because
+ not all servers will support filtering for this
+ datastore.";
+ }
+ }
+ }
+ }
+
+ anyxml filter {
+ description
+ "Subtree or XPath filter to use.";
+// nc:get-filter-element-attributes;
+ }
+ }
+
+ output {
+ anyxml data {
+ description
+ "Copy of the source datastore subset that matched
+ the filter criteria (if any). An empty data container
+ indicates that the request did not produce any results.";
+ }
+ }
+ }
+
+ rpc edit-config {
+ description
+ "The <edit-config> operation loads all or part of a specified
+ configuration to the specified target configuration.";
+
+ reference "RFC 6241, Section 7.2";
+
+ input {
+ container target {
+ description
+ "Particular configuration to edit.";
+
+ choice config-target {
+ mandatory true;
+ description
+ "The configuration target.";
+ case candidate {
+ leaf candidate {
+ if-feature candidate;
+ type empty;
+ description
+ "The candidate configuration is the config target.";
+ }
+ }
+ case running {
+ leaf running {
+ if-feature writable-running;
+ type empty;
+ description
+ "The running configuration is the config source.";
+ }
+ }
+ }
+ }
+
+ leaf default-operation {
+ type enumeration {
+ enum merge {
+ description
+ "The default operation is merge.";
+ }
+ enum replace {
+ description
+ "The default operation is replace.";
+ }
+ enum none {
+ description
+ "There is no default operation.";
+ }
+ }
+ default "merge";
+ description
+ "The default operation to use.";
+ }
+
+ leaf test-option {
+ if-feature validate;
+ type enumeration {
+ enum test-then-set {
+ description
+ "The server will test and then set if no errors.";
+ }
+ enum set {
+ description
+ "The server will set without a test first.";
+ }
+
+ enum test-only {
+ description
+ "The server will only test and not set, even
+ if there are no errors.";
+ }
+ }
+ default "test-then-set";
+ description
+ "The test option to use.";
+ }
+
+ leaf error-option {
+ type enumeration {
+ enum stop-on-error {
+ description
+ "The server will stop on errors.";
+ }
+ enum continue-on-error {
+ description
+ "The server may continue on errors.";
+ }
+ enum rollback-on-error {
+ description
+ "The server will roll back on errors.
+ This value can only be used if the 'rollback-on-error'
+ feature is supported.";
+ }
+ }
+ default "stop-on-error";
+ description
+ "The error option to use.";
+ }
+
+ choice edit-content {
+ mandatory true;
+ description
+ "The content for the edit operation.";
+ case config {
+ anyxml config {
+ description
+ "Inline Config content.";
+ }
+ }
+ case url {
+ leaf url {
+ if-feature url;
+ type inet:uri;
+ description
+ "URL-based config content.";
+ }
+ }
+ }
+ }
+ }
+
+ rpc copy-config {
+ description
+ "Create or replace an entire configuration datastore with the
+ contents of another complete configuration datastore.";
+
+ reference "RFC 6241, Section 7.3";
+
+ input {
+ container target {
+ description
+ "Particular configuration to copy to.";
+
+ choice config-target {
+ mandatory true;
+ description
+ "The configuration target of the copy operation.";
+ case candidate {
+ leaf candidate {
+ if-feature candidate;
+ type empty;
+ description
+ "The candidate configuration is the config target.";
+ }
+ }
+ case running {
+ leaf running {
+ if-feature writable-running;
+ type empty;
+ description
+ "The running configuration is the config target.
+ This is optional-to-implement on the server.";
+ }
+ }
+ case startup {
+ leaf startup {
+ if-feature startup;
+ type empty;
+ description
+ "The startup configuration is the config target.";
+ }
+ }
+ case url {
+ leaf url {
+ if-feature url;
+ type inet:uri;
+ description
+ "The URL-based configuration is the config target.";
+ }
+ }
+ }
+ }
+
+ container source {
+ description
+ "Particular configuration to copy from.";
+
+ choice config-source {
+ mandatory true;
+ description
+ "The configuration source for the copy operation.";
+
+ case candidate {
+ leaf candidate {
+ if-feature candidate;
+ type empty;
+ description
+ "The candidate configuration is the config source.";
+ }
+ }
+ case running {
+ leaf running {
+ type empty;
+ description
+ "The running configuration is the config source.";
+ }
+ }
+ case startup {
+ leaf startup {
+ if-feature startup;
+ type empty;
+ description
+ "The startup configuration is the config source.";
+ }
+ }
+ case url {
+ leaf url {
+ if-feature url;
+ type inet:uri;
+ description
+ "The URL-based configuration is the config source.";
+ }
+ }
+ case config {
+ anyxml config {
+ description
+ "Inline Config content: <config> element. Represents
+ an entire configuration datastore, not
+ a subset of the running datastore.";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ rpc delete-config {
+ description
+ "Delete a configuration datastore.";
+
+ reference "RFC 6241, Section 7.4";
+
+ input {
+ container target {
+ description
+ "Particular configuration to delete.";
+
+ choice config-target {
+ mandatory true;
+ description
+ "The configuration target to delete.";
+ case startup {
+ leaf startup {
+ if-feature startup;
+ type empty;
+ description
+ "The startup configuration is the config target.";
+ }
+ }
+ case url {
+ leaf url {
+ if-feature url;
+ type inet:uri;
+ description
+ "The URL-based configuration is the config target.";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ rpc lock {
+ description
+ "The lock operation allows the client to lock the configuration
+ system of a device.";
+
+ reference "RFC 6241, Section 7.5";
+
+ input {
+ container target {
+ description
+ "Particular configuration to lock.";
+
+ choice config-target {
+ mandatory true;
+ description
+ "The configuration target to lock.";
+ case candidate {
+ leaf candidate {
+ if-feature candidate;
+ type empty;
+ description
+ "The candidate configuration is the config target.";
+ }
+ }
+ case running {
+ leaf running {
+ type empty;
+ description
+ "The running configuration is the config target.";
+ }
+ }
+ case startup {
+ leaf startup {
+ if-feature startup;
+ type empty;
+ description
+ "The startup configuration is the config target.";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ rpc unlock {
+ description
+ "The unlock operation is used to release a configuration lock,
+ previously obtained with the 'lock' operation.";
+
+ reference "RFC 6241, Section 7.6";
+
+ input {
+ container target {
+ description
+ "Particular configuration to unlock.";
+
+ choice config-target {
+ mandatory true;
+ description
+ "The configuration target to unlock.";
+ case candidate {
+ leaf candidate {
+ if-feature candidate;
+ type empty;
+ description
+ "The candidate configuration is the config target.";
+ }
+ }
+ case running {
+ leaf running {
+ type empty;
+ description
+ "The running configuration is the config target.";
+ }
+ }
+ case startup {
+ leaf startup {
+ if-feature startup;
+ type empty;
+ description
+ "The startup configuration is the config target.";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ rpc get {
+ description
+ "Retrieve running configuration and device state information.";
+
+ reference "RFC 6241, Section 7.7";
+
+ input {
+ anyxml filter {
+ description
+ "This parameter specifies the portion of the system
+ configuration and state data to retrieve.";
+// nc:get-filter-element-attributes;
+ }
+ }
+
+ output {
+ anyxml data {
+ description
+ "Copy of the running datastore subset and/or state
+ data that matched the filter criteria (if any).
+ An empty data container indicates that the request did not
+ produce any results.";
+ }
+ }
+ }
+
+ rpc close-session {
+ description
+ "Request graceful termination of a NETCONF session.";
+
+ reference "RFC 6241, Section 7.8";
+ }
+
+ rpc kill-session {
+ description
+ "Force the termination of a NETCONF session.";
+
+ reference "RFC 6241, Section 7.9";
+
+ input {
+ leaf session-id {
+ type session-id-type;
+ mandatory true;
+ description
+ "Particular session to kill.";
+ }
+ }
+ }
+
+ rpc commit {
+ if-feature candidate;
+
+ description
+ "Commit the candidate configuration as the device's new
+ current configuration.";
+
+ reference "RFC 6241, Section 8.3.4.1";
+
+ input {
+ leaf confirmed {
+ if-feature confirmed-commit;
+ type empty;
+ description
+ "Requests a confirmed commit.";
+ reference "RFC 6241, Section 8.3.4.1";
+ }
+
+ leaf confirm-timeout {
+ if-feature confirmed-commit;
+ type uint32 {
+ range "1..max";
+ }
+ units "seconds";
+ default "600"; // 10 minutes
+ description
+ "The timeout interval for a confirmed commit.";
+ reference "RFC 6241, Section 8.3.4.1";
+ }
+
+ leaf persist {
+ if-feature confirmed-commit;
+ type string;
+ description
+ "This parameter is used to make a confirmed commit
+ persistent. A persistent confirmed commit is not aborted
+ if the NETCONF session terminates. The only way to abort
+ a persistent confirmed commit is to let the timer expire,
+ or to use the <cancel-commit> operation.
+
+ The value of this parameter is a token that must be given
+ in the 'persist-id' parameter of <commit> or
+ <cancel-commit> operations in order to confirm or cancel
+ the persistent confirmed commit.
+
+ The token should be a random string.";
+ reference "RFC 6241, Section 8.3.4.1";
+ }
+
+ leaf persist-id {
+ if-feature confirmed-commit;
+ type string;
+ description
+ "This parameter is given in order to commit a persistent
+ confirmed commit. The value must be equal to the value
+ given in the 'persist' parameter to the <commit> operation.
+ If it does not match, the operation fails with an
+ 'invalid-value' error.";
+ reference "RFC 6241, Section 8.3.4.1";
+ }
+
+ }
+ }
+
+ rpc discard-changes {
+ if-feature candidate;
+
+ description
+ "Revert the candidate configuration to the current
+ running configuration.";
+ reference "RFC 6241, Section 8.3.4.2";
+ }
+
+ rpc cancel-commit {
+ if-feature confirmed-commit;
+ description
+ "This operation is used to cancel an ongoing confirmed commit.
+ If the confirmed commit is persistent, the parameter
+ 'persist-id' must be given, and it must match the value of the
+ 'persist' parameter.";
+ reference "RFC 6241, Section 8.4.4.1";
+
+ input {
+ leaf persist-id {
+ type string;
+ description
+ "This parameter is given in order to cancel a persistent
+ confirmed commit. The value must be equal to the value
+ given in the 'persist' parameter to the <commit> operation.
+ If it does not match, the operation fails with an
+ 'invalid-value' error.";
+ }
+ }
+ }
+
+ rpc validate {
+ if-feature validate;
+
+ description
+ "Validates the contents of the specified configuration.";
+
+ reference "RFC 6241, Section 8.6.4.1";
+
+ input {
+ container source {
+ description
+ "Particular configuration to validate.";
+
+ choice config-source {
+ mandatory true;
+ description
+ "The configuration source to validate.";
+
+ case candidate {
+ leaf candidate {
+ if-feature candidate;
+ type empty;
+ description
+ "The candidate configuration is the config source.";
+ }
+ }
+ case running {
+ leaf running {
+ type empty;
+ description
+ "The running configuration is the config source.";
+ }
+ }
+ case startup {
+ leaf startup {
+ if-feature startup;
+ type empty;
+ description
+ "The startup configuration is the config source.";
+ }
+ }
+ case url {
+ leaf url {
+ if-feature url;
+ type inet:uri;
+ description
+ "The URL-based configuration is the config source.";
+ }
+ }
+ case config {
+ anyxml config {
+ description
+ "Inline Config content: <config> element. Represents
+ an entire configuration datastore, not
+ a subset of the running datastore.";
+ }
+ }
+ }
+ }
+ }
+ }
+
+}
\ No newline at end of file
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
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/ietf-system-tls-auth.yang b/drivers/microsemi/ea1000yang/src/main/yang/ietf-system-tls-auth.yang
new file mode 100644
index 0000000..c1cbf4c
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/ietf-system-tls-auth.yang
@@ -0,0 +1,215 @@
+module ietf-system-tls-auth {
+
+ yang-version 1;
+
+ namespace
+ "urn:ietf:params:xml:ns:yang:ietf-system-tls-auth";
+
+ prefix system-tls-auth;
+
+ import ietf-system {
+ prefix sys;
+ }
+ import ietf-netconf-acm {
+ prefix nacm;
+ }
+ import ietf-yang-types {
+ prefix yang;
+ }
+ import ietf-x509-cert-to-name {
+ prefix x509c2n;
+ }
+
+ organization
+ "IETF NETCONF (Network Configuration) Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ WG Chair: Mehmet Ersue
+ <mailto:mehmet.ersue@nsn.com>
+
+ WG Chair: Bert Wijnen
+ <mailto:bertietf@bwijnen.net>
+
+ Editor: Kent Watsen
+ <mailto:kwatsen@juniper.net>
+
+ Juergen Schoenwaelder
+ <mailto:j.schoenwaelder@jacobs-university.de>";
+
+ description
+ "This module augments the ietf-system module in order to
+ add TLS authentication configuration nodes to the
+ 'authentication' container.
+
+ Copyright (c) 2014 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD
+ License set forth in Section 4.c of the IETF Trust's
+ Legal Provisions Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC XXXX; see
+ the RFC itself for full legal notices.";
+
+ revision "2014-05-24" {
+ description "Initial version";
+ reference
+ "RFC XXXX: NETCONF Server Configuration Model";
+
+ }
+
+
+ feature tls-map-certificates {
+ description
+ "The tls-map-certificates feature indicates that the
+ NETCONF server implements mapping X.509 certificates to NETCONF
+ usernames.";
+ }
+
+ feature tls-map-pre-shared-keys {
+ description
+ "The tls-map-pre-shared-keys feature indicates that the
+ NETCONF server implements mapping TLS pre-shared keys to NETCONF
+ usernames.";
+ }
+
+ grouping tls-global-config {
+ container trusted-ca-certs {
+ description
+ "A list of Certificate Authority (CA) certificates that a
+ NETCONF server can use to authenticate a NETCONF client's
+ certificate. A client's certificate is authenticated if
+ its Issuer matches one of the configured trusted CA
+ certificates.";
+ leaf-list trusted-ca-cert {
+ type binary;
+ description
+ "The binary certificate structure, as
+ specified by RFC 5246, Section 7.4.6, i.e.,:
+
+ opaque ASN.1Cert<1..2^24>;
+
+ ";
+ reference
+ "RFC 5246: The Transport Layer Security (TLS)
+ Protocol Version 1.2";
+
+ }
+ } // container trusted-ca-certs
+
+ container trusted-client-certs {
+ description
+ "A list of client certificates that a NETCONF server can
+ use to authenticate a NETCONF client's certificate. A
+ client's certificate is authenticated if it is an exact
+ match to one of the configured trusted client certificates.";
+ leaf-list trusted-client-cert {
+ type binary;
+ description
+ "The binary certificate structure, as
+ specified by RFC 5246, Section 7.4.6, i.e.,:
+
+ opaque ASN.1Cert<1..2^24>;
+
+ ";
+ reference
+ "RFC 5246: The Transport Layer Security (TLS)
+ Protocol Version 1.2";
+
+ }
+ } // container trusted-client-certs
+
+ container cert-maps {
+ if-feature tls-map-certificates;
+ description
+ "The cert-maps container is used by a NETCONF server to
+ map the NETCONF client's presented X.509 certificate to
+ a NETCONF username.
+
+ If no matching and valid cert-to-name list entry can be
+ found, then the NETCONF server MUST close the connection,
+ and MUST NOT accept NETCONF messages over it.";
+ uses x509c2n:cert-to-name;
+ } // container cert-maps
+
+ container psk-maps {
+ if-feature tls-map-pre-shared-keys;
+ description
+ "During the TLS Handshake, the client indicates which
+ key to use by including a PSK identity in the TLS
+ ClientKeyExchange message. On the NETCONF server side,
+ this PSK identity is used to look up an entry in the psk-map
+ list. If such an entry is found, and the pre-shared keys
+ match, then the client is authenticated. The NETCONF
+ server uses the value from the user-name leaf in the
+ psk-map list as the NETCONF username. If the NETCONF
+ server cannot find an entry in the psk-map list, or if
+ the pre-shared keys do not match, then the NETCONF
+ server terminates the connection.";
+ reference
+ "RFC 4279: Pre-Shared Key Ciphersuites for Transport Layer
+ Security (TLS)";
+
+ list psk-map {
+ key "psk-identity";
+ leaf psk-identity {
+ type string;
+ description
+ "The PSK identity encoded as a UTF-8 string. For
+ details how certain common PSK identity formats can
+ be encoded in UTF-8, see section 5.1. of RFC 4279.";
+ reference
+ "RFC 4279: Pre-Shared Key Ciphersuites for Transport
+ Layer Security (TLS)";
+
+ }
+
+ leaf user-name {
+ type nacm:user-name-type;
+ mandatory true;
+ description
+ "The NETCONF username associated with this PSK
+ identity.";
+ }
+
+ leaf not-valid-before {
+ type yang:date-and-time;
+ description
+ "This PSK identity is not valid before the given date
+ and time.";
+ }
+
+ leaf not-valid-after {
+ type yang:date-and-time;
+ description
+ "This PSK identity is not valid after the given date
+ and time.";
+ }
+
+ leaf key {
+// nacm:default-deny-all;
+ type yang:hex-string;
+ mandatory true;
+ description
+ "The key associated with the PSK identity";
+ reference
+ "RFC 4279: Pre-Shared Key Ciphersuites for Transport
+ Layer Security (TLS)";
+
+ }
+ } // list psk-map
+ } // container psk-maps
+ } // grouping tls-global-config
+
+ augment /sys:system/sys:authentication {
+ container tls {
+ uses tls-global-config;
+ } // container tls
+ }
+ } // module ietf-system-tls-auth
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/ietf-system.yang b/drivers/microsemi/ea1000yang/src/main/yang/ietf-system.yang
new file mode 100644
index 0000000..12e6a9f
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/ietf-system.yang
@@ -0,0 +1,832 @@
+module ietf-system {
+ namespace "urn:ietf:params:xml:ns:yang:ietf-system";
+ prefix "sys";
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import ietf-netconf-acm {
+ prefix nacm;
+ }
+
+ import iana-crypt-hash {
+ prefix ianach;
+ }
+
+ import msea-types {
+ prefix msea;
+ revision-date 2016-02-29;
+ }
+
+ organization
+ "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/netmod/>
+ WG List: <mailto:netmod@ietf.org>
+
+ WG Chair: Thomas Nadeau
+ <mailto:tnadeau@lucidvision.com>
+
+ WG Chair: Juergen Schoenwaelder
+ <mailto:j.schoenwaelder@jacobs-university.de>
+
+ Editor: Andy Bierman
+ <mailto:andy@yumaworks.com>
+
+ Editor: Martin Bjorklund
+ <mailto:mbj@tail-f.com>";
+
+ description
+ "This module contains a collection of YANG definitions for the
+ configuration and identification of some common system
+ properties within a device containing a NETCONF server. This
+ includes data node definitions for system identification,
+ time-of-day management, user management, DNS resolver
+ configuration, and some protocol operations for system
+ management.
+
+ Copyright (c) 2014 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC 7317; see
+ the RFC itself for full legal notices.";
+
+ revision 2014-08-06 {
+ description
+ "Initial revision.";
+ reference
+ "RFC 7317: A YANG Data Model for System Management";
+ }
+
+ /*
+ * Typedefs
+ */
+
+ typedef timezone-name {
+ type string;
+ description
+ "A time zone name as used by the Time Zone Database,
+ sometimes referred to as the 'Olson Database'.
+
+ The exact set of valid values is an implementation-specific
+ matter. Client discovery of the exact set of time zone names
+ for a particular server is out of scope.";
+ reference
+ "RFC 6557: Procedures for Maintaining the Time Zone Database";
+ }
+
+ /*
+ * Features
+ */
+
+ feature radius {
+ description
+ "Indicates that the device can be configured as a RADIUS
+ client.";
+ reference
+ "RFC 2865: Remote Authentication Dial In User Service (RADIUS)";
+ }
+
+ feature authentication {
+ description
+ "Indicates that the device supports configuration of
+ user authentication.";
+ }
+
+ feature local-users {
+ if-feature authentication;
+ description
+ "Indicates that the device supports configuration of
+ local user authentication.";
+ }
+
+ feature radius-authentication {
+ if-feature radius;
+ if-feature authentication;
+ description
+ "Indicates that the device supports configuration of user
+ authentication over RADIUS.";
+ reference
+ "RFC 2865: Remote Authentication Dial In User Service (RADIUS)
+ RFC 5607: Remote Authentication Dial-In User Service (RADIUS)
+ Authorization for Network Access Server (NAS)
+ Management";
+ }
+
+ feature ntp {
+ description
+ "Indicates that the device can be configured to use one or
+ more NTP servers to set the system date and time.";
+ }
+
+ feature ntp-udp-port {
+ if-feature ntp;
+ description
+ "Indicates that the device supports the configuration of
+ the UDP port for NTP servers.
+
+ This is a 'feature', since many implementations do not support
+ any port other than the default port.";
+ }
+
+ feature timezone-name {
+ description
+ "Indicates that the local time zone on the device
+ can be configured to use the TZ database
+ to set the time zone and manage daylight saving time.";
+ reference
+ "RFC 6557: Procedures for Maintaining the Time Zone Database";
+ }
+
+ feature dns-udp-tcp-port {
+ description
+ "Indicates that the device supports the configuration of
+ the UDP and TCP port for DNS servers.
+
+ This is a 'feature', since many implementations do not support
+ any port other than the default port.";
+ }
+
+ /*
+ * Identities
+ */
+
+ identity authentication-method {
+ description
+ "Base identity for user authentication methods.";
+ }
+
+ identity radius {
+ base authentication-method;
+ description
+ "Indicates user authentication using RADIUS.";
+ reference
+ "RFC 2865: Remote Authentication Dial In User Service (RADIUS)
+ RFC 5607: Remote Authentication Dial-In User Service (RADIUS)
+ Authorization for Network Access Server (NAS)
+ Management";
+ }
+
+ identity local-users {
+ base authentication-method;
+ description
+ "Indicates password-based authentication of locally
+ configured users.";
+ }
+
+ identity radius-authentication-type {
+ description
+ "Base identity for RADIUS authentication types.";
+ }
+
+ identity radius-pap {
+ base radius-authentication-type;
+ description
+ "The device requests Password Authentication Protocol (PAP)
+ authentication from the RADIUS server.";
+ reference
+ "RFC 2865: Remote Authentication Dial In User Service (RADIUS)";
+ }
+
+ identity radius-chap {
+ base radius-authentication-type;
+ description
+ "The device requests Challenge Handshake Authentication
+ Protocol (CHAP) authentication from the RADIUS server.";
+ reference
+ "RFC 2865: Remote Authentication Dial In User Service (RADIUS)";
+ }
+
+ /*
+ * Configuration data nodes
+ */
+
+ container system {
+ description
+ "System group configuration.";
+
+ leaf contact {
+ type string;
+ description
+ "The administrator contact information for the system.
+
+ A server implementation MAY map this leaf to the sysContact
+ MIB object. Such an implementation needs to use some
+ mechanism to handle the differences in size and characters
+ allowed between this leaf and sysContact. The definition of
+ such a mechanism is outside the scope of this document.";
+ reference
+ "RFC 3418: Management Information Base (MIB) for the
+ Simple Network Management Protocol (SNMP)
+ SNMPv2-MIB.sysContact";
+ }
+
+ leaf hostname {
+ type inet:domain-name;
+ description
+ "The name of the host. This name can be a single domain
+ label or the fully qualified domain name of the host.";
+
+ }
+
+ leaf location {
+ type string;
+ description
+ "The system location.
+
+ A server implementation MAY map this leaf to the sysLocation
+ MIB object. Such an implementation needs to use some
+ mechanism to handle the differences in size and characters
+ allowed between this leaf and sysLocation. The definition
+ of such a mechanism is outside the scope of this document.";
+
+ reference
+ "RFC 3418: Management Information Base (MIB) for the
+ Simple Network Management Protocol (SNMP)
+ SNMPv2-MIB.sysLocation";
+ }
+
+ container clock {
+ description
+ "Configuration of the system date and time properties.";
+
+ choice timezone {
+ description
+ "The system time zone information.";
+
+ case timezone-name {
+ if-feature timezone-name;
+ leaf timezone-name {
+ type timezone-name;
+ description
+ "The TZ database name to use for the system, such
+ as 'Europe/Stockholm'.";
+ }
+ }
+ case timezone-utc-offset {
+ leaf timezone-utc-offset {
+ type int16 {
+ range "-1500 .. 1500";
+ }
+ units "minutes";
+ description
+ "The number of minutes to add to UTC time to
+ identify the time zone for this system. For example,
+ 'UTC - 8:00 hours' would be represented as '-480'.
+ Note that automatic daylight saving time adjustment
+ is not provided if this object is used.";
+ }
+ }
+ }
+ }
+
+ container ntp {
+ if-feature ntp;
+ presence
+ "Enables the NTP client unless the 'enabled' leaf
+ (which defaults to 'true') is set to 'false'";
+ description
+ "Configuration of the NTP client.";
+
+ leaf enabled {
+ type boolean;
+ default true;
+ description
+ "Indicates that the system should attempt to
+ synchronize the system clock with an NTP server
+ from the 'ntp/server' list.";
+ }
+ list server {
+ key name;
+ max-elements 3;
+ description
+ "List of NTP servers to use for system clock
+ synchronization. If '/system/ntp/enabled'
+ is 'true', then the system will attempt to
+ contact and utilize the specified NTP servers.
+ If DHCP retrieves NTP servers then these values
+ are used in addition to those";
+
+ leaf name {
+ type string;
+ description
+ "An arbitrary name for the NTP server.";
+ }
+ choice transport {
+ mandatory true;
+ description
+ "The transport-protocol-specific parameters for this
+ server.";
+
+ case udp {
+ container udp {
+ description
+ "Contains UDP-specific configuration parameters
+ for NTP.";
+ leaf address {
+ type inet:host;
+ mandatory true;
+ description
+ "The address of the NTP server.";
+ }
+// leaf port {
+// if-feature ntp-udp-port;
+// type inet:port-number;
+// default 123;
+// description
+// "The port number of the NTP server.";
+// }
+ }
+ }
+ }
+
+// leaf association-type { //These elements are omitted because MSEA1000 does not support these options
+// type enumeration {
+// enum server {
+// description
+// "Use client association mode. This device
+// will not provide synchronization to the
+// configured NTP server.";
+// }
+// enum peer {
+// description
+// "Use symmetric active association mode.
+// This device may provide synchronization
+// to the configured NTP server.";
+// }
+// enum pool {
+// description
+// "Use client association mode with one or
+// more of the NTP servers found by DNS
+// resolution of the domain name given by
+// the 'address' leaf. This device will not
+// provide synchronization to the servers.";
+// }
+// }
+// default server;
+// description
+// "The desired association type for this NTP server.";
+// }
+// leaf iburst {
+// type boolean;
+// default false;
+// description
+// "Indicates whether this server should enable burst
+// synchronization or not.";
+// }
+// leaf prefer {
+// type boolean;
+// default false;
+// description
+// "Indicates whether this server should be preferred
+// or not.";
+// }
+ }
+ }
+
+ container dns-resolver {
+ presence "If defined enables the DNS servers to be configured.";
+
+ description
+ "Configuration of the DNS resolver. If DHCP retrieves DNS
+ servers or search domains then these values are used in
+ addition to those";
+
+ leaf-list search {
+ type inet:domain-name;
+ max-elements 3;
+ ordered-by user;
+ description
+ "An ordered list of domains to search when resolving
+ a host name.";
+ }
+ list server {
+ key name;
+ max-elements 3;
+ ordered-by user;
+ description
+ "List of the DNS servers that the resolver should query.
+
+ When the resolver is invoked by a calling application, it
+ sends the query to the first name server in this list. If
+ no response has been received within 'timeout' seconds,
+ the resolver continues with the next server in the list.
+ If no response is received from any server, the resolver
+ continues with the first server again. When the resolver
+ has traversed the list 'attempts' times without receiving
+ any response, it gives up and returns an error to the
+ calling application.
+
+ Implementations MAY limit the number of entries in this
+ list.";
+
+ leaf name {
+ type string;
+ description
+ "An arbitrary name for the DNS server.";
+ }
+ choice transport {
+ mandatory true;
+ description
+ "The transport-protocol-specific parameters for this
+ server.";
+
+ case udp-and-tcp {
+ container udp-and-tcp {
+ description
+ "Contains UDP- and TCP-specific configuration
+ parameters for DNS.";
+ reference
+ "RFC 1035: Domain Names - Implementation and
+ Specification
+ RFC 5966: DNS Transport over TCP - Implementation
+ Requirements";
+
+ leaf address {
+ type inet:ip-address;
+ mandatory true;
+ description
+ "The address of the DNS server.";
+ }
+// leaf port {
+// if-feature dns-udp-tcp-port;
+// type inet:port-number;
+// default 53;
+// description
+// "The UDP and TCP port number of the DNS server.";
+// }
+ }
+ }
+ }
+ }
+// container options { //These elements are omitted because MSEA1000 does not support these options
+// description
+// "Resolver options. The set of available options has been
+// limited to those that are generally available across
+// different resolver implementations and generally useful.";
+// leaf timeout {
+// type uint8 {
+// range "1..max";
+// }
+// units "seconds";
+// default "5";
+// description
+// "The amount of time the resolver will wait for a
+// response from each remote name server before
+// retrying the query via a different name server.";
+// }
+// leaf attempts {
+// type uint8 {
+// range "1..max";
+// }
+// default "2";
+// description
+// "The number of times the resolver will send a query to
+// all of its name servers before giving up and returning
+// an error to the calling application.";
+// }
+// }
+ }
+
+ container radius {
+ if-feature radius;
+
+ description
+ "Configuration of the RADIUS client.";
+
+ list server {
+ key name;
+ ordered-by user;
+ description
+ "List of RADIUS servers used by the device.
+
+ When the RADIUS client is invoked by a calling
+ application, it sends the query to the first server in
+ this list. If no response has been received within
+ 'timeout' seconds, the client continues with the next
+ server in the list. If no response is received from any
+ server, the client continues with the first server again.
+ When the client has traversed the list 'attempts' times
+ without receiving any response, it gives up and returns an
+ error to the calling application.";
+
+ leaf name {
+ type string;
+ description
+ "An arbitrary name for the RADIUS server.";
+ }
+ choice transport {
+ mandatory true;
+ description
+ "The transport-protocol-specific parameters for this
+ server.";
+
+ case udp {
+ container udp {
+ description
+ "Contains UDP-specific configuration parameters
+ for RADIUS.";
+ leaf address {
+ type inet:host;
+ mandatory true;
+ description
+ "The address of the RADIUS server.";
+ }
+
+ leaf authentication-port {
+ type inet:port-number;
+ default "1812";
+ description
+ "The port number of the RADIUS server.";
+ }
+ leaf shared-secret {
+ type string;
+ mandatory true;
+// nacm:default-deny-all;
+ description
+ "The shared secret, which is known to both the
+ RADIUS client and server.";
+ reference
+ "RFC 2865: Remote Authentication Dial In User
+ Service (RADIUS)";
+ }
+ }
+ }
+ }
+ leaf authentication-type {
+ type identityref {
+ base radius-authentication-type;
+ }
+ default radius-pap;
+ description
+ "The authentication type requested from the RADIUS
+ server.";
+ }
+ }
+ container options {
+ description
+ "RADIUS client options.";
+
+ leaf timeout {
+ type uint8 {
+ range "1..max";
+ }
+ units "seconds";
+ default "5";
+ description
+ "The number of seconds the device will wait for a
+ response from each RADIUS server before trying with a
+ different server.";
+ }
+
+ leaf attempts {
+ type uint8 {
+ range "1..max";
+ }
+ default "2";
+ description
+ "The number of times the device will send a query to
+ all of its RADIUS servers before giving up.";
+ }
+ }
+ }
+
+ container authentication {
+// nacm:default-deny-write;
+ if-feature authentication;
+
+ description
+ "The authentication configuration subtree.";
+
+ leaf-list user-authentication-order {
+ type identityref {
+ base authentication-method;
+ }
+ must '(. != "sys:radius" or ../../radius/server)' {
+ error-message
+ "When 'radius' is used, a RADIUS server"
+ + " must be configured.";
+ description
+ "When 'radius' is used as an authentication method,
+ a RADIUS server must be configured.";
+ }
+ ordered-by user;
+
+ description
+ "When the device authenticates a user with a password,
+ it tries the authentication methods in this leaf-list in
+ order. If authentication with one method fails, the next
+ method is used. If no method succeeds, the user is
+ denied access.
+
+ An empty user-authentication-order leaf-list still allows
+ authentication of users using mechanisms that do not
+ involve a password.
+
+ If the 'radius-authentication' feature is advertised by
+ the NETCONF server, the 'radius' identity can be added to
+ this list.
+
+ If the 'local-users' feature is advertised by the
+ NETCONF server, the 'local-users' identity can be
+ added to this list.";
+ }
+
+ list user {
+ if-feature local-users;
+ key name;
+ description
+ "The list of local users configured on this device.";
+
+ leaf name {
+ type string;
+ description
+ "The user name string identifying this entry.";
+
+ must ".='netconf' or .='admin' or .='readonly'" {
+ error-message "The set of users is not changeable on this device. Must have admin, netconf and readonly";
+ error-app-tag "msea-sys-must-01";
+ }
+ }
+ leaf password {
+ type ianach:crypt-hash;
+ description
+ "The password for this entry.";
+ }
+ list authorized-key {
+ key name;
+ description
+ "A list of public SSH keys for this user. These keys
+ are allowed for SSH authentication, as described in
+ RFC 4253.";
+ reference
+ "RFC 4253: The Secure Shell (SSH) Transport Layer
+ Protocol";
+
+ leaf name {
+ type string;
+ description
+ "An arbitrary name for the SSH key.";
+ }
+
+ leaf algorithm {
+ type string;
+ mandatory true;
+ description
+ "The public key algorithm name for this SSH key.
+
+ Valid values are the values in the IANA 'Secure Shell
+ (SSH) Protocol Parameters' registry, Public Key
+ Algorithm Names.";
+ reference
+ "IANA 'Secure Shell (SSH) Protocol Parameters'
+ registry, Public Key Algorithm Names";
+ }
+ leaf key-data {
+ type binary;
+ mandatory true;
+ description
+ "The binary public key data for this SSH key, as
+ specified by RFC 4253, Section 6.6, i.e.:
+
+ string certificate or public key format
+ identifier
+ byte[n] key/certificate data.";
+ reference
+ "RFC 4253: The Secure Shell (SSH) Transport Layer
+ Protocol";
+ }
+ }
+ }
+ }
+ }
+
+ /*
+ * Operational state data nodes
+ */
+
+ container system-state {
+ config false;
+ description
+ "System group operational state.";
+
+ container platform {
+ description
+ "Contains vendor-specific information for
+ identifying the system platform and operating system.";
+ reference
+ "IEEE Std 1003.1-2008 - sys/utsname.h";
+
+ leaf os-name {
+ type string;
+ description
+ "The name of the operating system in use -
+ for example, 'Linux'.";
+ reference
+ "IEEE Std 1003.1-2008 - utsname.sysname";
+ }
+ leaf os-release {
+ type string;
+ description
+ "The current release level of the operating
+ system in use. This string MAY indicate
+ the OS source code revision.";
+ reference
+ "IEEE Std 1003.1-2008 - utsname.release";
+ }
+ leaf os-version {
+ type string;
+ description
+ "The current version level of the operating
+ system in use. This string MAY indicate
+ the specific OS build date and target variant
+ information.";
+ reference
+ "IEEE Std 1003.1-2008 - utsname.version";
+ }
+ leaf machine {
+ type string;
+ description
+ "A vendor-specific identifier string representing
+ the hardware in use.";
+ reference
+ "IEEE Std 1003.1-2008 - utsname.machine";
+ }
+ }
+
+ container clock {
+ description
+ "Monitoring of the system date and time properties.";
+
+ leaf current-datetime {
+ type yang:date-and-time;
+ description
+ "The current system date and time.";
+ }
+
+ leaf boot-datetime {
+ type yang:date-and-time;
+ description
+ "The system date and time when the system last restarted.";
+ }
+ }
+ }
+
+ rpc set-current-datetime {
+// nacm:default-deny-all;
+ description
+ "Set the /system-state/clock/current-datetime leaf
+ to the specified value.
+
+ If the system is using NTP (i.e., /system/ntp/enabled
+ is set to 'true'), then this operation will fail with
+ error-tag 'operation-failed' and error-app-tag value of
+ 'ntp-active'.";
+ input {
+ leaf current-datetime {
+ type yang:date-and-time;
+ mandatory true;
+ description
+ "The current system date and time.";
+ }
+ }
+ }
+
+ rpc system-restart {
+// nacm:default-deny-all;
+ description
+ "Request that the entire system be restarted immediately.
+ A server SHOULD send an rpc reply to the client before
+ restarting the system.";
+ input {
+ leaf reset-option {
+ type msea:reset-config-options;
+ description "Optionally specify a parameter that can be
+ used to reset the configuration on the device or
+ reset it to factory defaults";
+ }
+ }
+ }
+
+ rpc system-shutdown {
+// nacm:default-deny-all;
+ description
+ "Request that the entire system be shut down immediately.
+ A server SHOULD send an rpc reply to the client before
+ shutting down the system.";
+ }
+
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/ietf-x509-cert-to-name.yang b/drivers/microsemi/ea1000yang/src/main/yang/ietf-x509-cert-to-name.yang
new file mode 100644
index 0000000..2996954
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/ietf-x509-cert-to-name.yang
@@ -0,0 +1,248 @@
+module ietf-x509-cert-to-name {
+ namespace "urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name";
+ prefix x509c2n;
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+
+ organization "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+ contact
+ "WG Web: <http://tools.ietf.org/wg/netmod/>
+ WG List: <mailto:netmod@ietf.org>
+
+ WG Chair: David Kessens
+ <mailto:david.kessens@nsn.com>
+
+ WG Chair: Juergen Schoenwaelder
+ <mailto:j.schoenwaelder@jacobs-university.de>
+
+ Editor: Martin Bjorklund
+ <mailto:mbj@tail-f.com>
+
+ Editor: Juergen Schoenwaelder
+ <mailto:j.schoenwaelder@jacobs-university.de>";
+ description
+ "This module contains a collection of YANG definitions for
+ extracting a name from a X.509 certificate.
+
+ The algorithm used to extract a name from a X.509 certificate
+ was first defined in RFC 6353.
+
+ Copyright (c) 2013 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC XXXX; see
+ the RFC itself for full legal notices.";
+ reference
+ "RFC6353: Transport Layer Security (TLS) Transport Model for
+ the Simple Network Management Protocol (SNMP)";
+
+ revision 2013-03-26 {
+ description
+ "Initial revision.";
+ reference "RFC XXXX: A YANG Data Model for SNMP Configuration";
+ }
+
+ typedef tls-fingerprint {
+ type yang:hex-string {
+ pattern "([0-9a-fA-F]){2}(:([0-9a-fA-F]){2}){0,254}";
+ }
+ description
+ "A fingerprint value that can be used to uniquely reference
+ other data of potentially arbitrary length.
+
+ An tls-fingerprint value is composed of a 1-octet hashing
+ algorithm identifier followed by the fingerprint value. The
+ first octet value identifying the hashing algorithm is taken
+ from the IANA TLS HashAlgorithm Registry (RFC 5246). The
+ remaining octets are filled using the results of the hashing
+ algorithm.";
+ reference "SNMP-TLS-TM-MIB.SnmpTLSFingerprint";
+ }
+
+ identity cert-to-name {
+ description
+ "Base identity for algorithms to derive a name from a
+ certificate.";
+ }
+
+ identity specified {
+ base cert-to-name;
+ description
+ "Directly specifies the name to be used for the certificate.
+ The value of the leaf 'name' in 'cert-to-name' list is used.";
+ reference "SNMP-TLS-TM-MIB.snmpTlstmCertSpecified";
+ }
+
+ identity san-rfc822-name {
+ base cert-to-name;
+ description
+ "Maps a subjectAltName's rfc822Name to a name. The local part
+ of the rfc822Name is passed unaltered but the host-part of the
+ name must be passed in lowercase. This mapping results in a
+ 1:1 correspondence between equivalent subjectAltName
+ rfc822Name values and name values except that the host-part
+ of the name MUST be passed in lowercase. For example, the
+ rfc822Name field FooBar@Example.COM is mapped to name
+ FooBar@example.com.";
+ reference "SNMP-TLS-TM-MIB.snmpTlstmCertSANRFC822Name";
+ }
+
+ identity san-dns-name {
+ base cert-to-name;
+ description
+ "Maps a subjectAltName's dNSName to a name after first
+ converting it to all lowercase (RFC 5280 does not specify
+ converting to lowercase so this involves an extra step).
+ This mapping results in a 1:1 correspondence between
+ subjectAltName dNSName values and the name values.";
+ reference "SNMP-TLS-TM-MIB.snmpTlstmCertSANDNSName";
+ }
+
+ identity san-ip-address {
+ base cert-to-name;
+ description
+ "Maps a subjectAltName's iPAddress to a name by
+ transforming the binary encoded address as follows:
+
+ 1) for IPv4, the value is converted into a
+ decimal-dotted quad address (e.g., '192.0.2.1').
+
+ 2) for IPv6 addresses, the value is converted into a
+ 32-character all lowercase hexadecimal string
+ without any colon separators.
+
+ This mapping results in a 1:1 correspondence between
+ subjectAltName iPAddress values and the name values.";
+ reference "SNMP-TLS-TM-MIB.snmpTlstmCertSANIpAddress";
+ }
+
+ identity san-any {
+ base cert-to-name;
+ description
+ "Maps any of the following fields using the corresponding
+ mapping algorithms:
+
+ +------------+-----------------+
+ | Type | Algorithm |
+ |------------+-----------------|
+ | rfc822Name | san-rfc822-name |
+ | dNSName | san-dns-name |
+ | iPAddress | san-ip-address |
+ +------------+-----------------+
+
+ The first matching subjectAltName value found in the
+ certificate of the above types MUST be used when deriving
+ the name. The mapping algorithm specified in the
+ 'Algorithm' column MUST be used to derive the name.
+
+ This mapping results in a 1:1 correspondence between
+ subjectAltName values and name values. The three sub-mapping
+ algorithms produced by this combined algorithm cannot produce
+ conflicting results between themselves.";
+ reference "SNMP-TLS-TM-MIB.snmpTlstmCertSANAny";
+ }
+
+ identity common-name {
+ base cert-to-name;
+ description
+ "Maps a certificate's CommonName to a name after converting
+ it to a UTF-8 encoding. The usage of CommonNames is
+ deprecated and users are encouraged to use subjectAltName
+ mapping methods instead. This mapping results in a 1:1
+ correspondence between certificate CommonName values and name
+ values.";
+ reference "SNMP-TLS-TM-MIB.snmpTlstmCertCommonName";
+ }
+
+ grouping cert-to-name {
+ description
+ "Defines nodes for mapping certificates to names. Modules
+ that uses this grouping should describe how the resulting
+ name is used.";
+ list cert-to-name {
+ key "id";
+ description
+ "This list defines how certificates are mapped to names.
+ The name is derived by considering each cert-to-name
+ list entry in order. The cert-to-name entry's fingerprint
+ determines whether the list entry is a match:
+
+ 1) If the cert-to-name list entry's fingerprint value
+ matches that of the presented certificate, then consider
+ the list entry as a successful match.
+
+ 2) If the cert-to-name list entry's fingerprint value
+ matches that of a locally held copy of a trusted CA
+ certificate, and that CA certificate was part of the CA
+ certificate chain to the presented certificate, then
+ consider the list entry as a successful match.
+
+ Once a matching cert-to-name list entry has been found, the
+ map-type is used to determine how the name associated with
+ the certificate should be determined. See the map-type
+ leaf's description for details on determining the name value.
+ If it is impossible to determine a name from the cert-to-name
+ list entry's data combined with the data presented in the
+ certificate, then additional cert-to-name list entries MUST
+ be searched looking for another potential match.
+
+ Security administrators are encouraged to make use of
+ certificates with subjectAltName fields that can be mapped to
+ names so that a single root CA certificate can allow all
+ child certificate's subjectAltName to map directly to a name
+ via a 1:1 transformation.";
+ reference "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNEntry";
+ leaf id {
+ type uint32;
+ description
+ "The id specifies the order in which the entries in the
+ cert-to-name list are searched. Entries with lower
+ numbers are searched first.";
+ reference "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNID";
+ }
+ leaf fingerprint {
+ type x509c2n:tls-fingerprint;
+ mandatory true;
+ description
+ "Specifies a value with which the fingerprint of the
+ certificate presented by the peer is compared. If the
+ fingerprint of the certificate presented by the peer does
+ not match the fingerprint configured, then the entry is
+ skipped and the search for a match continues.";
+ reference "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNFingerprint";
+ }
+ leaf map-type {
+ type identityref {
+ base cert-to-name;
+ }
+ mandatory true;
+ description
+ "Specifies the algorithm used to map the certificate
+ presented by the peer to a name.
+
+ Mappings that need additional configuration objects should
+ use the 'when' statement to make them conditional based on
+ the 'map-type'.";
+ reference "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNMapType";
+ }
+ leaf name {
+ when "../map-type = 'x509c2n:specified'";
+ type string;
+ mandatory true;
+ description
+ "Directly specifies the NETCONF username when the
+ 'map-type' is 'specified'.";
+ reference "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNData";
+ }
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/ietf-yang-types.yang b/drivers/microsemi/ea1000yang/src/main/yang/ietf-yang-types.yang
new file mode 100644
index 0000000..371a091
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/ietf-yang-types.yang
@@ -0,0 +1,480 @@
+module ietf-yang-types {
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types";
+ prefix "yang";
+
+ organization
+ "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+ contact
+ "WG Web: <http://tools.ietf.org/wg/netmod/>
+ WG List: <mailto:netmod@ietf.org>
+
+ WG Chair: David Kessens
+ <mailto:david.kessens@nsn.com>
+
+ WG Chair: Juergen Schoenwaelder
+ <mailto:j.schoenwaelder@jacobs-university.de>
+
+ Editor: Juergen Schoenwaelder
+ <mailto:j.schoenwaelder@jacobs-university.de>";
+
+ description
+ "This module contains a collection of generally useful derived
+ YANG data types.
+
+ Copyright (c) 2013 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC 6991; see
+ the RFC itself for full legal notices.";
+
+ revision 2013-07-15 {
+ description
+ "This revision adds the following new data types:
+ - yang-identifier
+ - hex-string
+ - uuid
+ - dotted-quad";
+ reference
+ "RFC 6991: Common YANG Data Types";
+ }
+
+ revision 2010-09-24 {
+ description
+ "Initial revision.";
+ reference
+ "RFC 6021: Common YANG Data Types";
+ }
+
+ /*** collection of counter and gauge types ***/
+
+ typedef counter32 {
+ type uint32;
+ description
+ "The counter32 type represents a non-negative integer
+ that monotonically increases until it reaches a
+ maximum value of 2^32-1 (4294967295 decimal), when it
+ wraps around and starts increasing again from zero.
+
+ Counters have no defined 'initial' value, and thus, a
+ single value of a counter has (in general) no information
+ content. Discontinuities in the monotonically increasing
+ value normally occur at re-initialization of the
+ management system, and at other times as specified in the
+ description of a schema node using this type. If such
+ other times can occur, for example, the creation of
+ a schema node of type counter32 at times other than
+ re-initialization, then a corresponding schema node
+ should be defined, with an appropriate type, to indicate
+ the last discontinuity.
+
+ The counter32 type should not be used for configuration
+ schema nodes. A default statement SHOULD NOT be used in
+ combination with the type counter32.
+
+ In the value set and its semantics, this type is equivalent
+ to the Counter32 type of the SMIv2.";
+ reference
+ "RFC 2578: Structure of Management Information Version 2
+ (SMIv2)";
+ }
+
+ typedef zero-based-counter32 {
+ type yang:counter32;
+ default "0";
+ description
+ "The zero-based-counter32 type represents a counter32
+ that has the defined 'initial' value zero.
+
+ A schema node of this type will be set to zero (0) on creation
+ and will thereafter increase monotonically until it reaches
+ a maximum value of 2^32-1 (4294967295 decimal), when it
+ wraps around and starts increasing again from zero.
+
+ Provided that an application discovers a new schema node
+ of this type within the minimum time to wrap, it can use the
+ 'initial' value as a delta. It is important for a management
+ station to be aware of this minimum time and the actual time
+ between polls, and to discard data if the actual time is too
+ long or there is no defined minimum time.
+
+ In the value set and its semantics, this type is equivalent
+ to the ZeroBasedCounter32 textual convention of the SMIv2.";
+ reference
+ "RFC 4502: Remote Network Monitoring Management Information
+ Base Version 2";
+ }
+
+ typedef counter64 {
+ type uint64;
+ description
+ "The counter64 type represents a non-negative integer
+ that monotonically increases until it reaches a
+ maximum value of 2^64-1 (18446744073709551615 decimal),
+ when it wraps around and starts increasing again from zero.
+
+ Counters have no defined 'initial' value, and thus, a
+ single value of a counter has (in general) no information
+ content. Discontinuities in the monotonically increasing
+ value normally occur at re-initialization of the
+ management system, and at other times as specified in the
+ description of a schema node using this type. If such
+ other times can occur, for example, the creation of
+ a schema node of type counter64 at times other than
+ re-initialization, then a corresponding schema node
+ should be defined, with an appropriate type, to indicate
+ the last discontinuity.
+
+ The counter64 type should not be used for configuration
+ schema nodes. A default statement SHOULD NOT be used in
+ combination with the type counter64.
+
+ In the value set and its semantics, this type is equivalent
+ to the Counter64 type of the SMIv2.";
+ reference
+ "RFC 2578: Structure of Management Information Version 2
+ (SMIv2)";
+ }
+
+ typedef zero-based-counter64 {
+ type yang:counter64;
+ default "0";
+ description
+ "The zero-based-counter64 type represents a counter64 that
+ has the defined 'initial' value zero.
+
+
+
+
+ A schema node of this type will be set to zero (0) on creation
+ and will thereafter increase monotonically until it reaches
+ a maximum value of 2^64-1 (18446744073709551615 decimal),
+ when it wraps around and starts increasing again from zero.
+
+ Provided that an application discovers a new schema node
+ of this type within the minimum time to wrap, it can use the
+ 'initial' value as a delta. It is important for a management
+ station to be aware of this minimum time and the actual time
+ between polls, and to discard data if the actual time is too
+ long or there is no defined minimum time.
+
+ In the value set and its semantics, this type is equivalent
+ to the ZeroBasedCounter64 textual convention of the SMIv2.";
+ reference
+ "RFC 2856: Textual Conventions for Additional High Capacity
+ Data Types";
+ }
+
+ typedef gauge32 {
+ type uint32;
+ description
+ "The gauge32 type represents a non-negative integer, which
+ may increase or decrease, but shall never exceed a maximum
+ value, nor fall below a minimum value. The maximum value
+ cannot be greater than 2^32-1 (4294967295 decimal), and
+ the minimum value cannot be smaller than 0. The value of
+ a gauge32 has its maximum value whenever the information
+ being modeled is greater than or equal to its maximum
+ value, and has its minimum value whenever the information
+ being modeled is smaller than or equal to its minimum value.
+ If the information being modeled subsequently decreases
+ below (increases above) the maximum (minimum) value, the
+ gauge32 also decreases (increases).
+
+ In the value set and its semantics, this type is equivalent
+ to the Gauge32 type of the SMIv2.";
+ reference
+ "RFC 2578: Structure of Management Information Version 2
+ (SMIv2)";
+ }
+
+ typedef gauge64 {
+ type uint64;
+ description
+ "The gauge64 type represents a non-negative integer, which
+ may increase or decrease, but shall never exceed a maximum
+ value, nor fall below a minimum value. The maximum value
+ cannot be greater than 2^64-1 (18446744073709551615), and
+ the minimum value cannot be smaller than 0. The value of
+ a gauge64 has its maximum value whenever the information
+ being modeled is greater than or equal to its maximum
+ value, and has its minimum value whenever the information
+ being modeled is smaller than or equal to its minimum value.
+ If the information being modeled subsequently decreases
+ below (increases above) the maximum (minimum) value, the
+ gauge64 also decreases (increases).
+
+ In the value set and its semantics, this type is equivalent
+ to the CounterBasedGauge64 SMIv2 textual convention defined
+ in RFC 2856";
+ reference
+ "RFC 2856: Textual Conventions for Additional High Capacity
+ Data Types";
+ }
+
+ /*** collection of identifier-related types ***/
+
+ typedef object-identifier {
+ type string {
+ pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))'
+ + '(\.(0|([1-9]\d*)))*';
+ }
+ description
+ "The object-identifier type represents administratively
+ assigned names in a registration-hierarchical-name tree.
+
+ Values of this type are denoted as a sequence of numerical
+ non-negative sub-identifier values. Each sub-identifier
+ value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers
+ are separated by single dots and without any intermediate
+ whitespace.
+
+ The ASN.1 standard restricts the value space of the first
+ sub-identifier to 0, 1, or 2. Furthermore, the value space
+ of the second sub-identifier is restricted to the range
+ 0 to 39 if the first sub-identifier is 0 or 1. Finally,
+ the ASN.1 standard requires that an object identifier
+ has always at least two sub-identifiers. The pattern
+ captures these restrictions.
+
+ Although the number of sub-identifiers is not limited,
+ module designers should realize that there may be
+ implementations that stick with the SMIv2 limit of 128
+ sub-identifiers.
+
+ This type is a superset of the SMIv2 OBJECT IDENTIFIER type
+ since it is not restricted to 128 sub-identifiers. Hence,
+ this type SHOULD NOT be used to represent the SMIv2 OBJECT
+ IDENTIFIER type; the object-identifier-128 type SHOULD be
+ used instead.";
+ reference
+ "ISO9834-1: Information technology -- Open Systems
+ Interconnection -- Procedures for the operation of OSI
+ Registration Authorities: General procedures and top
+ arcs of the ASN.1 Object Identifier tree";
+ }
+
+ typedef object-identifier-128 {
+ type object-identifier {
+ pattern '\d*(\.\d*){1,127}';
+ }
+ description
+ "This type represents object-identifiers restricted to 128
+ sub-identifiers.
+
+ In the value set and its semantics, this type is equivalent
+ to the OBJECT IDENTIFIER type of the SMIv2.";
+ reference
+ "RFC 2578: Structure of Management Information Version 2
+ (SMIv2)";
+ }
+
+ typedef yang-identifier {
+ type string {
+ length "1..max";
+ pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*';
+ pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*';
+ }
+ description
+ "A YANG identifier string as defined by the 'identifier'
+ rule in Section 12 of RFC 6020. An identifier must
+ start with an alphabetic character or an underscore
+ followed by an arbitrary sequence of alphabetic or
+ numeric characters, underscores, hyphens, or dots.
+
+ A YANG identifier MUST NOT start with any possible
+ combination of the lowercase or uppercase character
+ sequence 'xml'.";
+ reference
+ "RFC 6020: YANG - A Data Modeling Language for the Network
+ Configuration Protocol (NETCONF)";
+ }
+
+ /*** collection of types related to date and time***/
+
+ typedef date-and-time {
+ type string {
+ pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?'
+ + '(Z|[\+\-]\d{2}:\d{2})';
+ }
+ description
+ "The date-and-time type is a profile of the ISO 8601
+ standard for representation of dates and times using the
+ Gregorian calendar. The profile is defined by the
+ date-time production in Section 5.6 of RFC 3339.
+
+ The date-and-time type is compatible with the dateTime XML
+ schema type with the following notable exceptions:
+
+ (a) The date-and-time type does not allow negative years.
+
+ (b) The date-and-time time-offset -00:00 indicates an unknown
+ time zone (see RFC 3339) while -00:00 and +00:00 and Z
+ all represent the same time zone in dateTime.
+
+ (c) The canonical format (see below) of data-and-time values
+ differs from the canonical format used by the dateTime XML
+ schema type, which requires all times to be in UTC using
+ the time-offset 'Z'.
+
+ This type is not equivalent to the DateAndTime textual
+ convention of the SMIv2 since RFC 3339 uses a different
+ separator between full-date and full-time and provides
+ higher resolution of time-secfrac.
+
+ The canonical format for date-and-time values with a known time
+ zone uses a numeric time zone offset that is calculated using
+ the device's configured known offset to UTC time. A change of
+ the device's offset to UTC time will cause date-and-time values
+ to change accordingly. Such changes might happen periodically
+ in case a server follows automatically daylight saving time
+ (DST) time zone offset changes. The canonical format for
+ date-and-time values with an unknown time zone (usually
+ referring to the notion of local time) uses the time-offset
+ -00:00.";
+ reference
+ "RFC 3339: Date and Time on the Internet: Timestamps
+ RFC 2579: Textual Conventions for SMIv2
+ XSD-TYPES: XML Schema Part 2: Datatypes Second Edition";
+ }
+
+ typedef timeticks {
+ type uint32;
+ description
+ "The timeticks type represents a non-negative integer that
+ represents the time, modulo 2^32 (4294967296 decimal), in
+ hundredths of a second between two epochs. When a schema
+ node is defined that uses this type, the description of
+ the schema node identifies both of the reference epochs.
+
+ In the value set and its semantics, this type is equivalent
+ to the TimeTicks type of the SMIv2.";
+ reference
+ "RFC 2578: Structure of Management Information Version 2
+ (SMIv2)";
+ }
+
+ typedef timestamp {
+ type yang:timeticks;
+ description
+ "The timestamp type represents the value of an associated
+ timeticks schema node at which a specific occurrence
+ happened. The specific occurrence must be defined in the
+ description of any schema node defined using this type. When
+ the specific occurrence occurred prior to the last time the
+ associated timeticks attribute was zero, then the timestamp
+ value is zero. Note that this requires all timestamp values
+ to be reset to zero when the value of the associated timeticks
+ attribute reaches 497+ days and wraps around to zero.
+
+ The associated timeticks schema node must be specified
+ in the description of any schema node using this type.
+
+ In the value set and its semantics, this type is equivalent
+ to the TimeStamp textual convention of the SMIv2.";
+ reference
+ "RFC 2579: Textual Conventions for SMIv2";
+ }
+
+ /*** collection of generic address types ***/
+
+ typedef phys-address {
+ type string {
+ pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?';
+ }
+
+
+
+
+ description
+ "Represents media- or physical-level addresses represented
+ as a sequence octets, each octet represented by two hexadecimal
+ numbers. Octets are separated by colons. The canonical
+ representation uses lowercase characters.
+
+ In the value set and its semantics, this type is equivalent
+ to the PhysAddress textual convention of the SMIv2.";
+ reference
+ "RFC 2579: Textual Conventions for SMIv2";
+ }
+
+ typedef mac-address {
+ type string {
+ pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}';
+ }
+ description
+ "The mac-address type represents an IEEE 802 MAC address.
+ The canonical representation uses lowercase characters.
+
+ In the value set and its semantics, this type is equivalent
+ to the MacAddress textual convention of the SMIv2.";
+ reference
+ "IEEE 802: IEEE Standard for Local and Metropolitan Area
+ Networks: Overview and Architecture
+ RFC 2579: Textual Conventions for SMIv2";
+ }
+
+ /*** collection of XML-specific types ***/
+
+ typedef xpath1.0 {
+ type string;
+ description
+ "This type represents an XPATH 1.0 expression.
+
+ When a schema node is defined that uses this type, the
+ description of the schema node MUST specify the XPath
+ context in which the XPath expression is evaluated.";
+ reference
+ "XPATH: XML Path Language (XPath) Version 1.0";
+ }
+
+ /*** collection of string types ***/
+
+ typedef hex-string {
+ type string {
+ pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?';
+ }
+ description
+ "A hexadecimal string with octets represented as hex digits
+ separated by colons. The canonical representation uses
+ lowercase characters.";
+ }
+
+ typedef uuid {
+ type string {
+ pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-'
+ + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';
+ }
+ description
+ "A Universally Unique IDentifier in the string representation
+ defined in RFC 4122. The canonical representation uses
+ lowercase characters.
+
+ The following is an example of a UUID in string representation:
+ f81d4fae-7dec-11d0-a765-00a0c91e6bf6
+ ";
+ reference
+ "RFC 4122: A Universally Unique IDentifier (UUID) URN
+ Namespace";
+ }
+
+ typedef dotted-quad {
+ type string {
+ pattern
+ '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+ + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';
+ }
+ description
+ "An unsigned 32-bit number expressed in the dotted-quad
+ notation, i.e., four octets written as decimal numbers
+ and separated with the '.' (full stop) character.";
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/msea-cfm.yang b/drivers/microsemi/ea1000yang/src/main/yang/msea-cfm.yang
new file mode 100644
index 0000000..1049008
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/msea-cfm.yang
@@ -0,0 +1,2065 @@
+module msea-cfm {
+
+ namespace "http://www.microsemi.com/microsemi-edge-assure/msea-cfm";
+ prefix "msea-cfm"; //MicroSemi EdgeAssure (msea)
+
+ 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;
+ }
+
+ 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 is a fork of the original mef-cfm YANG Module defined in MEF 38
+ This fork is done specifically to suit the EdgeAssure SFP which has some extra
+ constraints that are not handled by the original YANG.
+
+ Consideration was given to using 'deviations' in a separate YANG file as an
+ alternative to forking, but due to lack of full support for deviations in
+ Cisco/Tail-f NSO 4.1.1 (Jan 2016) this was not feasible.
+
+ This YANG is meant to mirror exactly the initial behaviour of the EdgeAssure
+ and present that to Client systems at the interface level (the alternative
+ being to raise exceptions when a constraint is broken). This is mostly
+ implemented through 'must' statements.
+
+ Copyright 2016 Microsemi Inc.
+ All rights reserved.";
+
+ revision "2016-02-29" {
+ description
+ "Initial EdgeAssure version forked from mef-cfm 2012-04-16 - Sean Condon, Microsemi";
+ reference
+ "Service OAM Fault Management YANG Modules (MEF 38), April 2012";
+ }
+
+ //
+ // Type definitions related to CFM
+ //
+
+ typedef lbm-transaction-id-type {
+ type uint32;
+
+ description
+ "A loopback transaction identifier";
+ reference
+ "[802.1q] 21.7.3";
+ }
+
+ typedef fault-alarm-defect-type {
+ type enumeration {
+ enum remote-rdi {
+ description "Indicates the aggregate health of the remote MEPs.";
+ }
+ enum remote-mac-error {
+ description "Indicates that one or more of the remote MEPs is
+ reporting a failure in its Port Status TLV or
+ Interface Status TLV.";
+ }
+ enum remote-invalid-ccm {
+ description "Indicates that at least one of the Remote MEP
+ state machines is not receiving valid CCMs
+ from its remote MEP.";
+ }
+ enum invalid-ccm {
+ description "Indicates that one or more invalid CCMs has been
+ received and that 3.5 times that CCMs transmission
+ interval has not yet expired.";
+ }
+ enum cross-connect-ccm {
+ description "Indicates that one or more cross connect CCMs has been
+ received and that 3.5 times of at least one of those
+ CCMs transmission interval has not yet expired.";
+ }
+ enum none {
+ description "Indicates that all defects of all types should
+ be ignored.";
+ }
+ }
+
+ description
+ "An enumerated value indicating the highest priority defect.";
+ reference
+ "[802.1q] 20.33.9";
+ }
+
+ typedef fault-alarm-defect-bits-type {
+ type bits {
+ bit remote-rdi {
+ description "Indicates that at least one of the Remote MEP state machines is
+ receiving valid CCMs from its remote MEP that has the RDI bit set.";
+ }
+ bit remote-mac-error {
+ description "One or more of the remote MEPs is reporting a failure
+ in its Port Status TLV or Interface Status";
+ }
+ bit remote-invalid-ccm {
+ description "At least one of the Remote MEP state machines is not
+ receiving valid CCMs from its remote MEP";
+ }
+ bit invalid-ccm {
+ description "One or more invalid CCMs has been received";
+ }
+ bit cross-connect-ccm {
+ description "One or more cross connect CCMs has been received";
+ }
+ }
+
+ description
+ "A set of bits indicating the the current defects";
+ reference
+ "[802.1q] 20.33.9";
+ }
+
+ typedef remote-mep-state-type {
+ type enumeration {
+ enum idle {
+ description
+ "Indicates momentary state during reset.";
+ }
+ enum start {
+ description
+ "Indicates the timer has not expired since the state machine was
+ reset, and no valid CCM has yet been received.";
+ }
+ enum failed {
+ description
+ "Indicates The timer has expired, both since the state machine
+ was reset, and since a valid CCM was received.";
+ }
+ enum ok {
+ description
+ "Indicates The timer has not expired since a valid CCM was
+ received.";
+ }
+ }
+ description
+ "An enumerated value indicating the operational state of a Remote
+ MEP state machine for a remote MEP.";
+ reference
+ "[802.1q] 12.14.7.6.3:b
+ IEEE8021-CFM-MIB.Dot1agCfmRemoteMepState";
+ }
+
+ typedef ltm-transaction-id-type {
+ type uint32;
+
+ description
+ "A linktrace transaction identifier";
+ reference
+ "[802.1q] 21.8.3";
+ }
+
+ //
+ // Groupings related to CFM
+ //
+
+ grouping target-address-group {
+ description
+ "An indication of a destination MEP, either:
+ 1) The MEPID of a MEP; or
+ 2) An Individual destination MAC address";
+
+ reference "[802.1q] 12.14.7.3.2:b";
+
+ choice address-type {
+ description "Either a mac address or a MEP id for the target";
+ case mac-address {
+ leaf mac-address {
+ type yang:mac-address;
+ description
+ "Target MAC address";
+ }
+ }
+ case mep-id {
+ leaf mep-id {
+ type msea:mep-id-type;
+ description
+ "Target MEP ID";
+ }
+ }
+ }
+ }
+
+ grouping maintenance-domain-reference {
+ description
+ "This grouping uniquely identifies a maintenance domain.";
+
+ leaf maintenance-domain {
+ type leafref {
+ path "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:id";
+ }
+ description
+ "A reference to a specific Maintenance Domain.";
+ }
+ }
+
+ grouping maintenance-association-reference {
+ description
+ "This grouping uniquely identifies a maintenance association. It consists
+ of a maintence-domain-reference and a maintenance-association leafref";
+
+ uses maintenance-domain-reference;
+
+ leaf maintenance-association {
+ type leafref {
+ path "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id=current()/../maintenance-domain]/msea-cfm:maintenance-association/msea-cfm:id";
+ }
+ description
+ "A reference to a specific Maintenance Association.";
+ }
+ }
+
+ grouping maintenance-association-end-point-reference {
+ description
+ "This grouping uniquely identifies a maintenance association. It consists
+ of a maintence-association-reference and a maintenance-association-end-point
+ leafref";
+
+ uses maintenance-association-reference;
+
+ leaf maintenance-association-end-point {
+ type leafref {
+ path "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id=current()/../maintenance-domain]/msea-cfm:maintenance-association[msea-cfm:id=current()/../maintenance-association]/msea-cfm:maintenance-association-end-point/msea-cfm:mep-identifier";
+ }
+ description
+ "A reference to a specific Maintenance association End Point.";
+ }
+ }
+
+ grouping mep-notification-reference {
+
+ description "A simple MEP reference that can be used in notifications";
+ leaf maintenance-domain {
+ type uint8;
+ description
+ "A reference to a specific Maintenance Domain.";
+ }
+
+ leaf maintenance-association {
+ type uint8;
+ description
+ "A reference to a specific Maintenance Association.";
+ }
+
+ leaf maintenance-association-end-point {
+ type msea:mep-id-type;
+ description
+ "A reference to a specific Maintenance association End Point.";
+ }
+
+ }
+
+ grouping linktrace-parameters-group {
+ description
+ "This is the group of parameters associated with linktrace sessions. It is
+ used for linktrace RPC input as well as linktrace database entries.";
+
+ container target-address {
+ description
+ "Target MAC address or MEP ID for the Linktrace session.";
+ uses target-address-group;
+ }
+
+ leaf transmit-ltm-flags {
+ type bits {
+ bit use-fdb-only {
+ description
+ "If set, indicates that only MAC addresses learned in a
+ Bridge’s FDB, and not information saved in the MIP CCM
+ Database, is to be used to determine the Egress Port.";
+ reference "[802.1q] 21.8.1";
+ }
+ }
+
+ description
+ "The Flags field for LTMs transmitted by the MEP";
+ reference
+ "[802.1q] 12.14.7.4.2:b";
+ }
+
+ leaf default-ttl {
+ type uint8;
+ default 64;
+
+ description
+ "An initial value for the LTM TTL field";
+ reference
+ "[802.1q] 12.14.7.4.2:d";
+ }
+ } //End of linktrace-parameters-group
+
+
+ grouping port-id-tlv-group {
+ description
+ "Data definitions associated with the Port ID TLV";
+
+ reference
+ "[802.1AB] 9.5.3";
+
+ choice port-id-subtype {
+ leaf interface-alias {
+ type string {
+ length "0..64";
+ }
+ description
+ "The ifAlias field from the Interfaces Group MIB";
+ reference
+ "[RFC2863]";
+ }
+
+ leaf port-component {
+ type string {
+ length "0..32";
+ }
+ description
+ "EntPhysicalAlias when entPhysClass has a value of port(10) or
+ backplane(4)";
+ reference
+ "[RFC2737]";
+ }
+ leaf mac-address {
+ type yang:mac-address;
+ description
+ "A MAC address";
+ }
+ leaf network-address {
+ type string;
+ description
+ "network-address is an octet string that identifies a particular network
+ address family and an associated network address that are
+ encoded in network octet order. An IP address, for example,
+ would be encoded with the first octet containing the IANA
+ Address Family Numbers enumeration value for the specific
+ address type and octets 2 through n containing the address
+ value";
+ reference
+ "[802.1AB] Table 9.2";
+ }
+
+ leaf interface-name {
+ type string {
+ length "0..64";
+ }
+ description
+ "The ifName field from the Interfaces Group MIB";
+ reference
+ "[RFC2863]";
+ }
+ leaf agent-circuit-id {
+ type string;
+ description
+ "Agent circuit ID";
+ reference
+ "[RFC3046]";
+ }
+ leaf local {
+ type string;
+ description
+ "A locally defined identifier";
+ reference
+ "[802.1AB] Table 9.3";
+ }
+ }
+ } //End of port-id-tlv-group
+
+
+ grouping sender-id-tlv-group {
+ description
+ "Data definitions associated with the Sender ID TLV";
+
+ reference
+ "[802.1q] 21.5.3";
+
+ choice chassis-id-subtype {
+ description
+ "The chassis-id-subtype contains the chassis ID entity that is listed in
+ the chassis ID field. This is a combination of the 'Chassis ID Subtype'
+ and 'chsssis ID' fields";
+
+ reference
+ "[802.1AB] 9.5.2.2";
+
+ leaf chassis-component {
+ type string {
+ length "0..32";
+ }
+ description
+ "This leaf contains the content of EntPhysicalAlias when entPhysClass has
+ a value of chassis(3)'";
+ reference
+ "[RFC2737]";
+ }
+
+ leaf interface-alias {
+ type string {
+ length "0..64";
+ }
+ description
+ "The IfAlias field from the Interfaces Group MIB";
+ reference
+ "[RFC2863]";
+ }
+
+ leaf port-component {
+ type string {
+ length "0..32";
+ }
+ description
+ "The EntPhysicalAlias from the Interfaces Group MIB when entPhysClass has
+ a value of port(10) or backplane(4)";
+ reference
+ "[RFC2737]";
+ }
+
+ leaf mac-address-type {
+ type yang:mac-address;
+
+ description
+ "An IEEE 802-2001 Ethernet MAC Address";
+ reference
+ "[802-2001]";
+ }
+
+ leaf network-address {
+ type string;
+ description
+ "network-address is an octet string that identifies a particular network
+ address family and an associated network address that are encoded in
+ network octet order. An IP address, for example, would be encoded with
+ the first octet containing the IANA Address Family Numbers enumeration
+ value for the specific address type and octets 2 through n containing
+ the address value";
+ reference
+ "[802.1AB] Table 9.2";
+ }
+
+ leaf interface-name {
+ type string {
+ length "0..64";
+ }
+ description
+ "IfName";
+ reference
+ "[RFC2863]";
+ }
+
+ leaf local {
+ type string;
+ description
+ "A locally assigned alpha-numeric string.";
+ reference
+ "[802.1AB] Table 9.2";
+ }
+ }
+
+ container management-address {
+ description
+ "Data definitions related to the management address fields defined
+ in a Sender ID TLV";
+ reference
+ "[802.1Q] Section 21.5.3";
+ choice management-address-choice {
+ case udp-ipv4 {
+ description
+ "Represents an IPv4 UDP transport address consisting of an IPv4 address,
+ and a port number.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainUdpIpv4";
+ leaf udp-ipv4-address {
+ type inet:ipv4-address;
+ }
+ leaf udp-ipv4-port {
+ type inet:port-number;
+ }
+ }
+
+ case udp-ipv6 {
+ description
+ "Represents an IPv6 UDP transport address consisting of an IPv6 address,
+ and a port number.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainUdpIpv6";
+ leaf udp-ipv6-address {
+ type inet:ipv6-address;
+ }
+ leaf udp-ipv6-port {
+ type inet:port-number;
+ }
+ }
+
+ case udp-ipv4z {
+ description
+ "Represents a UDP transport address consisting of an IPv4 address, a zone
+ index and a port number.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainUdpIpv4z";
+ leaf udp-ipv4z-address {
+ type inet:ipv4-address;
+ }
+ leaf udp-ipv4z-index {
+ type uint32;
+ }
+ leaf udp-ipv4z-port {
+ type inet:port-number;
+ }
+ }
+
+ case udp-ipv6z {
+ description
+ "Represents a UDP transport address consisting of an IPv6 address, a zone
+ index and a port number.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainUdpIpv6z";
+ leaf udp-ipv6z-address {
+ type inet:ipv6-address;
+ }
+ leaf udp-ipv6z-index {
+ type uint32;
+ }
+ leaf udp-ipv6z-port {
+ type inet:port-number;
+ }
+ }
+
+ case tcp-ipv4 {
+ description
+ "Represents an IPv4 TCP transport address consisting of an IPv4 address,
+ and a port number.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainTcpIpv4";
+ leaf tcp-ipv4-address {
+ type inet:ipv4-address;
+ }
+ leaf tcp-ipv4-port {
+ type inet:port-number;
+ }
+ }
+
+ case tcp-ipv6 {
+ description
+ "Represents an IPv6 TCP transport address consisting of an IPv6 address,
+ and a port number.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainTcpIpv6";
+ leaf tcp-ipv6-address {
+ type inet:ipv6-address;
+ }
+ leaf tcp-ipv6-port {
+ type inet:port-number;
+ }
+ }
+
+ case tcp-ipv4z {
+ description
+ "Represents a TCP IPv4 transport address consisting of an IPv4 address, a
+ zone index and a port number.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainTcpIpv4z";
+ leaf tcp-ipv4z-address {
+ type inet:ipv4-address;
+ }
+ leaf tcp-ipv4z-index {
+ type uint32;
+ }
+ leaf tcp-ipv4z-port {
+ type inet:port-number;
+ }
+ }
+
+ case tcp-ipv6z {
+ description
+ "Represents a TCP IPv6 transport address consisting of an IPv6 address,
+ a zone index and a port number.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainTcpIpv6z";
+ leaf tcp-ipv6z-address {
+ type inet:ipv6-address;
+ }
+ leaf tcp-ipv6z-index {
+ type uint32;
+ }
+ leaf tcp-ipv6z-port {
+ type inet:port-number;
+ }
+ }
+
+ case sctp-ipv4 {
+ description
+ "Represents an IPv4 SCTP transport address consisting of an IPv4 address,
+ and a port number.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainSctpIpv4";
+ leaf sctp-ipv4-address {
+ type inet:ipv4-address;
+ }
+ leaf sctp-ipv4-port {
+ type inet:port-number;
+ }
+ }
+
+ case sctp-ipv6 {
+ description
+ "Represents an IPv6 SCTP transport address consisting of an IPv6 address,
+ and a port number.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainSctpIpv6";
+ leaf sctp-ipv6-address {
+ type inet:ipv6-address;
+ }
+ leaf sctp-ipv6-port {
+ type inet:port-number;
+ }
+ }
+
+ case sctp-ipv4z {
+ description
+ "Represents an SCTP IPv4 transport address consisting of an IPv4
+ address, a zone index and a port number.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainSctpIpv4z";
+ leaf sctp-ipv4z-address {
+ type inet:ipv4-address;
+ }
+ leaf sctp-ipv4z-index {
+ type uint32;
+ }
+ leaf sctp-ipv4z-port {
+ type inet:port-number;
+ }
+ }
+
+ case sctp-ipv6z {
+ description
+ "Represents an SCTP IPv6 transport address consisting of an IPv6
+ address, a zone index and a port number.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainSctpIpv6z";
+ leaf sctp-ipv6z-address {
+ type inet:ipv6-address;
+ }
+ leaf sctp-ipv6z-index {
+ type uint32;
+ }
+ leaf sctp-ipv6z-port {
+ type inet:port-number;
+ }
+ }
+
+ case local {
+ leaf local-address {
+ type string {
+ length "1..255";
+ }
+ description
+ "Represents a POSIX Local IPC transport address.";
+ }
+ }
+
+ case udp-dns {
+ leaf udp-dns-address {
+ type string {
+ length "1..255";
+ }
+ description
+ "The UDP transport domain using fully qualified domain names. Represents
+ a DNS domain name followed by a colon ':' (ASCII character
+ 0x3A) and a port number in ASCII. The name SHOULD be fully
+ qualified whenever possible.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainUdpDns";
+ }
+ }
+ case tcp-dns {
+ leaf tcp-dns-address {
+ type string {
+ length "1..255";
+ }
+ description
+ "The TCP transport domain using fully qualified domain names. Represents
+ a DNS domain name followed by a colon ':' (ASCII character
+ 0x3A) and a port number in ASCII. The name SHOULD be fully
+ qualified whenever possible.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainTcpDns";
+ }
+ }
+ case sctp-dns {
+ leaf sctp-dns-address {
+ type string {
+ length "1..255";
+ }
+ description
+ "The SCTP transport domain using fully qualified domain names.
+ Represents a DNS domain name followed by a colon ':' (ASCII
+ character 0x3A) and a port number in ASCII. The name SHOULD be
+ fully qualified whenever possible.";
+ reference
+ "[RFC3419] TRANSPORT-ADDRESS-MIB.transportDomainSctpDns";
+ }
+ }
+ case unidentified {
+ leaf management-domain-binary {
+ type binary;
+ description "The management address domain found in the
+ Sender ID TLV encoded to base 64";
+ reference
+ "[802.1Q] Section 21.5.3";
+ }
+
+ leaf management-address-binary {
+ type binary;
+ description "The management address found in the
+ Sender ID TLV encoded to base 64";
+ reference
+ "[802.1Q] Section 21.5.3";
+ }
+ }
+ }
+ }
+ } //End of sender-id-tlv-group
+
+
+ grouping linktrace-reply-grouping {
+
+ description
+ "The attributes of a Linktrace reply.";
+
+ leaf transaction-id {
+ type ltm-transaction-id-type;
+
+ description
+ "The LTM Transaction Identifier to which the LTR entries will be
+ attached";
+ reference
+ "[802.1q] 12.14.7.5.2:b";
+ }
+
+ uses linktrace-parameters-group;
+
+ list reply {
+ key reply-order;
+
+ description
+ "The list of LTRs associated with a specific Linktrace
+ transaction.";
+ leaf reply-order {
+ type uint32;
+
+ description
+ "An index to distinguish among multiple LTRs with the same LTR
+ transaction-id field value. reply-order are
+ assigned sequentially from 1, in the order that the
+ Linktrace Initiator received the LTR";
+ reference "[802.1q] 12.14.7.5.2:c";
+ }
+
+ leaf reply-ttl {
+ type uint32;
+
+ description
+ "The integer Reply TTL field value returned in the LTR.";
+ reference
+ "[802.1q] 12.14.7.5.3:b";
+ }
+
+ leaf forwarded {
+ type boolean;
+
+ description
+ "A Boolean value stating whether an LTM was forwarded by
+ the responding MP.";
+ reference
+ "[802.1q] 12.14.7.5.3:c";
+ }
+
+ leaf terminal-mep {
+ type boolean;
+
+ description
+ "A Boolean value stating whether the forwarded LTM reached
+ a MEP for its MA.";
+ reference
+ "[802.1q] 12.14.7.5.3:d";
+ }
+
+ leaf last-egress-identifier {
+ type binary {
+ length 8;
+ }
+
+ description
+ "An octet string holding the Last Egress Identifier field
+ returned in the LTR Egress Identifier TLV of the LTR.";
+ reference
+ "[802.1q] 12.14.7.5.3:e";
+ }
+
+ leaf next-egress-identifier {
+ type binary {
+ length 8;
+ }
+
+ description
+ "An octet string holding the Next Egress Identifier field
+ returned in the LTR Egress Identifier TLV of the LTR";
+ reference
+ "[802.1q] 12.14.7.5.3:f";
+ }
+
+ leaf ltr-relay {
+ type enumeration {
+ enum hit {
+ description "Indicates the LTM reached an MP whose MAC
+ address matches the target MAC address.";
+ }
+ enum filtering-database {
+ description "Indicates the Egress Port was determined by
+ consulting the Filtering Database.";
+ }
+ enum mip-ccm-database {
+ description "Indicates the Egress Port was determined by
+ consulting the MIP CCM Database.";
+ }
+ }
+
+ description
+ "An enumerated value indicating the value returned in the
+ Relay Action field.";
+ reference
+ "[802.1q] 12.14.7.5.3:g, Table 21-27
+ IEEE8021-CFM-MIB.Dot1agCfmRelayActionFieldValue";
+ }
+
+ uses sender-id-tlv-group;
+
+ leaf ingress-action {
+ type enumeration {
+ enum ok {
+ description "Indicates the target data frame would be
+ passed through to the MAC Relay Entity.";
+ }
+ enum down {
+ description "Indicates the Bridge Ports MAC Operational
+ parameter is false.";
+ }
+ enum blocked {
+ description "Indicates the target data frame would not
+ be forwarded if received on this Port due
+ to active topology enforement.";
+ }
+ enum vid {
+ description "Indicates the ingress port is not in the
+ member set of the LTMs VID, and ingress
+ filtering is enabled, so the target data
+ frame would be filtered by ingress filtering.";
+ }
+ }
+
+ description
+ "An enumerated value indicating the value returned in the
+ Ingress Action field. This leaf is not present if no value
+ is returned in the LTR.";
+ reference
+ "[802.1q] 12.14.7.5.3:k, Table 21-30
+ IEEE8021-CFM-MIB.Dot1agCfmIngressActionFieldValue";
+ }
+
+ leaf ingress-mac {
+ type yang:mac-address;
+
+ description
+ "The MAC address returned in the Ingress MAC Address field.
+ This leaf is not present if no value is returned in the LTR.";
+ reference
+ "[802.1q] 12.14.7.5.3:l";
+ }
+
+ container ingress-port-id {
+ uses port-id-tlv-group;
+
+ description
+ "The Ingress Port ID field and the corresponding port ID value.
+ This leaf is not present if no value is returned in the LTR.";
+ reference
+ "[802.1q] 12.14.7.5.3:m";
+ }
+
+ leaf egress-action {
+ type enumeration {
+ enum ok {
+ description "Indicates the targeted data frame would be
+ forwarded.";
+ }
+ enum down {
+ description "Indicates the Egress Port can be identified,
+ but that Bridge Ports MAC Operational
+ parameter is false.";
+ }
+ enum blocked {
+ description "Indicates the Egress Port can be identified,
+ but the data frame would not pass through the
+ the Egress Port due to active topology
+ management, i.e., the Bridge Port is not in the
+ Forwarding state.";
+ }
+ enum vid {
+ description "Indicates the Egress Port can be identified,
+ but the Bridge Port is not in the LTMs VIDs
+ member set, so would be filtered by egress
+ filtering.";
+ }
+ }
+
+ description
+ "An enumerated value indicating the value returned in the
+ Egress Action field. This leaf is not present if no value
+ is returned in the LTR.";
+ reference
+ "[802.1q] 12.14.7.5.3:o, Table 21-32
+ IEEE8021-CFM-MIB.Dot1agCfmIngressActionFieldValue";
+ }
+
+ leaf egress-mac {
+ type yang:mac-address;
+
+ description
+ "The MAC address returned in the Egress MAC Address field.
+ This leaf is not present if no value is returned in the LTR.";
+ reference
+ "[802.1q] 12.14.7.5.3:p";
+ }
+
+ container egress-port-id {
+ uses port-id-tlv-group;
+
+ description
+ "The Egress Port ID field and the corresponding port ID value.
+ This leaf is not present if no value is returned in the LTR.";
+ reference
+ "[802.1q] 12.14.7.5.3:p, 12.14.7.5.3:q";
+ }
+
+ leaf organization-specific-tlv {
+ type binary {
+ length "0|4 .. 1500";
+ }
+ description
+ "The OUI and contents of any Organization-Specific TLVs. This
+ leaf is not present if no value is returned in the LTR.";
+ reference
+ "[802.1q] 12.14.7.5.3:s";
+ }
+ }
+ } //End of linktrace-reply-grouping
+
+
+ //
+ // Data definitions related to CFM
+ //
+
+ container mef-cfm {
+ description "The top level container to group the
+ maintenance-domain(s)";
+
+ reference "RFC 6087 Section 4.9 ";
+
+ must "not(contains('/y1564:y1564-test/y1564:service-config/y1564:mep-config/y1564:maintenance-domain | /y1564:y1564-test/y1564:service-config/y1564:mep-config/y1564:maintenance-association | /y1564:y1564-test/y1564:service-config/y1564:mep-config/y1564:maintenance-association-end-point | /y1564:y1564-test/y1564:service-config/y1564:mep-config/y1564:remote-mep-id','msea-internal-optional'))" {
+ error-app-tag "msea-cfm-must-01";
+ error-message "A MEP cannot be deleted while it is still referenced from a Y1564 service config";
+// msea:xref-module "y-1564";
+ }
+
+ must "not(contains('/rfc2544:rfc2544-test/rfc2544:mep-config/rfc2544:maintenance-domain | /rfc2544:rfc2544-test/rfc2544:mep-config/rfc2544:maintenance-association | /rfc2544:rfc2544-test/rfc2544:mep-config/rfc2544:maintenance-association-end-point | /rfc2544:rfc2544-test/rfc2544:mep-config/rfc2544:remote-mep-id','msea-internal-optional'))" {
+ error-app-tag "msea-cfm-must-02";
+ error-message "A MEP cannot be deleted while it is still referenced from an RFC2544 config";
+// msea:xref-module "rfc-2544";
+ }
+
+ container pm-global {
+// presence "Global level attributes for PM related measurements can be specified if present";
+ description "A placeholder for global level Performance Measurement PM related attributes";
+ }
+
+ container cfm-role {
+ presence "When present defines the role of this device in a Maintenance Domain";
+ description "Optional attributes that help to describe this devices role in a CFM configuration";
+
+ leaf role { //Microsemi specific configuration attribute
+ description "The role that this device will play in a Maitenance Domain";
+ type enumeration {
+ enum customer {
+ description "The customer role";
+ }
+ enum provider{
+ description "The provider role";
+ }
+ enum operator {
+ description "The operator role";
+ }
+ enum physical {
+ description "The physical role";
+ }
+ }
+ mandatory true;
+ reference "IEEE 802.1Q-2014 Clause 18";
+ }
+
+ leaf side { //Microsemi specific configuration attribute
+ description "An optional attribute to indicate which end of the Maintenance Domain ";
+ type enumeration {
+ enum left {
+ description "The device plays its role on the left side of the Maintenance Domain";
+ }
+ enum right {
+ description "The device plays its role on the right side of the Maintenance Domain";
+ }
+ }
+ default left;
+ reference "IEEE 802.1Q-2014 Clause 18";
+ }
+
+ leaf name { //Microsemi specific configuration attribute
+ description "An identifier relating to the cfm-role that device plays in CFM.
+ This could be the name of a customer or an operator for example";
+ type string {
+ length "1..40";
+ pattern "[a-zA-Z0-9\\-_. ,]*";
+ }
+ mandatory true;
+ reference "IEEE 802.1Q-2014 Clause 18";
+ }
+ }
+
+
+ list maintenance-domain {
+ key id;
+
+ max-elements 64;
+
+ description
+ "A Maintenance Domain managed object is required in order to create an MA
+ with a MAID that includes that Maintenance Domain's Name. From
+ this Maintenance Domain managed object, all Maintenance
+ Association managed objects associated with that Maintenance
+ Domain managed object can be accessed, and thus controlled.";
+ reference
+ "[802.1q] 12.14.5";
+
+ leaf id {
+ type uint8 {
+ range 1..64;
+ }
+ description
+ "A unique identifier of a Maintenance Domain. Changed to uint8 from string";
+ reference
+ "[802.1q] 12.14.5";
+ }
+
+ choice md-name-and-type-combo {
+ description
+ "The value Maintenance Domain Name depends on name-type.
+ Since the name-type defines the format for name they are
+ combined together here";
+
+ mandatory true;
+
+ case name-none {
+ leaf name-type-none {
+ type empty;
+ description "Indicates that name-type is none.
+ When name-type is 'none' then the
+ MA name can be up to 45 chars, because len
+ of MD is not used";
+ reference
+ "[802.1q] 21.6.5.1 (Table 21-19), 12.14.5.3.2:a";
+// msea:not-changeable;
+ }
+ }
+
+
+ case name-character-string {
+ leaf name { //Keep the old name
+ type msea:identifier45 {length 1..43;}
+
+ description
+ "When the name-type is 'character-string' then the name must be of
+ type string (restricted to 43 chars - 48 bytes are allowed overall
+ for the MD+MA incl 1 byte for type and 1 byte for len on each.
+ Leaving 1 char for MA name, the max MD name is 43 chars)";
+ reference
+ "[802.1q] 21.6.5.1 (Table 21-19), 12.14.5.3.2:a";
+
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:name = current()]) <= 1" {
+ error-message "The MD 'name' (if specified) must be unique across all character string names of MDs on the device";
+ error-app-tag "msea-cfm-must-05";
+ }
+
+// msea:not-changeable;
+ }
+ }
+
+ case name-domain-name {
+ leaf name-domain-name {
+ type union {
+ type inet:ip-address;
+ type inet:domain-name { length 1..43; }
+ }
+
+ description "When the name-type is 'domain-name' then the name
+ must be of type inet:host";
+ reference
+ "[802.1q] 21.6.5.1 (Table 21-19), 12.14.5.3.2:a";
+
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:name-domain-name = current()]) <= 1" {
+ error-message "The MD 'name-domain-name' (if specified) must be unique across all name-domain-names of MDs on the device";
+ error-app-tag "msea-cfm-must-06";
+ }
+// msea:not-changeable;
+ }
+ }
+
+ case mac-address-and-uint {
+ leaf name-mac-address-and-uint {
+ type msea:mac-address-and-uint-str;
+ description "When the name-type is 'mac-address-and-uint'
+ then the name must be a colon separated mac
+ address followed by a number between 0 and 65536
+ e.g. AA:BB:CC:DD:EE:FF:65536
+ The effective length when encoded is 8 bytes";
+ reference
+ "[802.1q] 21.6.5.1 (Table 21-19), 12.14.5.3.2:a";
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:name-mac-address-and-uint = current()]) <= 1" {
+ error-message "The MD 'name-mac-address-and-uint' (if specified) must be unique across all name-mac-address-and-uints of MDs on the device";
+ error-app-tag "msea-cfm-must-07";
+ }
+// msea:not-changeable;
+ }
+ }
+ }
+
+ leaf md-level {
+ type msea:md-level-type;
+ mandatory true;
+
+// msea:not-changeable;
+
+ description
+ "Integer identifying the Maintenance Domain Level (MD Level). Higher
+ numbers correspond to higher Maintenance Domains, those with the
+ greatest physical reach, with the highest values for customers'
+ CFM PDUs. Lower numbers correspond to lower Maintenance
+ Domains, those with more limited physical reach, with the lowest
+ values for CFM PDUs protecting single bridges or physical links.
+ Changed to mandatory";
+
+ reference
+ "[802.1q] 12.14.5.1.3:b";
+ }
+
+ list maintenance-association {
+ key id;
+ max-elements 64;
+
+ description
+ "This list represents Maintenance Entity Groups (Y.1731) or
+ Maintenance Associations (802.1ag). MEGs/MAs are sets of
+ MEPs, each configured to the same service inside a common
+ OAM domain.";
+
+ leaf id {
+ type uint8 {
+ range 1..64;
+ }
+ description
+ "A unique identifier of a Maintenance Association. Changed to uint8 from string";
+ reference
+ "[802.1q] 12.14.6";
+ }
+
+ choice ma-name-and-type-combo {
+ description
+ "The value Maintenance Association Name depends on name-type.
+ Since the name-type defines the format for name, they are
+ combined together here";
+
+ mandatory true;
+
+ case name-character-string {
+ leaf name {
+ type msea:identifier45;
+
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id = current()/../../msea-cfm:id]/msea-cfm:maintenance-association[msea-cfm:name = current()]) <= 1" {
+ error-message "The MA 'name' (if specified) must be unique across all MAs within this MD";
+ error-app-tag "msea-cfm-must-10";
+ }
+
+ must "string-length(current()/../../msea-cfm:name) + string-length(current()/../../msea-cfm:name-domain-name) + 8 * boolean(current()/../../msea-cfm:name-mac-address-and-uint) -1 * boolean(current()/../../msea-cfm:name-type-none) + string-length(current()) <= 44" {
+ error-message "The MA 'name' and MD 'name' length together must not exceed 44 chars when MD is not name-type-none or 45 chars for MA name when MD is name-type-none";
+ error-app-tag "msea-cfm-must-11";
+ }
+
+// msea:not-changeable;
+
+ description
+ "When the name-type is 'character-string' then the name must be of
+ type string. Length can be 45 when MD name-type is none (as 1 byte
+ is used on each for type, and 1 byte used on MA for len out of an
+ allowed 48 bytes). When MD name-type is not 'none' then the
+ combined length of both is 44 chars)";
+ reference
+ "[802.1q] 12.14.5.3.2:b, 21.6.5.4 Table 21-20";
+ }
+ }
+
+ case name-primary-vid {
+ leaf name-primary-vid {
+ type union {
+ type enumeration {
+ enum 0 {description "0 to use the MA's VID";}
+ }
+ type msea:vlan-id-type;
+ }
+// msea:not-changeable;
+
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id = current()/../../msea-cfm:id]/msea-cfm:maintenance-association[msea-cfm:name-primary-vid = current()]) <= 1" {
+ error-message "The MA 'name-primary-vid' (if specified) must be unique across all MAs within this MD";
+ error-app-tag "msea-cfm-must-12";
+ }
+
+ must "string-length(current()/../../msea-cfm:name) + string-length(current()/../../msea-cfm:name-domain-name) + 2 <= 44" {
+ error-message "The MA 'primary-vid' (2 octets) and MD 'name' length together must not exceed 44 bytes.";
+ error-app-tag "msea-cfm-must-13";
+ }
+
+ description
+ "When the name-type is 'primary-vid' then the name must be of type
+ vlan-id-type";
+ reference
+ "[802.1q] 12.14.5.3.2:b, 21.6.5.4 Table 21-20";
+ }
+ }
+
+ case name-uint16 {
+ leaf name-uint16 {
+ type uint16;
+// msea:not-changeable;
+
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id = current()/../../msea-cfm:id]/msea-cfm:maintenance-association[msea-cfm:name-uint16 = current()]) <= 1" {
+ error-message "The MA 'name-uint16' (if specified) must be unique across all MAs within this MD";
+ error-app-tag "msea-cfm-must-14";
+ }
+
+ must "string-length(current()/../../msea-cfm:name) + string-length(current()/../../msea-cfm:name-domain-name) + 2 <= 44" {
+ error-message "The MA 'name-uint16' (2 octets) and MD 'name' or 'name'domain-name' length together must not exceed 44 bytes";
+ error-app-tag "msea-cfm-must-15";
+ }
+
+ description
+ "When the name-type is 'uint16' then the name must be 0-65535";
+ reference
+ "[802.1q] 12.14.5.3.2:b, 21.6.5.4 Table 21-20";
+ }
+ }
+
+ case name-rfc2685-vpn-id {
+ leaf name-rfc2685-vpn-id {
+ type binary {
+ length 7;
+ }
+// msea:not-changeable;
+
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id = current()/../../msea-cfm:id]/msea-cfm:maintenance-association[msea-cfm:name-rfc2685-vpn-id = current()]) <= 1" {
+ error-message "The MA 'name-rfc2685-vpn-id' (if specified) must be unique across all MAs within this MD";
+ error-app-tag "msea-cfm-must-16";
+ }
+
+ must "string-length(current()/../../msea-cfm:name) + string-length(current()/../../msea-cfm:name-domain-name) + 7 <= 44" {
+ error-message "The MA 'name-rfc2685-vpn-id' (7 octets) and MD 'name' or 'name'domain-name' length together must not exceed 44 bytes";
+ error-app-tag "msea-cfm-must-17";
+ }
+
+
+ description
+ "When the name-type is 'rfc2685-vpn-id' then the name
+ must be of 7 bytes encoded as base64";
+ reference
+ "[802.1q] 12.14.5.3.2:b, 21.6.5.4 Table 21-20";
+ }
+ }
+
+ case name-y1731-icc {
+ leaf name-y1731-icc {
+ type yang:yang-identifier {
+ length 8..13;
+ }
+
+// msea:not-changeable;
+
+ must "boolean(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id = current()/../../msea-cfm:id]/msea-cfm:maintenance-association/msea-cfm:y1731-compliant)" {
+ error-message "The MA 'name-y1731-icc' can only be specified if y1731-compliant is present";
+ error-app-tag "msea-cfm-must-18";
+ }
+
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id = current()/../../msea-cfm:id]/msea-cfm:maintenance-association[msea-cfm:name-y1731-icc = current()]) <= 1" {
+ error-message "The MA 'name-y1731-icc' (if specified) must be unique across all MAs within this MD";
+ error-app-tag "msea-cfm-must-19";
+ }
+
+ must "boolean(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id = current()/../../msea-cfm:id]/msea-cfm:name-type-none)" {
+ error-message "name-y1731-icc can only be specified when MD name type is name-type-none";
+ error-app-tag "msea-cfm-must-20";
+ }
+
+ description
+ "ICC-based MEG ID Format, thirteen octet field. It consists of two
+ subfields: the ITU Carrier Code (ICC) followed by a unique MEG
+ ID code (UMC). The ITU Carrier Code consists of 1-6
+ left-justified characters, alphabetic, or leading alphabetic
+ with trailing numeric. The UMC code immediately follows the ICC
+ and shall consist of 7-12 characters, with trailing NULLs,
+ completing the 13-character MEG ID Value. Changed type to yang-identifier";
+ reference
+ "[Y.1731] Annex A";
+ }
+ }
+
+ }
+
+ container y1731-compliant {
+ presence "When present indicates compliance with Y-1731";
+// msea:not-changeable;
+
+ must "boolean(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id = current()/../../msea-cfm:id]/msea-cfm:name-type-none)" {
+ error-message "Parent MD must have a name-type-none when y1731-compilant is present";
+ error-app-tag "msea-cfm-must-21";
+ }
+
+ description
+ "A boolean flag to indicate whether the MEG ID/MAID for this MEG operates
+ in conformance with 802.1q (if false) or Y.1731 (if true).
+ When set to false:
+ - The format of the MAID (Maintenance Association ID) is controlled
+ by the name-type and name in the maintenance-association instance,
+ and the name-type and name in the maintenance-domain instance.
+ - The meg-id-format and meg-level leafs are ignored.
+ - The level is controlled by the md-level leaf.
+ When set to true:
+ - The MEG shall be in a maintenance-domain where name-type has the value
+ none(1).
+ - The format of the MEG ID is as defined by meg-id-format.
+ - The name-type in the maintenance-association is ignored.
+ - The name leaf contains the MEG ID value unless the meg-id-format
+ is set to 'icc-based' in which case it contains the value of the
+ 'icc-name-value' leaf
+ - The md-level leaf is ignored, and the level is controlled
+ by the meg-level leaf.";
+ reference
+ "[MEF31], MEF-SOAM-FM-MIB.mefSoamNetCfgY1731Compliant";
+ }
+
+ container component-list {
+
+ description
+ "A list of components each of which can be managed in a manner
+ essentially equivalent to an 802.1Q bridge.
+ Only one is allowed for Edge Assure, so changed to a container";
+ reference
+ "[802.1q] IEEE8021-CFM-V2-MIB.ieee8021CfmMaCompTable";
+
+ leaf-list vid {
+ type msea:vlan-id-type;
+// msea:not-changeable;
+
+ must "current()/../tag-type != 'vlan-none'" {
+ error-message "No VID should be specified when Tag Type is 'vlan-none'";
+ error-app-tag "msea-cfm-must-25";
+ }
+
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id = current()/../../../id]/msea-cfm:maintenance-association/msea-cfm:component-list[msea-cfm:vid = current()]) <= 1" {
+ error-message "The 'vid' (VLan ID) in a Maintenance Association must be unique in a Maintenance Domain";
+ error-app-tag "msea-cfm-must-26";
+ }
+
+ max-elements 1;
+ ordered-by user;
+
+ description
+ "The VID(s) monitored by this MA, or 0, if the MA is not attached to any
+ VID. The first VID returned is the MA's Primary VID";
+ reference
+ "[802.1q] 12.14.5.3.2:b";
+ }
+
+ leaf tag-type {
+ type enumeration {
+ enum vlan-none {
+ description "No tag applied";
+ }
+ enum vlan-ctag {
+ description "Ctags applied";
+ }
+ enum vlan-stag {
+ description "Stags applied";
+ }
+ }
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association/msea-cfm:component-list[msea-cfm:tag-type = 'vlan-none']) <= 1" {
+ error-message "A maximum of 1 MA with tag-type = vlan_none can be specified across all MAs in the device";
+ error-app-tag "msea-cfm-must-27";
+ }
+
+ must "(current() != 'vlan-none' and count(current()/../vid) = 1) or (current() = 'vlan-none' and count(current()/../vid) = 0)" {
+ error-message "A 'vid' must exist when tag-type is vlan-ctag or vlan-stag and must not exist when tag-type is vlan-none";
+ error-app-tag "msea-cfm-must-28";
+ }
+
+ mandatory true;
+// msea:not-changeable;
+ description "The type of tag to apply to packets in this VLAN";
+ }
+
+ } // end of component-list
+
+ leaf ccm-interval {
+ type enumeration {
+ enum 3.3ms {
+ description "CCMs are sent every 3 1/3 milliseconds (300Hz).";
+ }
+ enum 10ms {
+ description "CCMs are sent every 10 milliseconds.";
+ }
+ enum 100ms {
+ description "CCMs are sent every 100 milliseconds.";
+ }
+ enum 1s {
+ description "CCMs are sent every 1 second.";
+ }
+ }
+ mandatory true;
+
+ description
+ "The interval between CCM transmissions to be used by all MEPs in the MA";
+ reference
+ "[802.1q] 12.14.6.1.3:e
+ IEEE8021-CFM-MIB.Dot1agCfmCcmInterval";
+ }
+
+ leaf-list remote-meps {
+ type msea:mep-id-type;
+ max-elements 9; //The local MEP and up to 8 remote meps
+
+ must "(count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association/msea-cfm:remote-meps) - count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association)) <= 64" {
+ error-message "The maximum number of remote MEPs on the device across all MDs and MAs must not exceed 64";
+ error-app-tag "msea-cfm-must-29";
+ }
+
+ description
+ "A list of the MEPIDs of the MEPs in the MA. The list
+ consists of the ids of the local MEP (defined below)
+ and up to 8 remote meps. A maximum of 64 remote MEPs
+ can be configured on all MAs on the device";
+ reference
+ "[802.1q] 12.14.6.1.3:g";
+ }
+
+ list maintenance-association-end-point {
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association/msea-cfm:maintenance-association-end-point) <= 64" {
+ error-message "The maximum number of MEPs on the whole device must not exceed 64";
+ error-app-tag "msea-cfm-must-30";
+ }
+
+ key "mep-identifier";
+
+ max-elements 1; //Only one local MEP is allowed per MA
+
+ description
+ "The list of Maintenance association End Points in a specific Maintance Association.";
+
+ leaf mep-identifier {
+ type msea:mep-id-type;
+
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id = current()/../../../msea-cfm:id]/msea-cfm:maintenance-association[msea-cfm:id = current()/../../msea-cfm:id]/msea-cfm:remote-meps[text() = current()]) = 1" {
+ error-message "The MEP ID must be listed in the 'remote-meps' list for this MA";
+ error-app-tag "msea-cfm-must-31";
+ }
+
+ description
+ "Integer that is unique among all the MEPs in the same MA. Other
+ definition is: a small integer, unique over a given
+ Maintenance Association, identifying a specific Maintenance
+ association End Point.";
+ reference
+ "[802.1q] 12.14.6.3.2:b";
+ }
+
+ leaf interface {
+ type enumeration {
+ enum eth0 {
+ description "Optics/eth0/WAN - commonly the Carrier port.";
+ }
+ enum eth1 {
+ description "Host/eth1/LAN - commonly the System port.";
+ }
+ }
+
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:md-level = current()/../../../md-level]/msea-cfm:maintenance-association[msea-cfm:component-list/msea-cfm:vid = current()/../../component-list/vid]/msea-cfm:maintenance-association-end-point[msea-cfm:interface = current()]) <= 1" {
+ error-message "The combination of 'md-level', 'vid', 'direction' and 'interface' must be unique for all MEPs on the system";
+ error-app-tag "msea-cfm-must-32";
+ description "Check that this interface is unique for all MEPs in this Maintenance Association.
+ The Maintanance Association already checks that the VID is unique for the Maintenance Domain.";
+ }
+
+ mandatory true;
+// msea:not-changeable;
+
+ description
+ "An interface, either a Bridge Port or an aggregated IEEE 802.3 port
+ within a Bridge Port, to which the MEP is attached. Each interface in
+ the system is uniquely identified by an interface-name. The structure
+ and content of the name is outside the scope of this specification.
+
+ Added restriction for Edge Assure that the interface name can only be eth0 or eth1";
+ reference
+ "[802.1q] 12.14.7.1.3:b";
+ }
+
+ leaf direction {
+ type enumeration {
+ enum down {
+ description "Indicates when CFM frames are transmitted towards and
+ received from the wire.";
+ }
+ }
+ default down;
+// msea:not-changeable;
+
+ description
+ "A value indicating the direction in which the MEP faces on the
+ interface. For EdgeAssure can only be 'down' Changed from
+ mandatory to default = down";
+
+ reference
+ "[802.1q] 12.14.7.1.3:c";
+ }
+
+ leaf primary-vid {
+ type union {
+ type enumeration {
+ enum 0 {description "0 to use the MA's VID";}
+ }
+ type msea:vlan-id-type;
+ }
+
+ must "current() = 0 or count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id = current()/../../../id]/msea-cfm:maintenance-association[msea-cfm:id = current()/../../id]/msea-cfm:component-list/msea-cfm:vid[text() = current()]) = 1" {
+ error-message "PrimaryVID of MEP must be either 0 or from the range of VIDs in component-list of the MA";
+ error-app-tag "msea-cfm-must-33";
+ }
+
+ default 0;
+
+ description
+ "The Primary VID of the MEP. The value 0 indicates that either the
+ Primary VID is that of the MEP's MA or that the MEP's MA is
+ associated with no VID. Must be either 0 or from the range of VIDs in the
+ component-list of this MA. Changed to default=0 from mandatory";
+ reference
+ "[802.1q] 12.14.7.1.3:d";
+ }
+
+ leaf administrative-state {
+ type boolean;
+ mandatory true;
+
+ description
+ "The administrative state of the MEP";
+ reference
+ "[802.1q] 12.14.7.1.3:e";
+ }
+
+ leaf mac-address {
+ type yang:mac-address;
+ config false;
+
+ description
+ "The MAC address of the MEP";
+ reference
+ "[802.1q] 12.14.7.1.3:i";
+ }
+
+ leaf ccm-ltm-priority {
+ type msea:priority-type;
+ mandatory true;
+
+ description
+ "The priority parameter for CCMs and LTMs transmitted by the MEP.";
+ reference
+ "[802.1q] 12.14.7.1.3:h";
+ }
+
+ container continuity-check {
+ description
+ "Data definitions related to the Continuity Check function.";
+
+ leaf cci-enabled {
+ type boolean;
+ default false;
+
+ description
+ "Configuration of whether the MEP is or is not to generate CCMs";
+ reference
+ "[802.1q] 12.14.7.1.3:g";
+ }
+
+ leaf fng-state {
+ type enumeration {
+ enum reset {
+ description "No defect has been present since the
+ fng-reset-time timer expired, or since
+ the state machine was last reset.";
+ }
+ enum defect {
+ description "A defect is present, but not for a long enough
+ time to be reported (fng-alarm-time).";
+ }
+ enum report-defect {
+ description "A momentary state during which the defect is
+ reported by sending a fault-alarm notification,
+ if that action is enabled.";
+ }
+ enum defect-reported {
+ description "A defect is present, and some defect has been
+ reported.";
+ }
+ enum defect-clearing {
+ description "No defect is present, but the fng-reset-time timer has
+ not yet expired.";
+ }
+ }
+ default reset;
+ config false;
+
+ description
+ "A value indicating the current state of the MEP Fault Notification
+ Generator state machine";
+ reference
+ "[802.1q] 12.14.7.1.3:f, 20.35
+ IEEE8021-CFM-MIB.Dot1agCfmFngState";
+ }
+
+ leaf lowest-fault-priority-defect {
+ type fault-alarm-defect-type;
+
+ description
+ "The lowest priority defect that is allowed to generate a Fault
+ Alarm.";
+
+ default remote-mac-error;
+
+ reference
+ "[802.1q] 12.14.7.1.3:k";
+ }
+
+ leaf highest-priority-defect-found {
+ type fault-alarm-defect-type;
+ config false;
+
+ description
+ "Value indicating the highest-priority defect that has been
+ present since the MEP Fault Notification Generator state machine
+ was last in the FNG_RESET state The non-existence of this
+ leaf represents that no defect has been present since the
+ last FNG_RESET state";
+ reference
+ "[802.1q] 12.14.7.1.3:n";
+ }
+
+ leaf fng-alarm-time {
+ type yang:timeticks {
+ range 250..1000;
+ }
+ default 250;
+
+ description
+ "The time that defects must be present before a Fault Alarm is
+ issued in hundredths of seconds";
+ reference
+ "[802.1q] 12.14.7.1.3:l, 20.33.3";
+ }
+
+ leaf fng-reset-time {
+ type yang:timeticks {
+ range 250..1000;
+ }
+ default 1000;
+
+ description
+ "The time that defects must be absent before resetting a Fault Alarm
+ in hundredths of seconds";
+ reference
+ "[802.1q] 12.14.7.1.3:m, 20.33.4";
+ }
+
+ leaf active-defects {
+ type fault-alarm-defect-bits-type;
+ config false;
+
+ description
+ "A bit field of potential active defects. The values are the same as the
+ content of the fault-alarm-defect-type (except if it is 'none' then
+ nothing will be listed).";
+ reference
+ "[802.1q] 12.14.7.1.3:o, p, q, r, s";
+ }
+
+ leaf last-error-ccm {
+ type binary {
+ length "1..1522";
+ }
+ config false;
+
+ description
+ "The last-received CCM that triggered an invalid-ccm fault";
+ reference
+ "[802.1q] 12.14.7.1.3:t";
+ }
+
+ leaf last-cross-connect-ccm {
+ type binary {
+ length "1..1522";
+ }
+ config false;
+
+ description
+ "The last-received CCM that triggered a cross-connect-ccm fault";
+ reference
+ "[802.1q] 12.14.7.1.3:u";
+ }
+
+ leaf ccm-sequence-error-count {
+ type yang:counter32;
+ config false;
+ mandatory true;
+
+ description
+ "The total number of out-of-sequence CCMs received from all remote
+ MEPs.";
+ reference
+ "[802.1q] 12.14.7.1.3:v";
+ }
+
+ leaf sent-ccms {
+ type yang:counter32;
+ config false;
+ mandatory true;
+
+ description
+ "The total number of CCMs transmitted.";
+ reference
+ "[802.1q] 12.14.7.1.3:w";
+ }
+ }
+
+ container loopback {
+ description
+ "Data definitions related to the Loopback function.";
+
+ //config false; Commented out to let config attribs on mef-soam-pm work 08Dec15 SC Microsemi
+
+ leaf replies-received {
+ type yang:counter32;
+ config false;
+ mandatory true;
+
+ description
+ "The total number of valid, in-order LBRs received.";
+ reference
+ "[802.1q] 12.14.7.1.3:y";
+ }
+
+ leaf replies-transmitted {
+ type yang:counter32;
+ config false;
+ mandatory true;
+
+ description
+ "The total number of LBRs transmitted.";
+ reference
+ "[802.1q] 12.14.7.1.3:ad";
+ }
+ } //End of loopback
+
+ container remote-mep-database {
+ config false;
+ description
+ "The MEP CCM database";
+
+ list remote-mep {
+ key remote-mep-id;
+ description
+ "The list of remote MEPs in the MEP CCM database";
+ reference
+ "[802.1q] 12.14.7.6";
+
+ leaf remote-mep-id {
+ type msea:mep-id-type;
+
+ description
+ "The MEPID of a remote MEP";
+ reference
+ "[802.1q] 12.14.7.6.2";
+ }
+
+ leaf remote-mep-state {
+ type remote-mep-state-type;
+
+ description
+ "An enumerated value indicating the operational state of the
+ Remote MEP state machine for this remote MEP.";
+ reference
+ "[802.1q] 12.14.7.6.3:b
+ IEEE8021-CFM-MIB.Dot1agCfmRemoteMepState";
+ }
+
+ leaf failed-ok-time {
+ type yang:timeticks;
+
+ description
+ "The time (SysUpTime, IETF RFC 3418) at which the Remote MEP state
+ machine last entered either the RMEP_FAILED or RMEP_OK
+ state, or 0 if it has not yet entered either of those
+ states";
+ reference
+ "[802.1q] 12.14.7.6.3:c";
+ }
+
+ leaf mac-address {
+ type yang:mac-address;
+
+ description
+ "The MAC address of the remote MEP.";
+ reference
+ "[802.1q] 12.14.7.6.3:d";
+ }
+
+ leaf rdi {
+ type boolean;
+
+ description
+ "An indication of the state of the RDI bit in the last received CCM,
+ true for RDI = 1, or false for RDI = 0 or if none has been
+ received.";
+ reference
+ "[802.1q] 12.14.7.6.3:e";
+ }
+
+ leaf port-status-tlv {
+ type msea:port-status-type;
+
+ description
+ "The enumerated value from the Port Status TLV from the last
+ CCM received from the remote MEP.";
+ reference
+ "[802.1q] 12.14.7.6.3:f";
+ }
+
+ leaf interface-status-tlv {
+ type msea:interface-status-type;
+
+ description
+ "The enumerated value from the Interface Status TLV from the
+ last CCM received from the remote MEP";
+ reference
+ "[802.1q] 12.14.7.6.3:g";
+ }
+ }
+ } //end remote-mep-database
+
+
+ container linktrace {
+ config false;
+ description
+ "Data definitions related to the Linktrace function.";
+
+ leaf unexpected-replies-received {
+ type yang:counter32;
+
+ description
+ "The total number of unexpected LTRs received.";
+ reference
+ "[802.1q] 12.14.7.1.3:ac";
+ }
+
+ container linktrace-database {
+ description
+ "Data definitions related to the Linktrace database for a specific MEP";
+
+ list linktrace {
+ key "transaction-id";
+
+ description
+ "The list of entries in a Linktrace database.";
+
+ uses linktrace-reply-grouping;
+ }
+ }
+ } //End linktrace
+ }
+ }
+ }
+ }
+ //
+ // RPCs related to CFM
+ //
+
+ rpc transmit-loopback {
+ description
+ "Start a loopback session on a specific MEP
+
+ The counters in the loopback container of the associated MEP will be updated
+ with the result of the loopback session until the configured number of messages
+ have been sent.";
+// reference --Removed as Tail-f NSO 4.1 can't handle references on RPCs. Also cannot remove using a deviate statement since reference is not a valid deviate sub-statement
+// "[802.1q] 12.14.7.3";
+
+ input {
+ uses maintenance-association-end-point-reference; //Added 08Dec15 SC Microsemi
+
+ container target-address {
+ description
+ "Target MAC address or MEP ID for the Loopback session.";
+ uses target-address-group;
+ }
+
+ leaf number-of-messages {
+ type uint32 {
+ range "1..1024";
+ }
+ default 1;
+
+ description
+ "The number of LBM transmissions in a session.";
+ reference
+ "[802.1q] 12.14.7.3.2:c, [MEF30] R39";
+ }
+
+ leaf data-tlv {
+ type binary;
+
+ description
+ "An arbitrary amount of data to be included in a Data TLV.";
+ reference
+ "[802.1q] 12.14.7.3.d, IEEE8021-CFM-MIB.dot1agCfmMepTransmitLbmDataTlv";
+ }
+
+ leaf vlan-priority {
+ type msea:priority-type;
+
+ description
+ "The priority parameter to be used in the transmitted LBMs";
+ reference
+ "[802.1q] 12.14.7.3.2:e";
+ }
+
+ leaf vlan-drop-eligible {
+ type boolean;
+ default true;
+
+ description
+ "The drop eligible parameter to be used in the transmitted LBMs";
+ reference
+ "[802.1q] 12.14.7.3.2:e";
+ }
+ }
+ }
+
+ rpc abort-loopback {
+ description
+ "Administratively abort a loopback session in progress on a specific MEP";
+// reference --Removed as Tail-f NSO 4.1 can't handle references on RPCs. Also cannot remove using a deviate statement since reference is not a valid deviate sub-statement
+// "[MEF30] 8.2, R28";
+
+ input {
+ uses maintenance-association-end-point-reference; //Added 08Dec15 SC Microsemi
+
+ }
+ }
+
+ rpc transmit-linktrace {
+ description
+ "Start a linktrace session on a specific remote MEP associated
+ with a local MEP.
+
+ This RPC will wait 6 seconds for the linktrace replies to be
+ gathered from remote MEP and any intermediate MIPs and will
+ display them in line. The information about the last linktrace
+ transaction will also be visible in the state data beneath the
+ local MEP until the next linktrace is run. Only one
+ instance of linktrace can be run at a time";
+ // reference
+ // "[802.1q] 12.14.7.4";
+
+ input {
+ uses maintenance-association-end-point-reference; //Added 08Dec15 SC Microsemi
+
+ uses linktrace-parameters-group;
+ }
+
+ output {
+ anyxml data {
+ description "The complete response from the Linktrace
+ including the individual replies from remote MEPs
+ and any intermediate MIPs";
+ }
+ }
+ }
+
+
+ //
+ // Notifications related to CFM
+ //
+
+ notification fault-alarm {
+ description
+ "A notification that a specific MEP has a persistent defect condition.";
+ reference
+ "[802.1q] 12.14.7.7";
+
+ container alarm {
+ description
+ "Data definitions related to a persistent defect on a specific MEP.";
+
+ uses mep-notification-reference;
+
+ leaf remote-mep {
+ type msea:mep-id-type;
+ description "Remote MEP identifier";
+ }
+
+ leaf highest-defect {
+ type fault-alarm-defect-type;
+ description "The highest priority defect currently asserted when the alarm occurs on the MEP.";
+ }
+ }
+ }
+}
+
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/msea-sa-filtering.yang b/drivers/microsemi/ea1000yang/src/main/yang/msea-sa-filtering.yang
new file mode 100644
index 0000000..72534a9
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/msea-sa-filtering.yang
@@ -0,0 +1,149 @@
+module msea-sa-filtering {
+
+ /*** NAMESPACE / PREFIX DEFINITION ***/
+
+ namespace "http://www.microsemi.com/microsemi-edge-assure/msea-sa-filtering";
+ prefix "msea-saf";
+
+ import ietf-inet-types {
+ prefix inet;
+ revision-date 2013-07-15;
+ }
+
+ import msea-types {
+ prefix msea;
+ revision-date 2016-02-29;
+ }
+
+ /*** 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 add Source Address Filtering for IPv4 packets to
+ the Optics(eth0) port (only) of the Edge Assure device.
+
+ Copyright 2016 Microsemi Inc.
+ All rights reserved.";
+
+ revision "2016-04-12" {
+ description
+ "Initial version - Sean Condon, Microsemi";
+ }
+
+
+ container source-ipaddress-filtering {
+ presence "Supports IPv4 Source Address Filtering";
+
+ container interface-eth0 {
+
+ leaf filter-admin-state {
+ type enumeration {
+ enum inactive {
+ description "Source address filtering is inactive";
+ }
+ enum whitelist {
+ description "Only IPv4 packets from the source
+ address ranges are allowed in to the device on the
+ Optics(eth0) port. All non IPv4 packets are not
+ filtered by this whitelist";
+ }
+ enum blacklist {
+ description "All IPv4 packets from the source
+ address ranges are blocked from entering the device
+ on the Optics(eth0) port. All other packets are not
+ filtered by this blacklist";
+ }
+ }
+ default inactive;
+ description "This attribute sets the address range to be used as
+ either a whitelist or a blacklist of IPv4 packets.
+ When activating the filter the user should be careful not to
+ block or exclude the management IP address of the manager";
+ }
+
+ list source-address-range {
+ key range-id;
+ max-elements 10;
+ unique ipv4-address-prefix;
+ unique name;
+
+ leaf range-id {
+ type uint8 {
+ range "1..10";
+ }
+ }
+
+ leaf name {
+ type string{
+ length "1..45";
+ }
+ description "An optional name for the filter range";
+ }
+
+ leaf ipv4-address-prefix {
+ type string {
+ pattern
+ '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+ + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+ + '/(([1-9])|(1[0-9])|(2[0-7]))';
+ }
+
+ mandatory true;
+// msea:not-changeable;
+
+ description
+ "The ipv4-address-prefix type represents an IPv4 address prefix
+ in CIDR notation format. e.g. a.b.c.d/n
+
+ It consists of an address part and a mask length part.
+ The address part is only used up to the number of bits
+ specified in the length (1-27, given after the slash).
+
+ For example the value 10.10.159.211/20 will mean an
+ effective range from 10.10.144.0 - 10.10.159.255 and
+ a count of 2^12 = 4096. The last 12 bits (32-20=12)
+ of the address is ignored because it is not within the
+ mask length.";
+ }
+
+
+ container effective-address-range {
+ config false;
+
+ leaf start-of-range {
+ type inet:ipv4-address-no-zone;
+ description "The calculated start of the address range";
+ }
+
+ leaf end-of-range {
+ type inet:ipv4-address-no-zone;
+ description "The calculated end of the address range";
+ }
+
+ leaf count {
+ type uint32;
+ description "The number of IPv4 addresses that match the filter";
+ }
+
+ description "The effective start and end addresses calculated
+ from the ipv4-address-prefix";
+ }
+
+ description "A set of address ranges to be either blacklisted or
+ whitelisted on ingress to the eth0(Optics) port of the device";
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/msea-soam-fm.yang b/drivers/microsemi/ea1000yang/src/main/yang/msea-soam-fm.yang
new file mode 100644
index 0000000..35a95c9
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/msea-soam-fm.yang
@@ -0,0 +1,545 @@
+module msea-soam-fm {
+
+ namespace "http://www.microsemi.com/microsemi-edge-assure/msea-soam-fm";
+ prefix "msea-soam-fm"; //MicroSemi EdgeAssure (msea)
+
+ import ietf-yang-types {
+ prefix yang;
+ revision-date 2013-07-15;
+ }
+
+ import msea-cfm {
+ prefix msea-cfm;
+ }
+
+ import msea-types {
+ prefix msea;
+ }
+
+ 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 is a fork of the original mef-soam-fm YANG Module defined in MEF 38
+ for the management of Ethernet Services Operations, Administration and
+ Maintenance for Fault Management and extends the Connectivity Fault
+ Management (CFM) YANG modules.
+ This fork is done specifically to suit the EdgeAssure which has some extra
+ constraints that are not handled by the original YANG.
+
+ Copyright 2016 Microsemi Inc.
+ All rights reserved.";
+
+ revision "2016-02-29" {
+ description
+ "Initial EdgeAssure version forked from mef-soam-fm@2012-04-16 - Sean Condon, Microsemi";
+ reference
+ "Service OAM Fault Management YANG Modules (MEF 38), April 2012";
+ }
+
+ //
+ // Type definitions related to MEF SOAM FM
+ //
+
+ typedef operational-state-type {
+ type enumeration {
+ enum enabled {
+ description
+ "The MEP is able to provide OAM capabilities and has been set to
+ active via the 'administrative-state' leaf.";
+ }
+ enum disabled {
+ description
+ "The MEP is not able to provide OAM capabilities, for example
+ because it has been disabled via the administrative-state leaf,
+ has detected an operational failure condition, or has failed an
+ internal test.";
+ }
+ enum testing {
+ description
+ "The MEP has been placed into a test mode, either a troubleshooting
+ mode or ETH-Test 'Out-of-service' mode.";
+ }
+ enum unknown {
+ description
+ "The MEP is unable to report the operational state.";
+ }
+ }
+ description
+ "This attribute indicates the operational state (current capability) of
+ a MEP.";
+ reference
+ "[MEF7.1] 9.2.5";
+ }
+
+
+
+ //
+ // Augments into CFM related to MEF SOAM FM
+ //
+ augment "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association" {
+ description
+ "This set of data definitions represents the Maintenance Entity Group (Y.1731)
+ configuration that is unique from the Maintenance Association.";
+
+ leaf meg-level {
+ type msea:md-level-type;
+
+// msea:not-changeable;
+
+ must "../msea-cfm:y1731-compliant" {
+ error-message "meg-level can only be set when y1731-compliant is present";
+ error-app-tag "msea-soam-fm-must-04";
+ }
+
+ must "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id = current()/../../msea-cfm:id]/msea-cfm:md-level = current()" {
+ error-message "meg-level must be the same as its parent MD md-level";
+ error-app-tag "msea-soam-fm-must-05";
+ }
+
+ description
+ "This attribute indicates the MEG Level of the MEG. It has to be the same as the
+ MDs level, which is a way of ensuring that all MEG under this MD have the same level";
+
+ reference
+ "[MEF31] MEF-SOAM-FM-MIB.mefSoamNetCfgMegLevel";
+ }
+ }
+
+
+
+
+
+ augment "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association/msea-cfm:component-list" {
+ description
+ "This set of data definitions extends the component list of the Maintenance
+ Entity Group (as defined in Y.1731) or Maintenance Association (as defined
+ in 802.1q)";
+ reference
+ "[MEF7.1] 9.2.2";
+
+ leaf mep-port-status-tlv-included {
+ type boolean;
+ default true;
+
+ description
+ "Indicates whether a Port Status TLV is included in CCM frame
+ transmission. A value of 'true' indicates that the Port Status
+ TLV is to be included. A value of 'false' indicates that the
+ Port Status TLV is not to be included.";
+ reference
+ "[MEF7.1] 9.2.2";
+ }
+
+ leaf mep-interface-status-tlv-included {
+ type boolean;
+ default true;
+
+ description
+ "Indicates whether a Interface Status TLV is included in CCM frame
+ transmission. A value of 'true' indicates that the Interface Status TLV
+ is to be included. A value of 'false' indicates that the Interface
+ Status TLV is not to be included.";
+ reference
+ "[MEF7.1] 9.2.2";
+ }
+ }
+
+
+
+
+ augment "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association/msea-cfm:maintenance-association-end-point" {
+ description
+ "This set of data definitions extends the MEG End Point (as described in
+ Y.1731) or Maintenance association End Point (as described in 802.1q)
+ defined in the MEF CFM module (MEF-CFM)";
+ reference
+ "[MEF7.1] 9.2.2";
+
+ leaf operational-state {
+ type operational-state-type;
+
+ config false;
+
+ description
+ "This attribute indicates the operational state (current capability) of
+ the MEP.";
+ reference
+ "[MEF7.1] 9.2.5";
+ }
+
+ leaf connectivity-status {
+ type enumeration {
+ enum active {
+ description
+ "Refers to the ability to exchange SOAM PDU frames among all the UNIs
+ of an EVC.";
+ }
+ enum partially-active {
+ description
+ "Refers to the ability to exchange SOAM PDU frames among some but not
+ all the UNIs of an EVC.";
+ }
+ enum inactive {
+ description
+ "Refers to the ability to exchange SOAM PDU frames among any of the UNIs
+ of an EVC.";
+ }
+ }
+ config false;
+
+ description
+ "This attribute indicates the connectivity status for a MEP in an EVC
+ MEs. An 'active' MEP Connectivity Status refers to the ability
+ to exchange SOAM PDU frames among all the UNIs of an EVC. A
+ 'partially-active' MEP Connectivity Status refers to the
+ ability to exchange SOAM PDU frames among some but not all the
+ UNIs of an EVC. An 'inactive' MEP Connectivity Status refers to
+ the inability to exchange SOAM PDU frames among any of the UNIs
+ of an EVC.";
+ reference
+ "[MEF7.1] 9.2.5";
+ }
+
+ leaf port-status {
+ type msea:port-status-type;
+ config false;
+
+ description
+ "An enumerated value of the Port status TLV sent in the last CCM from the
+ local MEP or the default value psNoPortStateTLV indicating no
+ CCM has been sent or no Port Status TLV has been sent.";
+ reference
+ "[802.1q] 17.5";
+ }
+
+ leaf interface-status {
+ type msea:interface-status-type;
+ config false;
+
+ description
+ "An enumerated value of the Interface status TLV sent in the last CCM
+ from the local MEP or the default value no-status-tlv
+ indicating no CCM has been sent or no Interface Status TLV has
+ been sent.";
+ reference
+ "[802.1q] 17.5";
+ }
+
+ leaf last-defect-sent {
+ type msea-cfm:fault-alarm-defect-bits-type;
+ config false;
+
+ description
+ "This attribute indicates the state of the previous MEP defects,
+ that was sent with the previous
+ mep-defect-alarm notification. It is always some *previous*
+ value of cfm:active-defects. Once an mep-defect-alarm is sent
+ the mep-defect-alarm that was sent in the notification
+ updates the contents of this leaf.
+
+ If no mep-defect-alarm notification has been sent the value of
+ this leaf is '0'.";
+ reference
+ "[MEF31] MEF-SOAM-FM-MIB.mefSoamMepStatusLastDefectSentStatus";
+ }
+
+ leaf rdi-transmit-status {
+ type boolean;
+ config false;
+
+ description
+ "Indicates whether the local MEP is generating a RDI bit in the CCM that
+ it transmits. A value of 'true' indicates that a RDI bit was
+ set in the last CCM that the MEP transmitted. A value of
+ 'false' indicates that the last CCM transmitted by the MEP did
+ not set the RDI bit or that a CCM has never been transmitted by
+ the MEP.";
+ reference
+ "[MEF7.1] 9.2.2";
+ }
+
+ } //end of MEP augmentation
+
+
+ augment "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association/msea-cfm:maintenance-association-end-point/msea-cfm:loopback" {
+ description
+ "This set of data definitions extends on-demand Ethernet OAM Fault
+ Management Loopback function (ETH-LB) as defined in Y.1731 and
+ 802.1q and defined in MEF-CFM";
+ reference
+ "[MEF7.1] 9.3.2";
+
+ leaf multicast-enabled {
+ type boolean;
+ default false;
+
+ description
+ "This attribute specifies whether a MEP uses unicast or multicast
+ to send the ETH-LB messages (LBM). The 802.1ag standard only allows
+ unicast LBM. ITU-T Y.1731 allows LBM to be multicast. This attribute
+ allows the MEP to send either multicast or unicast LBM on a per MEP
+ basis.
+
+ The value 'true' indicates multicast is enabled.
+
+ The value 'false' indicates unicast is enabled.";
+ reference
+ "[MEF7.1] 9.3.2.1";
+ }
+
+ leaf interval {
+ type uint16 {
+ range "0..2096";
+ }
+ units milliseconds;
+ default 1000;
+
+ description
+ "This attribute specifies the period between LBM transmissions in an LB
+ Session. For an LB Session, the period for LBM transmission
+ is configurable in the range 0 and 2096 milliseconds . Granularity is 1 ms.
+ The transmission of the next LBM is not dependent upon the
+ reception the first LBR. The next LBM is sent out based upon
+ the interval count.
+
+ An interval count of '0' indicates that the subsequent LBM is sent
+ out with the minimum possible delay.";
+ reference
+ "[MEF7.1] 9.3.2.1";
+ }
+
+ leaf frame-size {
+ type uint16 {
+ range "64..9600";
+ }
+ units "bytes";
+
+ description
+ "This attribute specifies the LBM frame size. For an LB Session, the size
+ of the LBM frame is configurable to any Ethernet frame size
+ between 64 Bytes and the maximum transmission unit of the EVC.
+
+ The range of frame sizes from 64 through 2000 octets, in 4 octet increments,
+ MUST be supported, and the range of frame sizes from 2004 through 9600
+ octets, in 4 octet increments, SHOULD be supported.
+
+ The adjustment to the frame size of the standard LBM PDU size is accomplished
+ by the addition of a Data TLV or a Test TLV.";
+ reference
+ "[MEF7.1] 9.3.2.1";
+ }
+
+
+ leaf timeout {
+ type yang:gauge32 {
+ range "5000";
+ }
+ default 5000;
+
+ description
+ "This attribute specifies the maximum amount of time to receive an LBR in
+ response to a LBM. If a LBR is not received within the timeout
+ value it is considered lost.";
+ reference
+ "[MEF31] MEF-SOAM-FM-MIB.mefSoamLbCfgTimeout";
+ }
+
+ list responses {
+ key "receive-order";
+ config false;
+
+ description
+ "A list of responses from a Multicast Loopback Message. This are shown only when multicast is enabled";
+ reference
+ "[MEF31] MEF-SOAM-FM-MIB.mefSoamLbrMulticastTable";
+
+ leaf receive-order {
+ type int8;
+
+ description
+ "Loopback transaction identifier returned by a previous loopback message
+ command, indicating which loopback request is returned.";
+ reference
+ "[MEF31] MEF-SOAM-FM-MIB.mefSoamLbrMulticastTransId";
+ }
+
+ leaf multicast-reply-mac {
+ type yang:mac-address;
+
+ description
+ "Source MAC address returned in the LBR Ethernet frame";
+ reference
+ "[802.1q] 21.7, [Y.1731] 7.2,
+ [MEF31] MEF-SOAM-FM-MIB.mefSoamLbrMulticastReplyMac";
+ }
+ }
+ }
+
+
+
+ augment "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association/msea-cfm:maintenance-association-end-point/msea-cfm:linktrace" {
+ description
+ "Augments to support the enhanced CFM Linktrace functionality";
+ reference
+ "[MEF30] 8.4";
+
+ leaf ltm-msgs-transmitted {
+ type yang:zero-based-counter32;
+ config false;
+
+ description
+ "This attribute contains the count of the total number of LTM messages
+ transmitted by the MEP";
+ reference
+ "[MEF31] MEF-SOAM-FM-MIB.mefSoamLtLtmTransmitted";
+ }
+
+ leaf ltr-msgs-received {
+ type yang:zero-based-counter32;
+ config false;
+
+ description
+ "This attribute contains the count of the total number of LTR messages
+ received by the MEP";
+ reference
+ "[MEF31] MEF-SOAM-FM-MIB.mefSoamLtLtrReceived";
+ }
+
+ leaf ltm-msgs-received {
+ type yang:zero-based-counter32;
+ config false;
+
+ description
+ "This attribute contains the count of the total number of LTM messages
+ received by the MEP";
+ reference
+ "[MEF31] MEF-SOAM-FM-MIB.mefSoamLtLtmReceived";
+ }
+
+ leaf ltr-msgs-transmitted {
+ type yang:zero-based-counter32;
+ config false;
+
+ description
+ "This attribute contains the count of the total number of LTR messages
+ transmitted by the MEP";
+ reference
+ "[MEF31] MEF-SOAM-FM-MIB.mefSoamLtLtrTransmitted";
+ }
+ }
+
+
+ //
+ // Data definitions related to MEF SOAM FM
+ //
+ augment "/msea-cfm:mef-cfm" {
+ description
+ "A set of data definitions related to FM event notifications.";
+ reference
+ "[MEF31] MEF-SOAM-FM-MIB.mefSoamFmNotificationCfg";
+
+ container notification-configuration {
+ description
+ "A set of data definitions related to FM event notifications.";
+ reference
+ "[MEF31] MEF-SOAM-FM-MIB.mefSoamFmNotificationCfg";
+
+ leaf active-alarms {
+ type bits {
+ bit fault-alarm {
+ description "Send notifications when a specific MEP has a persistent defect condition";
+ }
+
+ bit mep-defect-alarm {
+ description "Send notifications when the value of mep-defects changes";
+ }
+
+ bit mep-operational-state-changed {
+ description "Send notifications when the value of a MEP's operational-state changes";
+ }
+ }
+ description "Configure the fault notification generator to enable the alarms given in
+ the bitmask list.";
+ }
+ }
+ }
+
+ //
+ // Notifications related to MEF SOAM FM
+ //
+
+ notification mep-defect-alarm {
+ description
+ "A mep-defect-alarm notification is generated when the value of
+ mep-defects changes. It indicates a persistent defect in
+ the MEP. This notification is sent whenever the
+ cfm:active-defects of the MEP changes, regardless of the
+ cfm:highest-priority-defect-found leaf.
+
+ The inclusion of the cfm:remote-mep-state leaf is
+ optional. It shall not be included if the defect is not based
+ upon a specific MEP instance, e.g.. bDefErrorCCM.";
+
+ reference
+ "[MEF31] MEF-SOAM-FM-MIB.mefSoamMepDefectAlarm";
+
+ uses msea-cfm:mep-notification-reference;
+
+ leaf remote-mep {
+ type msea:mep-id-type;
+ description "Remote MEP identifier";
+ }
+
+ leaf last-defect-sent {
+ type msea-cfm:fault-alarm-defect-type;
+
+ description
+ "The last defect sent on the specific MEP";
+ }
+ leaf active-defects {
+ type msea-cfm:fault-alarm-defect-bits-type;
+ description
+ "The currently active defects on the specific MEP.";
+ }
+
+ leaf remote-mep-state {
+ type msea-cfm:remote-mep-state-type;
+
+ description
+ "The value of the remote MEP state on a specific MEP";
+ reference
+ "[802.1q] 12.14.7.6.3:b";
+ }
+ }
+
+ notification mep-operational-state-changed {
+ description
+ "A mep-operational-state-changed notification is sent when the value of a
+ MEP's operational-state changes. It indicates an operational
+ state change in the MEP. This notification is sent whenever the
+ operational status of the MEP changes.";
+ reference
+ "[MEF31] MEF-SOAM-FM-MIB.mefSoamMepOperStatusAlarm";
+
+ uses msea-cfm:mep-notification-reference;
+
+ leaf operational-state {
+ type operational-state-type;
+
+ description
+ "The operational-state leaf of the affected MEP";
+ }
+ }
+}
+
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/msea-soam-pm.yang b/drivers/microsemi/ea1000yang/src/main/yang/msea-soam-pm.yang
new file mode 100644
index 0000000..21c05a6
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/msea-soam-pm.yang
@@ -0,0 +1,1479 @@
+module msea-soam-pm {
+
+ namespace "http://www.microsemi.com/microsemi-edge-assure/msea-soam-pm";
+ prefix "msea-soam-pm"; //MicroSemi EdgeAssure (msea)
+
+ import ietf-yang-types {
+ prefix yang;
+ revision-date 2013-07-15;
+ }
+
+ import msea-cfm {
+ prefix msea-cfm;
+ }
+
+ import msea-types {
+ prefix msea;
+ }
+
+ 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 is a fork of the original mef-soam-pm YANG Module defined in MEF 39
+ for the management of Ethernet Services Operations, Administration and
+ Maintenance for Performance Monitoring and extends the Connectivity Fault
+ Management (CFM) YANG modules.
+ This fork is done specifically to suit the EdgeAssure which has some extra
+ constraints that are not handled by the original YANG.
+
+ Copyright 2016 Microsemi Inc.
+ All rights reserved.";
+
+ revision "2016-02-29" {
+ description
+ "Initial EdgeAssure version forked from mef-soam-pm@2012-04-16 - Sean Condon, Microsemi";
+ reference
+ "Service OAM Fault Management YANG Modules (MEF 39), April 2012";
+ }
+
+ //
+ // Type definitions related to MEF SOAM PM
+ //
+
+ typedef suspect-status-type {
+ type boolean;
+ description
+ "This boolean data type indicates whether the measurement interval
+ has been marked as suspect.
+
+ The object is set to false at the start of a measurement
+ interval. It is set to true when there is a discontinuity in the
+ performance measurements during the measurement interval.
+ Conditions for a discontinuity include, but are not limited to
+ the following:
+
+ 1 - The local time-of-day clock is adjusted by at least 10
+ seconds
+ 2 - The conducting of a performance measurement is halted before
+ the current measurement interval is completed
+ 3 - A local test, failure, or reconfiguration that disrupts
+ service";
+ reference
+ "[MEF SOAM PM IA] R39, R40, 41 and R42";
+ }
+
+ typedef performance-monitoring-interval-type {
+ type uint32 {
+ range "3..3600000";
+ }
+ units ms;
+ description
+ "This integer data type indicates the transmission time between the
+ SOAM PM frames for session, in ms.";
+ }
+
+
+ typedef session-status-type {
+ type enumeration {
+ enum active {
+ description
+ "Indicates the measurement instance is active.";
+ }
+ enum not-active {
+ description
+ "Indicates the measurement instance is not active.";
+ }
+ }
+
+ description
+ "This enumeration data type defines the status of PM session of a MEP.";
+ reference
+ "MEF-SOAM-TC-MIB.MefSoamTcStatusType";
+ }
+
+
+ typedef measurement-bin-type {
+ type enumeration {
+ enum two-way-frame-delay {
+ description
+ "Indicates a measurement bin for two-way Frame Delay.";
+ }
+
+ enum two-way-inter-frame-delay-variation {
+ description
+ "Indicates a measurement bin for two-way Inter-frame Delay
+ Variation.";
+ }
+ }
+
+ description
+ "This enumeration data type indicates whether the bin number is for Frame
+ Delay and Inter-Frame Delay Variation.";
+ reference
+ "MEF-SOAM-TC-MIB.MefSoamTcDelayMeasurementBinType";
+ }
+
+ //
+ // Groupings related to MEF SOAM PM
+ //
+
+ grouping remote-mep-group {
+ description
+ "This grouping includes objects which identify a remote MEP.";
+ choice remote-mep {
+ mandatory true;
+ description
+ "The remote MEP can be identified by either a MAC address or a MEP ID";
+
+ case mac-address {
+ leaf mac-address {
+ type yang:mac-address;
+// msea:not-changeable;
+
+ description
+ "The Target MAC Address Field to be transmitted: A unicast
+ destination MAC address.
+
+ This object is only valid for the entity transmitting the
+ SOAM Loss and Delay Measurement frames and is ignored by
+ the entity receiving SOAM Loss and Delay Measurement
+ frames.";
+ }
+ }
+ case mep-id {
+ leaf mep-id {
+ type leafref {
+ path "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association/msea-cfm:remote-meps";
+ }
+// msea:not-changeable;
+
+ description
+ "The Maintenance Association End Point Identifier of another MEP in
+ the same Maintenance Association to which the SOAM Loss or Delay
+ Measurement frame is to be sent.
+
+ This object is only valid for the entity transmitting the
+ SOAM Loss Measurement or Delay Measurement frames and is
+ ignored by the entity receiving SOAM Loss Measurement or
+ Delay Measurement frames.";
+ }
+ }
+ }
+ }
+
+ grouping measurement-timing-group {
+ description
+ "This grouping includes objects used for proactive and on-demand
+ scheduling of PM measurement sessions.";
+
+ container start-time {
+ description
+ "This container defines the session start time";
+
+ choice start-time {
+ default immediate;
+ description
+ "Measurement session start time can be immediate, relative or
+ absolute.";
+
+ container immediate {
+ presence "Start the measurement session immediately.";
+
+ description
+ "This object specifies the start time to be immediately at the time
+ of session creation.";
+ }
+ }
+ }
+
+ container stop-time {
+ description
+ "This container defines the session stop time";
+
+ choice stop-time {
+ default none;
+ description
+ "Measurement session stop time can be none, relative or
+ absolute.";
+
+ container none {
+ presence "Never end the measurement session.";
+
+ description
+ "This object specifies the measurement session to never end.";
+ }
+ }
+ }
+ }
+
+ grouping loss-measurement-stats-group {
+ description
+ "This grouping includes statistics objects for a SOAM Loss Measurement
+ session.";
+
+ leaf suspect-status {
+ type suspect-status-type;
+
+ description
+ "Whether the Measurement Interval has been marked as suspect.
+
+ The object is set to false at the start of a measurement
+ interval. It is set to true when there is a discontinuity in
+ the performance measurements during the Measurement Interval.
+ Conditions for a discontinuity include, but are not limited to
+ the following:
+
+ 1 - The local time-of-day clock is adjusted by at least 10 seconds
+ 2 - The conducting of a performance measurement is halted before the
+ current Measurement Interval is completed
+ 3 - A local test, failure, or reconfiguration that disrupts service";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCurrentStatsSuspect";
+ }
+
+ leaf forward-transmitted-frames {
+ type yang:gauge32;
+ mandatory true;
+
+ description
+ "This object contains the number of frames transmitted in the forward
+ direction by this MEP.
+
+ For a PM Session of types lmm or ccm this includes Ethernet
+ Service Frames and SOAM PDUs that are in a higher MEG level
+ only.
+
+ For a PM Session of type slm this includes the count of SOAM
+ ETH-SLM frames only.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCurrentStatsForwardTransmittedFrames";
+ }
+
+ leaf forward-received-frames {
+ type yang:gauge32;
+ mandatory true;
+
+ description
+ "This object contains the number of frames received in the forward
+ direction by this MEP.
+
+ For a PM Session of types lmm or ccm this includes Ethernet
+ Service Frames and SOAM PDUs that are in a higher MEG level only.
+
+ For a PM Session of type slm this includes the count of SOAM
+ ETH-SLM frames only.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCurrentStatsForwardReceivedFrames";
+ }
+
+ leaf forward-average-frame-loss-ratio {
+ type uint32 {
+ range "0..100000";
+ }
+ units milli-percent;
+
+ description
+ "This object contains the average one-way frame loss ratio in the
+ forward direction calculated by this MEP for this Measurement
+ Interval. The FLR value is a ratio that is expressed as a
+ percent with a value of 0 (ratio 0.00) through 100000 (ratio
+ 1.00).
+
+ Units are in milli-percent, where 1 indicates 0.001 percent.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCurrentStatsForwardAvgFlr";
+ }
+
+ leaf backward-transmitted-frames {
+ type yang:gauge32;
+ mandatory true;
+
+ description
+ "This object contains the number of frames transmitted in the backward
+ direction by this MEP.
+
+ For a PM Session of type lmm or ccm this includes Ethernet
+ Service Frames and SOAM PDUs that are in a higher MEG level
+ only.
+
+ For a PM Session of type slm this includes the count of SOAM
+ ETH-SLM frames only.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCurrentStatsBackwardTransmittedFrames";
+ }
+
+ leaf backward-received-frames {
+ type yang:gauge32;
+ mandatory true;
+
+ description
+ "This object contains the number of frames received in the backward
+ direction by this MEP.
+
+ For a PM Session of type lmm this includes Ethernet Service
+ Frames and SOAM PDUs that are in a higher MEG level only.
+
+ For a PM Session of type slm this includes the count of SOAM
+ ETH-SLM frames only.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCurrentStatsBackwardReceivedFrames";
+ }
+
+ leaf backward-average-frame-loss-ratio {
+ type uint32 {
+ range "0..100000";
+ }
+ units milli-percent;
+
+ description
+ "This object contains the average one-way frame loss ratio in the
+ backward direction calculated by this MEP for this Measurement
+ Interval. The FLR value is a ratio that is expressed as a
+ percent with a value of 0 (ratio 0.00) through 100000 (ratio
+ 1.00).
+
+ Units are in milli-percent, where 1 indicates 0.001 percent.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCurrentStatsBackwardAvgFlr";
+ }
+
+ leaf soam-pdus-sent {
+ type yang:gauge32;
+ description
+ "This object contains the count of the number of SOAM PDUs sent during
+ this Measurement Interval.
+
+ This object applies when type is lmm, slm or ccm. It indicates
+ the number of LMM, CCM, or SLM SOAM frames transmitted.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCurrentStatsSoamPdusSent";
+ }
+
+ leaf soam-pdus-received {
+ type yang:gauge32;
+
+ description
+ "This object contains the count of the number of SOAM PDUs PDUs received
+ in this Measurement Interval.
+
+ This object applies when type is lmm, slm, or ccm. This object
+ indicates the number of LMR, CCM, or SLR SOAM frames received.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCurrentStatsSoamPdusReceived";
+ }
+ }
+
+ grouping delay-measurement-stats-group {
+ description
+ "This grouping includes statistics objects for a SOAM Delay Measurement
+ session.";
+
+ leaf suspect-status {
+ type suspect-status-type;
+ description
+ "Whether the Measurement Interval has been marked as suspect.
+
+ The object is to be set to false at the start of a measurement
+ interval. It is set to true when there is a discontinuity in
+ the performance measurements during the Measurement Interval.
+ Conditions for a discontinuity include, but are not limited to
+ the following:
+
+ 1 - The local time-of-day clock is adjusted by at least 10 seconds
+ 2 - The conducting of a performance measurement is halted before the
+ current Measurement Interval is completed
+ 3 - A local test, failure, or reconfiguration that disrupts service";
+ }
+
+ leaf frame-delay-two-way-min {
+ type yang:gauge32;
+ units "μs";
+
+ description
+ "This object contains the minimum two-way frame delay calculated by this
+ MEP for this Measurement Interval.
+
+ This object is undefined if measurement-type is dm1-transmitted
+ or dm1-received.";
+ }
+
+ leaf frame-delay-two-way-max {
+ type yang:gauge32;
+ units "μs";
+
+ description
+ "This object contains the maximum two-way frame delay calculated by this
+ MEP for this Measurement Interval.
+
+ This object is undefined if measurement-type is dm1DmTx or
+ dm1-received.";
+ }
+
+ leaf frame-delay-two-way-average {
+ type yang:gauge32;
+ units "μs";
+
+ description
+ "This object contains the average two-way frame delay calculated by this
+ MEP for this Measurement Interval.
+
+ This object is undefined if measurement-type is dm1-transmitted or
+ dm1-received.";
+ }
+
+ leaf inter-frame-delay-variation-two-way-min {
+ type yang:gauge32;
+ units "μs";
+
+ description
+ "This object contains the minimum two-way inter-frame delay interval
+ calculated by this MEP for this Measurement Interval.
+
+ The value of this object is undefined when measurement-type is
+ dm1-transmitted or dm1-received.";
+ }
+
+ leaf inter-frame-delay-variation-two-way-max {
+ type yang:gauge32;
+ units "μs";
+
+ description
+ "This object contains the maximum two-way inter-frame delay interval
+ calculated by this MEP for this Measurement Interval.
+
+ The value of this object is undefined when measurement-type is
+ dm1-transmitted or dm1-received.";
+ }
+
+ leaf inter-frame-delay-variation-two-way-average {
+ type yang:gauge32;
+ units "μs";
+
+ description
+ "This object contains the average two-way inter-frame delay interval
+ calculated by this MEP for this Measurement Interval.
+
+ The value of this object is undefined when measurement-type is
+ dm1-transmitted or dm1-received.";
+ }
+
+ leaf soam-pdus-received {
+ type yang:gauge32;
+ description
+ "This object contains the count of the number of SOAM PDUs received in
+ this Measurement Interval.
+
+ This object indicates the number of DMR and 1DM SOAM frames
+ received. This object applies when measurement-type is dmm or
+ dm1-received and is undefined if measurement-type is
+ dm1-transmitted.";
+ }
+ }
+
+ grouping delay-measurement-bins-content-group {
+ description
+ "This grouping contains result measurement bin objects for a SOAM Delay
+ Measurement session.";
+
+ leaf type {
+ type measurement-bin-type;
+
+ description
+ "This object specifies whether the bin number is for Frame Delay and
+ Inter-Frame Delay Variation.";
+ }
+
+ leaf number {
+ type uint8 {
+ range "1..4";
+ }
+
+ description
+ "This object specifies the bin number for the configured boundary. The
+ first bin has bin number 1.";
+ }
+
+ leaf lower-bound {
+ type yang:gauge32;
+ units "μs";
+
+ description
+ "This object specifies the lower boundary for a measurement bin. The
+ upper boundary is defined by the next bin value or infinite for
+ the last bin defined. The measurement boundary for each
+ measurement bin is to be larger than the measurement boundary
+ of the preceding measurement bin. By default, the next bin is
+ set to 5000us larger than the lower bin boundary.
+
+ The values in a bin boundary object represents the time range
+ used to segregate delay data into the appropriate statistical
+ data bin. For five bins with default values, each bin has the
+ following time range:
+
+ bin 1 = 0, range is 0us
+ bin 2 = 5000, range is 5,000us
+ bin 3 = 10000, range is 10,000us
+ bin 4 = 15000, range is 15,000us
+ bin 5 = 20000, range is 20,000us
+
+ The first bin boundary (number set to 1) always contains the
+ value of 0. Attempting to write a non-zero value to this bin
+ will result in an error.";
+ }
+
+ leaf counter {
+ type yang:gauge32;
+ config false;
+
+ description
+ "This object contains the count of the number of completed measurements
+ initiated in this Measurement Interval whose value falls within
+ the range specified for this bin (that is, greater than or
+ equal to the measurement boundary for the bin, and (unless the
+ bin is the last bin) less than the measurement boundary for the
+ following bin.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamDmCurrentStatsBinsCounter";
+ }
+ }
+
+ grouping delay-measurement-bins-group {
+ description
+ "This grouping contains the top-level structure for the three types of
+ measurements (frame delay and inter frame delay variation)";
+
+ container bins {
+ description
+ "This container defines the bins content for FD, IFDR, and FDR
+ sessions.";
+
+ list frame-delay {
+ key "type number";
+ uses delay-measurement-bins-content-group;
+
+ description
+ "Data definitions related to frame delay bins content.";
+ }
+
+ list inter-frame-delay-variation {
+ key "type number";
+ uses delay-measurement-bins-content-group;
+
+ description
+ "Data definitions related to inter frame delay bins content.";
+ }
+
+ }
+ }
+
+
+ grouping bin-lower-limit-override-attribs {
+
+ description
+ "Bin 1 of each type will always be 0.
+ The upper limit of each bin will be defined by the lower
+ limit of the next bin. The upper limit of the last bin
+ is unbounded.";
+
+ leaf bin2-lower-limit {
+ type uint32 {
+ range "10..max";
+ }
+ units "μs";
+ must "current() < ../bin3-lower-limit" {
+ error-message "Bin 2 must be between 0 and bin 3 lower limit";
+ error-app-tag "msea-soampm-must-01";
+ }
+ description "The lower limit of the bin 2 in microseconds";
+ }
+
+ leaf bin3-lower-limit {
+ type uint32 {
+ range "10..max";
+ }
+ units "μs";
+ must "current() > ../bin2-lower-limit and current() < ../bin4-lower-limit" {
+ error-message "Bin 3 must be between bin 2 and bin 4 lower limits";
+ error-app-tag "msea-soampm-must-02";
+ }
+ description "The lower limit of the bin 3 in microseconds";
+ }
+
+ leaf bin4-lower-limit {
+ type uint32 {
+ range "10..max";
+ }
+ units "μs";
+ must "current() > ../bin3-lower-limit" {
+ error-message "Bin 4 must be greater than 3 lower limit";
+ error-app-tag "msea-soampm-must-03";
+ }
+ description "The lower limit of the bin 4 in microseconds";
+ }
+ }
+
+ //
+ // Augments into CFM related to MEF SOAM PM
+ //
+
+ augment "/msea-cfm:mef-cfm/msea-cfm:pm-global" {
+
+ description "High level attributes that apply to the whole device generally
+ or that apply equally across all instances of a child entity.
+ Delay measurement services should be stopped before changing
+ these values, including the limit overrides";
+
+ leaf dm-bins-per-fd-interval {
+ type uint16 {
+ range "4";
+ }
+ default 4;
+
+ description
+ "This object specifies the number of measurement bins per Measurement
+ Interval for Frame Delay measurements.
+
+ Fixed at 4.";
+ }
+
+ leaf dm-bins-per-ifdv-interval {
+ type uint16 {
+ range "4";
+ }
+ default 4;
+
+ description
+ "This object specifies the number of measurement bins per Measurement
+ Interval for Inter-Frame Delay Variation measurements.
+
+ Fixed at 4.";
+ }
+
+
+ container bin-lower-limit-override-two-way-frame-delay {
+
+ uses bin-lower-limit-override-attribs {
+ refine bin2-lower-limit {
+ default 10000;
+ }
+ refine bin3-lower-limit {
+ default 20000;
+ }
+ refine bin4-lower-limit {
+ default 37000;
+ }
+ }
+
+ description "Override of the default Measurement Bin default
+ lower limits for Two Way Frame Delay.";
+
+ }
+
+ container bin-lower-limit-override-two-way-ifdv {
+
+ uses bin-lower-limit-override-attribs {
+ refine bin2-lower-limit {
+ default 3000;
+ }
+ refine bin3-lower-limit {
+ default 8000;
+ }
+ refine bin4-lower-limit {
+ default 100000;
+ }
+ }
+
+ description "Override of the default Measurement Bin default
+ lower limits for Two Way Interframe Delay Variation.";
+ }
+ }
+
+
+ augment "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association" +
+ "/msea-cfm:maintenance-association-end-point" {
+ description
+ "This set of data definitions extends the MEG End Point (as described
+ Y.1731) or Maintenance End Point (as described in 802.1q) defined
+ in the MEF CFM module (MEF-CFM), specifically with regards to
+ Loss Measurement and Delay Measurement.";
+
+ container loss-measurements {
+ description
+ "This container contains a collection of data definitions related to
+ Loss Measurements.";
+
+ list loss-measurement {
+ key lm-id;
+ max-elements 16;
+
+ description
+ "A list of Loss Measurement PM Sessions where each instance is uniquely
+ identified by an id attribute.
+ This grouping includes configuration objects for the Frame Loss
+ Measurement function defined in [Y.1731] and [MEF SOAM PM IA].";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCfgTable, [Y.1731] and [MEF SOAM PM IA]";
+
+ leaf lm-id {
+ type uint8 {
+ range 1..16;
+ }
+
+ description
+ "This object uniquely identifies a scheduled loss measurement.";
+ }
+
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association/msea-cfm:maintenance-association-end-point/msea-soam-pm:loss-measurement) <= 128" {
+ error-message "The maximum number of LMs on the whole device must not exceed 128";
+ error-app-tag "msea-soampm-must-04";
+ }
+
+ uses remote-mep-group;
+ uses measurement-timing-group;
+
+ leaf administrative-state {
+ type boolean;
+ default false;
+
+ description
+ "The administrative state of the MEP. Setting to true starts this Loss Measurement";
+ }
+
+ leaf measurement-type {
+ type enumeration {
+ enum slm {
+ description
+ "SLM SOAM PDU generated and received SLR responses tracked.";
+ }
+ }
+ default slm;
+
+ description
+ "This object specifies what type of Loss Measurement will be
+ performed.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCfgType";
+ }
+
+ leaf version {
+ type enumeration {
+ enum Y.1731-2008 {
+ description
+ "Indicates the PDU formats defined in Y.1731-2008";
+ }
+ }
+ default Y.1731-2008;
+
+ description
+ "This object indicates the version of the PDUs used to perform Loss
+ Measurement.
+ The exact PDUs to use are specified by this object in
+ combination with measurement-type.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCfgVersion";
+ }
+
+ leaf enabled-counters {
+ type bits {
+ bit forward-transmitted-frames {description "Count the number of frames transmitted in the forward direction by this MEP";}
+ bit forward-received-frames {description "Count the number of frames received in the forward direction by this MEP";}
+ bit forward-average-flr {description "Calculate the average one-way frame loss ratio in the forward direction calculated by this MEP";}
+ bit backward-transmitted-frames {description "Count the number of frames transmitted in the backward direction by this MEP";}
+ bit backward-received-frames {description "Count the number of frames received in the backward direction by this MEP";}
+ bit backward-average-flr {description "Calculate the average one-way frame loss ratio in the backward direction calculated by this MEP";}
+ bit soam-pdus-sent {description "Count of the number of SOAM PDUs sent during this Measurement Interval";}
+ bit soam-pdus-received {description "Count of the number of SOAM PDUs received during this Measurement Interval";}
+ bit measured-stats-forward-measured-flr {description "Measure the Frame Loss Ratio in the forward direction calculated by this MEP from the last received SOAM PDU";}
+ bit measured-stats-backward-measured-flr {description "Measure the Frame Loss Ratio in the backward direction calculated by this MEP from the last received SOAM PDU";}
+
+ }
+ default "";
+
+// msea:not-changeable;
+
+ description
+ "A vector of bits that indicates the type of SOAM LM counters found in
+ the current-stats and history-stats that are enabled.
+
+ A present bit enables the specific SOAM LM counter. A not present
+ bit disables the SOAM LM counter.
+
+ If a particular SOAM LM counter is not supported the BIT value
+ is not present.
+
+ Not all SOAM LM counters are supported for all SOAM LM types. ";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCfgMeasurementEnable";
+ }
+
+ leaf message-period {
+ type enumeration {
+ enum 1000ms {
+ description "The default 1000ms message period for LM";
+ }
+ enum 100ms {
+ description "100ms message period for LM";
+ }
+ enum 10ms {
+ description "10ms message period for LM";
+ }
+ enum 3ms {
+ description "3ms message period for LM";
+ }
+ }
+ default 1000ms;
+// msea:not-changeable;
+
+ description
+ "This object specifies the interval between Loss Measurement OAM message
+ transmission. For Loss Measurement monitoring applications the
+ default value is 1 sec.
+
+ This object is not applicable if measurement-type is set to
+ 'ccm' and is ignored for that Loss Measurement Type.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCfgMessagePeriod";
+ }
+
+ leaf priority {
+ type msea:priority-type;
+ mandatory true;
+// msea:not-changeable;
+
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id = current()/../../../../../msea-cfm:id]/msea-cfm:maintenance-association[msea-cfm:id = current()/../../../../msea-cfm:id]/msea-cfm:maintenance-association-end-point[msea-cfm:mep-identifier=current()/../../../msea-cfm:mep-identifier]/msea-soam-pm:loss-measurements/msea-soam-pm:loss-measurement[msea-soam-pm:priority=current()]) <= 1" {
+ error-message "The priority of a Loss Measurement must be unique within its MEP";
+ error-app-tag "msea-soampm-must-05";
+ }
+
+ description
+ "This object specifies the priority of frames with Performance
+ Monitoring OAM message information.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCfgPriority";
+ }
+
+ leaf frame-size {
+ type uint32 {
+ range "64 .. 9600";
+ }
+ units bytes;
+ default 64;
+// msea:not-changeable;
+
+ description
+ "This object specifies the Loss Measurement frame size between 64 bytes
+ and the maximum transmission unit of the EVC.
+
+ The range of frame sizes from 64 through 2000 octets need to be
+ supported, and the range of frame sizes from 2001 through 9600
+ octets is suggested be supported.
+
+ The adjustment to the frame size of the standard frame size is
+ accomplished by the addition of a Data or Test TLV. A Data or
+ Test TLV is only added to the frame if the frame size is greater
+ than 64 bytes.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCfgFrameSize";
+ }
+
+ leaf measurement-interval {
+ type uint32 {
+ range "1..525600";
+ }
+ units minutes;
+ default 15;
+// msea:not-changeable;
+
+ description
+ "This object specifies the Measurement Interval for FLR statistics, in
+ minutes.
+
+ A Measurement Interval of 15 minutes needs to be supported,
+ other intervals may be supported.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCfgMeasurementInterval";
+ }
+
+ leaf number-intervals-stored {
+ type uint32 {
+ range "32";
+ }
+ default 32;
+
+ description
+ "This object specifies the number of completed measurement intervals to
+ store in the history statistic table.
+
+ At least 32 completed measurement intervals are to be
+ stored.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCfgNumIntervalsStored";
+ }
+
+ leaf number-intervals-returned {
+ type uint32 {
+ range "2..32";
+ }
+ default 32;
+
+ description
+ "This object specifies the number of completed measurement intervals to
+ return from the history statistic table.
+ The number stored on the device is fixed at 32";
+ }
+
+ leaf session-status {
+ type session-status-type;
+ config false;
+
+ description
+ "This object indicates the current status of the LM session. A value
+ of 'active' indicates the current LM session is active,
+ i.e. the current time lies between the start time and the
+ stop time, and enabled is true. A value of 'not-active'
+ indicates the current LM session is not active, i.e. it has
+ not started yet, has stopped upon reaching the stop time,
+ or is disabled.";
+ }
+
+ leaf measured-forward-flr {
+ type yang:gauge32 {
+ range "0..100000";
+ }
+ units milli-percent;
+ config false;
+
+ description
+ "This object contains the Frame Loss Ratio in the forward direction
+ calculated by this MEP from the last received SOAM PDU. The
+ FLR value is a ratio that is expressed as a percent with a
+ value of 0 (ratio 0.00) through 100000 (ratio 1.00).
+
+ Units are in milli-percent, where 1 indicates 0.001
+ per-cent.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmMeasuredStatsForwardFlr";
+ }
+
+ leaf measured-backward-flr {
+ type yang:gauge32 {
+ range "0..100000";
+ }
+ units milli-percent;
+ config false;
+
+ description
+ "This object contains the Frame Loss Ratio in the backward direction
+ calculated by this MEP from the last received SOAM PDU. The
+ FLR value is a ratio that is expressed as a percent with a
+ value of 0 (ratio 0.00) through 100000 (ratio 1.00).
+
+ Units are in milli-percent, where 1 indicates 0.001
+ percent.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmMeasuredStatsBackwardFlr";
+ }
+
+ container current-measurement-stats {
+ config false;
+
+ description
+ "This container contains the results for the current Measurement
+ Interval in a SOAM Loss Measurement session gathered during
+ the interval indicated by measurement-interval.";
+
+ leaf id {
+ type uint32;
+
+ description
+ "The index for the current Measurement Interval for this PM
+ session. This value will become the value for id of the
+ history-measurement-stats list once the Measurement
+ Interval is completed.";
+ }
+
+ leaf start-time {
+ type yang:date-and-time;
+ mandatory true;
+
+ description
+ "The time that the current Measurement Interval started.";
+ }
+
+ leaf elapsed-time {
+ type uint32 {
+ range "0..2147483647";
+ }
+ units "0.01s";
+ mandatory true;
+
+ description
+ "The time that the current Measurement Interval has been running,
+ in 0.01 seconds.";
+ }
+
+ uses loss-measurement-stats-group;
+ }
+
+ list history-measurement-stats {
+ key id;
+ config false;
+ description
+ "This list contains the results for history Measurement
+ Intervals in a SOAM Loss Measurement session.";
+
+ leaf id {
+ type uint32;
+
+ description
+ "The index for the Measurement Interval within this
+ PM session.";
+ }
+
+ leaf end-time {
+ type yang:date-and-time;
+ mandatory true;
+
+ description
+ "The time that the Measurement Interval ended.";
+ }
+
+ leaf elapsed-time {
+ type uint32 {
+ range "0..2147483647";
+ }
+ mandatory true;
+
+ description
+ "The length of time that the Measurement Interval ran for,
+ in 0.01 seconds.";
+ }
+
+ uses loss-measurement-stats-group;
+ }
+ }
+ }
+
+ container delay-measurements {
+ description
+ "This container contains a collection of data definitions related to
+ Delay Measurements. The measurements are persisted as config data
+ with results being retrieved from the device as needed";
+
+ list delay-measurement {
+ key dm-id;
+ max-elements 16;
+
+ description
+ "A list of Delay Measurements where each instance is
+ uniquely identified by an id attribute.
+ This includes configuration objects for the Delay Measurement
+ function defined in [Y.1731] and [MEF SOAM PM IA].";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamDmCfgTable, [Y.1731], and [MEF SOAM PM IA].";
+
+ leaf dm-id {
+ type uint8 {
+ range 1..16;
+ }
+
+ description
+ "This object uniquely identifies a scheduled delay measurement.";
+ }
+
+ must "count(/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association/msea-cfm:maintenance-association-end-point/msea-soam-pm:delay-measurement) <= 128" {
+ error-message "The maximum number of DMs on the whole device must not exceed 128";
+ error-app-tag "msea-soampm-must-06";
+ }
+
+ uses remote-mep-group;
+ uses measurement-timing-group;
+
+ leaf administrative-state {
+ type boolean;
+ default false;
+
+ description
+ "The administrative state of the MEP. Setting to true starts this Delay Measurement";
+ }
+
+ leaf measurement-type {
+ type enumeration {
+ enum dmm {
+ description
+ "DMM SOAM PDU generated, DMR responses received (one-way or two-way
+ measurements).";
+ }
+ }
+ default dmm;
+
+ description
+ "This object indicates what type of Delay Measurement is to be
+ performed.
+
+ The exact PDUs to use are specified by this object in
+ combination with version.";
+ }
+
+ leaf version {
+ type enumeration {
+ enum Y.1731-2011 {
+ description
+ "Indicates the PDU formats defined in Y.1731-2011.";
+ }
+ }
+ default Y.1731-2011;
+
+ description
+ "This object indicates the version of the PDUs used to perform Delay
+ Measurement.
+
+ The exact PDUs to use are specified by this object in
+ combination with measurement-type.";
+ reference
+ "[Y.1731]";
+ }
+
+ leaf measurement-enable {
+ type bits {
+ bit soam-pdus-received {description "Count of the number of SOAM PDUs received";}
+ bit frame-delay-two-way-bins {description "Capture the two-way frame delay in bins";}
+ bit frame-delay-two-way-min {description "Capture the minimum two-way frame delay";}
+ bit frame-delay-two-way-max {description "Capture the maximum two-way frame delay";}
+ bit frame-delay-two-way-average {description "Calculate the average two-way frame delay";}
+ bit inter-frame-delay-variation-two-way-bins {description "Capture the two-way inter-frame-delay-variation in bins";}
+ bit inter-frame-delay-variation-two-way-min {description "Capture the minimum inter-frame-delay-variation frame delay";}
+ bit inter-frame-delay-variation-two-way-max {description "Capture the maximum inter-frame-delay-variation frame delay";}
+ bit inter-frame-delay-variation-two-way-average {description "Calculate the average inter-frame-delay-variation frame delay";}
+ }
+ default "";
+// msea:not-changeable;
+
+ description
+ "A vector of bits that indicates the type of SOAM DM counters that
+ are enabled.
+
+ A present bit enables the specific SOAM DM counter.
+
+ A not present bit disables the SOAM DM counter.
+
+ If a particular SOAM DM counter is not supported the BIT value
+ is not present.
+
+ Not all SOAM DM counters are supported for all SOAM DM types.";
+ }
+
+ leaf message-period {
+ type enumeration {
+ enum 1000ms {
+ description "1000ms message period for DM";
+ }
+ enum 100ms {
+ description "100ms message period for DM";
+ }
+ enum 10ms {
+ description "10ms message period for DM";
+ }
+ enum 3ms {
+ description "3ms message period for DM";
+ }
+ }
+ default 100ms;
+// msea:not-changeable;
+
+ description
+ "This object specifies the interval between Delay Measurement OAM
+ message transmission. For Delay Measurement monitoring applications,
+ the default value is 100ms.";
+ }
+
+ leaf priority {
+ type msea:priority-type;
+ mandatory true;
+// msea:not-changeable;
+
+ description
+ "This object specifies the priority of frames with Performance
+ Monitoring OAM message information.";
+ }
+
+ leaf frame-size {
+ type uint32 {
+ range "64 .. 9600";
+ }
+ default 64;
+// msea:not-changeable;
+
+ description
+ "This object specifies the Delay Measurement frame size between 64 bytes
+ and the maximum transmission unit of the EVC.
+
+ The range of frame sizes from 64 through 2000 octets need to be
+ supported, and the range of frame sizes from 2001 through 9600
+ octets is suggested to be supported.
+
+ The adjustment to the frame size of the standard frame size is
+ accomplished by the addition of a Data or Test TLV. A Data or
+ Test TLV is only added to the frame if the frame size is
+ greater than 64 bytes.";
+ }
+
+ leaf measurement-interval {
+ type uint32 {
+ range "1..1440";
+ }
+ units minutes;
+ default 15;
+// msea:not-changeable;
+
+ description
+ "This object specifies a Measurement Interval in minutes.
+
+ A Measurement Interval 15 minutes needs to be supported, other
+ intervals may be supported.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamDmCfgMeasurementInterval";
+ }
+
+ leaf number-intervals-stored {
+ type uint32 {
+ range "32";
+ }
+ default 32;
+ description
+ "This object specifies the number of completed measurement intervals to
+ store in the history statistic table.
+
+ At least 32 completed measurement intervals are to be
+ stored.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamLmCfgNumIntervalsStored";
+ }
+
+ leaf number-intervals-returned {
+ type uint32 {
+ range "2..32";
+ }
+ default 32;
+
+ description
+ "This object specifies the number of completed measurement intervals to
+ return from the history statistic table.
+ The number of intervals stored is fixed at 32 on the device";
+
+ }
+
+ leaf session-status {
+ type session-status-type;
+ config false;
+
+ description
+ "This object indicates the current status of the DM session. A value
+ of 'active' indicates the current DM session is active,
+ i.e. the current time lies between the start time and the
+ stop time, and enabled is true. A value of 'not-active'
+ indicates the current DM session is not active, i.e. it has
+ not started yet, has stopped upon reaching the stop time,
+ or is disabled.";
+ }
+
+ leaf frame-delay-two-way {
+ type yang:gauge32;
+ units microseconds;
+ config false;
+
+ description
+ "This object contains the two-way frame delay calculated by this MEP
+ from the last received SOAM PDU.
+
+ This object is undefined is measurement-type is
+ dm1-transmitted or dm1-received.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamDmMeasuredStatsFrameDelayTwoWay";
+ }
+
+ leaf inter-frame-delay-variation-two-way {
+ type yang:gauge32;
+ units microseconds;
+ config false;
+
+ description
+ "This object contains the last two-way inter-frame delay interval
+ calculated by this MEP.
+
+ The value of this object is undefined when measurement-type
+ is dm1-transmitted or dm1-received.";
+ reference
+ "MEF-SOAM-PM-MIB.mefSoamDmMeasuredStatsIfdvTwoWay";
+ }
+
+ container current-stats {
+ config false;
+
+ description
+ "This container contains the results for the current Measurement
+ Interval in a SOAM Delay Measurement session gathered
+ during the interval indicated by measurement-interval.";
+
+ leaf id {
+ type uint32;
+
+ description
+ "The index for the current Measurement Interval for this PM
+ session. This value will become the value for id of the
+ history-measurement-stats list once the Measurement
+ Interval is completed.";
+ }
+
+ leaf start-time {
+ type yang:date-and-time;
+ mandatory true;
+
+ description
+ "The time that the current Measurement Interval started.";
+ }
+
+ leaf elapsed-time {
+ type uint32 {
+ range "0..2147483647";
+ }
+ mandatory true;
+
+ description
+ "The time that the current Measurement Interval has been running,
+ in 0.01 seconds.";
+ }
+
+ uses delay-measurement-stats-group;
+ uses delay-measurement-bins-group;
+ }
+
+ list history-stats {
+ key id;
+ config false;
+ description
+ "This list contains the results for history Measurement Intervals in
+ a SOAM Delay Measurement session.";
+
+ leaf id {
+ type uint32;
+
+ description
+ "The identifier for the Measurement Interval within this
+ PM session.";
+ }
+
+ leaf end-time {
+ type yang:date-and-time;
+ mandatory true;
+
+ description
+ "The time that the Measurement Interval ended.";
+ }
+
+ leaf elapsed-time {
+ type uint32 {
+ range "0..2147483647";
+ }
+ mandatory true;
+
+ description
+ "The length of time that the Measurement Interval ran for, in 0.01
+ seconds.";
+ }
+
+ uses delay-measurement-stats-group;
+ uses delay-measurement-bins-group;
+ }
+ }
+ }
+ }
+
+ //
+ // RPCs related to MEF SOAM PM
+ //
+
+ rpc clear-loss-history-stats {
+ description
+ "Clear the Loss Measurement history list (history-availability-stats and
+ history-measurement-stats) for a specific session. All instance
+ data is deleted.";
+
+ input {
+ uses msea-cfm:maintenance-association-end-point-reference {
+ refine maintenance-domain {
+ mandatory true;
+ }
+ refine maintenance-association {
+ mandatory true;
+ }
+ refine maintenance-association-end-point {
+ mandatory true;
+ }
+ }
+
+ leaf lm-id {
+ type leafref {
+ path "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association/msea-cfm:maintenance-association-end-point/msea-soam-pm:loss-measurements/msea-soam-pm:loss-measurement/msea-soam-pm:lm-id";
+ }
+ mandatory true;
+
+ description
+ "The LM ID of the loss measurement session of which the loss
+ measurement history should be cleared";
+ }
+ }
+ }
+
+
+
+
+ rpc clear-delay-history-stats {
+ description
+ "Clear the Delay Measurement history list (history-stats) for a specific
+ session. All instance data is deleted.";
+
+ input {
+ uses msea-cfm:maintenance-association-end-point-reference { //Added to specify the MEP SC 10-Dec-15
+ refine maintenance-domain {
+ mandatory true;
+ }
+ refine maintenance-association {
+ mandatory true;
+ }
+ refine maintenance-association-end-point {
+ mandatory true;
+ }
+ }
+
+
+ leaf dm-id {
+ type leafref {
+ path "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:maintenance-association/msea-cfm:maintenance-association-end-point/msea-soam-pm:delay-measurements/msea-soam-pm:delay-measurement/msea-soam-pm:dm-id";
+ }
+ mandatory true;
+
+ description
+ "The DM ID of the loss measurement session of which the loss
+ measurement history should be cleared";
+ }
+ }
+ }
+
+ //
+ // Notifications related to MEF SOAM PM
+ //
+
+}
+
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/msea-types.yang b/drivers/microsemi/ea1000yang/src/main/yang/msea-types.yang
new file mode 100644
index 0000000..8b05aac
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/msea-types.yang
@@ -0,0 +1,385 @@
+module msea-types {
+
+ namespace "http://www.microsemi.com/microsemi-edge-assure/msea-types";
+ prefix "msea-types"; //MicroSemi EdgeAssure (msea)
+
+ 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 module contains a collection of generally useful derived
+ YANG data types for VLans and Meps and such.
+
+ Copyright 2016 Microsemi Inc.
+ All rights reserved.";
+
+ revision "2016-02-29" {
+ description
+ "Initial version - Sean Condon, Microsemi";
+ reference
+ "Eagle EANTC Tail-f Inter-operation Summary Revision 1.0 16th Feb 2016";
+ }
+
+ //
+ // Extensions related to Edge Assure
+ //
+ extension not-changeable {
+ description
+ "Marks the leaf as being settable at creation time
+ only and not writable thereafter";
+ }
+
+ extension xref-module {
+ description
+ "For leaf items that have type leafref, this attribute defines
+ the netopeer module that supports that reference if it is outside
+ the current module";
+ argument module-name;
+ }
+
+ extension deprecated {
+ description
+ "For leaf items that have become obsolete. This should generate a
+ warning to the user that they are using a deprected attribute";
+ }
+
+ //
+ // Type definitions related to Edge Assure
+ //
+ typedef mep-id-type {
+ type uint16 {
+ range "1..8191";
+ }
+
+ description
+ "Maintenance association End Point Identifier (MEPID): A small integer,
+ unique over a given Maintenance Association, identifying a
+ specific MEP.";
+ reference
+ "[802.1q] 3.19 and 19.2.1";
+ }
+
+ typedef vlan-id-type {
+ type uint16 {
+ range "1..4094";
+ }
+
+ description
+ "The VLAN-ID that uniquely identifies a VLAN. This is the 12-bit VLAN-ID
+ used in the VLAN Tag header.";
+
+ reference
+ "[802.1q] 9.6";
+ }
+
+ typedef port-status-type {
+ type enumeration {
+ enum no-status-tlv {
+ description "Indicates either that no CCM has been received or that
+ no port status TLV was present in the last CCM received.";
+ }
+ enum blocked {
+ description "Ordinary data cannot pass freely through the port on
+ which the remote MEP resides. Value of enableRmepDefect
+ is equal to false.";
+ }
+ enum up {
+ description "Ordinary data can pass freely through the port on which
+ the remote MEP resides. Value of enableRmepDefect is
+ equal to true.";
+ }
+ }
+
+ description
+ "The set of values available from the Port Status TLV in CCM PDUs
+ including the default no-status-tlv";
+
+ reference
+ "[802.1q] 20.19.3, 12.14.7.6.3:f
+ IEEE8021-CFM-MIB.Dot1agCfmPortStatus";
+ }
+
+ typedef interface-status-type {
+ type enumeration {
+ enum no-status-tlv {
+ description "Indicates either that no CCM has been received or that
+ no interface status TLV was present in the last CCM received.";
+ }
+ enum up {
+ description "The interface is ready to pass packets.";
+ }
+ enum down {
+ description "The interface cannot pass packets.";
+ }
+ enum testing {
+ description "The interface is in some test mode.";
+ }
+ enum unknown {
+ description "The interface status cannot be determined for some reason.";
+ }
+ enum dormant {
+ description "The interface is not in a state to pass
packets but is in a pending state, waiting
for some external event.";
+ }
+ enum not-present {
+ description "Some component of the interface is missing.";
+ }
+ enum lower-layer-down {
+ description "The interface is down due to state of the lower layer
+ interfaces.";
+ }
+ }
+
+ description
+ "The set of values available from the Interface Status TLV in CCM PDUs
+ including the default no-status-tlv";
+ reference
+ "[802.1q] 20.19.4, 12.14.7.6.3:g
+ IEEE8021-CFM-MIB.Dot1agCfmInterfaceStatus";
+ }
+
+ typedef mac-address-and-uint-type {
+ type binary {
+ length "8";
+ }
+ description
+ "A MAC address and a two-octet unsigned integer";
+ reference
+ "[802.1q] IEEE8021-CFM-MIB.Dot1agCfmMaintDomainNameType";
+ }
+
+ typedef mac-address-and-uint-str {
+ type string {
+ pattern '([0-9a-fA-F]{2}[:-]){6}([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5])';
+ }
+ description
+ "The mac-address type represents an IEEE 802 MAC address.
+ The canonical representation uses lowercase characters.
+
+ In the value set and its semantics, this type is equivalent
+ to the MacAddress textual convention of the SMIv2.";
+ reference
+ "IEEE 802: IEEE Standard for Local and Metropolitan Area
+ Networks: Overview and Architecture
+ RFC 2579: Textual Conventions for SMIv2";
+ }
+
+
+ typedef md-level-type {
+ type uint8 {
+ range "0..7";
+ }
+
+ description
+ "Maintenance Domain Level (MD Level) identifier. Higher numbers
+ correspond to higher Maintenance Domains, those with the greatest
+ physical reach, with the highest values for customers' CFM PDUs.
+ Lower numbers correspond to lower Maintenance Domains, those with
+ more limited physical reach, with the lowest values for CFM PDUs
+ protecting single bridges or physical links.";
+
+ reference
+ "[802.1q] 18.3, 21.4.1, IEEE8021-CFM-MIB.Dot1agCfmMDLevel";
+ }
+
+ typedef priority-type {
+ type uint8 {
+ range "0..7";
+ }
+
+ description
+ "A 3 bit priority value to be used in the VLAN tag, if present
+ in the transmitted frame.";
+ reference
+ "[802.1q] 12.14.7.3.2:e";
+ }
+
+ typedef cos-color-type {
+ type enumeration {
+ enum "green" {
+ description "Change color to green";
+ }
+ enum "yellow" {
+ description "Change color to yellow";
+ }
+ enum "drop" {
+ description "Delete color information";
+ }
+ }
+ description
+ "TBD";
+ reference "[MEF23.1].";
+ }
+
+ typedef service-list-type {
+ type string {
+ length "0..255";
+ pattern "\d*([,:]\d*)*";
+ }
+ description
+ "An octet string containing a list of item values.
+
+ An item value is an arbitrary string of octets from
+ ASCII character 0x30 - 0x39, but may not contain
+ a delimiter character. Delimiter characters are
+ defined to be one of the following:
+
+ - An ASCII comma character (0x2C)
+ - An ASCII colon character (0x3A)
+
+ Delimiter characters are used to separate item values
+ in a item list. Only a single delimiter character may
+ occur between two item values. A item value may not
+ have a zero length. These constraints imply certain
+ restrictions on the contents of this object:
+
+ - There cannot be a leading or trailing delimiter
+ character.
+
+ - There cannot be multiple adjacent delimiter
+ characters.
+
+ The 'comma' delimiter separates individual items or a
+ sequence of items. The 'colon' delimiter indicates a range
+ of items from the first item before the colon through the
+ last item after the colon. Individual ranges in the same
+ item list need to be separated by a 'comma'.
+
+ Some examples of valid item lists are:
+
+ - '' -- an empty list
+ - '1234' -- list of one item
+ - '10,11,12' -- list of several items
+ - '10:20' -- a list containing all the valid values from
+ 10 through 20
+
+ Note that although an item value may not have a length of
+ zero, an empty string is still valid. This indicates
+ an empty list (i.e. there are no tag values in the list).
+
+ The use of the item list is to select one or more items at
+ one time with a single object instead of having separate row
+ entries in a table for each individual item.";
+ }
+
+
+ typedef service-preservation-type {
+ type enumeration {
+ enum preserve {
+ description "The type of service is preserved, either CE-VLAN ID or
+ CE-VLAN CoS as indicated by the specific object";
+ }
+ enum noPreserve {
+ description "The type of service is not preserved, either CE-VLAN ID
+ or CE-VLAN CoS as indicated by the specific object.";
+ }
+ }
+ description
+ "Configures the EVC preservation attributes.";
+ reference
+ "[MEF 6.1] 6.1; [MEF 7.2] 6.2.1.3";
+ }
+
+ typedef service-delivery-type {
+ type enumeration {
+ enum discard {
+ description "Service Frames are discarded";
+ }
+ enum unconditional {
+ description "Service Frames are unconditionally delivered no matter the
+ content of the Service Frame. An example of this is a
+ Point-to-Point EVC";
+ }
+ enum conditional {
+ description "Service Frame are conditionally delivered to the
+ destination UNI. The condition is specified, for example via a
+ bandwidth profile or unicast MAC address learning.";
+ }
+ }
+ description
+ "A MEF service can have one of three different delivery types.";
+ reference
+ "[MEF 6.1] 6.0";
+ }
+
+
+ typedef identifier45 {
+ type string {
+ length "min..45";
+ }
+ description
+ "This type definition accepts any visible ASCII character " +
+ "plus the <space> character.The string must be RFC 2579 " +
+ "Display " +
+ "String but not contain the characters 0.00 through 0.1f " +
+ "It does not accept the <delete> character despite the " +
+ "current MEF specification.";
+ reference "MEF 10.3 [R8], [R9]";
+ }
+
+ typedef file-name {
+ type string {
+ length "1..45";
+ pattern '[a-zA-Z0-9\-_.]*';
+ }
+ description "Valid file names only";
+ }
+
+ typedef reset-config-options {
+ type enumeration {
+ enum operational {
+ description "Reset any operational data on the device. Configuration
+ for CFM, Y-1564, RFC-2544 and UNI";
+ }
+ enum safiltering {
+ description "Reset only safiltering data on the device.";
+ }
+ enum permissions {
+ description "Reset only permissions data on the device.";
+ }
+ enum allnetconf {
+ description "Reset all NETCONF data - leaves only logs and SSH keys.";
+ }
+ enum nuclear {
+ description "Remove all configuration and history on the device.
+ Deletes SSH keys. Resets device to factory defaults";
+ }
+ }
+ }
+
+ grouping mep-config-attribs-noref {
+ description
+ "Attributes related to the configuration of a MEP";
+
+ leaf maintenance-domain {
+ type uint8 {
+ range 1..64;
+ }
+ description
+ "A reference to a specific Maintenance Domain.";
+ }
+
+ leaf maintenance-association {
+ type uint8 {
+ range 1..64;
+ }
+ description
+ "A reference to a specific Maintenance Association.";
+ }
+
+ leaf maintenance-association-end-point {
+ type mep-id-type;
+ description
+ "A reference to a specific Maintenance association End Point.";
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/msea-uni-evc-interface.yang b/drivers/microsemi/ea1000yang/src/main/yang/msea-uni-evc-interface.yang
new file mode 100644
index 0000000..c63acea
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/msea-uni-evc-interface.yang
@@ -0,0 +1,1208 @@
+module msea-uni-evc-interface {
+
+ namespace "http://www.microsemi.com/microsemi-edge-assure/msea-uni-evc-interface";
+ prefix "msea-if"; //MicroSemi EdgeAssure (msea)
+
+ import ietf-yang-types {
+ prefix yang;
+ revision-date 2013-07-15;
+ }
+
+ import msea-types {
+ prefix msea;
+ revision-date 2016-02-29;
+ }
+
+ import ietf-interfaces {
+ prefix "if";
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import iana-if-type {
+ prefix "ianaift";
+ }
+
+ import ietf-netconf-acm {
+ prefix nacm;
+ }
+
+ 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 is based on the MEF 40 SNMP model, for the management
+ objects for the management of User Network Interfaces (UNIs).
+ It has been converted to YANG and modified slightly to suit the
+ EdgeAssure SFP which has some extra constraints that are not handled by
+ the original model
+
+ Copyright 2016 Microsemi Inc.
+ All rights reserved.";
+
+ reference
+ "***************************************************************************
+ Reference Overview
+
+ A number of base documents have been used to create this MIB. The following
+ are the abbreviations for the baseline documents:
+ [MEF 40] refers to SNMP MIB
+ [MEF6.1] refers to MEF 6.1 'Ethernet Services Definitions - Phase 2',
+ April 2008
+ [MEF 6.1.1] refers to MEF 6.1.1 'Layer 2 Control Protocol Handling Amendment
+ to MEF 6.1', January 2012
+ [MEF 7.2] refers to MEF 7.2 'Carrier Ethernet Management Information Model',
+ January 2013
+ [MEF 10.2] refers to MEF 10.2 'Ethernet Services Attributes Phase 2',
+ October 2009
+ [MEF 26.1] refers to MEF 26.1 'External Network Network Interface (ENNI) -
+ Phase 2', January 2012
+ [Q.840.1] refers to 'ITU-T Requirements and analysis for NMS-EMS
+ management interface of Ethernet over Transport and Metro Ethernet
+ Network (EoT/MEN)', March 2007
+ ****************************************************************************";
+
+ revision "2016-03-17" {
+ description
+ "Initial Version. Sean Condon - Microsemi";
+ reference "MEF 6.2";
+ }
+
+ typedef MefServiceInterfaceType {
+ type bits {
+// bit bUni1d1;
+// bit bUni1d2;
+ bit bUni2d1 {description "Only bUni2d1 is supported by EdgeAssure 1000";}
+// bit bUni2d2;
+// bit bEnni;
+// bit bEnniVuni;
+ }
+
+ default "bUni2d1";
+ description
+ "A MEF Interface can be one of several types:
+
+ bUni1d1 UNI Type 1.1 See MEF 13. Non-multiplexed UNI for services such as EPL,
+ bUni1d2 UNI Type 1.2 See MEF 13. Multiplexed UNI for services such as EVPL,
+ bUni2d1 UNI Type 2.1 See MEF 20 section 7
+ bUni2d2 UNI Type 2.2 See MEF 20 section 7
+ bEnni ENNI
+ bEnniVuni VUNI on an ENNI";
+ reference
+ "[MEF 6.1] 6.0";
+ }
+
+ typedef l2cp-dest-mac-address {
+ type string {
+ pattern '01-80-[cC]2-(00-){2}[02][0-9a-fA-F]|01:80:[cC]2:(00:){2}[02][0-9a-fA-F]';
+ }
+ description
+ "The L2CP Destination MAC address for CoS
+ Identifier type of 'l2cp' and is ignored for other types.
+
+ Valid values are 01-80-C2-00-00-00 through 01-80-C2-00-00-0F and
+ 01-80-C2-00-00-20 through 01-80-C2-00-00-2F
+
+ Values can be upper or lower case and can be separated by hyphen or colon (but not both)";
+ }
+
+ typedef l2cp-destination-address {
+ type enumeration {
+ enum destinationAddressOnly {
+ description "L2CP selection is determined by
+ MAC Destination Address only";
+ }
+
+// enum daPlusProtocol {
+// description "L2CP selection is determined by
+// MAC Destination Address plus
+// Ethernet protocol";
+// }
+//
+// enum daPlusProtocolPlusSubtype {
+// description "L2CP selection is determined by
+// MAC Destination Address plus
+// Ethernet protocol plus subtype";
+// }
+ }
+ }
+
+ typedef ip-address-origin {
+ type enumeration {
+ enum "other" {
+ value 0;
+ description
+ "None of the following.";
+ }
+ enum "static" {
+ value 1;
+ description
+ "Indicates that the address has been statically
+ configured - for example, using NETCONF or a Command Line
+ Interface.";
+ }
+ enum "dhcp" {
+ value 2;
+ description
+ "Indicates an address that has been assigned to this
+ system by a DHCP server.";
+ }
+ enum "link-layer" {
+ value 3;
+ description
+ "Indicates an address created by IPv6 stateless
+ autoconfiguration that embeds a link-layer address in its
+ interface identifier.";
+ }
+ enum "random" {
+ value 4;
+ description
+ "Indicates an address chosen by the system at
+
+ random, e.g., an IPv4 address within 169.254/16, an
+ RFC 4941 temporary address, or an RFC 7217 semantically
+ opaque address.";
+ reference
+ "RFC 4941: Privacy Extensions for Stateless Address
+ Autoconfiguration in IPv6
+ RFC 7217: A Method for Generating Semantically Opaque
+ Interface Identifiers with IPv6 Stateless
+ Address Autoconfiguration (SLAAC)";
+
+ }
+ }
+ description
+ "The origin of an address.";
+ }
+
+ typedef neighbor-origin {
+ type enumeration {
+ enum "other" {
+ value 0;
+ description
+ "None of the following.";
+ }
+ enum "static" {
+ value 1;
+ description
+ "Indicates that the mapping has been statically
+ configured - for example, using NETCONF or a Command Line
+ Interface.";
+ }
+ enum "dynamic" {
+ value 2;
+ description
+ "Indicates that the mapping has been dynamically resolved
+ using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery
+ protocol.";
+ }
+ }
+ description
+ "The origin of a neighbor entry.";
+ }
+
+ feature ipv4-non-contiguous-netmasks {
+ description
+ "Indicates support for configuring non-contiguous
+ subnet masks.";
+ }
+
+ /*** OBJECT DEFINITIONS ***/
+ augment "/if:interfaces" {
+ leaf l2cp-group-index { //aka mefServiceInterfaceCfgL2cpGrpIndex
+ type leafref {
+ path "/if:interfaces/msea-if:interface-profiles/msea-if:l2cp-group/msea-if:group-index";
+ }
+ description
+ "This object is the index of the L2CP profile group
+ (mefServiceL2cpGrpCfgIndex) associated with the current interface. A
+ value of 0 indicates that no interface L2CP profile group is associated
+ with the interface. The L2CP group must be the same for both interfaces";
+ reference
+ "[MEF 6.1] 6.0; [MEF 6.1.1] 8.0; [MEF 7.2] 6.2.1.2";
+
+// must "count(//if:interfaces/if:interface[msea-if:l2cp-group-index = current()]) = 2" {
+// error-app-tag "msea-if-must-01";
+// error-message "The same L2CP Group must be used on both interfaces of this device";
+// }
+ }
+
+ leaf mef-service-type { //aka mefServiceInterfaceCfgType
+ type MefServiceInterfaceType;
+ description
+ "This object indicates the configured interface type. One
+ bit in the vector can be set at one time based upon the
+ possible values indicated by mefServiceInterfaceStatusType.";
+ //default bUni1d1; --These defaults break the validation - not using them in Eagle
+ reference
+ "[MEF 6.1] 6.0; [MEF 7.2] 6.2.1.1, 6.2.1.2, 6.2.1.3";
+ }
+
+ leaf dhcp-timeout {
+ type uint16 {range 0..max;}
+ units seconds;
+ default 0;
+ description "The DHCP timeout in seconds, after which it will use fixed IP addreses
+ A zero value specifies it should never timeout";
+ }
+
+ container zero-touch-provisioning {
+ presence "When present sets this device to be configured through Zero Touch Provisioning";
+
+ description "Setting Zero Touch Provisioning (ZTP) configures the setting up
+ of the management interface through an LLDP server
+ When ZTP is active any DHCP or fixed IP address settings must not be specified.
+
+ If this attribute is set during a NETCONF session it will have no effect until the
+ next time the device is rebooted.";
+
+ must "count(/if:interfaces/if:interface/msea-if:ipv4/msea-if:address) = 0" {
+ error-app-tag "msea-if-must-01";
+ error-message "When ZTP is specified there must not be a manually specified IP address for either interface";
+ }
+
+ must "not(/if:interfaces/if:interface[msea-if:dhcp-addressing = 'true']) " {
+ error-app-tag "msea-if-must-02";
+ error-message "When ZTP is specified there must not be a DHCP Specification for either interface";
+ }
+
+ }
+
+ container interface-profiles {
+
+ list interface-bwp-group { //aka mefServiceBwpGrpCfgEntry
+
+ key "group-index";
+ max-elements 64;
+ description
+ "Bandwidth profile group settings table entry.";
+
+ leaf group-index { //aka mefServiceBwpGrpCfgIndex
+ type uint8;
+ description
+ "Bandwidth profile group index number";
+ }
+
+ list interface-bwp { //aka mefServiceBwpCfgEntry
+ key "cos-index";//Changed to cos-index (from bwp-index) based on MEP 40 6.4.2
+ unique name;
+ max-elements 64;
+
+ description
+ "Bandwidth profile. This maps 1:1 with a COS instance. This object is
+ maintained here to keep the traditional layout of BWPGroup-BWP-COS, but does
+ not have any other purpose in the current implementation";
+
+ leaf cos-index { //aka mefServiceBwpCfgCosIndex
+ type leafref {
+ path "/if:interfaces/msea-if:interface-profiles/msea-if:interface-cos/msea-if:cos-index";
+ }
+ description
+ "This object is the index number of the CoS ID profile
+ associated with the current bandwidth profile. A value of 0 indicates
+ that no CoS ID profile is associated with the bandwidth profile and the
+ bandwidth profile applies to all CoS IDs.
+
+ This index indicates a specific CoS ID profile previously configured via
+ mefServiceCosCfgTable as indicated by the mefServiceCosCfgIndex object.";
+ reference
+ "[MEF 6.1] 6.1; [MEF 7.2] 6.2.1.3";
+
+ must "current()/../../msea-if:group-index > 0" {
+ error-app-tag "msea-if-must-10";
+ error-message "No BWP's can be added to the Bandwidth Profile Group 0, as this index represents a special case";
+ }
+ }
+
+ leaf name { //mefServiceBwpCfgIdentifier
+ type string {
+ length "1..45";
+ }
+ mandatory true;
+ description
+ "This object indicates the bandwidth profile identifier for the
+ associated bandwidth profile index and is an arbitrary
+ text string that is used to identify a bandwidth profile. Unique
+ string values are chosen to uniquely identify the bandwidth
+ profile.
+
+ Octet values of 0x00 through 0x1f are illegal.
+
+ MEF 26.1 restricts the maximum size identifiers to 45 octets.";
+ reference
+ "[MEF 6.1] 6.0, 6.1, 6.2, 6.3; [MEF 7.2] 6.2.1.2, 6.2.1.3";
+ }
+
+
+ } //End bwp
+
+ } //End bwp-group
+
+ list interface-cos { //aka mefServiceCosCfgEntry
+ key "cos-index";
+ unique name;
+ max-elements 64;
+ description
+ "Class of Service Identifier settings table entry.";
+
+ leaf cos-index { //aka mefServiceCosCfgIndex
+ type uint32 {
+ range 1..max;
+ }
+ description
+ "Class of Service Identifier profile index number.";
+ }
+
+ leaf name { //aka mefServiceCosCfgIdentifier
+ type string {
+ length 1..45;
+ }
+
+ description
+ "This object indicates the Class of Service Name for the
+ associated CoS profile index and is an arbitrary text string that is
+ used to identify a CoS ID profile. Unique string values are chosen to
+ uniquely identify the profile.
+
+ Octet values of 0x00 through 0x1f are illegal.
+
+ MEF 26.1 restricts the maximum size identifiers to 45 octets.";
+ reference
+ "[MEF 6.1] 6.0, 6.1, 6.2, 6.3; [MEF 7.2] 6.2.1.2, 6.2.1.3";
+ }
+
+ container dscp-cos-type {
+ description "Indicates that the CoS profile is associated
+ with the incoming frame's DSCP field if it is an IP frame.
+ If it is not an IP frame no action is taken on it";
+
+ choice dscp-id-choice {
+ case dscp-bits-list {
+ leaf dscp-group-bit-list {
+ type bits {
+ bit dscp-0-7 {
+ description "The set of DSCP identifiers from 0-7";
+ }
+ bit dscp-8-15 {
+ description "The set of DSCP identifiers from 8-15";
+ }
+ bit dscp-16-23 {
+ description "The set of DSCP identifiers from 16-23";
+ }
+ bit dscp-24-31 {
+ description "The set of DSCP identifiers from 24-31";
+ }
+ bit dscp-32-39 {
+ description "The set of DSCP identifiers from 32-39";
+ }
+ bit dscp-40-47 {
+ description "The set of DSCP identifiers from 40-47";
+ }
+ bit dscp-48-55 {
+ description "The set of DSCP identifiers from 48-55";
+ }
+ bit dscp-56-63 {
+ description "The set of DSCP identifiers from 56-63";
+ }
+ }
+ }
+ }
+
+ case dscp-0-63 {
+ container dscp-0-63 {
+ presence "The full set of DSCP identifiers from 0-63";
+ }
+ }
+
+ case specific-values {
+ leaf-list dscp-id {
+ type uint16 {
+ range 0..64;
+ }
+ ordered-by system;
+ description "The set of DSCP identifiers handled by this COS";
+ }
+ }
+ mandatory true;
+// msea:not-changeable;
+ }
+
+ choice color-specification {
+ case all-green {
+ container color-all-green {
+ presence "Color for all specified DSCPs mapped to green";
+ }
+ }
+ case all-yellow {
+ container color-all-yellow {
+ presence "Color for all specified DSCPs mapped to yellow";
+ }
+ }
+ case all-dropped {
+ container color-all-dropped {
+ presence "Color for all specified DSCPs mapped to dropped";
+ }
+ }
+
+ case dscp-to-color-map {
+ list dscp-color {
+ key dscp-id;
+ ordered-by system;
+ description "A list of DSCP values that apply to this COS.
+ When the COS type is DSCP a subset of the values can
+ be specified. Other DSCP values can be specified in
+ additional COS profiles. In total the same priority
+ cannot be repeated in a BWP Group";
+
+ leaf dscp-id {
+ type uint16 {
+ range 0..64;
+ }
+ }
+
+ leaf color {
+ description "Color to apply to incoming IP frames
+ with this DSCP id";
+
+ type msea:cos-color-type;
+ }
+ }
+ }
+ default all-green;
+// msea:not-changeable;
+ }
+ }
+
+ leaf outgoing-cos-value {
+ type msea:priority-type;
+ mandatory true;
+// msea:not-changeable;
+
+ description
+ "Used to set the egress COS to use for all ingress COS explicitly listed";
+ reference
+ "Edge Assure internal API";
+ }
+ }
+
+ list l2cp-group { //aka mefServiceL2cpGrpCfgEntry
+ key "group-index";
+ max-elements 64;
+ description
+ "L2CP profile group settings table entry on an interface.";
+
+ leaf group-index { //aka mefServiceL2cpGrpCfgIndex
+ type uint32;
+ description
+ "L2CP profile group index number, indicating the specific L2CP profile
+ group";
+ }
+
+ list l2cp { //aka mefServiceL2cpCfgEntry
+ key "index";
+ max-elements 64;
+ description
+ "L2CP settings table entry on an interface or a service.";
+
+ leaf index { //aka mefServiceL2cpCfgIndex
+ type uint32;
+ description
+ "This object configures the L2CP index number on an interface or a
+ Service and is used to create/access a L2CP profile within a L2CP
+ group.";
+
+ must "current()/../../msea-if:group-index > 0" {
+ error-app-tag "msea-if-must-11";
+ error-message "No L2CP's can be added to the L2CP Group 0, as this index represents a special case";
+ }
+ }
+
+ leaf handling { //aka mefServiceL2cpCfgType
+ type enumeration {
+ enum discard {description "The indicated L2CP is discarded";}
+
+ enum tunnel {description "The indicated L2CP is tunneled (passed)";}
+
+ enum peer {description "The indicated L2CP is peered with the NE";}
+
+ // enum passToEvc {description "the indicated L2CP is passed to the EVC for
+ // EVC processing of the L2CP. Final L2CP
+ // disposition is based the L2CP profile for
+ // the EVC to be tunneled, discarded, or peered.
+ // This value is not valid for EVC based L2CP";
+ // }
+ }
+ default tunnel;
+// msea:not-changeable;
+
+ description
+ "This object configures the handling of matching L2CP frames.";
+ reference
+ "[MEF 6.1] 6.0, 8.0; [MEF 6.1.1] 8.0; [MEF 7.2] 6.2.1.2";
+ }
+
+ leaf match-scope { //aka mefServiceL2cpCfgMatchScope
+ type l2cp-destination-address;
+ default destinationAddressOnly;
+// msea:not-changeable;
+
+ description
+ "This object configures the L2CP selection matching scope.";
+ reference
+ "[MEF 6.1] 6.0, 8.0; [MEF 6.1.1] 8.0; [MEF 7.2] 6.2.1.2";
+
+ }
+
+ leaf mac-address { //aka mefServiceL2cpCfgMacAddress
+ type l2cp-dest-mac-address;
+ mandatory true;
+// msea:not-changeable;
+
+ description
+ "This object configures the L2CP Destination MAC address.
+
+ Valid values are 01-80-C2-00-00-00 through 01-80-C2-00-00-0F and
+ 01-80-C2-00-00-20 through 01-80-C2-00-00-2F";
+
+ must "count(current()/../../msea-if:l2cp[msea-if:mac-address = current()]) <= 1" {
+ error-app-tag "msea-if-must-12";
+ error-message "A destination address can only appear once in an L2CP Group";
+ }
+ }
+ } //End l2cp
+
+ } //End l2cp-group
+
+ } //End profiles
+ } //end augment interfaces
+
+ //
+ // Augments ietf-interfaces (only of type ethernetCsmacd) with MEF Services
+ //
+ augment "/if:interfaces/if:interface" {
+
+ //Copied IPV4 over from ietf-ip because
+ // i) We do not want to have to include IPv6
+ // ii) libnetconf only supports augmenting any container
+ // from one file (i.e. cannot augment interface here and
+ // also in ietf-ip.yang
+
+
+ container ipv4 {
+ presence
+ "Enables IPv4 unless the 'enabled' leaf
+ (which defaults to 'true') is set to 'false'";
+ description
+ "Parameters for the IPv4 address family.";
+
+ leaf enabled {
+ type boolean;
+ default true;
+
+ description
+ "Controls whether IPv4 is enabled or disabled on this
+ interface. When IPv4 is enabled, this interface is
+ connected to an IPv4 stack, and the interface can send
+ and receive IPv4 packets. When ZTP is configured it
+ will treat both interfaces as enabled and will ignore
+ what this value is set to";
+
+ must "count(/if:interfaces/if:interface[if:name='eth0' or if:name='eth1']/msea-if:ipv4[msea-if:enabled = 'true']) >= 1" {
+ error-app-tag "msea-if-must-20";
+ error-message "At least one of the interfaces eth0 and eth1 must be enabled";
+ }
+ }
+
+ leaf forwarding {
+ type boolean;
+ default false;
+ description
+ "Controls IPv4 packet forwarding of datagrams received by,
+ but not addressed to, this interface. IPv4 routers
+ forward datagrams. IPv4 hosts do not (except those
+ source-routed via the host).";
+ }
+
+ leaf mtu {
+ type uint16 {
+ range "68..max";
+ }
+ units "octets";
+ description
+ "The size, in octets, of the largest IPv4 packet that the
+ interface will send and receive.
+
+ The server may restrict the allowed values for this leaf,
+ depending on the interface's type.
+
+ If this leaf is not configured, the operationally used MTU
+ depends on the interface's type.";
+ reference
+ "RFC 791: Internet Protocol";
+
+ }
+
+ container address {
+ when "not (../../msea-if:dhcp-addressing = 'true')";
+ presence "This address being present indicates the interface has been configured";
+
+ description
+ "The configured IPv4 addresses on the interface.";
+ leaf ip {
+ type inet:ipv4-address-no-zone;
+ description
+ "The IPv4 address on the interface.";
+ }
+
+ choice subnet {
+ mandatory true;
+ description
+ "The subnet can be specified as a prefix-length, or,
+ if the server supports non-contiguous netmasks, as
+ a netmask.";
+ leaf prefix-length {
+ type uint8 {
+ range "0..32";
+ }
+ description
+ "The length of the subnet prefix.";
+ }
+ leaf netmask {
+ if-feature ipv4-non-contiguous-netmasks;
+ type yang:dotted-quad;
+ description
+ "The subnet specified as a netmask.";
+ }
+ } // choice subnet
+
+ leaf gateway {
+ type inet:ipv4-address-no-zone;
+
+ description "This will be ignored if ZTP or DHCP are configured
+ for management addressing. If unspecified then 0.0.0.0 will be used.";
+
+ }
+ } // container address
+ } // container ipv4
+
+
+
+ leaf frame-format { //aka mefServiceInterfaceCfgFrameFormat
+ when "../if:type='ianaift:ethernetCsmacd' and (../if:name='eth0' or ../if:name='eth1')";
+ type enumeration {
+ enum noTag {
+ description "Indicates that all data on the interface
+ is regarded as untagged, regardless of it ingress type";
+ }
+ enum ctag {
+ description "Ingress frames with CTAG(vlan>0) will be
+ regared as 'VLAN tagged'; with CTAG(vlan=0) as Priority; otherwise untagged";
+ }
+ enum stag {
+ description "Ingress frames with STAG(vlan>0) will be
+ regared as 'VLAN tagged'; with STAG(vlan=0) as Priority; otherwise untagged";
+ }
+// enum stagCtag { description "Indicates that service traffic identified
+// with both an S-TAG (outer tag) and a C-TAG
+// (inner tag)"; }
+ //default noTag; --These defaults break the validation - not using them in Eagle
+ }
+ description
+ "This object indicates the interface frame format type that the
+ interface can recognize. Default is noTag";
+ reference
+ "[MEF 6.1] 6.0";
+ } //end frame-format
+
+ leaf interface-ingress-bwp-group-index { //aka mefServiceInterfaceCfgIngressBwpGrpIndex
+ when "../if:type='ianaift:ethernetCsmacd' and (../if:name='eth0' or ../if:name='eth1')";
+ type leafref {
+ path "/if:interfaces/msea-if:interface-profiles/msea-if:interface-bwp-group/msea-if:group-index";
+ }
+ description
+ "This object is the index number of the ingress bandwidth profile group
+ associated with the current interface. A value of 0 indicates that no
+ interface ingress bandwidth profile group is associated with the
+ interface.
+
+ This index indicates the specific bandwidth profile group previously
+ configured via mefServiceBwpGrpCfgTable and mefServiceBwpCfgTable
+ using this value for mefServiceBwpGrpCfgIndex. There may be multiple
+ entries in mefServiceBwpCfgTable using this index, each containing
+ bandwidth parameters for a different Class of Service Identifier.";
+ reference
+ "[MEF 6.1] 6.0; [MEF 7.2] 6.2.1.2";
+ }
+
+ leaf ce-vid-untagged { //aka mefServiceUniCfgCeVidUntagged
+ when "../if:type='ianaift:ethernetCsmacd' and (../if:name='eth0' or ../if:name='eth1')";
+ type msea:vlan-id-type;
+
+// mandatory true;
+ description
+ "Configures the CE VLAN ID associated with untagged and priority
+ Service Frames. It allows the identification of untagged and
+ priority tagged traffic with a specific CE-VLAN ID. This object
+ is ignored for all to one bundling at the UNI.
+ This attribute has been placed on the interface (rather than the UNI)
+ as it can be defined regardless of whether a UNI exists or not";
+ reference
+ "[MEF 6.1] 6.0, [MEF 7.2] 6.2.1.2";
+ }
+
+ leaf ce-priority-untagged { //aka mefServiceUniCfgCePriorityUntagged
+ when "../if:type='ianaift:ethernetCsmacd' and (../if:name='eth0' or ../if:name='eth1')";
+ type msea:priority-type;
+// mandatory true;
+
+ description
+ "Configures the CE VLAN Priority associated with untagged Service
+ Frames. It allows the assignment of a specific VLAN priority to
+ untagged traffic. This object is ignored for all to one bundling
+ at the UNI.
+ This attribute has been placed on the interface (rather than the UNI)
+ as it can be defined regardless of whether a UNI exists or not";
+ reference
+ "[MEF 7.2] 6.2.1.2";
+ }
+
+ leaf admittance-criteria {
+ when "../if:type='ianaift:ethernetCsmacd' and (../if:name='eth0' or ../if:name='eth1')";
+ type enumeration {
+ enum admitAll {
+ description "Admit all frames";
+ }
+// enum admitPrioUntaggedOnly {description "Admit only frames that are not Priority tagged";}
+// enum admitVlanOnly {description "Admit only frames that are VLAN tagged";}
+ }
+
+// default admitAll;
+
+ description "Criteria for admitting packets to this interface.
+ The Frame Format attribute to determintes how frames are tagged";
+ }
+
+ leaf color-aware {
+ type boolean;
+ default true;
+
+ description
+ "Defines whether the interface should handle color mappings.
+ If true the color is extracted from the packet tag (DEI bit)
+ or for IPv4 packets, the DSCP field.
+ If false the packet is always assumed to be green.";
+ reference
+ "Edge Assure internal API";
+ }
+
+ leaf color-forward {
+ type boolean;
+ default true;
+
+ description
+ "Defines whether the interface should handle color mappings.
+ If true color mappings defined in the interface-cos
+ associated with the active interface-ingress-bwp-group will be applied";
+ reference
+ "Edge Assure internal API";
+ }
+
+ leaf dhcp-addressing {
+ when "../if:type='ianaift:ethernetCsmacd' and (../if:name='eth0' or ../if:name='eth1')";
+ type boolean;
+
+ description "This element can only be specified when ZTP
+ is not specified.
+
+ If this element is not present and ZTP is not
+ present then the fixed IP addresses specified at
+ /if:interfaces/if:interface/msea-if:ipv4
+ will be used
+
+ This element is specified per interface";
+
+ must "(not(/if:interfaces/if:interface[if:name = current()/../if:name]/msea-if:ipv4/msea-if:address) and not(/if:interfaces/msea-if:zero-touch-provisioning) and current() = 'true') or ((boolean(/if:interfaces/if:interface[if:name = current()/../if:name]/msea-if:ipv4/msea-if:address) or boolean(/if:interfaces/if:interface[if:name = current()/../if:name]/msea-if:ipv4[msea-if:enabled='false']) or (/if:interfaces/msea-if:zero-touch-provisioning)) and current() = 'false')" {
+ error-app-tag "msea-if-must-21";
+ error-message "When DHCP is 'true' there must be neither a fixed IP address for that interface NOR a ZTP node. When DHCP is 'false' there must be either a fixed IP address for that interface, a disabled interface OR a ZTP node";
+ }
+
+ }
+ } //End augment "/if:interfaces/if:interface
+
+ augment "/if:interfaces-state" {
+ leaf mef-service-type-options { //aka mefServiceInterfaceStatusType
+ type MefServiceInterfaceType;
+ description
+ "This object is a vector of bits that indicates the possible
+ interface types that an interface can be configured to. An interface,
+ for instance, can be configured to be a UNI type 1 or 2, or an ENNI.
+
+ All the possible capabilities of an interface are indicated, one bit
+ per possible type. At least one bit must be set for MEF compliant NEs.";
+ reference
+ "[MEF 6.1] 6.0";
+ }
+
+ leaf zero-touch-provisioning-state {
+ type enumeration {
+ enum complete {
+ description "The device was configured through ZTP at last reboot";
+ }
+ enum incomplete {
+ description "The device was configured through ZTP at last reboot but is not yet complete";
+ }
+ enum dhcp-failed {
+ description "Communication with DHCP server found through ZTP failed
+ and default values were used instead.";
+ }
+ enum needs-reboot {
+ description "ZTP was added to the configuration since last reboot";
+ }
+ }
+ description "A read only set of attributes indicating the status of
+ Zero Touch Provisioning. This only appears when ZTP is configured";
+ }
+ } //End augment "/if:interfaces-state
+
+
+ augment "/if:interfaces-state/if:interface" {
+
+ container ipv4 {
+ presence
+ "Present if IPv4 is enabled on this interface";
+ config false;
+ description
+ "Interface-specific parameters for the IPv4 address family.";
+ leaf forwarding {
+ type boolean;
+ description
+ "Indicates whether IPv4 packet forwarding is enabled or
+ disabled on this interface.";
+ }
+
+ leaf mtu {
+ type uint16 {
+ range "68..max";
+ }
+ units "octets";
+ description
+ "The size, in octets, of the largest IPv4 packet that the
+ interface will send and receive.";
+ reference
+ "RFC 791: Internet Protocol";
+
+ }
+
+ container address {
+ description
+ "The list of IPv4 addresses on the interface.";
+ leaf ip {
+ type inet:ipv4-address-no-zone;
+ description
+ "The IPv4 address on the interface.";
+ }
+
+ choice subnet {
+ description
+ "The subnet can be specified as a prefix-length, or,
+ if the server supports non-contiguous netmasks, as
+ a netmask.";
+ leaf prefix-length {
+ type uint8 {
+ range "0..32";
+ }
+ description
+ "The length of the subnet prefix.";
+ }
+ leaf netmask {
+ if-feature ipv4-non-contiguous-netmasks;
+ type yang:dotted-quad;
+ description
+ "The subnet specified as a netmask.";
+ }
+ } // choice subnet
+
+ leaf origin {
+ type ip-address-origin;
+ description
+ "The origin of this address.";
+ }
+ } // list address
+
+ leaf gateway {
+ type inet:ipv4-address;
+ description "The gateway IP address assigned through ZTP";
+ }
+
+ list neighbor {
+ key "ip";
+ description
+ "A list of mappings from IPv4 addresses to
+ link-layer addresses.
+
+ This list represents the ARP Cache.";
+ reference
+ "RFC 826: An Ethernet Address Resolution Protocol";
+
+ leaf ip {
+ type inet:ipv4-address-no-zone;
+ description
+ "The IPv4 address of the neighbor node.";
+ }
+
+ leaf link-layer-address {
+ type yang:phys-address;
+ description
+ "The link-layer address of the neighbor node.";
+ }
+
+ leaf origin {
+ type neighbor-origin;
+ description
+ "The origin of this neighbor entry.";
+ }
+ } // list neighbor
+ } // container ipv4
+
+ leaf max-vc { //aka mefServiceInterfaceStatusMaxVc
+ type uint32 {
+ range "1..4095";
+ }
+ description
+ "This object indicates the maximum number of EVCs that the
+ interface can support.";
+ reference
+ "[MEF 6.1] 6.0; [MEF 7.2] 6.2.1.2";
+ }
+
+ leaf configured-by {
+ type enumeration {
+ enum zero-touch-provisioning {
+ description "ZTP is active and has configured this interface";
+ }
+ enum dhcp {
+ description "Interface has been configured by a DHCP server without ZTP";
+ }
+ enum fixed-ipv4 {
+ description "Interface has been configured manually";
+ }
+ }
+ }
+ } //End augment "/if:interfaces-state/if:interface"
+
+
+ augment "/if:interfaces-state/if:interface/if:statistics" {
+
+ leaf ingress-undersized { //aka mefServiceInterfaceStatisticsIngressUndersized
+ type yang:counter32;
+ units "Ethernet frames";
+ description
+ "This object is incremented for each frame received
+ on a NE interface that was smaller than 64 octets.
+
+ This object defaults to '0'. ";
+ reference
+ "[MEF 15] 8.2; [Q.840.1] 6.2.4";
+ }
+
+ leaf ingress-oversized { //aka mefServiceInterfaceStatisticsIngressOversized
+ type yang:counter32;
+ units "Ethernet frames";
+ description
+ "This object is incremented for each frame received
+ on a NE interface that was larger than the maximum MTU size.
+
+ This object defaults to '0'.";
+ reference
+ "[MEF 15] 8.2; [Q.840.1] 6.2.4";
+ }
+
+ leaf ingress-fragments { //aka mefServiceInterfaceStatisticsIngressFragments
+ type yang:counter32;
+ units "Ethernet frames";
+ description
+ "This object is incremented for each frame received
+ on a NE interface that was less than 64 octets in length
+ (excluding framing bits but including FCS octets) and had
+ either a bad Frame Check Sequence (FCS) with an integral
+ number of octets (FCS Error) or a bad FCS with a non-integral
+ number of octets (Alignment Error).
+
+ Note that it is entirely normal for this counter to
+ increment. This is because it counts both runts (which are
+ normal occurrences due to collisions) and noise hits.
+
+ This object defaults to '0'.";
+ reference
+ "[MEF 15] 8.2; [Q.840.1] 6.2.4";
+ }
+
+ leaf ingress-crc-alignment { //aka mefServiceInterfaceStatisticsIngressCrcAlignment
+ type yang:counter32;
+ units "Ethernet frames";
+ description
+ "This object is incremented for each frame received
+ on a NE interface that was from 64 octets to the maximum MTU
+ size in length, but had either a bad Frame Check Sequence (FCS)
+ with an integral number of octets (FCS Error) or a bad FCS with
+ a non-integral number of octets (Alignment Error).
+
+ This object defaults to '0'.";
+ reference
+ "[MEF 15] 8.2; [Q.840.1] 6.2.4";
+ }
+
+ leaf ingress-invalid-vid { //aka mefServiceInterfaceStatisticsIngressInvalidVid
+ type yang:counter32;
+ units "Ethernet frames";
+ description
+ "This object is incremented for each frame received
+ on a NE interface with an invalid VLAN ID.
+
+ This object defaults to '0'.";
+ reference
+ "[MEF 15] 8.2; [Q.840.1] 6.2.4";
+ }
+
+ leaf ingress-octets { //aka mefServiceInterfaceStatisticsIngressOctets
+ type yang:counter64;
+ units "octets";
+ description
+ "This object is incremented by the number of octets in a
+ valid frame received on a NE interface.
+
+ This object defaults to '0'.";
+ reference
+ "[MEF 15] 8.2; [Q.840.1] 6.2.4";
+ }
+
+ leaf ingress-unicast { //aka mefServiceInterfaceStatisticsIngressUnicast
+ type yang:counter64;
+ units "Ethernet frames";
+ description
+ "This object is incremented for each valid unicast frame received
+ on a NE interface.
+
+ NEs that do not support 64 bit counters can return the
+ upper half of the counter as all zeros.
+
+ This object defaults to '0'.";
+ reference
+ "[MEF 15] 8.2; [Q.840.1] 6.2.4";
+ }
+
+ leaf ingress-multicast { //aka mefServiceInterfaceStatisticsIngressMulticast
+ type yang:counter64;
+ units "Ethernet frames";
+ description
+ "This object is incremented for each valid multicast frame received
+ on a NE interface.
+
+ ME-NEs that do not support 64 bit counters can return the
+ upper half of the counter as all zeros.
+
+ This object defaults to '0'.";
+ reference
+ "[MEF 15] 8.2; [Q.840.1] 6.2.4";
+ }
+
+ leaf ingress-broadcast { //aka mefServiceInterfaceStatisticsIngressBroadcast
+ type yang:counter64;
+ units "Ethernet frames";
+ description
+ "This object is incremented for each valid broadcast frame received
+ on a NE interface.
+
+ ME-NEs that do not support 64 bit counters can return the
+ upper half of the counter as all zeros.
+
+ This object defaults to '0'.";
+ reference
+ "[MEF 15] 8.2; [Q.840.1] 6.2.4";
+ }
+
+ leaf egress-octets { //aka mefServiceInterfaceStatisticsEgressOctets
+ type yang:counter64;
+ units "octets";
+ description
+ "This object is incremented by the number of octets in a frame
+ transmitted on a NE interface.
+
+ This object defaults to '0'.";
+ reference
+ "[MEF 15] 8.2; [Q.840.1] 6.2.4";
+ }
+
+ leaf egress-unicast { //aka mefServiceInterfaceStatisticsEgressUnicast
+ type yang:counter64;
+ units "Ethernet frames";
+ description
+ "This object is incremented for each unicast frame transmitted on a
+ NE interface.
+
+ ME-NEs that do not support 64 bit counters can return the
+ upper half of the counter as all zeros.
+
+ This object defaults to '0'.";
+ reference
+ "[MEF 15] 8.2; [Q.840.1] 6.2.4";
+ }
+
+ leaf egress-multicast { //aka mefServiceInterfaceStatisticsEgressMulticast
+ type yang:counter64;
+ units "Ethernet frames";
+ description
+ "This object is incremented for each multicast frame transmitted on a
+ NE interface.
+
+ ME-NEs that do not support 64 bit counters can return the
+ upper half of the counter as all zeros.
+
+ This object defaults to '0'.";
+ reference
+ "[MEF 15] 8.2; [Q.840.1] 6.2.4";
+ }
+
+ leaf egress-broadcast { //aka mefServiceInterfaceStatisticsEgressBroadcast
+ type yang:counter64;
+ units "Ethernet frames";
+ description
+ "This object is incremented for each broadcast frame transmitted on a
+ NE interface.
+
+ ME-NEs that do not support 64 bit counters can return the
+ upper half of the counter as all zeros.
+
+ This object defaults to '0'.";
+ reference
+ "[MEF 15] 8.2; [Q.840.1] 6.2.4";
+ }
+ } //End augment "/if:interfaces-state/if:interface/if:statistics
+
+
+
+ rpc ztp-reset-and-reboot {
+// nacm:default-deny-all;
+ description
+ "Request that the ZTP system should be reset and the system rebooted.
+ This can only be run when the zero-touch-provisioning element
+ already exists on the interfaces element
+
+ If the zero-touch-provisioning element has been added since the last
+ reboot then the reset will be pending already and will be brought
+ in to effect by this reboot.";
+ }
+
+ } /* end of module msea-uni-evc-interface */
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/msea-uni-evc-service.yang b/drivers/microsemi/ea1000yang/src/main/yang/msea-uni-evc-service.yang
new file mode 100644
index 0000000..5075ffb
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/msea-uni-evc-service.yang
@@ -0,0 +1,1070 @@
+module msea-uni-evc-service {
+
+ namespace "http://www.microsemi.com/microsemi-edge-assure/msea-uni-evc-service";
+ prefix "msea-svcs"; //MicroSemi EdgeAssure (msea)
+
+
+ import msea-types {
+ prefix msea;
+ revision-date 2016-02-29;
+ }
+
+// import ietf-interfaces { prefix if; }
+// import mef-uni-evc-interface { prefix mef-interface; }
+ import ENTITY-STATE-TC-MIB {prefix "entity-state";}
+
+ /*** 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 is based on the MEF 40 SNMP model, for the management
+ objects for the management of User Network Interfaces (UNIs) and Ethernet
+ Virtual Connections (EVCs). It has been converted to YANG and modified
+ slightly to suit the EdgeAssure SFP which has some extra
+ constraints that are not handled by the original model
+
+ Copyright 2016 Microsemi Inc.
+ All rights reserved.";
+
+ reference
+ "***************************************************************************
+ Reference Overview
+
+ A number of base documents have been used to create this MIB. The following
+ are the abbreviations for the baseline documents:
+ [MEF 40] refers to SNMP MIB
+ [MEF6.1] refers to MEF 6.1 'Ethernet Services Definitions - Phase 2',
+ April 2008
+ [MEF 6.1.1] refers to MEF 6.1.1 'Layer 2 Control Protocol Handling Amendment
+ to MEF 6.1', January 2012
+ [MEF 7.2] refers to MEF 7.2 'Carrier Ethernet Management Information Model',
+ January 2013
+ [MEF 10.2] refers to MEF 10.2 'Ethernet Services Attributes Phase 2',
+ October 2009
+ [MEF 26.1] refers to MEF 26.1 'External Network Network Interface (ENNI) -
+ Phase 2', January 2012
+ [Q.840.1] refers to 'ITU-T Requirements and analysis for NMS-EMS
+ management interface of Ethernet over Transport and Metro Ethernet
+ Network (EoT/MEN)', March 2007
+ ****************************************************************************";
+
+ revision "2016-03-17" {
+ description
+ "Initial Version. Sean Condon - Microsemi";
+ reference "MEF 6.2";
+ }
+
+
+
+
+ grouping uni-attributes {
+
+ description "Common UNI attributes";
+
+ leaf bundling-multiplex { //aka mefServiceUniCfgBundlingMultiplex
+ type enumeration {
+ enum allToOne {
+ description
+ "All to One Bundling, used for Private services:
+ EPL, EP-LAN, and EP-Tree";
+ }
+
+ enum bundling {
+ description
+ "Bundling, indicates one or more
+ CE-VLANS per service, used for virtual private CE-VLAN
+ preservation services: EVPL, EVP-LAN, EVP-Tree";
+ }
+
+ enum multiplex {
+ description
+ "Service Multiplexing, indicates
+ one or more EVCs per UNI, used for virtual private
+ CE-VLAN preservation or non-preservation services:
+ EVPL, EVP-LAN, EVP-Tree";
+ }
+
+ enum bundlingMultiplex {
+ description
+ "Service Multiplexing plus
+ Bundling, indicates one or more EVCs per UNI that are
+ composed of one or more CE-VLANs, used for virtual
+ CE-VLAN preservation services: EVPL, EVP-LAN, EVP-Tree";
+ }
+ }
+
+ default allToOne;
+// msea:not-changeable;
+
+ description
+ "Configures bundling and multiplexing options for the UNI. This object
+ is an enumerated list of possible multiplexing and bundling options
+ on a UNI that is unambiguous and provides only the legal possibilities.";
+
+ reference
+ "[MEF 6.1] 6.0, [MEF 7.2] 6.2.1.2";
+ }
+
+ }
+
+
+ grouping evc-per-uni-extension-attributes {
+ description "EVC attributes that are configured depending on
+ the UNI side.";
+
+ leaf ce-vlan-map { //aka mefServiceEvcPerUniCfgCeVlanMap
+ type msea:service-list-type;
+
+ mandatory true;
+ description
+ "This object indicates the CE-VLANs associated with the specific
+ EVC on a UNI. CE-VLAN IDs have value of 0 to 4095. The CE-VLAN ID
+ list can be a single value or multiple values separated by a delimiter.
+
+ Some valid values are: '100', '1:10', '10,20,30', '1:4095'. In the
+ first example only CE-VLAN ID 100 is associated with the VLAN map.
+ In the second example the CE-VLAN map includes CE-VLAN IDs 1 through
+ 10 (range of values). The third example indicates three separate values
+ that make up the CE-VLAN map. The last example indicates all CE-VLAN IDs
+ are included in the map (range of values). ";
+ reference
+ "[MEF 6.1] 6.1; [MEF 7.2] 6.2.1.3";
+ }
+
+
+ leaf ingress-bwp-group-index { //aka mefServiceEvcPerUniCfgIngressBwpGrpIndex
+ type leafref {
+ path "/msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:bwp-group/msea-svcs:group-index";
+ }
+
+ mandatory true;
+
+ description
+ "This object is the index number of the ingress bandwidth profile group
+ associated with the current EVC on a UNI. A value of 0 indicates that
+ no ingress bandwidth profile group is associated with the EVC on a UNI.
+
+ This index indicates the specific bandwidth profile group previously
+ configured via mefServiceBwpGrpCfgTable and mefServiceBwpCfgTable
+ using this value for mefServiceBwpGrpCfgIndex. There may be multiple
+ entries in mefServiceBwpCfgTable using this index, each containing
+ bandwidth parameters for a different Class of Service Identifier.";
+ reference
+ "[MEF 6.1] 6.1; [MEF 7.2] 6.2.1.3";
+ }
+
+
+ choice tag-manipulation {
+ description "Tag Action to take for an EVC.
+ If no case is specified then the default noAction will apply";
+ //case noAction - if not specified then noAction will be taken
+ case tagPop {
+ container tag-pop {
+ description "Pop the tag.";
+ presence "Tag pop.";
+ }
+ }
+
+ case tagPush {
+ container tag-push {
+ description "Push the tag.";
+
+ leaf push-tag-type { //Microsemi Eagle specific configuration attribute
+ type enumeration {
+ enum pushCtag { description "Use Ctag type on push"; }
+ enum pushStag { description "Use Stag type on push"; }
+ }
+ default pushCtag;
+
+ description
+ "Specify what tag type should be used is if tagAction is 'push'.";
+ reference
+ "Edge Assure internal API";
+ }
+
+ leaf outer-tag-vlan { //Microsemi Eagle specific configuration attribute
+ type msea:vlan-id-type;
+ mandatory true;
+ description
+ "The VLan value to use as the outer tag's vlan.";
+ reference
+ "Edge Assure internal API";
+ }
+ }
+ }
+
+ case tagOverwrite {
+ container tag-overwrite {
+ description "Overwrite the tag";
+
+ leaf outer-tag-vlan { //Microsemi Eagle specific configuration attribute
+ type msea:vlan-id-type;
+ mandatory true;
+ description
+ "The VLan value to use as the outer tag's vlan.";
+ reference
+ "Edge Assure internal API";
+ }
+ }
+ }
+ }
+
+ leaf evc-per-uni-service-type { //aka mefServiceEvcPerUniCfgServiceType
+ type enumeration {
+ enum epl {
+ description "Ethernet Private Line Service (EPL)
+ Point-to-Point EVC, all to one bundling";
+ }
+
+ enum evpl {
+ description "Ethernet Virtual Private Line (EVPL)
+ Point-to-Point EVC, bundling and/or multiplexing";
+ }
+
+ enum eplan {
+ description "Ethernet Private LAN Service (EP-LAN)
+ Multipoint-to-Multipoint EVC, all to one bundling";
+ }
+
+ enum evplan {
+ description "Ethernet Virtual Private LAN Service (EVP-LAN)
+ Multipoint-to-Multipoint EVC, bundling and/or multiplexing";
+ }
+
+ enum eptree {
+ description "Ethernet Private Tree Service (EP-Tree)
+ Rooted-Multipoint EVC, all to one bundling";
+ }
+
+ enum evptree {
+ description "Ethernet Virtual Private Tree Service (EVP-Tree)
+ Rooted-Multipoint EVC, bundling and/or multiplexing";
+ }
+ }
+ config false;
+
+ description
+ "This object indicates the specific Ethernet service type. The value is
+ derived from the EVC object 'mefServiceEvcCfgType' and the UNI object
+ 'mefServiceUniCfgBundlingMultiplex'.";
+
+ reference
+ "[MEF 6.1] 6.1; [MEF 7.2] 6.2.1.3";
+ }
+
+ list flow-mapping {
+ description "A list to track the VLANs relationship to a Flow";
+ key ce-vlan-id;
+ leaf ce-vlan-id {
+ type msea:vlan-id-type;
+ description "A VLan Id";
+ }
+ leaf flow-id {
+ type uint64;
+ description "An identifier for a Flow Rule related to this VLan Id";
+ }
+ }
+ }
+
+
+ grouping pcp-color-map-grouping {
+ description "The PCP identifiers for the COS";
+ leaf pcp-id {
+ description "The priority level";
+ type msea:priority-type;
+ }
+
+ leaf pcp-color {
+ description "The color to apply to this Priority";
+ type msea:cos-color-type;
+// msea:not-changeable;
+ }
+ }
+
+ container mef-services {
+ description
+ "This acts as a container of the MEF (6.2) Services configuration.";
+
+ container uni {
+// must "count(/if:interfaces/if:interface/[mef-interface:mef-service-type = 'bUni2d1']) = 2" {
+// error-message "The interfaces must be configured as a UNI";
+// error-app-tag "msea-uni-must-01";
+// } //Unenforceable as the interface resides in a different module - may have to be implemented in the TransAPI
+
+ presence "If present this device acts as a UNI";
+
+ description "This Edge Assure device support only one UNI.
+ This device supports only one UNI even though it has two interfaces.
+ One of the interfaces corresponds to the UNI-N side of the UNI,
+ while the other interface corresponds to the UNI-C side of the interface.
+ Each side performs the mapping to and from the EVC on the ingress
+ of packets to the device.";
+
+
+ leaf name { //aka mefServiceUniCfgIdentifier
+ type msea:identifier45;
+ mandatory true;
+ description
+ "This object indicates the UNI identifier.
+ MEF 26.1 restricts the maximum size identifiers to 45 octets.";
+ reference
+ "[MEF 6.1] 6.0, [MEF 7.2] 6.2.1.2";
+ }
+
+ leaf uni-side-interface-assignment {
+ type enumeration {
+ enum uni-c-on-host {
+ description "Uni-C (Customer) is the Host/eth1/LAN - commonly the System port.
+ Uni-N (Network) is the Optics/eth0/WAN - commonly the Carrier port";
+ }
+ enum uni-c-on-optics {
+ description "Uni-C (Customer) is the Optics/eth0/WAN - commonly the Carrier port.
+ Uni-N (Network) is the Host/eth1/LAN - commonly the System port";
+ }
+ }
+
+ default uni-c-on-host;
+// msea:not-changeable;
+
+
+ description "An attribute to configure the assignment of UNI-C (Customer) and
+ UNI-N (Network) to the interfaces.
+ This Edge Assure supports only one UNI over its two interfaces.
+ One of the interfaces corresponds to the UNI-N side of the UNI,
+ while the other interface corresponds to the UNI-C side of the interface.
+ Each side acts on packets only on ingress at each interface";
+ }
+
+ container uni-c { //aka mefServiceUniCfgEntry
+ presence "If present this configures the UNI-C";
+
+ uses uni-attributes;
+
+ must "//msea-svcs:mef-services/msea-svcs:uni/msea-svcs:uni-n" {
+ error-app-tag "msea-svcs-must-00";
+ error-message "Both UNI-C and UNI-N must be specified";
+ }
+
+ description "The configuration of the UNI-C side of the UNI.
+ UNI-C refers to eth1 by default but can be changed through the
+ uni-side-interface-assignment attribute.
+ The interface used must have been configured as a UNI";
+ }
+
+ container uni-n { //aka mefServiceUniCfgEntry
+ presence "If present this configures the UNI-N";
+
+ uses uni-attributes;
+
+ must "//msea-svcs:mef-services/msea-svcs:uni/msea-svcs:uni-c" {
+ error-app-tag "msea-svcs-must-01";
+ error-message "Both UNI-C and UNI-N must be specified";
+ }
+
+ description "The configuration of the UNI-C side of the UNI.
+ UNI-N refers to eth0 by default but can be changed through the
+ uni-side-interface-assignment attribute.
+ The interface used must have been configured as a UNI";
+ }
+
+ list evc { //aka mefServiceEvcPerUniCfgEntry
+ key evc-index;
+ max-elements 32;
+ description "The UNI can support one or more EVCs";
+
+
+ leaf evc-index { //aka mefServiceEvcCfgIndex
+ type uint32 {
+ range 1..max;
+ }
+ description
+ "The specific instance of an EVC number.";
+ }
+
+ leaf name { //aka mefServiceEvcCfgIdentifier
+ type msea:identifier45;
+ mandatory true;
+
+ description
+ "This object indicates the EVC identifier. The identifier is
+ an arbitrary text string that is used to identify an EVC.
+ Unique string values are chosen to uniquely identify the EVC.
+
+ Octet values of 0x00 through 0x1f are illegal.
+
+ MEF 26.1 restricts the maximum size identifiers to 45 octets.";
+ reference
+ "[MEF 6.1] 6.1; [MEF 7.2] 6.2.1.3";
+ }
+
+
+ leaf uni-evc-id { //aka mefServiceEvcCfgIdentifier
+ type msea:identifier45;
+ config false;
+ description
+ "The UNI EVC ID is a string formed by the concatenation of
+ the UNI ID (Section 9.1) and the EVC ID (Section 8.2) that
+ is used to identify an EVC at the UNI. It is intended for
+ management and control purposes.";
+ reference
+ "[MEF 10.3] 10.1";
+ }
+
+ leaf service-type { //aka mefServiceEvcCfgServiceType
+ type enumeration {
+ enum pointToPoint {
+ description "EVC Point-to-Point service,
+ used for EPL and EVPL services";
+ }
+
+ enum multipointToMultipoint {
+ description "EVC Multipoint-to-Multipoint
+ Service, used for EP-LAN and EVP-LAN
+ services";
+ }
+
+ enum rootedMultipoint {
+ description "EVC Rooted-Multipoint Service,
+ used for EP-Tree and EVP-Tree services";
+ }
+
+ }
+ default pointToPoint;
+// msea:not-changeable;
+
+ description
+ "This object configures the EVC service type for the ME-NE.";
+
+ reference
+ "[MEF 6.1] 6.1; [MEF 7.2] 6.2.1.3";
+ }
+
+ leaf mtu-size { //aka mefServiceEvcCfgMtuSize
+ type uint32 {
+ range "9600";
+ }
+ units "octets";
+ default 9600;
+ description
+ "This object indicates the configured EVC maximum service frame format
+ size. It must be less than or equal to the
+ mefServiceEvcStatusMaxMtuSize.";
+ reference
+ "[MEF 6.1] 6.1; [MEF 7.2] 6.2.1.3";
+ }
+
+ leaf cevlan-id-preservation { //aka mefServiceEvcCfgCevlanIdPreservation
+ type msea:service-preservation-type;
+ default preserve;
+// msea:not-changeable;
+
+ description
+ "This object configures the EVC CE-VLAN ID preservation.
+
+ preserve(1) The CE-VLAN ID is preserved. The ingress CE-VLAN
+ is the CE-VLAN ID at the egress UNI
+ noPreserve(2) The CE-VLAN ID is not preserved. The ingress
+ CE-VLAN ID may not be the CE-VLAN ID at the egress
+ UNI";
+ reference
+ "[MEF 6.1] 6.1; [MEF 7.2] 6.2.1.3";
+ }
+
+ leaf cevlan-cos-preservation { //aka mefServiceEvcCfgCevlanCosPreservation
+ type msea:service-preservation-type;
+ default preserve;
+// msea:not-changeable;
+
+ description
+ "This object configures EVC CE-VLAN CoS preservation.
+
+ preserve(1) The CE-VLAN CoS is preserved. The ingress CE-VLAN
+ CoS is the CE-VLAN CoS at the egress UNI
+ noPreserve(2) The CE-VLAN CoS is not preserved. The ingress
+ CE-VLAN CoS may not be the CE-VLAN CoS at the
+ egress UNI";
+ reference
+ "[MEF 6.1] 6.1; [MEF 7.2] 6.2.1.3";
+ }
+
+ container evc-status { //aka mefServiceEvcStatusEntry
+ config false;
+ description
+ "The conceptual row of mefServiceEvcStatusTable.";
+
+ leaf max-mtu-size { //aka mefServiceEvcStatusMaxMtuSize
+ type uint32 {
+ range "1522..16384";
+ }
+ units "octets";
+ description
+ "This object indicates the EVC maximum configurable service
+ frame format size. The actual configured size is set via the
+ mefServiceEvcCfgMtuSize object.";
+ reference
+ "[MEF 6.1] 6.1; [MEF 7.2] 6.2.1.3";
+ }
+
+ leaf max-num-uni { //aka mefServiceEvcStatusMaxNumUni
+ type uint32 {
+ range "2..16384";
+ }
+ description
+ "This object indicates the maximum number of UNIs in an EVC. For
+ a Point-to-Point EVC this value is '2'. For a Multipoint EVC the
+ value can be '2' or greater.";
+ reference
+ "[MEF 6.1] 6.1; [MEF 7.2] 6.2.1.3";
+ }
+
+ leaf operational-state { //aka mefServiceEvcStatusOperationalState
+ type entity-state:EntityOperState;
+ description
+ "This object indicates the operational state (current
+ capability) of the EVC.
+
+ If the value is 'enabled', the EVC is able to ingress and
+ egress service frames and has been set to active.
+
+ If the value is 'disabled' the EVC is not able to ingress and
+ egress service frames, has detected an operational failure
+ condition, or has failed an internal test.
+
+ If the value is 'testing' the EVC has been placed into a test mode,
+ either a troubleshooting mode or a test mode.
+
+ If the value is 'unknown' the EVC is unable to report the operational
+ state.";
+ reference
+ "[MEF 7.2] 6.2.1.3";
+ }
+ } //End evc-status
+
+ container evc-per-uni {
+ leaf evc-uni-type { //aka mefServiceEvcUniCfgType
+ type enumeration {
+ enum root {
+ description "Valid setting for all service types. A UNI set
+ to this value may send frames to UNIs configured
+ as 'root' or 'leaf'";
+ }
+ }
+ default root;
+ description
+ "This object configures UNI type on an EVC.";
+ reference
+ "[MEF 10.2]";
+
+ }
+
+ container evc-per-uni-c { //aka mefServiceUniCfgEntry
+
+ description "The configuration of the UNI-C side of the EVC-per-UNI.";
+
+ uses evc-per-uni-extension-attributes;
+
+ } //End evc-per-uni-c
+
+
+ container evc-per-uni-n { //aka mefServiceUniCfgEntry
+
+ description "The configuration of the UNI-N side of the EVC-per-UNI";
+
+ uses evc-per-uni-extension-attributes;
+
+ } //End evc-per-uni-n
+ }
+ } //End evc
+ } //end of uni
+
+
+ container profiles {
+
+ list bwp-group { //aka mefServiceBwpGrpCfgEntry
+
+ key "group-index";
+ max-elements 64;
+ description
+ "Bandwidth profile group settings table entry.";
+
+ leaf group-index { //aka mefServiceBwpGrpCfgIndex
+ type uint8;
+ description
+ "Bandwidth profile group index number";
+ }
+
+ list bwp { //aka mefServiceBwpCfgEntry
+ key "cos-index";//Changed to cos-index (from bwp-index) based on MEP 40 6.4.2
+ unique name;
+ max-elements 64;
+
+ description
+ "Bandwidth profile settings table entry.";
+
+ leaf cos-index { //aka mefServiceBwpCfgCosIndex
+ type leafref {
+ path "/msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:cos/msea-svcs:cos-index";
+ }
+ description
+ "This object is the index number of the CoS ID profile
+ associated with the current bandwidth profile. A value of 0 indicates
+ that no CoS ID profile is associated with the bandwidth profile and the
+ bandwidth profile applies to all CoS IDs.
+
+ This index indicates a specific CoS ID profile previously configured via
+ mefServiceCosCfgTable as indicated by the mefServiceCosCfgIndex object.";
+ reference
+ "[MEF 6.1] 6.1; [MEF 7.2] 6.2.1.3";
+
+ must "count(//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:cos[msea-svcs:cos-index=//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:bwp-group[msea-svcs:group-index=current()/../../msea-svcs:group-index]/msea-svcs:bwp/msea-svcs:cos-index]/msea-svcs:*/priority[.='0']) <= 1" {
+ error-app-tag "msea-svcs-must-02";
+ error-message "Priority 0 can be specified only once in the COS's related to a BWP Group";
+ }
+
+ must "count(//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:cos[msea-svcs:cos-index=//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:bwp-group[msea-svcs:group-index=current()/../../msea-svcs:group-index]/msea-svcs:bwp/msea-svcs:cos-index]/msea-svcs:*/priority[.='1']) <= 1" {
+ error-app-tag "msea-svcs-must-03";
+ error-message "Priority 1 can be specified only once in the COS's related to a BWP Group";
+ }
+
+ must "count(//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:cos[msea-svcs:cos-index=//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:bwp-group[msea-svcs:group-index=current()/../../msea-svcs:group-index]/msea-svcs:bwp/msea-svcs:cos-index]/msea-svcs:*/priority[.='2']) <= 1" {
+ error-app-tag "msea-svcs-must-04";
+ error-message "Priority 2 can be specified only once in the COS's related to a BWP Group";
+ }
+
+ must "count(//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:cos[msea-svcs:cos-index=//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:bwp-group[msea-svcs:group-index=current()/../../msea-svcs:group-index]/msea-svcs:bwp/msea-svcs:cos-index]/msea-svcs:*/priority[.='3']) <= 1" {
+ error-app-tag "msea-svcs-must-05";
+ error-message "Priority 3 can be specified only once in the COS's related to a BWP Group";
+ }
+
+ must "count(//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:cos[msea-svcs:cos-index=//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:bwp-group[msea-svcs:group-index=current()/../../msea-svcs:group-index]/msea-svcs:bwp/msea-svcs:cos-index]/msea-svcs:*/priority[.='4']) <= 1" {
+ error-app-tag "msea-svcs-must-06";
+ error-message "Priority 4 can be specified only once in the COS's related to a BWP Group";
+ }
+
+ must "count(//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:cos[msea-svcs:cos-index=//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:bwp-group[msea-svcs:group-index=current()/../../msea-svcs:group-index]/msea-svcs:bwp/msea-svcs:cos-index]/msea-svcs:*/priority[.='5']) <= 1" {
+ error-app-tag "msea-svcs-must-07";
+ error-message "Priority 5 can be specified only once in the COS's related to a BWP Group";
+ }
+
+ must "count(//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:cos[msea-svcs:cos-index=//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:bwp-group[msea-svcs:group-index=current()/../../msea-svcs:group-index]/msea-svcs:bwp/msea-svcs:cos-index]/msea-svcs:*/priority[.='6']) <= 1" {
+ error-app-tag "msea-svcs-must-08";
+ error-message "Priority 6 can be specified only once in the COS's related to a BWP Group";
+ }
+
+ must "count(//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:cos[msea-svcs:cos-index=//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:bwp-group[msea-svcs:group-index=current()/../../msea-svcs:group-index]/msea-svcs:bwp/msea-svcs:cos-index]/msea-svcs:*/priority[.='7']) <= 1" {
+ error-app-tag "msea-svcs-must-09";
+ error-message "Priority 7 can be specified only once in the COS's related to a BWP Group";
+ }
+
+
+ must "count(//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:cos[msea-svcs:cos-index=//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:bwp-group[msea-svcs:group-index=current()/../../msea-svcs:group-index]/msea-svcs:bwp/msea-svcs:cos-index]/msea-svcs:evc-cos-type-all-8-prio-to-1-evc-color) <= 1" {
+ error-app-tag "msea-svcs-must-10";
+ error-message "Only one COS can be specified in a Bandwidth Profile Group when the cos-type is 'evc-cos-type-all-8-prio-to-1-evc-color' ";
+ }
+
+ must "count(//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:cos[msea-svcs:cos-index=//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:bwp-group[msea-svcs:group-index=current()/../../msea-svcs:group-index]/msea-svcs:bwp/msea-svcs:cos-index]/msea-svcs:evc-cos-type-all-8-prio-to-1-pcp-color) <= 1" {
+ error-app-tag "msea-svcs-must-11";
+ error-message "Only one COS can be specified in a Bandwidth Profile Group when the cos-type is 'evc-cos-type-all-8-prio-to-1-pcp-color' ";
+ }
+
+ must "count(//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:cos[msea-svcs:cos-index=//msea-svcs:mef-services/msea-svcs:profiles/msea-svcs:bwp-group[msea-svcs:group-index=current()/../../msea-svcs:group-index]/msea-svcs:bwp/msea-svcs:cos-index]/msea-svcs:evc-cos-type-all-8-prio-to-1-dei-color) <= 1" {
+ error-app-tag "msea-svcs-must-12";
+ error-message "Only one COS can be specified in a Bandwidth Profile Group when the cos-type is 'evc-cos-type-all-8-prio-to-1-dei-color' ";
+ }
+
+ must "current()/../../msea-svcs:group-index > 0" {
+ error-app-tag "msea-svcs-must-15";
+ error-message "No BWP's can be added to the Bandwidth Profile Group 0, as this index represents a special case";
+ }
+ }
+
+ leaf name { //mefServiceBwpCfgIdentifier
+ type string {
+ length "1..45";
+ }
+ mandatory true;
+ description
+ "This object indicates the bandwidth profile identifier for the
+ associated bandwidth profile index and is an arbitrary
+ text string that is used to identify a bandwidth profile. Unique
+ string values are chosen to uniquely identify the bandwidth
+ profile.
+
+ Octet values of 0x00 through 0x1f are illegal.
+
+ MEF 26.1 restricts the maximum size identifiers to 45 octets.";
+ reference
+ "[MEF 6.1] 6.0, 6.1, 6.2, 6.3; [MEF 7.2] 6.2.1.2, 6.2.1.3";
+ }
+
+ leaf committed-information-rate { //aka mefServiceBwpCfgCir
+ type uint32 {
+ range "0..10000000";
+ }
+ units "kbits/s";
+ default 1000000;
+// msea:not-changeable;
+
+ description
+ "This object indicates the Committed Information Rate (CIR) in kbits/s
+ and defines the average rate in kbits/sec up to which
+ the network delivers Service Frames. Service Frames that meet
+ the CIR are said to be in profile or in conformance to performance
+ objectives. These frames are generally identified as 'Green'
+ Service Frames.";
+ reference
+ "[MEF 6.1] 6.0, 6.1, 6.2, 6.3; [MEF 7.2] 6.2.1.2, 6.2.1.3";
+ }
+
+ leaf committed-burst-size { //aka mefServiceBwpCfgCbs
+ type uint32 {
+ range "0..10000000";
+ }
+ units "bytes";
+ default 12;
+// msea:not-changeable;
+
+ description
+ "This object indicates the Committed Burst Size (CBS) in bytes. It limits
+ the maximum number of bytes available for a burst of Service Frames sent
+ at interface speed to remain CIR-conformant.";
+ reference
+ "[MEF 10.2]";
+ }
+
+ leaf excess-information-rate { //aka mefServiceBwpCfgEir
+ type uint32 {
+ range "0..10000000";
+ }
+ units "kbits/s";
+// msea:not-changeable;
+
+ description
+ "This object indicates the Excess Information Rate (EIR) in kbits/s
+ and defines the average rate in kbits/sec of Service Frames up to
+ which the network may deliver Service Frames but without performance
+ objectives. Service Frames that meet the EIR as set to be in out-of-
+ profile or not in conformance to performance objectives. These
+ frames are not guaranteed to be delivered and are generally identified
+ as 'Yellow' service frames.";
+ reference
+ "[MEF 6.1] 6.0, 6.1, 6.2, 6.3; [MEF 7.2] 6.2.1.2, 6.2.1.3";
+ }
+
+ leaf excess-burst-size { //aka mefServiceBwpCfgEbs
+ type uint32 {
+ range "0..10000000";
+ }
+ units "bytes";
+// msea:not-changeable;
+
+ description
+ "This object indicates the Excess Burst Size (EBS) in bytes. It limits
+ the maximum number of bytes available for a burst of Service Frames
+ sent at the interface speed to remain EIR-conformant.";
+ reference
+ "[MEF 6.1] 6.0, 6.1, 6.2, 6.3; [MEF 7.2] 6.2.1.2, 6.2.1.3";
+ }
+
+ leaf color-mode { //aka mefServiceBwpCfgCm
+ type enumeration {
+ enum colorBlind {description "A bandwidth profile property where ingress
+ Service Frames are not pre-colored for either
+ green or yellow, and if present, is ignored when
+ determining the level of compliance for each
+ Service Frame";
+ }
+
+ enum colorAware {
+ description "A bandwidth profile property were a pre-determined
+ level of Bandwidth Profile compliance for each
+ Service Frame is taken into account when determining
+ the level of compliance for each Service Frame.
+ Each service frame can be colored red (discarded),
+ yellow (conditional delivery), or green (unconditional
+ delivery.";
+ }
+ }
+ default colorBlind;
+// msea:not-changeable;
+
+ description
+ "This object configures the bandwidth profile color mode.";
+
+ reference
+ "[MEF 6.1] 6.0, 6.1, 6.2, 6.3; [MEF 7.2] 6.2.1.2, 6.2.1.3";
+ }
+
+ leaf coupling-flag { //aka mefServiceBwpCfgCf
+ type enumeration {
+ enum couplingYellowEirOnly {
+ description "The long term average bit rate of Service
+ Frames that are declared Yellow is bounded by EIR.";
+ }
+
+ enum couplingYellowEirPlusCir {
+ description "The long term average bit rate of Service
+ Frames that are declared Yellow is bounded
+ by CIR + EIR depending on the volume of
+ the offered Service Frames that are
+ declared Green.";
+ }
+ }
+
+ default couplingYellowEirOnly;
+// msea:not-changeable;
+
+ description
+ "This object configures the bandwidth profile coupling flag and has
+ the effect of controlling the volume of the Service Frames that are
+ declared Yellow.";
+
+ reference
+ "[MEF 6.1] 6.0, 6.1, 6.2, 6.3; [MEF 7.2] 6.2.1.2, 6.2.1.3";
+ }
+
+ } //End bwp
+
+ } //End bwp-group
+
+ list cos { //aka mefServiceCosCfgEntry
+ key "cos-index";
+ unique name;
+ max-elements 64;
+ description
+ "Class of Service Identifier settings table entry.";
+
+ leaf cos-index { //aka mefServiceCosCfgIndex
+ type uint32 {
+ range 1..max;
+ }
+ description
+ "Class of Service Identifier profile index number.";
+ }
+
+ leaf name { //aka mefServiceCosCfgIdentifier
+ type string {
+ length 1..45;
+ }
+
+ description
+ "This object indicates the Class of Service Name for the
+ associated CoS profile index and is an arbitrary text string that is
+ used to identify a CoS ID profile. Unique string values are chosen to
+ uniquely identify the profile.
+
+ Octet values of 0x00 through 0x1f are illegal.
+
+ MEF 26.1 restricts the maximum size identifiers to 45 octets.";
+ reference
+ "[MEF 6.1] 6.0, 6.1, 6.2, 6.3; [MEF 7.2] 6.2.1.2, 6.2.1.3";
+ }
+
+ choice cos-type-choice {
+ description "CoS configuration alternatives.";
+ //We have 6 choices in a single tier choice structure which is easier for client
+ //tools to represent automatically rather than a two tier choice structure
+
+ case evc-cos-type-evc-color-id {
+ container evc-cos-type-all-8-prio-to-1-evc-color {
+ description "Indicates that the CoS profile is associated
+ with the virtual channel, i.e. EVC or OVC. All 8 priorities
+ are mapped to the outgoing-cos-value - therefore there can
+ only be one of this type of COS specified in any BWP Group";
+
+ leaf evc-all-8-color-to {
+ description "The color to be applied regardless of priority";
+ mandatory true;
+ type msea:cos-color-type;
+ }
+ }
+ }
+
+ case evc-cos-type-pcp-color-id {
+
+ container evc-cos-type-all-8-prio-to-1-pcp-color {
+ description "Indicates that the CoS profile is associated
+ with the virtual channel, i.e. EVC or OVC. All 8 priorities
+ are mapped to the outgoing-cos-value - therefore there can
+ only be one of this type of COS specified in any BWP Group";
+
+ list pcp-color-per-prio {
+ key pcp-id;
+ description "The PCP value of the incoming frame is
+ used to lookup the following table to determine the
+ frame's color";
+
+ min-elements 8;
+ max-elements 8;
+ uses pcp-color-map-grouping;
+ }
+ }
+ }
+
+ case evc-cos-type-dei-color-id {
+ container evc-cos-type-all-8-prio-to-1-dei-color {
+ presence "Cos type EVC and Color Mapping DEI";
+
+ description "Indicates that the CoS profile is associated
+ with the virtual channel, i.e. EVC or OVC. All 8 priorities
+ are mapped to the outgoing-cos-value - therefore there can
+ only be one of this type of COS specified in any BWP Group
+ The source of the color is DEI of the
+ incoming frame. False (0) in the DEI field will set
+ the color to Green and True (1) will set to Yellow";
+
+ }
+ }
+
+ case pcp-cos-type-evc-color-id {
+ container pcp-cos-type-n-prio-to-1-evc-color {
+ description "Indicates that the CoS profile is associated
+ with the incoming frame's Priority Code Point (priority bits).";
+
+ leaf-list priority {
+ type msea:priority-type;
+ ordered-by system;
+
+ description "A list of priorities that apply to this COS.
+ When the COS type is PCP a subset of the priorities can
+ be specified. Other priorities can be specified in
+ additional COS profiles. In total the same priority
+ cannot be repeated in a BWP Group";
+
+ min-elements 1;
+ max-elements 8;
+ }
+
+ leaf evc-all-8-colors-to {
+ description "The color to be applied regardless
+ of priority. If multiple instances of this cos
+ type have different values then the color-type
+ of the last one will apply";
+
+ type msea:cos-color-type;
+ mandatory true;
+ }
+ }
+ }
+
+ case pcp-cos-type-pcp-color-id {
+ container pcp-cos-type-n-prio-to-1-pcp-color {
+ description "Indicates that the CoS profile is associated
+ with the incoming frame's Priority Code Point (priority bits).
+ The PCP value of the incoming frame is used to lookup the
+ follwing table to determine the frame's color";
+
+ leaf-list priority {
+ type msea:priority-type;
+ min-elements 1;
+ max-elements 8;
+ ordered-by system;
+
+ description "A list of priorities that apply to this COS.
+ When the COS type is PCP a subset of the priorities can
+ be specified. Other priorities can be specified in
+ additional COS profiles. In total the same priority
+ cannot be repeated in a BWP Group";
+ }
+
+ list pcp-color-for-prio {
+ key pcp-id;
+ description "Each priority specified above must
+ have a corresponding color otherwise the default
+ (green) will apply";
+
+ min-elements 1;
+ ordered-by system;
+
+ uses pcp-color-map-grouping {
+ refine pcp-id {
+ must "count(current()/../../msea-svcs:priority[.=current()]) = 1" {
+ error-message "Each element must already exist in the priority list";
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ case pcp-cos-type-dei-color-id {
+ container pcp-cos-type-n-prio-to-1-dei-color {
+ description "Indicates that the CoS profile is associated
+ with the incoming frame's Priority Code Point (priority bits).
+ The DEI value of the incoming frame is used to determine
+ the frame's color. False (0) in the DEI field of the frame
+ will set the color to Green and True (1) will set to Yellow";
+
+ leaf-list priority {
+ type msea:priority-type;
+ min-elements 1;
+ max-elements 8;
+ ordered-by system;
+
+ description "A list of priorities that apply to this COS.
+ When the COS type is PCP a subset of the priorities can
+ be specified. Other priorities can be specified in
+ additional COS profiles. In total the same priority
+ cannot be repeated in a BWP Group";
+ }
+ }
+ }
+
+ mandatory true;
+// msea:not-changeable;
+ }
+
+ leaf outgoing-cos-value {
+ type msea:priority-type;
+ mandatory true;
+// msea:not-changeable;
+
+ description
+ "Used to set the egress COS to use for all ingress COS explicitly listed";
+ reference
+ "Edge Assure internal API";
+ }
+
+ leaf color-aware {
+ type boolean;
+ mandatory true;
+// msea:not-changeable;
+
+ description
+ "Set if the profile should be treated as colour aware (true) or not (false)";
+ reference
+ "Edge Assure internal API";
+ }
+
+ leaf color-forward {
+ type boolean;
+ mandatory true;
+// msea:not-changeable;
+
+ description
+ "Used to override the colour mapping of the profile. If true the ingress colour is forwarded";
+ reference
+ "Edge Assure internal API";
+ }
+
+ } //End cos
+
+
+ } //End of profiles
+
+ } //End of mef-services
+
+} /* end of module msea-uni-evc-service */
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/nc-notifications.yang b/drivers/microsemi/ea1000yang/src/main/yang/nc-notifications.yang
new file mode 100644
index 0000000..5636aeb
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/nc-notifications.yang
@@ -0,0 +1,95 @@
+module nc-notifications {
+
+ namespace "urn:ietf:params:xml:ns:netmod:notification";
+ prefix "manageEvent";
+
+ import ietf-yang-types{ prefix yang; }
+ import notifications { prefix ncEvent; }
+
+ organization
+ "IETF NETCONF WG";
+
+ contact
+ "netconf@ietf.org";
+
+ description
+ "Conversion of the 'manageEvent' XSD in the NETCONF
+ Notifications RFC.";
+
+ reference
+ "RFC 5277";
+
+ revision 2008-07-14 {
+ description "RFC 5277 version.";
+ }
+
+ container netconf {
+ description "Top-level element in the notification namespace";
+
+ config false;
+
+ container streams {
+ description
+ "The list of event streams supported by the system. When
+ a query is issued, the returned set of streams is
+ determined based on user privileges.";
+
+ list stream {
+ description
+ "Stream name, description and other information.";
+ key name;
+ min-elements 1;
+
+ leaf name {
+ description
+ "The name of the event stream. If this is the default
+ NETCONF stream, this must have the value 'NETCONF'.";
+ type ncEvent:streamNameType;
+ }
+
+ leaf description {
+ description
+ "A description of the event stream, including such
+ information as the type of events that are sent over
+ this stream.";
+ type string;
+ mandatory true;
+ }
+
+ leaf replaySupport {
+ description
+ "A description of the event stream, including such
+ information as the type of events that are sent over
+ this stream.";
+ type boolean;
+ mandatory true;
+ }
+
+ leaf replayLogCreationTime {
+ description
+ "The timestamp of the creation of the log used to support
+ the replay function on this stream. Note that this might
+ be earlier then the earliest available notification in
+ the log. This object is updated if the log resets for
+ some reason. This object MUST be present if replay is
+ supported.";
+ type yang:date-and-time; // xsd:dateTime is wrong!
+ }
+ }
+ }
+ }
+
+ notification replayComplete {
+ description
+ "This notification is sent to signal the end of a replay
+ portion of a subscription.";
+ }
+
+ notification notificationComplete {
+ description
+ "This notification is sent to signal the end of a notification
+ subscription. It is sent in the case that stopTime was
+ specified during the creation of the subscription..";
+ }
+
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/netopeer-cfgnetopeer.yang b/drivers/microsemi/ea1000yang/src/main/yang/netopeer-cfgnetopeer.yang
new file mode 100644
index 0000000..79f1566
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/netopeer-cfgnetopeer.yang
@@ -0,0 +1,72 @@
+module netopeer-cfgnetopeer {
+ namespace "urn:cesnet:tmc:netopeer:1.0";
+ prefix cfgnetopeer;
+
+ organization "CESNET, z.s.p.o.";
+ contact
+ "dkupka@cesnet.cz";
+ description
+ "Module specifying Netopeer module data model and RPC operation.";
+
+ revision 2013-02-14 {
+ description
+ "Modules are now configurable. Except implemented-rpcs which depends on module data model.";
+ }
+ revision 2012-11-13 {
+ description
+ "Removed parts implemented by library (RFC6022).";
+ }
+ revision 2011-10-20 {
+ description
+ "Initial revision";
+ }
+
+ container netopeer {
+ container modules {
+ list module {
+ key "name";
+ leaf name {
+ type string;
+ description
+ "Name of module";
+ }
+ leaf enabled {
+ type boolean;
+ default false;
+ description
+ "Specify whether or not the module is allowed to be managed over server.";
+ }
+ }
+ }
+ }
+ rpc netopeer-reboot {
+ description
+ "Operation allowing privileged user to restart netopeer-server.";
+ input {
+ leaf type {
+ type enumeration {
+ enum "soft";
+ enum "hard";
+ }
+ default "soft";
+ description
+ "Soft restart only unplugs all device modules and reloads configuration.
+ Hard restart also abort all connections and reload the binary.";
+ }
+ }
+ }
+ rpc reload-module {
+ description
+ "Unload and load any loaded module." ;
+ input {
+ leaf module {
+ type leafref {
+ path "/netopeer/modules/module/name";
+ }
+ mandatory true;
+ description
+ "Name of module to reload.";
+ }
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/notifications.yang b/drivers/microsemi/ea1000yang/src/main/yang/notifications.yang
new file mode 100644
index 0000000..1ae9cc2
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/notifications.yang
@@ -0,0 +1,95 @@
+module notifications {
+
+ namespace "urn:ietf:params:xml:ns:netconf:notification:1.0";
+ prefix "ncEvent";
+
+ import ietf-yang-types { prefix yang; }
+
+ organization
+ "IETF NETCONF WG";
+
+ contact
+ "netconf@ops.ietf.org";
+
+ description
+ "Conversion of the 'ncEvent' XSD in the
+ NETCONF Notifications RFC.";
+
+ reference
+ "RFC 5277.";
+
+ revision 2008-07-14 {
+ description "RFC 5277 version.";
+ }
+
+ typedef streamNameType {
+ description
+ "The name of an event stream.";
+ type string;
+ }
+
+ rpc create-subscription {
+ description
+ "The command to create a notification subscription. It
+ takes as argument the name of the notification stream
+ and filter. Both of those options limit the content of
+ the subscription. In addition, there are two time-related
+ parameters, startTime and stopTime, which can be used to
+ select the time interval of interest to the notification
+ replay feature.";
+
+ input {
+ leaf stream {
+ description
+ "An optional parameter that indicates which stream of events
+ is of interest. If not present, then events in the default
+ NETCONF stream will be sent.";
+ type streamNameType;
+ default "NETCONF";
+ }
+
+ anyxml filter {
+ description
+ "An optional parameter that indicates which subset of all
+ possible events is of interest. The format of this
+ parameter is the same as that of the filter parameter
+ in the NETCONF protocol operations. If not present,
+ all events not precluded by other parameters will
+ be sent.";
+ }
+
+ leaf startTime {
+ description
+ "A parameter used to trigger the replay feature and
+ indicates that the replay should start at the time
+ specified. If start time is not present, this is not a
+ replay subscription.";
+ type yang:date-and-time;
+ }
+
+ leaf stopTime {
+ // must ". >= ../startTime";
+ description
+ "An optional parameter used with the optional replay
+ feature to indicate the newest notifications of
+ interest. If stop time is not present, the notifications
+ will continue until the subscription is terminated.
+ Must be used with startTime.";
+ type yang:date-and-time;
+ }
+ }
+ }
+
+ container notification {
+ description "internal struct to start a notification";
+ config false;
+
+ leaf eventTime {
+ mandatory true;
+ type yang:date-and-time;
+ }
+
+ // eventType and any data content goes here
+ }
+}
+
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/rfc-2544.yang b/drivers/microsemi/ea1000yang/src/main/yang/rfc-2544.yang
new file mode 100644
index 0000000..fb1a7c0
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/rfc-2544.yang
@@ -0,0 +1,509 @@
+module rfc-2544 {
+
+ /*** NAMESPACE / PREFIX DEFINITION ***/
+
+ namespace "http://www.microsemi.com/rfc2544";
+ prefix "rfc2544";
+
+ import svc-activation-types {
+ prefix sa;
+ }
+
+ import msea-types {
+ prefix msea;
+ revision-date 2016-02-29;
+ }
+
+ /*** 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 defines the interface for RFC 2544 Benchmarking Methodology for Network Interconnect Devices
+
+ Copyright 2015 Microsemi Inc.
+ All rights reserved.";
+
+ revision "2015-10-20" {
+ description
+ "Initial version - Sean Condon, Microsemi";
+ }
+
+ /*
+ * Typedefs
+ */
+
+
+ /*
+ * Groupings
+ */
+ grouping frame-size-group {
+
+ description "Frame sizes to use in the test";
+
+ leaf-list frame-size {
+ type sa:frame-size-type;
+ max-elements 8;
+ units "byte";
+ ordered-by user;
+ description "A range of frame sizes to use. 512 bytes will be used if nothing is specified";
+ }
+
+ reference "RFC 2544 Section 9
+ All of the described tests SHOULD be performed at a number of frame
+ sizes. Specifically, the sizes SHOULD include the maximum and minimum
+ legitimate sizes for the protocol under test on the media under test
+ and enough sizes in between to be able to get a full characterization
+ of the DUT performance. Except where noted, at least five frame
+ sizes SHOULD be tested for each test condition.";
+ }
+
+ grouping throughput-group {
+ description
+ "Configuration parameters for throughput test.";
+
+ leaf step-size {
+ type uint8 {
+ range 1..10|20|25|30|40|50|100;
+ }
+ must "current() <= ((../max-rate) - (../min-rate))" {
+ error-app-tag "msea-2544-must-1";
+ error-message "step-size must be less than or equal to the difference between min- and max-rate";
+ }
+ units "Mb/s";
+ default 10;
+ description "The throughput rate step size from 1Mb/s to 1,000Mb/s (1 Gbps)";
+ }
+
+ leaf min-rate {
+ type uint16 {
+ range 1..999;
+ }
+ must "current() < ../max-rate" {
+ error-app-tag "msea-2544-must-2";
+ error-message "min-rate must not equal or exceed max-rate";
+ }
+ units "Mb/s";
+ default 10;
+ description "The minimum throughput rate from 1Mb/s to 1,000Mb/s (1Gbps)
+ The test starts at the max-rate and reduces by step-size on each
+ iteration until it drops below min-rate. For example with
+ max-rate=10, step-size=2 and min-rate=1, tests will be
+ performed at 10,8,6,4 and 2 Mb/s";
+ }
+
+ leaf max-rate {
+ type uint16 {
+ range 2..1000;
+ }
+ units "Mb/s";
+ default 1000;
+ description "The maximum throughput rate from 1Mb/s to 1,000Mb/s (1Gbps)";
+ }
+
+ leaf trial-duration {
+ type uint32 {
+ range 1..max;
+ }
+ default 60;
+ units "s";
+ description "Trial duration";
+ reference "RFC 2544 Section 24
+ The duration of the test portion of each trial SHOULD be
+ at least 60 seconds.";
+ }
+ }
+
+ grouping afl-group {
+ description
+ "Extra configuration parameters for throughput and latency test.";
+
+ leaf accepted-frame-loss {
+ type uint32 {
+ range min..100000;
+ }
+ units "m%";
+ default 0;
+ description "The acceptable Frame Loss ratio in units of 0.001%";
+ }
+ }
+
+ grouping result-common-group {
+ description
+ "Common attributes of by-frame-size result set.";
+
+ leaf test-status {
+ type sa:test-status;
+ mandatory true;
+ description "The current status of the subset of tests";
+ }
+
+ leaf frame-size {
+ type sa:frame-size-type;
+ units "bytes";
+ description "The frame size used";
+ }
+
+ leaf elapsed-time {
+ type uint16;
+ units "s";
+ description "The number of seconds the test has been running";
+ }
+ }
+
+ /*
+ * Features
+ */
+ feature throughput {
+ description
+ "This feature indicates that the device supports throughput tests";
+ reference
+ "RFC 2544: Section 26.1";
+ }
+
+ feature latency {
+ description
+ "This feature indicates that the device supports Latency tests";
+ reference
+ "RFC 2544: Section 26.2";
+ }
+
+ feature frame-loss-rate {
+ description
+ "This feature indicates that the device supports Frame Loss Rate tests";
+ reference
+ "RFC 2544: Section 26.3";
+ }
+
+ feature back-to-back {
+ description
+ "This feature indicates that the device supports Back-to-Back (burst mode) tests";
+ reference
+ "RFC 2544: Section 26.4";
+ }
+
+ container rfc2544-test {
+ description
+ "A configured set of parameters for an RFC 2544 test";
+
+ container mep-config {
+ presence "Presence indicates that a MEP has been configured";
+
+ uses msea:mep-config-attribs-noref;
+
+ leaf remote-mep-id {
+ type msea:mep-id-type;
+ must "current()/../maintenance-association-end-point != current()" {
+ error-message "Remote MEP Id must not be the same as Local MEP Id";
+ error-app-tag "msea-svc-must-01";
+ }
+
+ //mandatory true; //Should not be mandatory in a top level container
+ description "The Id of the remote MEP";
+ }
+
+ container overwrite-pcp {
+ presence "Enables PCP Overwrite";
+ description "If present allows attributes to be
+ specified for the PCP overwrite";
+
+ uses sa:overwrite-pcp-attribs;
+
+ leaf overwrite-drop-eligible {
+ type boolean;
+ default false;
+ description
+ "The Drop Eligible flag in the MEP's TAG is replaced
+ with this value if overwrite-pcp is present.";
+ }
+ }
+ }
+
+ leaf binary-search-step-duration {
+ type uint16 {
+ range 1..10;
+ }
+ default 2;
+ units "s";
+ description
+ "The time in seconds for each step in the Throughput binary search. Range 1 to 10, default 2.";
+ reference "RFC 2544 Section 24";
+ }
+
+
+ container throughput {
+ if-feature throughput;
+ description "Configuration parameters for the Throughput part of the test";
+
+ uses throughput-group;
+ uses frame-size-group;
+ uses afl-group;
+ }
+
+ container latency {
+ if-feature latency;
+ description "Configuration parameters for the Latency part of the test";
+
+ uses throughput-group {
+ refine trial-duration {
+ default 120;
+ }
+ }
+ uses frame-size-group;
+ uses afl-group;
+ }
+
+ container frame-loss {
+ if-feature frame-loss-rate;
+ description "Configuration parameters for the Frame Loss part of the test";
+
+ uses throughput-group;
+ uses frame-size-group;
+ }
+
+ container back-to-back {
+ if-feature back-to-back;
+ description "Configuration parameters for the Back-to-Back part of the test";
+
+ leaf trial-duration {
+ type uint32 {
+ range 1..10000;
+ }
+ units "ms";
+ default 2000;
+ description "The duration of the Back-to-Back test in milliseconds";
+ }
+
+ leaf iterations {
+ type uint16 {
+ range 1..max;
+ }
+ default 50;
+ description "The number of times to run the test";
+ }
+
+ uses frame-size-group;
+ }
+ }
+
+ container rfc2544-result {
+ config false;
+
+ description "A collection of the results from the RFC 2544 tests";
+
+ container throughput {
+ if-feature throughput;
+
+ description "Results for the Throughput test";
+
+ uses sa:results-header-group;
+
+ list result-item {
+ key frame-size;
+
+ description "The list of results by frame size";
+
+ reference "RFC 2544: Section 26.1";
+
+ uses result-common-group;
+
+ leaf frame-rate {
+ type uint32;
+ units "Mb/s";
+ description "The throughput rate achieved for this packet size";
+ }
+ }
+ }
+
+ container latency {
+ if-feature latency;
+
+ description "Results for the Latency test";
+
+ uses sa:results-header-group;
+
+ list result-item {
+ key frame-size;
+
+ uses result-common-group;
+
+ leaf frame-rate {
+ type uint32;
+ units "Mb/s";
+ description "The throughput rate achieved for this frame size";
+ }
+
+ leaf frame-delay-min {
+ type uint32;
+ units "μs";
+ description "The Minimum Frame Delay measured at the throughput rate";
+ }
+
+ leaf frame-delay-max {
+ type uint32;
+ units "μs";
+ description "The Maximum Frame Delay measured at the throughput rate";
+ }
+
+ leaf frame-delay-avg {
+ type uint32;
+ units "μs";
+ description "The Average Frame Delay measured at the throughput rate";
+ }
+
+ leaf frame-delay-var-min {
+ type uint32;
+ units "μs";
+ description "The Minimum Frame Delay Variation measured at the throughput rate";
+ }
+
+ leaf frame-delay-var-max {
+ type uint32;
+ units "μs";
+ description "The Maximum Frame Delay Variation measured at the throughput rate";
+ }
+
+ leaf frame-delay-var-avg {
+ type uint32;
+ units "μs";
+ description "The Average Frame Delay Variation measured at the throughput rate";
+ }
+ }
+ }
+
+ container frame-loss {
+ if-feature frame-loss-rate;
+
+ description "Results for the Frame Loss test";
+ reference "RFC-2544 Section 26.3";
+
+ uses sa:results-header-group;
+
+ list result-item {
+ key frame-size;
+
+ description "The frame-loss result set for this frame-size";
+
+ uses result-common-group;
+
+ leaf frame-steps {
+ type uint8;
+ description "The number of steps recorded during Frame Loss test. Maximum is 8";
+ }
+
+ list frame-rate {
+ key rate;
+ description "A list of the losses at each rate step. This shows up to the 8 most recent steps";
+
+ leaf rate {
+ type uint32;
+ units "Mb/s";
+ description "The test rate used for this step";
+ }
+
+ leaf frame-loss {
+ type uint32;
+ units "m%";
+ description "The percentage frames lost for this rate step (in 0.001% units)";
+ }
+ }
+ }
+ }
+
+ container back-to-back {
+ if-feature back-to-back;
+
+ description "Results for the Back-to-Back (burst mode) test";
+
+ uses sa:results-header-group;
+
+ list result-item {
+ key frame-size;
+
+ leaf test-status {
+ type sa:test-status;
+ mandatory true;
+ description "The current status of the subset of tests";
+ }
+
+ leaf frame-size {
+ type sa:frame-size-type;
+ units "bytes";
+ description "The frame size used";
+ }
+
+ leaf burst-duration {
+ type uint16;
+ units "ms";
+ description "The duration of the burst in milliseconds";
+ }
+
+ leaf average-burst-frame-count {
+ type uint32;
+ description "An average of the count of received frames for the test for this frame size";
+ }
+ }
+
+ }
+
+ }
+
+
+
+ rpc run-rfc2544-test {
+
+ description
+ "Run the configured RFC 2544 test";
+
+ input {
+ leaf tests-enabled {
+ type bits {
+ bit throughput;
+ bit latency;
+ bit frameLoss;
+ bit backToBack;
+ }
+ default "throughput latency frameLoss backToBack";
+ description "Choose the test components to run - by default all are selected";
+ }
+
+
+ leaf send-subtest-event {
+ type boolean;
+ default true;
+ description "If true then send events for all of the state changes of tests at the 'frame size' level.
+ If false events are sent only for state changes in the top level tests e.g. throughput";
+ }
+ }
+ }
+
+ rpc stop-rfc2544-test {
+ description
+ "Stop the running RFC 2544 test";
+ }
+
+ notification rfc2544-test-updated {
+ description
+ "A rfc2544-test-updated notification is sent when the state of a test changes.";
+
+ uses sa:notification-group;
+
+ leaf frame-size {
+ type sa:frame-size-type;
+ units "bytes";
+ description "The frame size that is being tested. If not present then
+ the notification pertains to the overall test type";
+ }
+ }
+}
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/svc-activation-types.yang b/drivers/microsemi/ea1000yang/src/main/yang/svc-activation-types.yang
new file mode 100644
index 0000000..f82227b
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/svc-activation-types.yang
@@ -0,0 +1,190 @@
+module svc-activation-types {
+
+ /*** NAMESPACE / PREFIX DEFINITION ***/
+
+ namespace "http://www.microsemi.com/svc-activation-types";
+ prefix "sa";
+
+ import ietf-yang-types {
+ prefix yang;
+ revision-date 2013-07-15;
+ }
+
+ import msea-types {
+ prefix msea;
+ revision-date 2016-02-29;
+ }
+
+ import msea-cfm {
+ prefix msea-cfm;
+ revision-date 2016-02-29;
+ }
+ /*** 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 defines common types that
+ are used in both RFC 2544 and ITU-T Y.1564
+
+ Copyright 2015 Microsemi Inc.
+ All rights reserved.";
+
+ revision "2015-10-27" {
+ description
+ "Initial version - Sean Condon, Microsemi";
+ reference "Initial revision";
+ }
+
+ /*
+ * Typedefs
+ */
+ typedef test-status {
+ type enumeration {
+ enum disabled {
+ value 0;
+ description "Test is disabled";
+ }
+ enum running {
+ value 1;
+ description "Test is running";
+ }
+ enum pending {
+ value 2;
+ description "Test is pending";
+ }
+ enum stopped {
+ value 3;
+ description "Test is stopped";
+ }
+ enum completed {
+ value 4;
+ description "Test is completed";
+ }
+ enum failed {
+ value 5;
+ description "Test is failed";
+ }
+ }
+ description "Enumerated values for the status of a test";
+ }
+
+ typedef frame-size-type {
+ type uint16 {
+ range 64..9600;
+ }
+ description "Frame size in bytes data type";
+ }
+
+ grouping mep-config-attribs {
+ description
+ "Attributes related to the configuration of a MEP";
+
+ leaf maintenance-domain {
+ type leafref {
+ path "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain/msea-cfm:id";
+// msea:xref-module "msea-cfm";
+ }
+ description
+ "A reference to a specific Maintenance Domain.";
+ }
+
+ leaf maintenance-association {
+ type leafref {
+ path "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id=current()/../maintenance-domain]/msea-cfm:maintenance-association/msea-cfm:id";
+// msea:xref-module "msea-cfm";
+ }
+ description
+ "A reference to a specific Maintenance Association.";
+ }
+
+ leaf maintenance-association-end-point {
+ type leafref {
+ path "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id=current()/../maintenance-domain]/msea-cfm:maintenance-association[msea-cfm:id=current()/../maintenance-association]/msea-cfm:maintenance-association-end-point/msea-cfm:mep-identifier";
+// msea:xref-module "msea-cfm";
+ }
+ description
+ "A reference to a specific Maintenance association End Point.";
+ }
+
+
+ leaf remote-mep-id {
+ type leafref {
+ path "/msea-cfm:mef-cfm/msea-cfm:maintenance-domain[msea-cfm:id=current()/../maintenance-domain]/msea-cfm:maintenance-association[msea-cfm:id=current()/../maintenance-association]/msea-cfm:remote-meps";
+// msea:xref-module "msea-cfm";
+ }
+
+ must "current()/../maintenance-association-end-point != current()" {
+ error-message "Remote MEP Id must not be the same as Local MEP Id";
+ error-app-tag "msea-svc-must-01";
+ }
+
+ //mandatory true; //Should not be mandatory in a top level container
+ description "The Id of the remote MEP";
+ }
+ }
+
+ grouping overwrite-pcp-attribs {
+ leaf overwrite-priority {
+ type msea:priority-type;
+ default 0;
+ description
+ "The priority in the MEP's TAG is replaced
+ with this priority if overwrite-pcp is present";
+ }
+ }
+
+ grouping results-header-group {
+ description
+ "Common attributes of a result set.";
+
+ leaf start-time {
+ type yang:date-and-time;
+ mandatory true;
+ description "Time at which the test was started.";
+ }
+
+ leaf end-time {
+ type yang:date-and-time;
+ description "Time at which the test ended.
+ Not specified if test has ended.";
+ }
+
+ leaf test-status {
+ type test-status;
+ mandatory true;
+ description "The status of the test";
+ }
+ }
+
+ grouping notification-group {
+ description "Attributes related to notifications";
+ leaf new-status {
+ type sa:test-status;
+ mandatory true;
+ description "The new status of the test";
+ }
+
+ leaf old-status {
+ type sa:test-status;
+ description "The old status of the test";
+ }
+
+ leaf test-type {
+ type string;
+ mandatory true;
+ description "Name of the test currently being performed";
+ }
+ }
+}
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/main/yang/y-1564.yang b/drivers/microsemi/ea1000yang/src/main/yang/y-1564.yang
new file mode 100644
index 0000000..9f40ba8
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/main/yang/y-1564.yang
@@ -0,0 +1,667 @@
+module y-1564 {
+
+ /*** NAMESPACE / PREFIX DEFINITION ***/
+
+ namespace "http://www.microsemi.com/y1564";
+ prefix "y1564";
+
+ import svc-activation-types {
+ prefix sa;
+ }
+
+ import msea-types {
+ prefix msea;
+ revision-date 2016-02-29;
+ }
+
+ /*** 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 defines the interface for Rec. ITU-T Y.1564
+ (03/2011) Ethernet service activation test methodology
+
+ Copyright 2015 Microsemi Inc.
+ All rights reserved.";
+
+ revision "2015-10-29" {
+ description
+ "Initial version - Sean Condon, Microsemi
+ This version does not cover frame reordering (Section 7.2.5)";
+ reference "Initial implementation";
+ }
+
+ /*
+ * Typedefs
+ */
+
+ /*
+ * Groupings
+ */
+ grouping service-attributes-group {
+ description
+ "Attributes for service definition";
+ leaf service-id {
+ type uint8 {
+ range 1..8;
+ }
+ mandatory true;
+ description "The unique ID of the Service";
+ }
+ }
+ grouping result-attributes-group {
+ description "Common attributes in result";
+
+ leaf status {
+ type sa:test-status;
+ mandatory true;
+ description "Status of the test - Values are disabled,
+ running, pending, stopped, completed or failed";
+ }
+
+ }
+
+
+ grouping pass-fail-group {
+ leaf passed {
+ type boolean;
+ description
+ "Flag that indicates whether the test component
+ sucessfully met the test criteria.";
+ }
+
+ leaf fail-reason {
+ type enumeration {
+ enum notFailed {
+ value 0;
+ description "Test did not fail";
+ }
+ enum zeroTxCount {
+ value 1;
+ description "The test resulted in no transmitted packets";
+ }
+ enum zeroRxCount {
+ value 2;
+ description "No packets were received";
+ }
+ enum exceedFdvThreshold {
+ value 3;
+ description "The measured maximum Frame Delay Variation value exceeded the allowable threshold";
+ }
+ enum exceedFtdThreshold {
+ value 4;
+ description "The measured maximum Frame Transfer Delay value exceeded the allowable threshold";
+ }
+ enum exceedLossThreshold {
+ value 5;
+ description "The measured Frame Loss value exceeded the allowable threshold";
+ }
+ enum exceedAvailThreshold {
+ value 6;
+ description "The measured maximum Availability value exceeded the allowable threshold";
+ }
+ enum irAvgTooHigh {
+ value 7;
+ description "The measured Information Rate is above the maximum allowable rate";
+ }
+ enum irAvgTooLow {
+ value 8;
+ description "The measured Information Rate is below the maximum allowable rate";
+ }
+ enum targetUnknown {
+ value 9;
+ description "The MAC address of the target MEP was not known";
+ }
+ }
+ }
+ }
+
+ grouping y1564-test-result-group {
+ description "Common attributes in test result";
+ leaf tf {
+ type uint64;
+ description
+ "Count of the frames transmitted during the test period.";
+ }
+
+ leaf rf {
+ type uint64;
+ description
+ "Count of the frames received during the test period.";
+ }
+
+ leaf fl {
+ type uint64;
+ description
+ "Count of the frames lost during the test period.";
+ }
+
+ leaf flr {
+ type uint32;
+ units "m%";
+ description "The Frame Loss Ratio achieved. Units are 0.001%";
+ }
+
+ leaf elapsed {
+ type uint16;
+ units "s";
+ description
+ "The number of number of seconds the test has been running";
+ }
+
+ leaf fs {
+ type uint16;
+ units byte;
+ description "The Frame Size for which these results apply";
+ }
+
+ leaf ulr-min {
+ type uint32;
+ units "bit/s";
+ description "The minimum Utilised Line Rate achieved";
+ }
+
+ leaf ulr-max {
+ type uint32;
+ units "bit/s";
+ description "The maximum Utilised Line Rate achieved";
+ }
+
+ leaf ulr-avg {
+ type uint32;
+ units "bit/s";
+ description "The average Utilised Line Rate achieved";
+ }
+
+ leaf ulr-meas {
+ type uint32;
+ units "bit/s";
+ description
+ "The instantaneous Utilised Line Rate measured
+ at the time of this result set";
+ }
+
+ leaf ftd-min {
+ type uint32;
+ units "μs";
+ description "The minimum Frame Transfer Delay achieved";
+ }
+
+ leaf ftd-max {
+ type uint32;
+ units "μs";
+ description "The maximum Frame Transfer Delay achieved";
+ }
+
+ leaf ftd-avg {
+ type uint32;
+ units "μs";
+ description "The average Frame Transfer Delay achieved";
+ }
+
+ leaf ftd-meas {
+ type uint32;
+ units "μs";
+ description
+ "The instantaneous Frame Transfer Delay
+ measured at the time of this result set";
+ }
+
+ leaf fdv-min {
+ type uint32;
+ units "μs";
+ description "The minimum Frame Delay Variation achieved";
+ }
+
+ leaf fdv-max {
+ type uint32;
+ units "μs";
+ description "The maximum Frame Delay Variation achieved";
+ }
+
+ leaf fdv-avg {
+ type uint32;
+ units "μs";
+ description "The average Frame Delay Variation achieved";
+ }
+
+ leaf fdv-meas {
+ type uint32;
+ units "μs";
+ description
+ "The instantaneous Frame Delay Variation measured
+ at the time of this result set";
+ }
+ }
+
+
+
+ /*
+ * Features
+ */
+ feature emix {
+ description
+ "This feature indicates that the device supports
+ EMIX style of repeating frame rates patterns";
+ reference
+ "Rec. ITU-T Y.1564 (03/2011) Section 8.1.1";
+ }
+
+ /*
+ * Configuration
+ */
+ container y1564-test {
+ description "The overall configuration of the Y.1564
+ tests are done through the 'service' entities";
+
+ leaf config-step-duration {
+ type uint16 {
+ range 1..60;
+ }
+ units second;
+ default 60;
+ description "The duration of each step when
+ performing Configuration tests";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.3";
+ }
+
+ choice performance-duration-choice {
+ description
+ "Duration can be chosen from enumerated values or
+ specified as a duration in minutes";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.2.1";
+
+ case fixed-durations-renamed {
+ leaf performance-duration-fixed {
+ type enumeration {
+ enum Test15m {
+ value 15;
+ description "15 minute test duration";
+ }
+ enum Test2h {
+ value 120;
+ description "2 hour test duration";
+ }
+ enum Test24h {
+ value 1440;
+ description "24 hour test duration";
+ }
+ enum Unbounded {
+ description "Unbounded test duration";
+ }
+ }
+ default Test15m;
+ description "Fixed durations set";
+ }
+ }
+
+
+ case test-duration-minutes {
+ leaf performance-duration {
+ type uint16 {
+ range 1..max;
+ }
+ units min;
+ description
+ "The duration of Performance tests specified in minutes";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.2.1";
+ }
+ }
+ }
+
+ leaf performance-frame-size {
+ type sa:frame-size-type;
+ units octet;
+ default 512;
+ description
+ "The frame size used for the performance test.
+ Frame sizes for configuration are configured at a
+ the service level. This is a constant value per service (
+ frame size repeating emix values are not supported)";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.1.1";
+ }
+
+ list service-config {
+ key service-id;
+ description "The services can be configured on this device";
+
+ uses service-attributes-group;
+
+ leaf enabled {
+ type boolean;
+ default true;
+ description "Toggles whether the service is enabled in tests";
+ }
+
+
+ container mep-config {
+ presence "Presence indicates that a MEP has been configured";
+
+ uses msea:mep-config-attribs-noref;
+
+ leaf remote-mep-id {
+ type msea:mep-id-type;
+ must "current()/../maintenance-association-end-point != current()" {
+ error-message "Remote MEP Id must not be the same as Local MEP Id";
+ error-app-tag "msea-svc-must-01";
+ }
+
+ //mandatory true; //Should not be mandatory in a top level container
+ description "The Id of the remote MEP";
+ }
+
+ container overwrite-pcp {
+ presence "Enables PCP Overwrite";
+ description "If present allows attributes to be
+ specified for the PCP overwrite";
+
+ uses sa:overwrite-pcp-attribs;
+
+ }
+ }
+
+ leaf config-frame-size {
+ type sa:frame-size-type;
+ units octet;
+ default 512;
+ description
+ "The frame size used for the service configuration test.
+ Frame sizes for performance test is configured at a
+ higher level. This is a constant value per service (
+ frame size repeating emix values are not supported)";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.1.1";
+ }
+
+ leaf cir {
+ type uint16 {
+ range min..1000;
+ }
+ units "Mb/s";
+ default 1;
+ description "Committed Information Rate. If 0 then will return zeros";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.1";
+ }
+
+ leaf eir {
+ type uint16 {
+ range min..1000;
+ }
+ units "Mb/s";
+ description "Excess Information Rate. If 0 then this test is disabled";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.1";
+ }
+
+ leaf colour-aware {
+ type boolean;
+ default true;
+ description "Indicates if the service is colour aware or not";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 6.2.1";
+ }
+
+ leaf m-factor {
+ type uint16;
+ units "kb/s";
+ description "The M factor is added to allow for the effect of
+ the traffic policer's CBS and EBS settings, and test time.
+ Experience will determine the values for M.
+ Additional guidance on M is for further study.";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.1.2 C.2";
+ }
+
+ container enable-step-test {
+ presence "Enables step test";
+ description "If this item is present then a step load test of
+ CIR will be performed.
+ Otherwise simple validation of CIR will be performed.";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.1.2";
+
+ leaf step-load-size-override {
+ type uint16 {
+ range 1..1000;
+ }
+ units "Mb/s";
+ description "A manually specified Step Load size in Mb/s.
+ A maximum of 4 steps will be taken. If not specified
+ the default behaviour means the CIR rate divided by
+ 4 rounded up to nearest Mb/s. When CIR rate is below 4Mb/s
+ then a corresponding nuumber of steps will be used";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.1";
+ }
+ }
+
+ container enable-policing-test {
+ presence "Enables Policing test";
+ description "If this item is present then a Policing
+ test will be performed.
+ Otherwise no Policing will be performed.";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.1.2";
+ }
+
+ container service-acceptance-criteria {
+ description "Attributes that tune the Service Acceptance
+ Criteria per service.";
+
+ leaf accepted-flr {
+ type uint32 {
+ range min..100000;
+ }
+ units "m%";
+ description "A measured Frame Loss Ratio greater than
+ or equal to this value will result in test fail.
+ Units are 0.001%. Default is 0";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.3";
+ }
+
+ leaf accepted-ftd {
+ type uint32;
+ units "μs";
+ mandatory true;
+ description "A measured Frame Transfer Delay greater than
+ or equal to this value will result in test fail.";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.3";
+ }
+
+ leaf accepted-fdv {
+ type uint32;
+ units "μs";
+ mandatory true;
+ description "A measured Frame Delay Variation greater than
+ or equal to this value will result in test fail.";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.3";
+ }
+
+ leaf accepted-availability {
+ type uint32 {
+ range min..100000;
+ }
+ units "m%";
+ default 100000;
+ description "A measured Availability for a performance
+ test must meet or exceed this value. Values are in
+ milli-percent. Default is 100%";
+ }
+ }
+ }
+ }
+
+ container y1564-results {
+ config false;
+ description "Top level container for results from the tests";
+ container configuration {
+ description
+ "The results of the Y.1564 Configuration tests on each
+ service which was enabled when the test was run";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.1.3";
+
+ list service {
+ key service-id;
+ description "The results for the services configured on this device";
+
+ uses service-attributes-group;
+
+ uses sa:results-header-group;
+
+ container cir-results {
+ description "Results for Committed Information Rate
+ part of the test";
+
+ leaf steps {
+ type uint8;
+ description "Indicates the number if steps taken so far.";
+ }
+
+ list step {
+ key step-id;
+
+ description "A list of results for each of the steps for
+ the CIR test";
+
+ leaf step-id {
+ type uint8;
+ mandatory true;
+ description "The index of the step";
+ }
+
+ uses result-attributes-group;
+ uses pass-fail-group;
+
+ container green-frames {
+ uses y1564-test-result-group;
+ description "The details of frames marked green during
+ the step of the CIR test";
+ }
+ }
+
+ }
+
+ container eir-results {
+ description "Results for Excess Information Rate
+ part of the test";
+ uses result-attributes-group;
+ uses pass-fail-group;
+
+ container green-frames {
+ uses y1564-test-result-group;
+ description
+ "The details of frames marked green of the EIR test";
+ }
+
+ container yellow-frames {
+ uses y1564-test-result-group;
+ description
+ "The details of frames marked yellow of the EIR test";
+ }
+ }
+
+ container policer-results {
+ presence "Can be omitted if policer test is
+ not enabled on this service";
+ description "Container for the policer results";
+ uses result-attributes-group;
+ uses pass-fail-group;
+
+ container green-frames {
+ uses y1564-test-result-group;
+ description
+ "The details of frames marked green of the Policer test";
+ }
+
+ container yellow-frames {
+ uses y1564-test-result-group;
+ description
+ "The details of frames marked yellow of the Policer test";
+ }
+ }
+
+ }
+ }
+
+ container performance {
+ description
+ "The results of the Y.1564 Performance tests on each
+ service was 'enabled'";
+ reference "Rec. ITU-T Y.1564 (03/2011) Section 8.2.2";
+
+ uses sa:results-header-group;
+
+ list service {
+ key service-id;
+ description "The services can be configured on this device";
+
+ uses service-attributes-group;
+
+ uses pass-fail-group;
+
+ uses y1564-test-result-group;
+
+ leaf avail-sec {
+ type uint32;
+ units "s";
+ description
+ "The count of seconds during the test period for which
+ service was Available";
+ }
+ }
+ }
+ }
+
+ /*
+ * RPCs
+ */
+ rpc run-y1564-test {
+ description
+ "Run the configured Y.1564 test on each service
+ that has been marked 'enabled'";
+
+ input {
+ leaf tests-enabled {
+ type bits {
+ bit configuration {
+ description "Runs the configuration tests";
+ }
+ bit performance {
+ description "Runs the performance tests";
+ }
+ }
+ default "configuration performance";
+ description
+ "Bit mask to define which parts of the test are run.
+ Specify as a set of space separated string values";
+ }
+ }
+ }
+
+ rpc stop-y1564-test {
+ description
+ "Stop the running Y.1564 test on all services";
+ }
+
+ /*
+ * Notifications
+ */
+ notification y1564-test-updated {
+ description
+ "A y1564-test-updated notification is sent
+ when the state of a test changes.";
+
+ uses sa:notification-group;
+
+ leaf service-id {
+ type uint16;
+ mandatory true;
+ description "The ID of the Service that is being tested";
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/CeVlanMapUtilsTest.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/CeVlanMapUtilsTest.java
new file mode 100644
index 0000000..c7b3e72
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/CeVlanMapUtilsTest.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onosproject.drivers.microsemi.yang.utils.CeVlanMapUtils;
+
+public class CeVlanMapUtilsTest {
+
+ @Test
+ public void testGetVlanSet() {
+ Short[] vlanArray = CeVlanMapUtils.getVlanSet("101:102");
+ assertEquals(2, vlanArray.length);
+
+ vlanArray = CeVlanMapUtils.getVlanSet("101:103,107,110:115");
+ assertEquals(10, vlanArray.length);
+
+ vlanArray = CeVlanMapUtils.getVlanSet("1:4095");
+ assertEquals(4095, vlanArray.length);
+ }
+
+ @Test
+ public void testVlanListAsString() {
+ String ceVlanMap = CeVlanMapUtils.vlanListAsString(new Short[]{101, 102, 103});
+ assertEquals("101:103", ceVlanMap);
+
+ ceVlanMap = CeVlanMapUtils.vlanListAsString(new Short[]{0, 101, 104, 108});
+ assertEquals("101,104,108", ceVlanMap);
+ }
+
+ @Test
+ public void testAddtoCeVlanMap() {
+ String ceVlanMap = CeVlanMapUtils.addtoCeVlanMap("101:102", (short) 103);
+ assertEquals("101:103", ceVlanMap);
+
+ ceVlanMap = CeVlanMapUtils.addtoCeVlanMap("101:102", (short) 0);
+ assertEquals("101:102", ceVlanMap);
+
+ ceVlanMap = CeVlanMapUtils.addtoCeVlanMap("101:102", (short) 104);
+ assertEquals("101:102,104", ceVlanMap);
+ }
+
+ @Test
+ public void testRemoveZeroIfPossible() {
+ String ceVlanMap = CeVlanMapUtils.removeZeroIfPossible("101:102");
+ assertEquals("101:102", ceVlanMap);
+
+ ceVlanMap = CeVlanMapUtils.removeZeroIfPossible("0,101:102");
+ assertEquals("101:102", ceVlanMap);
+
+ ceVlanMap = CeVlanMapUtils.removeZeroIfPossible("0");
+ assertEquals("0", ceVlanMap);
+ }
+
+ @Test
+ public void testRemoveFromCeVlanMap() {
+ String ceVlanMap = CeVlanMapUtils.removeFromCeVlanMap("101:102", (short) 102);
+ assertEquals("101", ceVlanMap);
+
+ ceVlanMap = CeVlanMapUtils.removeFromCeVlanMap("101:103", (short) 102);
+ assertEquals("101,103", ceVlanMap);
+ }
+
+ @Test
+ public void testCombineVlanSets() {
+ assertEquals("101:104", CeVlanMapUtils.combineVlanSets("101:102", "103:104"));
+
+ assertEquals("101:103", CeVlanMapUtils.combineVlanSets("101:102", "103"));
+
+ assertEquals("101:102,104", CeVlanMapUtils.combineVlanSets("101:102", "104"));
+
+ assertEquals("99,101:102", CeVlanMapUtils.combineVlanSets("101:102", "99"));
+
+ assertEquals("101:102", CeVlanMapUtils.combineVlanSets("101:102", "0"));
+
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/IetfSystemManagerTest.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/IetfSystemManagerTest.java
new file mode 100644
index 0000000..c792b91
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/IetfSystemManagerTest.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.io.UncheckedIOException;
+import java.text.ParseException;
+import java.time.OffsetDateTime;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onlab.packet.Ip4Address;
+import org.onosproject.drivers.microsemi.yang.impl.IetfSystemManager;
+import org.onosproject.netconf.NetconfDeviceInfo;
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.ietfsystemmicrosemi.system.AugmentedSysSystem;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.ietfsystemmicrosemi.systemstate.platform.AugmentedSysPlatform;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.IetfSystem;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.IetfSystemOpParam;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.ietfsystem.DefaultSystem;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.ietfsystem.System;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.ietfsystem.system.Clock;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.ietfsystem.system.DefaultClock;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.ietfsystem.system.clock.timezone.DefaultTimezoneName;
+import org.onosproject.yms.ymsm.YmsService;
+
+public class IetfSystemManagerTest {
+
+ IetfSystemManager sysSvc = null;
+ YmsService ymsService;
+ NetconfSession session;
+
+ @Before
+ public void setUp() throws Exception {
+ try {
+ sysSvc = new MockIetfSystemManager();
+ sysSvc.activate();
+ } catch (UncheckedIOException e) {
+ fail(e.getMessage());
+ }
+ NetconfDeviceInfo deviceInfo = new NetconfDeviceInfo("netconf", "netconf", Ip4Address.valueOf("1.2.3.4"), 830);
+ session = new MockNetconfSessionEa1000(deviceInfo);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ sysSvc.deactivate();
+ }
+
+ @Test
+ public void testGetIetfSystemSession() throws NetconfException {
+ Clock.ClockBuilder cBuilder = new DefaultClock.ClockBuilder();
+ Clock clock = cBuilder.build();
+
+ System.SystemBuilder sBuilder = new DefaultSystem.SystemBuilder();
+ System system = sBuilder.clock(clock).build();
+
+ IetfSystemOpParam.IetfSystemBuilder builder = new IetfSystemOpParam.IetfSystemBuilder();
+ IetfSystemOpParam sampleSystem = (IetfSystemOpParam) builder.system(system).build();
+
+ IetfSystem sys = sysSvc.getIetfSystem(sampleSystem, session);
+ assertNotNull(sys);
+
+ assertEquals(sys.system().clock().timezone().getClass(), DefaultTimezoneName.class);
+ DefaultTimezoneName tzName = (DefaultTimezoneName) sys.system().clock().timezone();
+ assertEquals("Etc/UTC", tzName.timezoneName().string());
+ }
+
+ @Test
+ public void testGetIetfSystemInit() throws NetconfException {
+
+ IetfSystem sys = sysSvc.getIetfSystemInit(session);
+ assertNotNull(sys);
+ assertNotNull(sys.system());
+
+ AugmentedSysSystem sysSystem = (AugmentedSysSystem) sys.system().yangAugmentedInfo(AugmentedSysSystem.class);
+
+ assertEquals("-8.4683990", sysSystem.longitude().toPlainString());
+ assertEquals("51.9036140", sysSystem.latitude().toPlainString());
+ assertEquals("4.4.0-53-generic", sys.systemState().platform().osRelease());
+
+ AugmentedSysPlatform sysSystemState =
+ (AugmentedSysPlatform) sys.systemState().platform().yangAugmentedInfo(AugmentedSysPlatform.class);
+
+ assertEquals("Eagle Simulator.", sysSystemState.deviceIdentification().serialNumber());
+ }
+
+ @Test
+ public void testSetCurrentDatetime() throws NetconfException, ParseException {
+ sysSvc.setCurrentDatetime(OffsetDateTime.now(), session);
+ //Look at MockNetconfSessionEa1000::sampleXmlRegexSetCurrentDatetime() for catching an error
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockIetfSystemManager.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockIetfSystemManager.java
new file mode 100644
index 0000000..49723f0
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockIetfSystemManager.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang;
+
+import java.io.IOException;
+import java.io.UncheckedIOException;
+
+import org.onosproject.drivers.microsemi.yang.impl.IetfSystemManager;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.IetfSystemMicrosemiService;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.IetfSystemService;
+import org.onosproject.yms.app.yab.MockYmsManager;
+
+public class MockIetfSystemManager extends IetfSystemManager {
+
+ @Override
+ public void activate() {
+ try {
+ ymsService = new MockYmsManager();
+ ych = ymsService.getYangCodecHandler();
+ ych.addDeviceSchema(IetfSystemService.class);
+ ych.addDeviceSchema(IetfSystemMicrosemiService.class);
+ } catch (InstantiationException | IllegalAccessException e) {
+ log.error("Failed to load YMS Manager: " + e.getMessage());
+ e.printStackTrace();
+ } catch (IOException e) {
+ log.error("Failed to load YMS Manager: " + e.getMessage());
+ throw new UncheckedIOException(e);
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockMseaCfmManager.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockMseaCfmManager.java
new file mode 100644
index 0000000..af34a02
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockMseaCfmManager.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang;
+
+import java.io.IOException;
+import java.io.UncheckedIOException;
+
+import org.onosproject.drivers.microsemi.yang.impl.MseaCfmManager;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.MseaCfmService;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.soam.fm.rev20160229.MseaSoamFmService;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.soam.pm.rev20160229.MseaSoamPmService;
+import org.onosproject.yms.app.yab.MockYmsManager;
+
+public class MockMseaCfmManager extends MseaCfmManager {
+
+ @Override
+ public void activate() {
+ try {
+ ymsService = new MockYmsManager();
+ ych = ymsService.getYangCodecHandler();
+ ych.addDeviceSchema(MseaCfmService.class);
+ ych.addDeviceSchema(MseaSoamFmService.class);
+ ych.addDeviceSchema(MseaSoamPmService.class);
+ } catch (InstantiationException | IllegalAccessException e) {
+ log.error("Failed to load YMS Manager: " + e.getMessage());
+ e.printStackTrace();
+ } catch (IOException e) {
+ log.error("Failed to load YMS Manager: " + e.getMessage());
+ throw new UncheckedIOException(e);
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockMseaSaFilteringManager.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockMseaSaFilteringManager.java
new file mode 100644
index 0000000..60aae90
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockMseaSaFilteringManager.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang;
+
+import java.io.IOException;
+import java.io.UncheckedIOException;
+
+import org.onosproject.drivers.microsemi.yang.impl.MseaSaFilteringManager;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.MseaSaFilteringService;
+import org.onosproject.yms.app.yab.MockYmsManager;
+
+public class MockMseaSaFilteringManager extends MseaSaFilteringManager {
+
+ @Override
+ public void activate() {
+ try {
+ ymsService = new MockYmsManager();
+ ych = ymsService.getYangCodecHandler();
+ ych.addDeviceSchema(MseaSaFilteringService.class);
+ } catch (InstantiationException | IllegalAccessException e) {
+ log.error("Failed to load YMS Manager: " + e.getMessage());
+ e.printStackTrace();
+ } catch (IOException e) {
+ log.error("Failed to load YMS Manager: " + e.getMessage());
+ throw new UncheckedIOException(e);
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockMseaUniEvcServiceManager.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockMseaUniEvcServiceManager.java
new file mode 100644
index 0000000..c715e78
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockMseaUniEvcServiceManager.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang;
+
+import java.io.IOException;
+import java.io.UncheckedIOException;
+
+import org.onosproject.drivers.microsemi.yang.impl.MseaUniEvcServiceManager;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.MseaUniEvcServiceService;
+import org.onosproject.yms.app.yab.MockYmsManager;
+
+public class MockMseaUniEvcServiceManager extends MseaUniEvcServiceManager {
+ @Override
+ public void activate() {
+ try {
+ ymsService = new MockYmsManager();
+ ych = ymsService.getYangCodecHandler();
+ ych.addDeviceSchema(MseaUniEvcServiceService.class);
+ } catch (InstantiationException | IllegalAccessException e) {
+ log.error("Failed to load YMS Manager: " + e.getMessage());
+ e.printStackTrace();
+ } catch (IOException e) {
+ log.error("Failed to load YMS Manager: " + e.getMessage());
+ throw new UncheckedIOException(e);
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockNetconfSessionEa1000.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockNetconfSessionEa1000.java
new file mode 100644
index 0000000..19a291e
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MockNetconfSessionEa1000.java
@@ -0,0 +1,1076 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang;
+
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.regex.Pattern;
+
+import org.onosproject.netconf.NetconfDeviceInfo;
+import org.onosproject.netconf.NetconfDeviceOutputEventListener;
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.netconf.TargetConfig;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MockNetconfSessionEa1000 implements NetconfSession {
+ private static final Logger log = LoggerFactory
+ .getLogger(MockNetconfSessionEa1000.class);
+
+ private static final String MESSAGE_ID_STRING = "message-id";
+ private static final String EQUAL = "=";
+ private static final String RPC_OPEN = "<rpc ";
+ private static final String RPC_CLOSE = "</rpc>";
+ private static final String GET_OPEN = "<get>";
+ private static final String GET_CLOSE = "</get>";
+ private static final String NEW_LINE = "\n";
+ private static final String SUBTREE_FILTER_OPEN = "<filter type=\"subtree\">";
+ private static final String SUBTREE_FILTER_CLOSE = "</filter>";
+ private static final String WITH_DEFAULT_OPEN = "<with-defaults ";
+ private static final String WITH_DEFAULT_CLOSE = "</with-defaults>";
+ private static final String EDIT_CONFIG_OPEN = "<edit-config>";
+ private static final String EDIT_CONFIG_CLOSE = "</edit-config>";
+ private static final String TARGET_OPEN = "<target>";
+ private static final String TARGET_CLOSE = "</target>";
+ private static final String DEFAULT_OPERATION_OPEN = "<default-operation>";
+ private static final String DEFAULT_OPERATION_CLOSE = "</default-operation>";
+ private static final String CONFIG_OPEN = "<config xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">";
+ private static final String CONFIG_CLOSE = "</config>";
+
+ private static final String ENDPATTERN = "]]>]]>";
+ private static final String XML_HEADER =
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
+ private static final String NETCONF_BASE_NAMESPACE =
+ "xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"";
+ private static final String NETCONF_WITH_DEFAULTS_NAMESPACE =
+ "xmlns=\"urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults\"";
+
+
+ private Pattern sampleXmlRegex1 =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<get>).*(<filter).*"
+ + "(<system).*(<clock/>).*(</system>).*(</filter>)*.(</get>).*(</rpc).*(]]>){2}",
+ Pattern.DOTALL);
+
+ private Pattern sampleXmlRegex2 =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<get>).*(<filter).*(<system-state).*(</system-state>).*"
+ + "(<system).*(</system>).*(</filter>).*(</get>).*(</rpc).*(]]>){2}",
+ Pattern.DOTALL);
+
+ private Pattern sampleXmlRegexSaFiltering =
+ Pattern.compile("(<\\?xml).*"
+ + "(<rpc).*(<get>).*"
+ + "(<filter type=\"subtree\">).*(<source-ipaddress-filtering).*"
+ + "(</filter>).*(</get>).*(</rpc>).*"
+ + "(]]>){2}", Pattern.DOTALL);
+
+ private Pattern sampleXmlRegexEditConfigSaFilt =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<edit-config>).*"
+ + "(<target><running/></target>).*(<config xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">).*"
+ + "(<source-ipaddress-filtering).*(<interface-eth0>).*"
+ + "(<source-address-range>).*(<range-id>).*(</range-id>).*"
+ + "(<name>).*(</name>).*(<ipv4-address-prefix>).*(</ipv4-address-prefix>).*"
+ + "(</source-address-range>).*(</interface-eth0>)*(</source-ipaddress-filtering>).*"
+ + "(</config>).*(</edit-config>).*(</rpc>).*(]]>){2}", Pattern.DOTALL);
+
+ private Pattern sampleXmlRegexEditDeleteSaFilt =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<edit-config>).*"
+ + "(<target><running/></target>).*(<config xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">).*"
+ + "(<source-ipaddress-filtering "
+ + "xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-sa-filtering\">).*"
+ + "(<interface-eth0>).*"
+ + "(<source-address-range nc:operation=\"delete\">).*(<range-id>).*(</range-id>).*"
+ + "(</source-address-range>).*"
+ + "(<source-address-range nc:operation=\"delete\">).*(<range-id>).*(</range-id>).*"
+ + "(</source-address-range>).*"
+ + "(</interface-eth0>).*(</source-ipaddress-filtering>).*"
+ + "(</config>).*(</edit-config>).*(</rpc>).*(]]>){2}", Pattern.DOTALL);
+
+ private Pattern sampleXmlRegexUniEvc =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<get-config>)\\R?"
+ + "(<source>)\\R?(<running/>)\\R?(</source>)\\R?"
+ + "(<filter type=\"subtree\">)\\R?"
+ + "(<mef-services "
+ + "xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-uni-evc-service\"/>)\\R?"
+ + "(</filter>)\\R?(</get-config>)\\R?(</rpc>)\\R?(]]>){2}", Pattern.DOTALL);
+
+ private Pattern sampleXmlRegexUniEvcUni =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<get-config>)\\R?"
+ + "(<source>)\\R?(<running/>)\\R?(</source>)\\R?"
+ + "(<filter type=\"subtree\">)\\R?"
+ + "(<mef-services "
+ + "xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-uni-evc-service\">)\\R?"
+ + "(<uni/>)\\R?"
+ + "(</mef-services>)\\R?"
+ + "(</filter>)\\R?(</get-config>)\\R?(</rpc>)\\R?(]]>){2}", Pattern.DOTALL);
+
+ private Pattern sampleXmlRegexEditConfigUni1Evc =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<edit-config>)\\R?"
+ + "(<target><running/></target>)\\R?"
+ + "(<config xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">)\\R?"
+ + "(<mef-services).*(<uni>)\\R?(<name>).*(</name>)\\R?"
+ + "(<evc>)\\R?(<evc-index>).*(</evc-index>)\\R?(<name>).*(</name>)\\R?"
+ + "(<evc-per-uni>)\\R?"
+ + "(<evc-per-uni-c>)\\R?"
+ + "(<ce-vlan-map>).*(</ce-vlan-map>)\\R?"
+ + "(<ingress-bwp-group-index>).*(</ingress-bwp-group-index>)\\R?"
+ + "(<tag-push>)\\R?(<push-tag-type>)pushStag(</push-tag-type>)\\R?(<outer-tag-vlan>).*"
+ + "(</outer-tag-vlan>)\\R?(</tag-push>)\\R?"
+ + "((<flow-mapping>)\\R?"
+ + "(<ce-vlan-id>)[0-9]*(</ce-vlan-id>)\\R?"
+ + "(<flow-id>)[0-9]*(</flow-id>)\\R?"
+ + "(</flow-mapping>)\\R?)*"
+ + "(</evc-per-uni-c>)\\R?"
+ + "(<evc-per-uni-n>)\\R?"
+ + "(<ce-vlan-map>).*(</ce-vlan-map>)\\R?"
+ + "(<ingress-bwp-group-index>).*(</ingress-bwp-group-index>)\\R?"
+ + "(<tag-pop).*"
+ + "((<flow-mapping>)\\R?"
+ + "(<ce-vlan-id>)[0-9]*(</ce-vlan-id>)\\R?"
+ + "(<flow-id>)[0-9]*(</flow-id>)\\R?"
+ + "(</flow-mapping>)\\R?)*"
+ + "(</evc-per-uni-n>)\\R?"
+ + "(</evc-per-uni>)\\R?"
+ + "(</evc>)\\R?"
+ + "(</uni>).*"
+ + "(</mef-services>)\\R?"
+ + "(</config>)\\R?(</edit-config>)\\R?(</rpc>)\\R?(]]>){2}", Pattern.DOTALL);
+
+ private Pattern sampleXmlRegexEditConfigUni2Evc =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<edit-config>)\\R?"
+ + "(<target><running/></target>)\\R?"
+ + "(<config xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">)\\R?"
+ + "(<mef-services).*(<uni>)\\R?(<name>)[0-9a-zA-Z\\-\\:]*(</name>)\\R?"
+ + "(<evc>)\\R?(<evc-index>)[0-9]*(</evc-index>)\\R?(<name>)[0-9a-zA-Z\\-\\:]*(</name>)\\R?"
+ + "(<evc-per-uni>)\\R?"
+ + "(<evc-per-uni-c>)\\R?"
+ + "(<ce-vlan-map>)[0-9\\:\\,]*(</ce-vlan-map>)\\R?"
+ + "(<ingress-bwp-group-index>)[0-9]*(</ingress-bwp-group-index>)\\R?"
+ + "(</evc-per-uni-c>)\\R?"
+ + "(<evc-per-uni-n>)\\R?"
+ + "(<ce-vlan-map>)[0-9\\:\\,]*(</ce-vlan-map>)\\R?"
+ + "(<ingress-bwp-group-index>)[0-9]*(</ingress-bwp-group-index>)\\R?"
+ + "(<evc-per-uni-service-type>).*(</evc-per-uni-service-type>)\\R?"
+ + "(<tag-push>)\\R?(<push-tag-type>)pushStag(</push-tag-type>)\\R?(<outer-tag-vlan>).*"
+ + "(</outer-tag-vlan>)\\R?(</tag-push>)\\R?"
+ + "(</evc-per-uni-n>)\\R?"
+ + "(</evc-per-uni>)\\R?"
+ + "(</evc>)\\R?"
+ + "(<evc>)\\R?(<evc-index>)[0-9]*(</evc-index>)\\R?(<name>)[0-9a-zA-Z\\-\\:]*(</name>)\\R?"
+ + "(<evc-per-uni>)\\R?"
+ + "(<evc-per-uni-c>)\\R?"
+ + "(<ce-vlan-map>)[0-9\\:\\,]*(</ce-vlan-map>)\\R?"
+ + "(<ingress-bwp-group-index>)[0-9]*(</ingress-bwp-group-index>)\\R?"
+ + "(</evc-per-uni-c>)\\R?"
+ + "(<evc-per-uni-n>)\\R?"
+ + "(<ce-vlan-map>)[0-9\\:\\,]*(</ce-vlan-map>)\\R?"
+ + "(<ingress-bwp-group-index>)[0-9]*(</ingress-bwp-group-index>)\\R?"
+ + "(</evc-per-uni-n>)\\R?"
+ + "(</evc-per-uni>)\\R?"
+ + "(</evc>)\\R?(</uni>).*"
+ + "(</mef-services>)\\R?"
+ + "(</config>)\\R?(</edit-config>)\\R?(</rpc>)\\R?(]]>){2}", Pattern.DOTALL);
+
+ private Pattern sampleXmlRegexEditConfigUniProfiles =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<edit-config>).*"
+ + "(<target><running/></target>).*(<config xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">).*"
+ + "(<mef-services).*(<profiles>).*"
+ + "(<bwp-group>).*(<group-index>).*(</group-index>).*(</bwp-group>).*"
+ + "(<bwp-group>).*(<group-index>).*(</group-index>).*"
+ + "(<bwp>).*(<cos-index>).*(</cos-index>).*(<color-mode>).*(</color-mode>).*(</bwp>).*"
+ + "(<bwp>).*(<cos-index>).*(</cos-index>).*(<color-mode>).*(</color-mode>).*(</bwp>).*"
+ + "(</bwp-group>).*"
+ + "(</profiles>).*(</mef-services>).*"
+ + "(</config>).*(</edit-config>).*(</rpc>).*(]]>){2}", Pattern.DOTALL);
+
+ private Pattern sampleXmlRegexEditConfigEvcDelete =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<edit-config>).*"
+ + "(<target><running/></target>).*(<config xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">).*"
+ + "(<mef-services).*"
+ + "(<uni>).*"
+ + "(<evc nc:operation=\"delete\">).*(<evc-index>).*(</evc-index>).*(</evc>).*"
+ + "(</uni>).*"
+ + "(</mef-services>).*"
+ + "(</config>).*(</edit-config>).*(</rpc>).*(]]>){2}", Pattern.DOTALL);
+
+ private Pattern sampleXmlRegexGetConfigCeVlanMapsEvc =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<get-config>)\\R?"
+ + "(<source>)\\R?(<running/>)\\R?(</source>)\\R?"
+ + "(<filter type=\"subtree\">)\\R?"
+ + "(<mef-services).*"
+ + "(<uni>)\\R?"
+ + "(<evc>)\\R?"
+ + "(<evc-index/>)\\R?"
+ + "(<evc-per-uni>)\\R?"
+ + "(<evc-per-uni-c><ce-vlan-map/><flow-mapping/><ingress-bwp-group-index/></evc-per-uni-c>)\\R?"
+ + "(<evc-per-uni-n><ce-vlan-map/><flow-mapping/><ingress-bwp-group-index/></evc-per-uni-n>)\\R?"
+ + "(</evc-per-uni>)\\R?"
+ + "(</evc>)\\R?"
+ + "(</uni>)\\R?"
+ + "(</mef-services>)\\R?"
+ + "(</filter>)\\R?"
+ + "(</get-config>)\\R?"
+ + "(</rpc>)\\R?"
+ + "(]]>){2}", Pattern.DOTALL);
+
+ //For test testRemoveEvcUniFlowEntries()
+ private Pattern sampleXmlRegexEditConfigCeVlanMapReplace =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<edit-config>).*"
+ + "(<target><running/></target>).*"
+ + "(<config xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">).*"
+ + "(<mef-services xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-uni-evc-service\">).*"
+ + "(<uni>).*"
+ + "(<evc nc:operation=\"delete\">).*(<evc-index>.*</evc-index>).*(</evc>).*"
+ + "(<evc nc:operation=\"delete\">).*(<evc-index>.*</evc-index>).*(</evc>).*"
+ + "(<evc>).*(<evc-index>).*(</evc-index>).*(<evc-per-uni>).*"
+ + "(<evc-per-uni-c>).*"
+ + "(<ce-vlan-map nc:operation=\"replace\">).*(</ce-vlan-map>).*"
+ + "(<flow-mapping nc:operation=\"delete\">).*(<ce-vlan-id>).*(</ce-vlan-id>).*(</flow-mapping>).*"
+ + "(</evc-per-uni-c>).*"
+ + "(<evc-per-uni-n>).*"
+ + "(<ce-vlan-map nc:operation=\"replace\">).*(</ce-vlan-map>).*"
+ + "(<flow-mapping nc:operation=\"delete\">).*(<ce-vlan-id>).*(</ce-vlan-id>).*(</flow-mapping>).*"
+ + "(</evc-per-uni-n>).*"
+ + "(</evc-per-uni>).*(</evc>).*"
+ + "(<evc>).*(<evc-index>).*(</evc-index>).*(<evc-per-uni>).*"
+ + "(<evc-per-uni-c>).*"
+ + "(<ce-vlan-map nc:operation=\"replace\">).*(</ce-vlan-map>).*"
+ + "(<flow-mapping nc:operation=\"delete\">).*(<ce-vlan-id>).*(</ce-vlan-id>).*(</flow-mapping>).*"
+ + "(</evc-per-uni-c>).*"
+ + "(<evc-per-uni-n>).*"
+ + "(<ce-vlan-map nc:operation=\"replace\">).*(</ce-vlan-map>).*"
+ + "(<flow-mapping nc:operation=\"delete\">).*(<ce-vlan-id>).*(</ce-vlan-id>).*(</flow-mapping>).*"
+ + "(</evc-per-uni-n>).*"
+ + "(</evc-per-uni>).*(</evc>).*"
+ + "(</uni>).*(</mef-services>).*"
+ + "(</config>).*(</edit-config>).*(</rpc>).*(]]>){2}", Pattern.DOTALL);
+
+
+ //For testPerformMeterOperationDeviceIdMeterAdd()
+ private Pattern sampleXmlRegexEditConfigBwpGroup1 =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<edit-config>)\\R?"
+ + "(<target>\\R?<running/>\\R?</target>)\\R?"
+ + "(<config xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">)\\R?"
+ + "(<mef-services "
+ + "xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-uni-evc-service\">)\\R?"
+ + "(<profiles>)\\R?"
+ + "(<bwp-group>)\\R?"
+ + "(<group-index>)[0-9]*(</group-index>)\\R?"
+ + "(<bwp>)\\R?"
+ + "(<cos-index>)[0-9]*(</cos-index>)\\R?"
+ + "(<name>).*(</name>)\\R?"
+ + "(<committed-information-rate>)[0-9]*(</committed-information-rate>)\\R?"
+ + "(<committed-burst-size>)[0-9]*(</committed-burst-size>)\\R?"
+ + "(<excess-information-rate>)[0-9]*(</excess-information-rate>)\\R?"
+ + "(<excess-burst-size>)[0-9]*(</excess-burst-size>)\\R?"
+ + "(</bwp>)\\R?"
+ + "(</bwp-group>)\\R?"
+ + "(<cos>)\\R?"
+ + "(<cos-index>)[0-9](</cos-index>)\\R?"
+ + "(<name>).*(</name>)\\R?"
+ + "(<outgoing-cos-value>)[0-9]*(</outgoing-cos-value>)\\R?"
+ + "(<color-aware>true</color-aware>)\\R?"
+ + "(<color-forward>true</color-forward>)\\R?"
+ + "(<evc-cos-type-all-8-prio-to-1-evc-color>)\\R?"
+ + "(<evc-all-8-color-to>green</evc-all-8-color-to>)\\R?"
+ + "(</evc-cos-type-all-8-prio-to-1-evc-color>)\\R?"
+ + "(</cos>)\\R?"
+ + "(</profiles>)\\R?"
+ + "(</mef-services>)\\R?"
+ + "(</config>)\\R?(</edit-config>)\\R?(</rpc>)\\R?(]]>){2}", Pattern.DOTALL);
+
+ //For testPerformMeterOperationDeviceIdMeterRemove()
+ private Pattern sampleXmlRegexEditConfigBwpGroup1Delete =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<edit-config>)\\R?"
+ + "(<target>\\R?<running/>\\R?</target>)\\R?"
+ + "(<config xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">)\\R?"
+ + "(<mef-services xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-uni-evc-service\">)\\R?"
+ + "(<profiles>)\\R?"
+ + "(<bwp-group nc:operation=\"delete\">)\\R?"
+ + "(<group-index>)[0-9]*(</group-index>)\\R?"
+ + "(</bwp-group>)\\R?"
+ + "(</profiles>)\\R?"
+ + "(</mef-services>)\\R?"
+ + "(</config>)\\R?(</edit-config>)\\R?(</rpc>)\\R?(]]>){2}", Pattern.DOTALL);
+
+ private Pattern sampleXmlRegexSetCurrentDatetime =
+ Pattern.compile("(<\\?xml).*(<rpc).*"
+ + "(<set-current-datetime xmlns=\"urn:ietf:params:xml:ns:yang:ietf-system\">)\\R?"
+ + "(<current-datetime>)"
+ + "[0-9]{4}-[0-9]{2}-[0-9]{2}(T)[0-9]{2}:[0-9]{2}:[0-9]{2}[+-][0-9]{2}:[0-9]{2}"
+ + "(</current-datetime>)\\R?"
+ + "(</set-current-datetime>)\\R?"
+ + "(</rpc>)\\R?(]]>){2}", Pattern.DOTALL);
+
+ //For testGetConfigMseaCfmEssentials
+ private Pattern sampleXmlRegexGetMseaCfmEssentials =
+ Pattern.compile("(<\\?xml).*(<rpc).*(<get>)\\R?"
+ + "(<filter type=\"subtree\">)\\R?"
+ + "(<mef-cfm).*"
+ + "(<maintenance-domain>)\\R?"
+ + "(<id/>)\\R?"
+ + "(<name>)([a-zA-Z0-9\\-:\\.]){1,48}(</name>)\\R?"
+ + "(<md-level/>)\\R?"
+ + "(<maintenance-association>)\\R?"
+ + "(<id/>)\\R?"
+ + "(<name>)([a-zA-Z0-9\\-:\\.]){1,48}(</name>)\\R?"
+ // rpc.append("<ccm-interval>10ms</ccm-interval>\n"); //Have to omit for the moment - YMS problem
+ + "(<remote-meps/>)\\R?"
+ + "(<component-list/>)\\R?"
+ + "(<maintenance-association-end-point>)\\R?"
+ + "(<mep-identifier>)[0-9]{1,4}(</mep-identifier>)\\R?"
+ + "(<interface/>)\\R?"
+ + "(<primary-vid/>)\\R?"
+ + "(<administrative-state/>)\\R?"
+ + "(<ccm-ltm-priority/>)\\R?"
+ + "(<continuity-check/>)\\R?"
+ + "(<mac-address/>)\\R?"
+ + "(<msea-soam-fm:port-status/>)\\R?"
+ + "(<msea-soam-fm:interface-status/>)\\R?"
+ // rpc.append("<msea-soam-fm:last-defect-sent/>\n");//Have to omit for the moment - YMS problem
+ + "(<msea-soam-fm:rdi-transmit-status/>)\\R?"
+ + "(<loopback/>)\\R?"
+ + "(<remote-mep-database/>)\\R?"
+ + "(<linktrace/>)\\R?"
+ + "(</maintenance-association-end-point>)\\R?"
+ + "(</maintenance-association>)\\R?"
+ + "(</maintenance-domain>)\\R?"
+ + "(</mef-cfm>)\\R?"
+ + "(</filter>)\\R?"
+ + "(</get>)\\R?"
+ + "(</rpc>)\\R?"
+ + "(]]>){2}", Pattern.DOTALL);
+
+
+ private static final String SAMPLE_SYSTEM_REPLY = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ + "<rpc-reply xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" message-id=\"1\">\n"
+ + "<data xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n"
+ + "<system xmlns=\"urn:ietf:params:xml:ns:yang:ietf-system\">\n"
+ + "<clock><timezone-name>Etc/UTC</timezone-name></clock>\n"
+ + "</system>\n"
+ + "</data>\n"
+ + "</rpc-reply>";
+
+ private static final String SAMPLE_SYSTEM_REPLY_INIT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ + "<rpc-reply xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" message-id=\"1\">"
+ + "<data xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n"
+ + "<system xmlns=\"urn:ietf:params:xml:ns:yang:ietf-system\">\n"
+ + "<longitude xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-system\">-8.4683990</longitude>\n"
+ + "<latitude xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-system\">51.9036140</latitude>\n"
+ + "</system>\n"
+ + "<system-state xmlns=\"urn:ietf:params:xml:ns:yang:ietf-system\""
+ + " xmlns:sysms=\"http://www.microsemi.com/microsemi-edge-assure/msea-system\">\n"
+ + "<platform>\n"
+ + "<os-release>4.4.0-53-generic</os-release>\n"
+ + "<sysms:device-identification>\n"
+ + "<sysms:serial-number>Eagle Simulator.</sysms:serial-number>\n"
+ + "</sysms:device-identification>\n"
+ + "</platform>\n"
+ + "</system-state>\n"
+ + "</data>"
+ + "</rpc-reply>";
+
+ private static final String SAMPLE_MSEASAFILTERING_FE_REPLY = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ + "<rpc-reply xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" message-id=\"1\">\n"
+ + "<data xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n"
+ + "<source-ipaddress-filtering "
+ + "xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-sa-filtering\">\n"
+ + "<interface-eth0>\n"
+ + "<filter-admin-state>inactive</filter-admin-state>\n"
+ + "<source-address-range>\n"
+ + "<range-id>1</range-id>\n"
+ + "<ipv4-address-prefix>10.10.10.10/16</ipv4-address-prefix>\n"
+ + "<name>Filter1</name>\n"
+ + "</source-address-range>\n"
+ + "<source-address-range>\n"
+ + "<range-id>2</range-id>\n"
+ + "<ipv4-address-prefix>20.30.40.50/18</ipv4-address-prefix>\n"
+ + "<name>Flow:5e0000abaa2772</name>\n"
+ + "</source-address-range>\n"
+ + "</interface-eth0>\n"
+ + "</source-ipaddress-filtering>\n"
+ + "</data>\n"
+ + "</rpc-reply>";
+
+ private static final String SAMPLE_MSEAEVCUNI_REPLY_INIT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ + "<rpc-reply xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" message-id=\"1\">\n"
+ + "<data xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n"
+ + "<mef-services xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-uni-evc-service\"/>"
+ + "</data>\n"
+ + "</rpc-reply>";
+
+ private static final String SAMPLE_MSEAEVCUNI_FE_REPLY = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ + "<rpc-reply xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" message-id=\"1\">\n"
+ + "<data xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n"
+ + "<mef-services xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-uni-evc-service\">\n"
+ + "<uni>\n"
+ + "<name>Flow:7557655abfecd57865</name>\n"
+ + "<evc>\n"
+ + "<evc-index>7</evc-index\n>"
+ + "<name>evc-7</name>\n"
+ + "<evc-per-uni>\n"
+ + "<evc-per-uni-c>\n"
+ + "<ce-vlan-map>10</ce-vlan-map>\n"
+ + "<ingress-bwp-group-index>1</ingress-bwp-group-index>\n"
+ + "<tag-push>\n"
+ + "<push-tag-type>pushStag</push-tag-type>\n"
+ + "<outer-tag-vlan>3</outer-tag-vlan>\n"
+ + "</tag-push>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>10</ce-vlan-id>\n"
+ + "<flow-id>27021600672053710</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "<evc-per-uni-service-type>epl</evc-per-uni-service-type>\n"
+ + "</evc-per-uni-c>\n"
+ + "<evc-per-uni-n>\n"
+ + "<ce-vlan-map>11</ce-vlan-map>\n"
+ + "<ingress-bwp-group-index>0</ingress-bwp-group-index>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>11</ce-vlan-id>\n"
+ + "<flow-id>27021600672053711</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "</evc-per-uni-n>\n"
+ + "</evc-per-uni>\n"
+ + "<uni-evc-id>EA1000-Uni-from-ONOS_5</uni-evc-id>\n"
+ + "<evc-status>\n"
+ + "<operational-state>unknown</operational-state>\n"
+ + "<max-mtu-size>9600</max-mtu-size>\n"
+ + "<max-num-uni>2</max-num-uni>\n"
+ + "</evc-status>\n"
+ + "</evc>\n"
+ + "<evc>\n"
+ + "<evc-index>8</evc-index>\n"
+ + "<name>evc-8</name>\n"
+ + "<evc-per-uni>\n"
+ + "<evc-per-uni-c>\n"
+ + "<ce-vlan-map>12:14,20:22,25</ce-vlan-map>\n"
+ + "<ingress-bwp-group-index>0</ingress-bwp-group-index>\n"
+ + "<tag-pop />\n"
+ + "<evc-per-uni-service-type>epl</evc-per-uni-service-type>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>12</ce-vlan-id>\n"
+ + "<flow-id>27021600672053712</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>13</ce-vlan-id>\n"
+ + "<flow-id>27021600672053713</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>14</ce-vlan-id>\n"
+ + "<flow-id>27021600672053714</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>20</ce-vlan-id>\n"
+ + "<flow-id>27021600672053720</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>21</ce-vlan-id>\n"
+ + "<flow-id>27021600672053721</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>22</ce-vlan-id>\n"
+ + "<flow-id>27021600672053722</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>25</ce-vlan-id>\n"
+ + "<flow-id>27021600672053725</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "</evc-per-uni-c>\n"
+ + "<evc-per-uni-n>\n"
+ + "<ce-vlan-map>13</ce-vlan-map>\n"
+ + "<ingress-bwp-group-index>0</ingress-bwp-group-index>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>13</ce-vlan-id>\n"
+ + "<flow-id>27021600672053713</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "</evc-per-uni-n>\n"
+ + "</evc-per-uni>\n"
+ + "<uni-evc-id>EA1000-Uni-from-ONOS_5</uni-evc-id>\n"
+ + "<evc-status>\n"
+ + "<operational-state>unknown</operational-state>\n"
+ + "<max-mtu-size>9600</max-mtu-size>\n"
+ + "<max-num-uni>2</max-num-uni>\n"
+ + "</evc-status>\n"
+ + "</evc>\n"
+ + "</uni>\n"
+ + "<profiles>\n"
+ + "<bwp-group>\n"
+ + "<group-index>0</group-index>\n"
+ + "</bwp-group>\n"
+ + "</profiles>\n"
+ + "</mef-services>\n"
+ + "</data>\n"
+ + "</rpc-reply>";
+
+ private static final String SAMPLE_MSEAEVCUNI_CEVLANMAP_EVC_REPLY = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ + "<rpc-reply xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" message-id=\"1\">\n"
+ + "<data xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n"
+ + "<mef-services xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-uni-evc-service\">\n"
+ + "<uni>\n"
+
+ + "<evc><evc-index>1</evc-index>\n"
+ + "<evc-per-uni>\n"
+ + "<evc-per-uni-c>\n"
+ + "<ce-vlan-map>101</ce-vlan-map>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>101</ce-vlan-id>\n"
+ + "<flow-id>27021598629213101</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "</evc-per-uni-c>\n"
+ + "<evc-per-uni-n>\n"
+ + "<ce-vlan-map>102</ce-vlan-map>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>102</ce-vlan-id>\n"
+ + "<flow-id>27021598629213102</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "</evc-per-uni-n>\n"
+ + "</evc-per-uni>\n"
+ + "</evc>\n"
+
+ + "<evc><evc-index>7</evc-index>\n"
+ + "<evc-per-uni>\n"
+ + "<evc-per-uni-c>\n"
+ + "<ce-vlan-map>700,710,720</ce-vlan-map>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>700</ce-vlan-id>\n"
+ + "<flow-id>27021598629213700</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>710</ce-vlan-id>\n"
+ + "<flow-id>27021598629213710</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>720</ce-vlan-id>\n"
+ + "<flow-id>27021598629213720</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "</evc-per-uni-c>\n"
+ + "<evc-per-uni-n>\n"
+ + "<ce-vlan-map>701:703</ce-vlan-map>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>701</ce-vlan-id>\n"
+ + "<flow-id>27021598629213701</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>702</ce-vlan-id>\n"
+ + "<flow-id>27021598629213702</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "<flow-mapping>\n"
+ + "<ce-vlan-id>703</ce-vlan-id>\n"
+ + "<flow-id>27021598629213703</flow-id>\n"
+ + "</flow-mapping>\n"
+ + "</evc-per-uni-n>\n"
+ + "</evc-per-uni>\n"
+ + "</evc>\n"
+
+ + "<evc><evc-index>8</evc-index>\n"
+ + "<evc-per-uni>\n"
+ + "<evc-per-uni-c>\n<ce-vlan-map>800,810,820</ce-vlan-map>\n</evc-per-uni-c>\n"
+ + "<evc-per-uni-n>\n<ce-vlan-map>801:803</ce-vlan-map>\n</evc-per-uni-n>\n"
+ + "</evc-per-uni>\n"
+ + "</evc>\n"
+
+ + "</uni>\n"
+ + "</mef-services>\n"
+ + "</data>\n"
+ + "</rpc-reply>";
+
+ private static final String SAMPLE_MSEACFM_MD_MA_MEP_REPLY =
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ + "<rpc-reply xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" message-id=\"47\">"
+ + "<data>"
+ + "<mef-cfm xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-cfm\" "
+ + "xmlns:msea-soam-fm=\"http://www.microsemi.com/microsemi-edge-assure/msea-soam-fm\" "
+ + "xmlns:msea-soam-pm=\"http://www.microsemi.com/microsemi-edge-assure/msea-soam-pm\">"
+ + "<maintenance-domain>"
+ + "<id>1</id>"
+ + "<name>md-1</name>"
+ + "<md-level>3</md-level>"
+ + "<maintenance-association>"
+ + "<id>1</id>"
+ + "<name>ma-1-1</name>"
+ + "<ccm-interval>10ms</ccm-interval>" //Causing problems on create of MA
+ + "<remote-meps>1</remote-meps>"
+ + "<remote-meps>2</remote-meps>"
+ + "<component-list>"
+ + "<vid>100</vid>"
+ + "<tag-type>vlan-stag</tag-type>"
+ + "</component-list>"
+ + "<maintenance-association-end-point>"
+ + "<mep-identifier>1</mep-identifier>"
+ + "<interface>eth1</interface>"
+ + "<primary-vid>100</primary-vid>"
+ + "<administrative-state>true</administrative-state>"
+ + "<ccm-ltm-priority>4</ccm-ltm-priority>"
+ + "<continuity-check>"
+ + "<cci-enabled>true</cci-enabled>"
+ + "<fng-state>report-defect</fng-state>"
+ + "<highest-priority-defect-found>remote-mac-error</highest-priority-defect-found>"
+ + "<active-defects> remote-mac-error invalid-ccm</active-defects>"
+ + "<last-error-ccm>U2FtcGxlIGxhc3QgZXJyb3IgY2NtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ + "AAAAAAAAAAAAAAAAAAAAAAAAAAAA==</last-error-ccm>"
+ + "<ccm-sequence-error-count>10</ccm-sequence-error-count>"
+ + "<sent-ccms>15</sent-ccms>"
+ + "</continuity-check>"
+ + "<mac-address>53:65:61:6e:20:43</mac-address>"
+ + "<msea-soam-fm:port-status>no-status-tlv</msea-soam-fm:port-status>"
+ + "<msea-soam-fm:interface-status>no-status-tlv</msea-soam-fm:interface-status>"
+// + "<msea-soam-fm:last-defect-sent/>" --Can't handle this at the moment
+ + "<msea-soam-fm:rdi-transmit-status>false</msea-soam-fm:rdi-transmit-status>"
+ + "<loopback>"
+ + "<replies-received>123</replies-received>"
+ + "<replies-transmitted>456</replies-transmitted>"
+ + "</loopback>"
+ + "<remote-mep-database>"
+ + "<remote-mep>"
+ + "<remote-mep-id>2</remote-mep-id>"
+ + "<remote-mep-state>ok</remote-mep-state>"
+ + "<failed-ok-time>1490692834</failed-ok-time>"
+ + "<mac-address>53:65:61:6e:20:43</mac-address>"
+ + "<rdi>true</rdi>"
+ + "<port-status-tlv>up</port-status-tlv>"
+ + "<interface-status-tlv>dormant</interface-status-tlv>"
+ + "</remote-mep>"
+ + "</remote-mep-database>"
+ + "<linktrace>"
+ + "<unexpected-replies-received>0</unexpected-replies-received>"
+ + "<msea-soam-fm:ltm-msgs-transmitted>2</msea-soam-fm:ltm-msgs-transmitted>"
+ + "<msea-soam-fm:ltm-msgs-received>2</msea-soam-fm:ltm-msgs-received>"
+ + "<msea-soam-fm:ltr-msgs-transmitted>2</msea-soam-fm:ltr-msgs-transmitted>"
+ + "<msea-soam-fm:ltr-msgs-received>2</msea-soam-fm:ltr-msgs-received>"
+ + "<linktrace-database/>"
+ + "</linktrace>"
+ + "</maintenance-association-end-point>"
+ + "<remote-meps>4</remote-meps>"
+ + "</maintenance-association>"
+ + "</maintenance-domain>"
+ + "</mef-cfm>"
+ + "</data>"
+ + "</rpc-reply>";
+
+ private static final String SAMPLE_MSEACFM_MD_MA_MEP_REPLY2 =
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ + "<rpc-reply xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" message-id=\"47\">"
+ + "<data>"
+ + "<mef-cfm xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-cfm\" "
+ + "xmlns:msea-soam-fm=\"http://www.microsemi.com/microsemi-edge-assure/msea-soam-fm\" "
+ + "xmlns:msea-soam-pm=\"http://www.microsemi.com/microsemi-edge-assure/msea-soam-pm\">"
+ + "<maintenance-domain>"
+ + "<id>1</id>"
+ + "<name>Microsemi</name>"
+ + "<md-level>2</md-level>"
+ + "<maintenance-association>"
+ + "<id>1</id>"
+ + "<name>example-ma</name>"
+ + "<remote-meps>1</remote-meps>"
+ + "<remote-meps>2</remote-meps>"
+ + "<component-list>"
+ + "<vid>100</vid>"
+ + "<tag-type>vlan-stag</tag-type>"
+ + "</component-list>"
+ + "<maintenance-association-end-point>"
+ + "<mep-identifier>4</mep-identifier>"
+ + "<interface>eth1</interface>"
+ + "<primary-vid>100</primary-vid>"
+ + "<administrative-state>true</administrative-state>"
+ + "<ccm-ltm-priority>4</ccm-ltm-priority>"
+ + "<continuity-check>"
+ + "<cci-enabled>true</cci-enabled>"
+ + "<fng-state>defect-reported</fng-state>"
+ + "<highest-priority-defect-found>remote-invalid-ccm</highest-priority-defect-found>"
+// + "<active-defects> remote-invalid-ccm</active-defects>"
+ + "<active-defects/>"
+ + "<ccm-sequence-error-count>0</ccm-sequence-error-count>"
+ + "<sent-ccms>41013</sent-ccms>"
+ + "</continuity-check>"
+ + "<mac-address>00:b0:ae:03:ff:31</mac-address>"
+ + "<msea-soam-fm:port-status>up</msea-soam-fm:port-status>"
+ + "<msea-soam-fm:interface-status>up</msea-soam-fm:interface-status>"
+ + "<msea-soam-fm:rdi-transmit-status>true</msea-soam-fm:rdi-transmit-status>"
+ + "<loopback>"
+ + "<replies-received>0</replies-received>"
+ + "<replies-transmitted>0</replies-transmitted>"
+ + "</loopback>"
+ + "<remote-mep-database>"
+ + "<remote-mep>"
+ + "<remote-mep-id>1</remote-mep-id>"
+ + "<remote-mep-state>failed</remote-mep-state>"
+ + "<failed-ok-time>26315533</failed-ok-time>"
+ + "<mac-address>00:00:00:00:00:00</mac-address>"
+ + "<rdi>false</rdi>"
+ + "<port-status-tlv>no-status-tlv</port-status-tlv>"
+ + "<interface-status-tlv>no-status-tlv</interface-status-tlv>"
+ + "</remote-mep>"
+ + "<remote-mep>"
+ + "<remote-mep-id>2</remote-mep-id>"
+ + "<remote-mep-state>failed</remote-mep-state>"
+ + "<failed-ok-time>26315541</failed-ok-time>"
+ + "<mac-address>00:00:00:00:00:00</mac-address>"
+ + "<rdi>false</rdi>"
+ + "<port-status-tlv>no-status-tlv</port-status-tlv>"
+ + "<interface-status-tlv>no-status-tlv</interface-status-tlv>"
+ + "</remote-mep>"
+ + "</remote-mep-database>"
+ + "<linktrace />"
+ + "</maintenance-association-end-point>"
+ + "<remote-meps>4</remote-meps>"
+ + "</maintenance-association>"
+ + "</maintenance-domain>"
+ + "</mef-cfm>"
+ + "</data>"
+ + "</rpc-reply>";
+
+ private static final String SAMPLE_REPLY_OK = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ + "<rpc-reply xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" message-id=\"2\">"
+ + "<ok/>"
+ + "</rpc-reply>";
+
+ private NetconfDeviceInfo deviceInfo;
+
+ private final AtomicInteger messageIdInteger = new AtomicInteger(0);
+
+ public MockNetconfSessionEa1000(NetconfDeviceInfo deviceInfo) throws NetconfException {
+ this.deviceInfo = deviceInfo;
+ }
+
+ @Override
+ public CompletableFuture<String> request(String request) throws NetconfException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String get(String request) throws NetconfException {
+
+ return sendRequest(request);
+ }
+
+ @Override
+ public String get(String filterSchema, String withDefaultsMode) throws NetconfException {
+ StringBuilder rpc = new StringBuilder(XML_HEADER);
+ rpc.append(RPC_OPEN);
+ rpc.append(MESSAGE_ID_STRING);
+ rpc.append(EQUAL);
+ rpc.append("\"");
+ rpc.append(messageIdInteger.get());
+ rpc.append("\" ");
+ rpc.append(NETCONF_BASE_NAMESPACE).append(">\n");
+ rpc.append(GET_OPEN).append(NEW_LINE);
+ if (filterSchema != null) {
+ rpc.append(SUBTREE_FILTER_OPEN).append(NEW_LINE);
+ rpc.append(filterSchema).append(NEW_LINE);
+ rpc.append(SUBTREE_FILTER_CLOSE).append(NEW_LINE);
+ }
+ if (withDefaultsMode != null) {
+ rpc.append(WITH_DEFAULT_OPEN).append(NETCONF_WITH_DEFAULTS_NAMESPACE).append(">");
+ rpc.append(withDefaultsMode).append(WITH_DEFAULT_CLOSE).append(NEW_LINE);
+ }
+ rpc.append(GET_CLOSE).append(NEW_LINE);
+ rpc.append(RPC_CLOSE).append(NEW_LINE);
+ rpc.append(ENDPATTERN);
+ String reply = sendRequest(rpc.toString());
+ checkReply(reply);
+ return reply;
+ }
+
+ @Override
+ public String doWrappedRpc(String request) throws NetconfException {
+ StringBuilder rpc = new StringBuilder(XML_HEADER);
+ rpc.append(RPC_OPEN);
+ rpc.append(MESSAGE_ID_STRING);
+ rpc.append(EQUAL);
+ rpc.append("\"");
+ rpc.append(messageIdInteger.get());
+ rpc.append("\" ");
+ rpc.append(NETCONF_BASE_NAMESPACE).append(">\n");
+ rpc.append(request);
+ rpc.append(RPC_CLOSE).append(NEW_LINE);
+ rpc.append(ENDPATTERN);
+ String reply = sendRequest(rpc.toString());
+ checkReply(reply);
+ return reply;
+ }
+
+ @Override
+ public String requestSync(String request) throws NetconfException {
+ if (!request.contains(ENDPATTERN)) {
+ request = request + NEW_LINE + ENDPATTERN;
+ }
+ String reply = sendRequest(request);
+ checkReply(reply);
+ return reply;
+ }
+
+ @Override
+ public String getConfig(String targetConfiguration) throws NetconfException {
+ return getConfig(TargetConfig.valueOf(targetConfiguration), null);
+ }
+
+ @Override
+ public String getConfig(String targetConfiguration, String configurationSchema) throws NetconfException {
+ return getConfig(TargetConfig.valueOf(targetConfiguration), null);
+ }
+
+ @Override
+ public String getConfig(TargetConfig targetConfiguration) throws NetconfException {
+ return getConfig(targetConfiguration, null);
+ }
+
+ @Override
+ public String getConfig(TargetConfig targetConfiguration, String configurationSchema) throws NetconfException {
+ StringBuilder rpc = new StringBuilder(XML_HEADER);
+ rpc.append("<rpc ");
+ rpc.append(MESSAGE_ID_STRING);
+ rpc.append(EQUAL);
+ rpc.append("\"");
+ rpc.append(messageIdInteger.get());
+ rpc.append("\" ");
+ rpc.append("xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n");
+ rpc.append("<get-config>\n");
+ rpc.append("<source>\n");
+ rpc.append("<").append(targetConfiguration).append("/>");
+ rpc.append("</source>");
+ if (configurationSchema != null) {
+ rpc.append("<filter type=\"subtree\">\n");
+ rpc.append(configurationSchema).append("\n");
+ rpc.append("</filter>\n");
+ }
+ rpc.append("</get-config>\n");
+ rpc.append("</rpc>\n");
+ rpc.append(ENDPATTERN);
+ String reply = sendRequest(rpc.toString());
+ return checkReply(reply) ? reply : "ERROR " + reply;
+ }
+
+ @Override
+ public boolean editConfig(String newConfiguration) throws NetconfException {
+ return editConfig(TargetConfig.RUNNING, null, newConfiguration);
+ }
+
+ @Override
+ public boolean editConfig(String targetConfiguration, String mode, String newConfiguration)
+ throws NetconfException {
+ return editConfig(TargetConfig.valueOf(targetConfiguration), mode, newConfiguration);
+ }
+ @Override
+ public boolean editConfig(TargetConfig targetConfiguration, String mode, String newConfiguration)
+ throws NetconfException {
+ newConfiguration = newConfiguration.trim();
+ StringBuilder rpc = new StringBuilder(XML_HEADER);
+ rpc.append(RPC_OPEN);
+ rpc.append(MESSAGE_ID_STRING);
+ rpc.append(EQUAL);
+ rpc.append("\"");
+ rpc.append(messageIdInteger.get());
+ rpc.append("\" ");
+ rpc.append(NETCONF_BASE_NAMESPACE).append(">\n");
+ rpc.append(EDIT_CONFIG_OPEN).append("\n");
+ rpc.append(TARGET_OPEN);
+ rpc.append("<").append(targetConfiguration).append("/>");
+ rpc.append(TARGET_CLOSE).append("\n");
+ if (mode != null) {
+ rpc.append(DEFAULT_OPERATION_OPEN);
+ rpc.append(mode);
+ rpc.append(DEFAULT_OPERATION_CLOSE).append("\n");
+ }
+ rpc.append(CONFIG_OPEN).append("\n");
+ rpc.append(newConfiguration);
+ rpc.append(CONFIG_CLOSE).append("\n");
+ rpc.append(EDIT_CONFIG_CLOSE).append("\n");
+ rpc.append(RPC_CLOSE);
+ rpc.append(ENDPATTERN);
+ log.debug(rpc.toString());
+ String reply = sendRequest(rpc.toString());
+ return checkReply(reply);
+ }
+
+ @Override
+ public boolean copyConfig(String targetConfiguration, String newConfiguration) throws NetconfException {
+ return copyConfig(TargetConfig.valueOf(targetConfiguration), newConfiguration);
+ }
+
+ @Override
+ public boolean copyConfig(TargetConfig targetConfiguration, String newConfiguration) throws NetconfException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean deleteConfig(String targetConfiguration) throws NetconfException {
+ return deleteConfig(TargetConfig.valueOf(targetConfiguration));
+ }
+
+ @Override
+ public boolean deleteConfig(TargetConfig targetConfiguration) throws NetconfException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void startSubscription() throws NetconfException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void startSubscription(String filterSchema) throws NetconfException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void endSubscription() throws NetconfException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean lock(String configType) throws NetconfException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean unlock(String configType) throws NetconfException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean lock() throws NetconfException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean unlock() throws NetconfException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean close() throws NetconfException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public String getSessionId() {
+ return "mockSessionId";
+ }
+
+ @Override
+ public String getServerCapabilities() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setDeviceCapabilities(List<String> capabilities) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void addDeviceOutputListener(NetconfDeviceOutputEventListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void removeDeviceOutputListener(NetconfDeviceOutputEventListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+
+ private boolean checkReply(String reply) throws NetconfException {
+ if (reply != null) {
+ if (!reply.contains("<rpc-error>")) {
+ log.debug("Device {} sent reply {}", deviceInfo, reply);
+ return true;
+ } else if (reply.contains("<ok/>")
+ || (reply.contains("<rpc-error>")
+ && reply.contains("warning"))) {
+ log.debug("Device {} sent reply {}", deviceInfo, reply);
+ return true;
+ }
+ }
+ log.warn("Device {} has error in reply {}", deviceInfo, reply);
+ return false;
+ }
+
+ private String sendRequest(String request) throws NetconfException {
+ log.info("Mocking NETCONF Session send request: \n" + request);
+
+ if (sampleXmlRegex1.matcher(request).matches()) {
+ return SAMPLE_SYSTEM_REPLY;
+
+ } else if (sampleXmlRegex2.matcher(request).matches()) {
+ return SAMPLE_SYSTEM_REPLY_INIT;
+
+ } else if (sampleXmlRegexSaFiltering.matcher(request).matches()) {
+ return SAMPLE_MSEASAFILTERING_FE_REPLY;
+
+ } else if (sampleXmlRegexEditConfigSaFilt.matcher(request).matches()) {
+ return SAMPLE_REPLY_OK;
+
+ } else if (sampleXmlRegexEditDeleteSaFilt.matcher(request).matches()) {
+ return SAMPLE_REPLY_OK;
+
+ } else if (sampleXmlRegexUniEvc.matcher(request).matches()) {
+ return SAMPLE_MSEAEVCUNI_REPLY_INIT;
+
+ } else if (sampleXmlRegexUniEvcUni.matcher(request).matches()) {
+ return SAMPLE_MSEAEVCUNI_FE_REPLY;
+
+ } else if (sampleXmlRegexEditConfigUni1Evc.matcher(request).matches()) {
+ return SAMPLE_REPLY_OK;
+
+ } else if (sampleXmlRegexEditConfigUni2Evc.matcher(request).matches()) {
+ return SAMPLE_REPLY_OK;
+
+ } else if (sampleXmlRegexEditConfigUniProfiles.matcher(request).matches()) {
+ return SAMPLE_REPLY_OK;
+
+ } else if (sampleXmlRegexEditConfigEvcDelete.matcher(request).matches()) {
+ return SAMPLE_REPLY_OK;
+
+ } else if (sampleXmlRegexGetConfigCeVlanMapsEvc.matcher(request).matches()) {
+ return SAMPLE_MSEAEVCUNI_CEVLANMAP_EVC_REPLY;
+
+ } else if (sampleXmlRegexEditConfigCeVlanMapReplace.matcher(request).matches()) {
+ return SAMPLE_REPLY_OK;
+
+ } else if (sampleXmlRegexEditConfigBwpGroup1.matcher(request).matches()) {
+ return SAMPLE_REPLY_OK;
+
+ } else if (sampleXmlRegexEditConfigBwpGroup1Delete.matcher(request).matches()) {
+ return SAMPLE_REPLY_OK;
+
+ } else if (sampleXmlRegexSetCurrentDatetime.matcher(request).matches()) {
+ return SAMPLE_REPLY_OK;
+
+ } else if (sampleXmlRegexGetMseaCfmEssentials.matcher(request).matches()) {
+ return SAMPLE_MSEACFM_MD_MA_MEP_REPLY2;
+
+ } else {
+ throw new NetconfException("MocknetconfSession. No sendRequest() case for query: " +
+ request);
+ }
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MseaCfmManagerTest.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MseaCfmManagerTest.java
new file mode 100644
index 0000000..7ec6288
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MseaCfmManagerTest.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.UncheckedIOException;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onlab.packet.Ip4Address;
+import org.onosproject.drivers.microsemi.yang.impl.MseaCfmManager;
+import org.onosproject.netconf.NetconfDeviceInfo;
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.MseaCfm;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.DefaultMefCfm;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.MefCfm;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.mefcfm.DefaultMaintenanceDomain;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.mefcfm.MaintenanceDomain;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.mefcfm.maintenancedomain.mdnameandtypecombo.DefaultNameCharacterString;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.cfm.rev20160229.mseacfm.mefcfm.maintenancedomain.mdnameandtypecombo.NameCharacterString;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.types.rev20160229.mseatypes.Identifier45;
+import org.onosproject.yms.ymsm.YmsService;
+
+public class MseaCfmManagerTest {
+
+ MseaCfmManager mseaCfmService;
+ YmsService ymsService;
+ NetconfSession session;
+
+ @Before
+ public void setUp() throws Exception {
+ try {
+ mseaCfmService = new MockMseaCfmManager();
+ mseaCfmService.activate();
+ } catch (UncheckedIOException e) {
+ fail(e.getMessage());
+ }
+ NetconfDeviceInfo deviceInfo = new NetconfDeviceInfo("netconf", "netconf", Ip4Address.valueOf("1.2.3.4"), 830);
+ session = new MockNetconfSessionEa1000(deviceInfo);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testGetConfigMseaCfmEssentials() throws NetconfException {
+ MseaCfm mseaCfm = mseaCfmService.getMepEssentials("md-1", "ma-1-1", 1, session);
+ assertNotNull(mseaCfm);
+
+ //See SAMPLE_MSEACFM_MD_MA_MEP_REPLY in MockNetconfSessionEa1000
+ assertEquals(1, mseaCfm.mefCfm().maintenanceDomain().size());
+ assertEquals(2, mseaCfm.mefCfm().maintenanceDomain().get(0).mdLevel().uint8());
+ }
+
+ /**
+ * Create the Maintenance Domain "md-1".
+ * @throws NetconfException
+ */
+ @Test
+ public void testSetMseaCfm() throws NetconfException {
+ NameCharacterString mdName = DefaultNameCharacterString.builder().name(Identifier45.fromString("md-1")).build();
+
+ MaintenanceDomain yangMd = DefaultMaintenanceDomain.builder()
+ .id((short) 1)
+ .mdNameAndTypeCombo(mdName)
+ .build();
+
+ MefCfm mefCfm = DefaultMefCfm.builder().addToMaintenanceDomain(yangMd).build();
+ //FIXME implement this
+// MseaCfmOpParam mseaCfmOpParam = (MseaCfmOpParam) MseaCfmOpParam.builder().mefCfm(mefCfm).build();
+// mseaCfmService.setMseaCfm(mseaCfmOpParam, session, NcDsType.running);
+ }
+
+ @Test
+ public void testTransmitLoopback() throws NetconfException {
+ try {
+ mseaCfmService.transmitLoopback(null, session);
+ } catch (UnsupportedOperationException e) {
+ assertTrue(e.getMessage().contains("Not yet implemented"));
+ }
+ }
+
+ @Test
+ public void testAbortLoopback() throws NetconfException {
+ try {
+ mseaCfmService.abortLoopback(null, session);
+ } catch (UnsupportedOperationException e) {
+ assertTrue(e.getMessage().contains("Not yet implemented"));
+ }
+ }
+
+ @Test
+ public void testTransmitLinktrace() throws NetconfException {
+ try {
+ mseaCfmService.transmitLinktrace(null, session);
+ } catch (UnsupportedOperationException e) {
+ assertTrue(e.getMessage().contains("Not yet implemented"));
+ }
+ }
+
+}
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MseaSaFilteringManagerTest.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MseaSaFilteringManagerTest.java
new file mode 100644
index 0000000..b663554
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MseaSaFilteringManagerTest.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.io.UncheckedIOException;
+import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onlab.packet.Ip4Address;
+import org.onosproject.drivers.microsemi.yang.impl.MseaSaFilteringManager;
+import org.onosproject.netconf.NetconfDeviceInfo;
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.netconf.TargetConfig;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.MseaSaFiltering;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.MseaSaFilteringOpParam;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.mseasafiltering.DefaultSourceIpaddressFiltering;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.mseasafiltering.SourceIpaddressFiltering;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.mseasafiltering.sourceipaddressfiltering.DefaultInterfaceEth0;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.mseasafiltering.sourceipaddressfiltering.InterfaceEth0;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.mseasafiltering.sourceipaddressfiltering.interfaceeth0.DefaultSourceAddressRange;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.mseasafiltering.sourceipaddressfiltering.interfaceeth0.SourceAddressRange;
+import org.onosproject.yms.ymsm.YmsService;
+
+public class MseaSaFilteringManagerTest {
+
+ MseaSaFilteringManager mseaSaSvc;
+ YmsService ymsService;
+ NetconfSession session;
+
+ @Before
+ public void setUp() throws Exception {
+ try {
+ mseaSaSvc = new MockMseaSaFilteringManager();
+ mseaSaSvc.activate();
+ } catch (UncheckedIOException e) {
+ fail(e.getMessage());
+ }
+ NetconfDeviceInfo deviceInfo = new NetconfDeviceInfo("netconf", "netconf", Ip4Address.valueOf("1.2.3.4"), 830);
+ session = new MockNetconfSessionEa1000(deviceInfo);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testGetMseaSaFilteringMseaSaFilteringOpParamNetconfSession() throws NetconfException {
+ SourceIpaddressFiltering.SourceIpaddressFilteringBuilder sipBuilder =
+ new DefaultSourceIpaddressFiltering.SourceIpaddressFilteringBuilder();
+
+ MseaSaFilteringOpParam.MseaSaFilteringBuilder opBuilder =
+ new MseaSaFilteringOpParam.MseaSaFilteringBuilder();
+ MseaSaFilteringOpParam mseaSaFilteringFilter =
+ (MseaSaFilteringOpParam) opBuilder
+ .sourceIpaddressFiltering(sipBuilder.build())
+ .build();
+
+ MseaSaFiltering result = mseaSaSvc.getMseaSaFiltering(mseaSaFilteringFilter, session);
+
+ //Results come from MockNetconfSession SAMPLE_MSEASAFILTERING_REPLY_INIT
+ assertNotNull(result.sourceIpaddressFiltering().interfaceEth0().sourceAddressRange());
+ List<SourceAddressRange> ranges = result.sourceIpaddressFiltering().interfaceEth0().sourceAddressRange();
+ assertEquals(2, ranges.size());
+
+ for (SourceAddressRange sa:ranges) {
+ if (sa.rangeId() == 1) {
+ assertEquals("10.10.10.10/16", sa.ipv4AddressPrefix());
+
+ } else if (sa.rangeId() == 2) {
+ assertEquals("20.30.40.50/18", sa.ipv4AddressPrefix());
+ }
+ }
+ }
+
+ @Test
+ public void testSetMseaSaFilteringMseaSaFilteringOpParamNetconfSessionNcDsType() {
+
+ MseaSaFilteringOpParam mseaSaFilteringConfig = createConfigForEdit("192.168.60.10/27", (short) 3, "Filter3");
+
+ //Calling on the edit-config just makes the change and hopefully does not throw a Netconf Exception
+ try {
+ mseaSaSvc.setMseaSaFiltering(mseaSaFilteringConfig, session, TargetConfig.RUNNING);
+ } catch (NetconfException e) {
+ e.printStackTrace();
+ fail("NETCONF Exception: " + e.getMessage());
+ }
+ }
+
+ /**
+ * This is also called from the test case EA1000FlowRuleProgrammableTest().
+ * In the ea1000driver project
+ * @return
+ */
+ public static MseaSaFilteringOpParam createConfigForEdit(String ipAddrPrefix, short rangeId, String rangeName) {
+ SourceAddressRange.SourceAddressRangeBuilder sarBuilder =
+ new DefaultSourceAddressRange.SourceAddressRangeBuilder();
+ SourceAddressRange saRange =
+ sarBuilder
+ .ipv4AddressPrefix(ipAddrPrefix)
+ .rangeId(rangeId)
+ .name(rangeName)
+ .build();
+
+ InterfaceEth0.InterfaceEth0Builder eth0Builder =
+ new DefaultInterfaceEth0.InterfaceEth0Builder();
+ InterfaceEth0 eth0 = eth0Builder.addToSourceAddressRange(saRange).build();
+
+ SourceIpaddressFiltering.SourceIpaddressFilteringBuilder sipBuilder =
+ new DefaultSourceIpaddressFiltering.SourceIpaddressFilteringBuilder();
+
+ SourceIpaddressFiltering sip = sipBuilder.interfaceEth0(eth0).build();
+
+ MseaSaFilteringOpParam.MseaSaFilteringBuilder opBuilder =
+ new MseaSaFilteringOpParam.MseaSaFilteringBuilder();
+ MseaSaFilteringOpParam mseaSaFilteringConfig =
+ (MseaSaFilteringOpParam) opBuilder
+ .sourceIpaddressFiltering(sipBuilder.build())
+ .build();
+
+ return mseaSaFilteringConfig;
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MseaUniEvcServiceManagerTest.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MseaUniEvcServiceManagerTest.java
new file mode 100644
index 0000000..79e3435
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/MseaUniEvcServiceManagerTest.java
@@ -0,0 +1,456 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.io.UncheckedIOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onlab.packet.Ip4Address;
+import org.onosproject.drivers.microsemi.yang.impl.MseaUniEvcServiceManager;
+import org.onosproject.drivers.microsemi.yang.utils.CeVlanMapUtils;
+import org.onosproject.netconf.NetconfDeviceInfo;
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.onosproject.netconf.TargetConfig;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.types.rev20160229.mseatypes.Identifier45;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.types.rev20160229.mseatypes.ServiceListType;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.types.rev20160229.mseatypes.VlanIdType;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.MseaUniEvcService;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.MseaUniEvcServiceOpParam;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.DefaultMefServices;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.MefServices;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.evcperuniextensionattributes.EvcPerUniServiceTypeEnum;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.evcperuniextensionattributes.tagmanipulation.TagPush;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.evcperuniextensionattributes.tagmanipulation.tagpush.tagpush.PushTagTypeEnum;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.evcperuniextensionattributes.tagmanipulation.DefaultTagPush;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.Profiles;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.DefaultProfiles;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.DefaultUni;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.Uni;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.profiles.BwpGroup;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.profiles.Cos;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.profiles.DefaultBwpGroup;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.profiles.DefaultCos;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.profiles.bwpgroup.Bwp;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.profiles.bwpgroup.DefaultBwp;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.profiles.bwpgroup.bwp.ColorModeEnum;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.CustomEvc;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.DefaultEvc;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.Evc;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.UniSideInterfaceAssignmentEnum;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.evc.DefaultEvcPerUni;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.evc.EvcPerUni;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni.CustomEvcPerUnic;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni.CustomEvcPerUnin;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni.DefaultEvcPerUnic;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni.DefaultEvcPerUnin;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni.EvcPerUnic;
+import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc.service.rev20160317.mseaunievcservice.mefservices.uni.evc.evcperuni.EvcPerUnin;
+import org.onosproject.yms.ymsm.YmsService;
+
+public class MseaUniEvcServiceManagerTest {
+
+ MseaUniEvcServiceManager mseaUniEvcServiceSvc;
+ YmsService ymsService;
+ NetconfSession session;
+
+ @Before
+ public void setUp() throws Exception {
+ try {
+ mseaUniEvcServiceSvc = new MockMseaUniEvcServiceManager();
+ mseaUniEvcServiceSvc.activate();
+ } catch (UncheckedIOException e) {
+ fail(e.getMessage());
+ }
+ NetconfDeviceInfo deviceInfo = new NetconfDeviceInfo("netconf", "netconf", Ip4Address.valueOf("1.2.3.4"), 830);
+ session = new MockNetconfSessionEa1000(deviceInfo);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testGetMseaUniEvcServiceMseaUniEvcServiceOpParamNetconfSession() {
+ Uni.UniBuilder uniBuilder = new DefaultUni.UniBuilder();
+
+ MefServices.MefServicesBuilder mefBuilder = new DefaultMefServices.MefServicesBuilder();
+ MefServices mefServices = mefBuilder.uni(uniBuilder.build()).build();
+
+ MseaUniEvcService.MseaUniEvcServiceBuilder evcUniBuilder =
+ new MseaUniEvcServiceOpParam.MseaUniEvcServiceBuilder();
+
+ MseaUniEvcServiceOpParam mseaUniEvcServiceFilter =
+ (MseaUniEvcServiceOpParam) evcUniBuilder.mefServices(mefServices).build();
+ MseaUniEvcService result = null;
+ try {
+ result =
+ mseaUniEvcServiceSvc.getConfigMseaUniEvcService(
+ mseaUniEvcServiceFilter, session, TargetConfig.RUNNING);
+ } catch (NetconfException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ fail("Error: " + e.getMessage());
+ }
+
+ assertNotNull(result);
+ }
+
+ @Test
+ public void testSetMseaUniEvcServiceMseaUniEvcServiceOpParamEvcs() {
+ TagPush.TagPushBuilder tpBuilder1 = new DefaultTagPush.TagPushBuilder();
+ org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.uni.evc
+ .service.rev20160317.mseaunievcservice.evcperuniextensionattributes.tagmanipulation
+ .tagpush.TagPush.TagPushBuilder tpInnerBuilder1 =
+ new org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea
+ .uni.evc.service.rev20160317.mseaunievcservice.evcperuniextensionattributes
+ .tagmanipulation.tagpush.DefaultTagPush.TagPushBuilder();
+ TagPush tp1 = tpBuilder1
+ .tagPush(tpInnerBuilder1
+ .outerTagVlan(new VlanIdType(3))
+ .pushTagType(PushTagTypeEnum.PUSHSTAG)
+ .build())
+ .build();
+
+ EvcPerUnin.EvcPerUninBuilder epunBuilder1 = new DefaultEvcPerUnin.EvcPerUninBuilder();
+ EvcPerUnin epun1 = epunBuilder1
+ .evcPerUniServiceType(EvcPerUniServiceTypeEnum.EVPL)
+ .ceVlanMap(ServiceListType.fromString("10"))
+ .ingressBwpGroupIndex("0")
+ .tagManipulation(tp1)
+ .build();
+
+ EvcPerUnic.EvcPerUnicBuilder epucBuilder1 = new DefaultEvcPerUnic.EvcPerUnicBuilder();
+ EvcPerUnic epuc1 = epucBuilder1
+ .ceVlanMap(new ServiceListType("11"))
+ .ingressBwpGroupIndex("0")
+ .build();
+
+ EvcPerUni.EvcPerUniBuilder epuBuilder = new DefaultEvcPerUni.EvcPerUniBuilder();
+
+ List<Evc> evcList = new ArrayList<Evc>();
+ Evc.EvcBuilder evcBuilder1 = new DefaultEvc.EvcBuilder();
+ evcList.add(evcBuilder1
+ .evcIndex(1)
+ .name(new Identifier45("evc-1"))
+ .evcPerUni(epuBuilder.evcPerUnin(epun1).evcPerUnic(epuc1).build())
+ .build());
+
+
+ EvcPerUnin.EvcPerUninBuilder epunBuilder2 = new DefaultEvcPerUnin.EvcPerUninBuilder();
+ EvcPerUnin epun2 = epunBuilder2
+ .ceVlanMap(ServiceListType.fromString("13"))
+ .ingressBwpGroupIndex("0")
+ .build();
+
+ EvcPerUnic.EvcPerUnicBuilder epucBuilder2 = new DefaultEvcPerUnic.EvcPerUnicBuilder();
+ EvcPerUnic epuc2 = epucBuilder2
+ .ceVlanMap(new ServiceListType("12"))
+ .ingressBwpGroupIndex("0")
+ .build();
+
+ Evc.EvcBuilder evcBuilder2 = new DefaultEvc.EvcBuilder();
+ evcList.add(evcBuilder2
+ .evcIndex(2)
+ .name(new Identifier45("evc-2"))
+ .evcPerUni(epuBuilder.evcPerUnin(epun2).evcPerUnic(epuc2).build())
+ .build());
+
+ Uni.UniBuilder uniBuilder = new DefaultUni.UniBuilder();
+ Uni uni = uniBuilder.name(new Identifier45("testUni")).evc(evcList).build();
+
+ MefServices.MefServicesBuilder mefBuilder = new DefaultMefServices.MefServicesBuilder();
+ MefServices mefServices = mefBuilder.uni(uni).build();
+
+ MseaUniEvcService.MseaUniEvcServiceBuilder evcUniBuilder =
+ new MseaUniEvcServiceOpParam.MseaUniEvcServiceBuilder();
+
+ MseaUniEvcServiceOpParam mseaUniEvcServiceFilter =
+ (MseaUniEvcServiceOpParam) evcUniBuilder.mefServices(mefServices).build();
+ try {
+ mseaUniEvcServiceSvc.setMseaUniEvcService(mseaUniEvcServiceFilter, session, TargetConfig.RUNNING);
+ } catch (NetconfException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ fail("Error: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testSetMseaUniEvcServiceMseaUniEvcServiceOpParamProfiles() {
+ List<Cos> cosList = new ArrayList<Cos>();
+ Cos.CosBuilder cosBuilder0 = new DefaultCos.CosBuilder();
+ cosList.add(cosBuilder0.cosIndex(0).name("cos0").build());
+ Cos.CosBuilder cosBuilder1 = new DefaultCos.CosBuilder();
+ cosList.add(cosBuilder1.cosIndex(1).name("cos1").build());
+
+ List<BwpGroup> bwpGroupList = new ArrayList<BwpGroup>();
+ BwpGroup.BwpGroupBuilder bwpGrpBuilder = new DefaultBwpGroup.BwpGroupBuilder();
+ bwpGroupList.add(bwpGrpBuilder.groupIndex((short) 0).build());
+
+ List<Bwp> bwpList = new ArrayList<Bwp>();
+ Bwp.BwpBuilder bwpBuilder1 = new DefaultBwp.BwpBuilder();
+ bwpList.add(bwpBuilder1.cosIndex(0).colorMode(ColorModeEnum.COLORAWARE).build());
+ Bwp.BwpBuilder bwpBuilder2 = new DefaultBwp.BwpBuilder();
+ bwpList.add(bwpBuilder2.cosIndex(1).colorMode(ColorModeEnum.COLORBLIND).build());
+
+ BwpGroup.BwpGroupBuilder bwpGrpBuilder1 = new DefaultBwpGroup.BwpGroupBuilder();
+ bwpGroupList.add(bwpGrpBuilder1.groupIndex((short) 1).bwp(bwpList).build());
+
+ Profiles.ProfilesBuilder profilesBuilder = new DefaultProfiles.ProfilesBuilder();
+ Profiles profiles = profilesBuilder.bwpGroup(bwpGroupList).build();
+
+ MefServices.MefServicesBuilder mefBuilder = new DefaultMefServices.MefServicesBuilder();
+ MefServices mefServices = mefBuilder.profiles(profiles).build();
+
+ MseaUniEvcService.MseaUniEvcServiceBuilder evcUniBuilder =
+ new MseaUniEvcServiceOpParam.MseaUniEvcServiceBuilder();
+
+ MseaUniEvcServiceOpParam mseaUniEvcServiceFilter =
+ (MseaUniEvcServiceOpParam) evcUniBuilder.mefServices(mefServices).build();
+ try {
+ mseaUniEvcServiceSvc.setMseaUniEvcService(mseaUniEvcServiceFilter, session, TargetConfig.RUNNING);
+ } catch (NetconfException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ fail("Error: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testGetMseaUniEvcCeVlanMaps() {
+
+ try {
+ MseaUniEvcService ceVlanMapsResult7 =
+ mseaUniEvcServiceSvc.getmseaUniEvcCeVlanMaps(session, TargetConfig.RUNNING);
+
+ assertNotNull(ceVlanMapsResult7.mefServices().uni().evc());
+
+ List<Evc> evcList = ceVlanMapsResult7.mefServices().uni().evc();
+ assertEquals(3, evcList.size());
+ for (Evc evc : evcList) {
+ assertNotNull(evc.evcPerUni().evcPerUnic().ceVlanMap());
+ assertNotNull(evc.evcPerUni().evcPerUnin().ceVlanMap());
+
+ if (evc.evcIndex() == 7) {
+ assertEquals("700,710,720", evc.evcPerUni().evcPerUnic().ceVlanMap().string());
+ assertEquals("701:703", evc.evcPerUni().evcPerUnin().ceVlanMap().string());
+ }
+ }
+
+ } catch (NetconfException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ fail("Error: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testChangeEvcCeVlanMap() {
+ EvcPerUnin.EvcPerUninBuilder epunBuilder1 = new DefaultEvcPerUnin.EvcPerUninBuilder();
+ EvcPerUnin epun1 = epunBuilder1
+ .evcPerUniServiceType(EvcPerUniServiceTypeEnum.EVPL)
+ .ceVlanMap(ServiceListType.fromString("10"))
+ .ingressBwpGroupIndex("0")
+ .build();
+
+ EvcPerUnic.EvcPerUnicBuilder epucBuilder1 = new DefaultEvcPerUnic.EvcPerUnicBuilder();
+ EvcPerUnic epuc1 = epucBuilder1
+ .ceVlanMap(new ServiceListType("11"))
+ .ingressBwpGroupIndex("0")
+ .build();
+
+ EvcPerUni.EvcPerUniBuilder epuBuilder = DefaultEvcPerUni.builder().evcPerUnic(epuc1).evcPerUnin(epun1);
+
+ Evc evc = CustomEvc.builder().evcPerUni(epuBuilder.build()).build();
+
+ assertEquals("10", evc.evcPerUni().evcPerUnin().ceVlanMap().string());
+ assertEquals("11", evc.evcPerUni().evcPerUnic().ceVlanMap().string());
+
+ evc = CustomEvc.builder(evc).addToCeVlanMap(new ServiceListType("12,13"), UniSide.NETWORK).build();
+
+ assertEquals("10,12:13", evc.evcPerUni().evcPerUnin().ceVlanMap().string());
+ assertEquals("11", evc.evcPerUni().evcPerUnic().ceVlanMap().string());
+
+ }
+
+ @Test
+ public void testChangeEvcCeVlanMapNoValues() {
+ EvcPerUnin.EvcPerUninBuilder epunBuilder1 = CustomEvcPerUnin.builder();
+ EvcPerUnin epun1 = epunBuilder1
+ .evcPerUniServiceType(EvcPerUniServiceTypeEnum.EVPL)
+ .ingressBwpGroupIndex("0")
+ .build();
+
+ EvcPerUnic.EvcPerUnicBuilder epucBuilder1 = CustomEvcPerUnic.builder();
+ EvcPerUnic epuc1 = epucBuilder1
+ .ingressBwpGroupIndex("0")
+ .build();
+
+ EvcPerUni.EvcPerUniBuilder epuBuilder = DefaultEvcPerUni.builder().evcPerUnic(epuc1).evcPerUnin(epun1);
+
+ Evc evc = CustomEvc.builder().evcPerUni(epuBuilder.build()).build();
+
+ assertEquals("0", evc.evcPerUni().evcPerUnin().ceVlanMap().string());
+ assertEquals("0", evc.evcPerUni().evcPerUnic().ceVlanMap().string());
+ }
+
+ @Test
+ public void testRemoveEvcUniFlowEntries() {
+
+ Map<Integer, String> ceVlanUpdates = new TreeMap<>();
+ ceVlanUpdates.put((1 << 2), "");
+ ceVlanUpdates.put((1 << 2) + 1, "");
+ ceVlanUpdates.put((2 << 2), "");
+ ceVlanUpdates.put((2 << 2) + 1, "");
+
+ ceVlanUpdates.put((7 << 2), "700,710,720");
+ ceVlanUpdates.put((7 << 2) + 1, "701:703");
+ ceVlanUpdates.put((8 << 2), "800,810,820");
+ ceVlanUpdates.put((8 << 2) + 1, "801,802,803");
+
+ Map<Integer, List<Short>> flowVlanIdMap = new HashMap<>();
+ //These should get ignored because whole EVC is being deleted
+ flowVlanIdMap.put(1 << 2, new ArrayList<Short>());
+ flowVlanIdMap.get(1 << 2).add((short) 11);
+
+ flowVlanIdMap.put((1 << 2) + 1, new ArrayList<Short>());
+ flowVlanIdMap.get((1 << 2) + 1).add((short) 12L);
+
+ //These are the EVCs being removed
+ flowVlanIdMap.put(7 << 2, new ArrayList<Short>());
+ flowVlanIdMap.get(7 << 2).add((short) 730L);
+ flowVlanIdMap.get(7 << 2).add((short) 740L);
+
+ flowVlanIdMap.put((7 << 2) + 1, new ArrayList<Short>());
+ flowVlanIdMap.get((7 << 2) + 1).add((short) 705L);
+ flowVlanIdMap.get((7 << 2) + 1).add((short) 706L);
+
+ flowVlanIdMap.put(8 << 2, new ArrayList<Short>());
+ flowVlanIdMap.get(8 << 2).add((short) 830L);
+ flowVlanIdMap.get(8 << 2).add((short) 840L);
+
+ flowVlanIdMap.put((8 << 2) + 1, new ArrayList<Short>());
+ flowVlanIdMap.get((8 << 2) + 1).add((short) 805L);
+ flowVlanIdMap.get((8 << 2) + 1).add((short) 806L);
+
+ try {
+ mseaUniEvcServiceSvc.removeEvcUniFlowEntries(
+ ceVlanUpdates, flowVlanIdMap, session, TargetConfig.RUNNING,
+ UniSideInterfaceAssignmentEnum.UNI_C_ON_OPTICS);
+ } catch (NetconfException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ fail("Error: " + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testGetVlanSet1() {
+ Short[] vlanIds = CeVlanMapUtils.getVlanSet("10");
+ assertEquals(1, vlanIds.length);
+ }
+
+ @Test
+ public void testGetVlanSet2() {
+ Short[] vlanIds = CeVlanMapUtils.getVlanSet("10:20");
+ assertEquals(11, vlanIds.length);
+ assertEquals(10, vlanIds[0].shortValue());
+ assertEquals(20, vlanIds[10].shortValue());
+ }
+
+ @Test
+ public void testGetVlanSet3() {
+ Short[] vlanIds = CeVlanMapUtils.getVlanSet("10:20,30:40");
+ assertEquals(22, vlanIds.length);
+ assertEquals(10, vlanIds[0].shortValue());
+ assertEquals(40, vlanIds[21].shortValue());
+ }
+
+ @Test
+ public void testGetVlanSet4() {
+ Short[] vlanIds = CeVlanMapUtils.getVlanSet("10,20,30");
+ assertEquals(3, vlanIds.length);
+ assertEquals(10, vlanIds[0].shortValue());
+ assertEquals(30, vlanIds[2].shortValue());
+ }
+
+ @Test
+ public void testVlanListAsString() {
+ assertEquals("20:22", CeVlanMapUtils.vlanListAsString(new Short[]{20, 21, 22}));
+
+ assertEquals("20:22,24:25",
+ CeVlanMapUtils.vlanListAsString(new Short[]{20, 21, 22, 24, 25}));
+
+ assertEquals("30,33,36:40",
+ CeVlanMapUtils.vlanListAsString(new Short[]{30, 33, 36, 37, 38, 39, 40}));
+
+ assertEquals("20", CeVlanMapUtils.vlanListAsString(new Short[]{20}));
+
+ assertEquals("20,22,24,26,28",
+ CeVlanMapUtils.vlanListAsString(new Short[]{20, 22, 24, 26, 28}));
+ }
+
+ @Test
+ public void testAddtoCeVlanMap() {
+ assertEquals("20,22:24,26,28",
+ CeVlanMapUtils.addtoCeVlanMap("20,22,24,26,28", (short) 23));
+
+ assertEquals("20:26,28",
+ CeVlanMapUtils.addtoCeVlanMap("20,21,22,24,25,26,28", (short) 23));
+
+ assertEquals("20,23",
+ CeVlanMapUtils.addtoCeVlanMap("20", (short) 23));
+
+ assertEquals("20,22:23",
+ CeVlanMapUtils.addtoCeVlanMap("20,22", (short) 23));
+ }
+
+ @Test
+ public void testCombineVlanSets() {
+ assertEquals("10:11,13:14", CeVlanMapUtils.combineVlanSets("10:11", "13:14"));
+
+ assertEquals("10:14", CeVlanMapUtils.combineVlanSets("10:11", "12:14"));
+
+ assertEquals("10:11,14", CeVlanMapUtils.combineVlanSets("10:11", "14"));
+
+ assertEquals("10:12", CeVlanMapUtils.combineVlanSets("10:11", "11:12"));
+ }
+
+ @Test
+ public void testRemoveZeroIfPossible() {
+ assertEquals("0", CeVlanMapUtils.removeZeroIfPossible(""));
+
+ assertEquals("0", CeVlanMapUtils.removeZeroIfPossible("0"));
+
+ assertEquals("1,3", CeVlanMapUtils.removeZeroIfPossible("0:1,3"));
+
+ assertEquals("1:2", CeVlanMapUtils.removeZeroIfPossible("0:2"));
+
+ assertEquals("10:12", CeVlanMapUtils.removeZeroIfPossible("0,10:12"));
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/package-info.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/package-info.java
new file mode 100644
index 0000000..4173ece
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Package for Microsemi device drivers support for NETCONF for EA1000.
+ */
+package org.onosproject.drivers.microsemi.yang;
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/utils/IetfYangTypesUtilsTest.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/utils/IetfYangTypesUtilsTest.java
new file mode 100644
index 0000000..4e62beb
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/drivers/microsemi/yang/utils/IetfYangTypesUtilsTest.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.drivers.microsemi.yang.utils;
+
+import static org.junit.Assert.assertEquals;
+
+import java.time.LocalDateTime;
+import java.time.OffsetDateTime;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev20130715.ietfyangtypes.DateAndTime;
+
+public class IetfYangTypesUtilsTest {
+
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testFromYangDateTime() {
+ OffsetDateTime odt = IetfYangTypesUtils.fromYangDateTime(DateAndTime.fromString("2015-07-08T12:49:20.9Z"));
+ assertEquals(OffsetDateTime.of(2015, 7, 8, 12, 49, 20, 900000000, ZoneOffset.UTC), odt);
+ }
+
+ @Test
+ public void testFromYangDateTimeZoned() {
+ ZonedDateTime zdt = IetfYangTypesUtils.fromYangDateTimeZoned(DateAndTime.fromString("2015-07-08T12:49:20.9Z"),
+ ZoneId.systemDefault());
+
+ assertEquals(OffsetDateTime.of(2015, 7, 8, 12, 49, 20, 900000000, ZoneOffset.UTC).toInstant(),
+ zdt.toOffsetDateTime().toInstant());
+ }
+
+ @Test
+ public void testFromYangDateTimeToLocal() {
+ LocalDateTime ldt = IetfYangTypesUtils
+ .fromYangDateTimeToLocal(DateAndTime.fromString("2015-07-08T12:49:20.9Z"));
+
+ OffsetDateTime odtExpected = OffsetDateTime.of(2015, 7, 8, 12, 49, 20, 900000000, ZoneOffset.UTC);
+ ZoneOffset offsetForcurrentZone = ZoneId.systemDefault().getRules().getOffset(ldt);
+ assertEquals(odtExpected.toInstant(), ldt.toInstant(offsetForcurrentZone));
+ }
+
+}
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/yms/app/yab/MockYmsManager.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/yms/app/yab/MockYmsManager.java
new file mode 100644
index 0000000..7645a32
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/yms/app/yab/MockYmsManager.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yms.app.yab;
+
+import static java.lang.String.valueOf;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.onosproject.core.CoreService;
+import org.onosproject.core.IdGenerator;
+import org.onosproject.drivers.netconf.MockCoreService;
+import org.onosproject.yms.app.ych.DefaultYangCodecHandler;
+import org.onosproject.yms.app.ych.defaultcodecs.YangCodecRegistry;
+import org.onosproject.yms.app.ydt.YangRequestWorkBench;
+import org.onosproject.yms.app.ysr.DefaultYangModuleLibrary;
+import org.onosproject.yms.app.ysr.MockYangSchemaRegistry;
+import org.onosproject.yms.app.ysr.YangSchemaRegistry;
+import org.onosproject.yms.ych.YangCodecHandler;
+import org.onosproject.yms.ych.YangDataTreeCodec;
+import org.onosproject.yms.ych.YangProtocolEncodingFormat;
+import org.onosproject.yms.ydt.YdtBuilder;
+import org.onosproject.yms.ydt.YdtResponse;
+import org.onosproject.yms.ydt.YdtWalker;
+import org.onosproject.yms.ydt.YmsOperationType;
+import org.onosproject.yms.ymsm.YmsService;
+import org.onosproject.yms.ynh.YangNotificationService;
+import org.onosproject.yms.ysr.YangModuleIdentifier;
+import org.onosproject.yms.ysr.YangModuleLibrary;
+
+/**
+ * Represents implementation of YANG application management system manager.
+ */
+public class MockYmsManager
+ implements YmsService {
+ private static final String MODULE_ID = "module-id";
+
+ YangSchemaRegistry schemaRegistry;
+ private YangModuleLibrary library;
+ private IdGenerator moduleIdGenerator;
+
+ @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+ protected CoreService coreService;
+
+ public MockYmsManager()
+ throws InstantiationException, IllegalAccessException, IOException {
+ coreService = new MockCoreService();
+ moduleIdGenerator = coreService.getIdGenerator(MODULE_ID);
+ library = new DefaultYangModuleLibrary(getNewModuleId());
+ YangCodecRegistry.initializeDefaultCodec();
+ }
+
+ @Override
+ public YdtBuilder getYdtBuilder(String logicalRootName,
+ String rootNamespace,
+ YmsOperationType operationType) {
+ return new YangRequestWorkBench(logicalRootName, rootNamespace,
+ operationType, schemaRegistry, false);
+ }
+
+ @Override
+ public YdtBuilder getYdtBuilder(String logicalRootName,
+ String rootNamespace,
+ YmsOperationType operationType,
+ Object schemaRegistryForYdt) {
+ return null;
+ }
+
+ @Override
+ public YdtWalker getYdtWalker() {
+ return null;
+ }
+
+ @Override
+ public YdtResponse executeOperation(YdtBuilder operationRequest) {
+ YangApplicationBroker requestBroker =
+ new YangApplicationBroker(schemaRegistry);
+ switch (operationRequest.getYmsOperationType()) {
+ case EDIT_CONFIG_REQUEST:
+ try {
+ return requestBroker.processEdit(operationRequest);
+ } catch (CloneNotSupportedException e) {
+ }
+ break;
+ case QUERY_CONFIG_REQUEST:
+ case QUERY_REQUEST:
+ return requestBroker.processQuery(operationRequest);
+ case RPC_REQUEST:
+ return requestBroker.processOperation(operationRequest);
+ default:
+ }
+ return null;
+ }
+
+ @Override
+ public YangNotificationService getYangNotificationService() {
+ return null;
+ }
+
+ @Override
+ public void registerService(Object appManager, Class<?> yangService,
+ List<String> supportedFeatureList) {
+ }
+
+ @Override
+ public void unRegisterService(Object appManager, Class<?> yangService) {
+
+ }
+
+ @Override
+ public YangModuleLibrary getYangModuleLibrary() {
+ return library;
+ }
+
+ @Override
+ public String getYangFile(YangModuleIdentifier moduleIdentifier) {
+ return null;
+ }
+
+ @Override
+ public void registerDefaultCodec(YangDataTreeCodec defaultCodec,
+ YangProtocolEncodingFormat dataFormat) {
+ }
+
+ @Override
+ public YangCodecHandler getYangCodecHandler() {
+ YangSchemaRegistry registry = new MockYangSchemaRegistry();
+ DefaultYangCodecHandler handler = new DefaultYangCodecHandler(registry);
+ handler.setLibrary(new DefaultYangModuleLibrary(getNewModuleId()));
+ return handler;
+ }
+
+ private String getNewModuleId() {
+ return valueOf(moduleIdGenerator.getNewId());
+ }
+}
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/yms/app/yab/package-info.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/yms/app/yab/package-info.java
new file mode 100644
index 0000000..a8a971c
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/yms/app/yab/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Package for Microsemi device drivers support for NETCONF for EA1000.
+ */
+package org.onosproject.yms.app.yab;
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/yms/app/ysr/MockYangSchemaRegistry.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/yms/app/ysr/MockYangSchemaRegistry.java
new file mode 100644
index 0000000..5de56fd
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/yms/app/ysr/MockYangSchemaRegistry.java
@@ -0,0 +1,767 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yms.app.ysr;
+
+import org.onosproject.yangutils.datamodel.YangInclude;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangSchemaNode;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yms.ysr.YangModuleIdentifier;
+import org.onosproject.yms.ysr.YangModuleInformation;
+import org.onosproject.yms.ysr.YangModuleLibrary;
+import org.slf4j.Logger;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.regex.Pattern;
+
+import static java.util.Collections.sort;
+import static org.apache.commons.io.FileUtils.deleteDirectory;
+import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.deSerializeDataModel;
+import static org.onosproject.yangutils.utils.UtilConstants.EVENT_STRING;
+import static org.onosproject.yangutils.utils.UtilConstants.HYPHEN;
+import static org.onosproject.yangutils.utils.UtilConstants.OP_PARAM;
+import static org.onosproject.yangutils.utils.UtilConstants.PERIOD;
+import static org.onosproject.yangutils.utils.UtilConstants.SERVICE;
+import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
+import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
+import static org.slf4j.LoggerFactory.getLogger;
+
+
+/**
+ * Representation of default YANG schema registry. Yang schema registry
+ * provides interface to an application to register its YANG schema
+ * with YMS. It provides YANG schema nodes to YDT, YNB and YSB.
+ */
+public class MockYangSchemaRegistry implements YangSchemaRegistry {
+
+ private static final String SYSTEM = SLASH + "system" + SLASH;
+ private static final String MAVEN = "mvn:";
+ private static final String JAR = ".jar";
+ private static final String USER_DIRECTORY = "user.dir";
+ private static final String AT = "@";
+ private static final String DATE_FORMAT = "yyyy-mm-dd";
+ private static final String ONOS = "org.onosproject";
+ private static final Logger log = getLogger(MockYangSchemaRegistry.class);
+
+ private static final String FS = File.separator;
+ private static final String USER_DIR = System.getProperty("user.dir").replaceAll("ea1000driver", "ea1000yang");
+// private static final String BUCK_OUT_DIR = "/buck-out/gen/drivers/microsemi/ea1000yang/";
+ private static final String BUCK_OUT_BIN_LOC =
+ "/buck-out/bin/drivers/microsemi/ea1000yang/"
+ + "lib__onos-drivers-microsemi-ea1000yang__classes/YangMetaData.ser";
+ private static final String PATH = FS + "target" + FS + "classes" + FS;
+ private static final String SER_FILE_PATH = "yang" + FS + "resources" +
+ FS + "YangMetaData.ser";
+ private static final String RESOURCE = "src/test/resources";
+
+
+ /*
+ * Map for storing app objects.
+ */
+ private final ConcurrentMap<String, Object> appObjectStore;
+
+ /*
+ * Map for storing YANG schema nodes.
+ */
+ private final ConcurrentMap<String, ConcurrentMap<String, YangSchemaNode>>
+ yangSchemaStore;
+
+ /*
+ * Map for storing YANG schema nodes with respect to root's generated
+ * interface file name.
+ */
+ private final ConcurrentMap<String, YangSchemaNode> interfaceNameKeyStore;
+
+ /*
+ * Map for storing YANG schema nodes root's generated op param file name.
+ */
+ private final ConcurrentMap<String, YangSchemaNode> opParamNameKeyStore;
+
+ /*
+ * Map for storing YANG schema nodes with respect to notifications.
+ */
+ private final ConcurrentMap<String, YangSchemaNode> eventNameKeyStore;
+
+ /*
+ * Map for storing YANG schema nodes with respect to app name.
+ */
+ private final ConcurrentMap<String, YangSchemaNode> appNameKeyStore;
+
+ /*
+ * Map for storing registered classes.
+ */
+ private final ConcurrentMap<String, Class<?>> registerClassStore;
+
+ /*
+ * Map for storing YANG file details.
+ */
+ private final ConcurrentMap<YangModuleIdentifier, String> yangFileStore;
+
+ /**
+ * Map for storing schema nodes with respect to namespace.
+ */
+ private final ConcurrentMap<String, YangSchemaNode> nameSpaceSchemaStore;
+
+ private final ConcurrentMap<Object, Boolean> ynhRegistrationStore;
+ private final ConcurrentMap<String, String> jarPathStore;
+
+ /**
+ * Creates an instance of default YANG schema registry.
+ */
+ public MockYangSchemaRegistry() {
+ appObjectStore = new ConcurrentHashMap<>();
+ yangSchemaStore = new ConcurrentHashMap<>();
+ interfaceNameKeyStore = new ConcurrentHashMap<>();
+ opParamNameKeyStore = new ConcurrentHashMap<>();
+ eventNameKeyStore = new ConcurrentHashMap<>();
+ registerClassStore = new ConcurrentHashMap<>();
+ yangFileStore = new ConcurrentHashMap<>();
+ appNameKeyStore = new ConcurrentHashMap<>();
+ ynhRegistrationStore = new ConcurrentHashMap<>();
+ jarPathStore = new ConcurrentHashMap<>();
+ nameSpaceSchemaStore = new ConcurrentHashMap<>();
+ }
+
+
+ /**
+ * This is overridden for Maven and Buck.
+ *
+ * Because they don't have a Bundle Context, and the JAR file doesn't exist
+ * when this is called, we have to work with the .ser file
+ */
+ @Override
+ public void registerApplication(Object appObject, Class<?> serviceClass) {
+ synchronized (MockYangSchemaRegistry.class) {
+ doPreProcessing(serviceClass, appObject);
+ if (!verifyIfApplicationAlreadyRegistered(serviceClass)) {
+
+ List<YangNode> curNodes = new ArrayList<>();
+ Path serFile = Paths.get(USER_DIR, PATH, SER_FILE_PATH);
+ if (USER_DIR.contains("ea1000yang")) {
+ serFile = Paths.get(USER_DIR, PATH, SER_FILE_PATH);
+ } else {
+ serFile = Paths.get(USER_DIR, BUCK_OUT_BIN_LOC);
+ }
+
+ if (Files.notExists(serFile)) {
+ throw new UncheckedIOException(
+ new IOException("File " + serFile.toString() + " does not exist!"));
+ }
+
+ try {
+ curNodes.addAll(deSerializeDataModel(serFile.toString()));
+ } catch (IOException e) {
+ throw new UncheckedIOException(e);
+ }
+
+ // process application registration.
+ if (curNodes != null && !curNodes.isEmpty()) {
+ jarPathStore.put(serviceClass.getName(), serFile.toString());
+ processRegistration(serviceClass, serFile.toString(),
+ curNodes, appObject, false);
+ } else {
+ throw new UncheckedIOException(
+ new IOException("Unable to find Yang Nodes in serFile: " + serFile.toString()));
+ }
+ }
+ }
+ }
+
+ @Override
+ public void unRegisterApplication(Object managerObject,
+ Class<?> serviceClass) {
+ synchronized (MockYangSchemaRegistry.class) {
+ YangSchemaNode curNode;
+ String serviceName = serviceClass.getName();
+
+ //Check if service should be unregistered?
+ if (managerObject != null) {
+ verifyApplicationRegistration(managerObject, serviceClass);
+ }
+ //Remove registered class from store.
+ registerClassStore.remove(serviceName);
+ //check if service is in app store.
+ curNode = appNameKeyStore.get(serviceName);
+ if (curNode == null) {
+ curNode = interfaceNameKeyStore.get(serviceName);
+ }
+
+ if (curNode != null) {
+ removeSchemaNode(curNode);
+ eventNameKeyStore.remove(getEventClassName(curNode));
+ appObjectStore.remove(serviceName);
+ interfaceNameKeyStore.remove(getInterfaceClassName(curNode));
+ opParamNameKeyStore.remove(getOpParamClassName(curNode));
+ yangFileStore.remove(getModuleIdentifier(curNode));
+ appNameKeyStore.remove(serviceName);
+ nameSpaceSchemaStore.remove(curNode.getNameSpace()
+ .getModuleNamespace());
+ removeYsrGeneratedTemporaryResources(jarPathStore.get(serviceName),
+ serviceName);
+ log.info(" service {} is unregistered.",
+ serviceClass.getSimpleName());
+ } else {
+ throw new RuntimeException(serviceClass.getSimpleName() +
+ " service was not registered.");
+ }
+ }
+ }
+
+ @Override
+ public Object getRegisteredApplication(YangSchemaNode schemaNode) {
+ Object obj = null;
+ if (schemaNode != null) {
+ String name = getServiceName(schemaNode);
+ obj = appObjectStore.get(name);
+ if (obj == null) {
+ log.error("{} not found.", name);
+ }
+ }
+ return obj;
+ }
+
+ @Override
+ public YangSchemaNode getYangSchemaNodeUsingSchemaName(String schemaName) {
+ return getSchemaNodeUsingSchemaNameWithRev(schemaName);
+ }
+
+ @Override
+ public YangSchemaNode getYangSchemaNodeUsingAppName(String appName) {
+ YangSchemaNode node = appNameKeyStore.get(appName);
+ if (node == null) {
+ log.error("{} not found.", appName);
+ }
+ return node;
+ }
+
+ @Override
+ public YangSchemaNode
+ getYangSchemaNodeUsingGeneratedRootNodeInterfaceFileName(String name) {
+ YangSchemaNode node = interfaceNameKeyStore.get(name);
+ if (node == null) {
+ log.error("{} not found.", name);
+ }
+ return node;
+ }
+
+ @Override
+ public YangSchemaNode getYangSchemaNodeUsingGeneratedRootNodeOpPramFileName(
+ String name) {
+ YangSchemaNode node = opParamNameKeyStore.get(name);
+ if (node == null) {
+ log.error("{} not found.", name);
+ }
+ return node;
+ }
+
+ @Override
+ public YangSchemaNode getRootYangSchemaNodeForNotification(String name) {
+ YangSchemaNode node = eventNameKeyStore.get(name);
+ if (node == null) {
+ log.error("{} not found.", name);
+ }
+ return node;
+ }
+
+ @Override
+ public Class<?> getRegisteredClass(YangSchemaNode schemaNode) {
+ String interfaceName = getInterfaceClassName(schemaNode);
+ String serviceName = getServiceName(schemaNode);
+ Class<?> regClass = registerClassStore.get(serviceName);
+ if (regClass == null) {
+ regClass = registerClassStore.get(interfaceName);
+ }
+ return regClass;
+ }
+
+ @Override
+ public YangSchemaNode getSchemaWrtNameSpace(String nameSpace) {
+
+ YangSchemaNode node = nameSpaceSchemaStore.get(nameSpace);
+ if (node == null) {
+ log.error("node with {} namespace not found.", nameSpace);
+ }
+ return node;
+ }
+
+ @Override
+ public String getYangFile(YangModuleIdentifier moduleIdentifier) {
+ String file = yangFileStore.get(moduleIdentifier);
+ if (file == null) {
+ log.error("YANG files for corresponding module identifier {} not " +
+ "found", moduleIdentifier);
+ }
+ return file;
+ }
+
+ @Override
+ public boolean verifyNotificationObject(Object appObj, Class<?> service) {
+ synchronized (MockYangSchemaRegistry.class) {
+ YangSchemaNode node = appNameKeyStore.get(service.getName());
+ if (node == null) {
+ log.error("application is not registered with YMS {}",
+ service.getName());
+ return false;
+ }
+ try {
+ if (node.isNotificationPresent()) {
+ if (appObj != null) {
+ Boolean ifPresent = ynhRegistrationStore.get(appObj);
+ if (ifPresent == null) {
+ ynhRegistrationStore.put(appObj, true);
+ return true;
+ }
+ }
+ }
+ } catch (DataModelException e) {
+ log.error("notification registration error: {} {}", e
+ .getLocalizedMessage(), e);
+ }
+ return false;
+ }
+ }
+
+ @Override
+ public void flushYsrData() {
+ appObjectStore.clear();
+ yangSchemaStore.clear();
+ eventNameKeyStore.clear();
+ opParamNameKeyStore.clear();
+ interfaceNameKeyStore.clear();
+ registerClassStore.clear();
+ yangFileStore.clear();
+ nameSpaceSchemaStore.clear();
+ }
+
+ @Override
+ public void processModuleLibrary(String serviceName,
+ YangModuleLibrary library) {
+ synchronized (MockYangSchemaRegistry.class) {
+ YangSchemaNode node = appNameKeyStore.get(serviceName);
+ if (node != null) {
+ YangModuleInformation moduleInformation =
+ new DefaultYangModuleInformation(getModuleIdentifier(node),
+ node.getNameSpace());
+ addSubModuleIdentifier(node, (
+ DefaultYangModuleInformation) moduleInformation);
+ //TODO: add feature list to module information.
+ ((DefaultYangModuleLibrary) library)
+ .addModuleInformation(moduleInformation);
+ }
+ }
+ }
+
+ /**
+ * Process service class.
+ *
+ * @param serviceClass service class
+ * @param appObject application object
+ */
+
+ void doPreProcessing(Class<?> serviceClass, Object appObject) {
+
+ //Check if service should be registered?
+ if (appObject != null) {
+ verifyApplicationRegistration(appObject, serviceClass);
+ }
+ String name = serviceClass.getName();
+ //Add app class to registered service store.
+ if (!registerClassStore.containsKey(name)) {
+ registerClassStore.put(name, serviceClass);
+ }
+ }
+
+ void updateServiceClass(Class<?> service) {
+ registerClassStore.put(service.getName(), service);
+ }
+
+ /**
+ * Process application registration.
+ *
+ * @param service service class
+ * @param jarPath jar path
+ * @param nodes YANG nodes
+ * @param appObj application object
+ * @param isFromUt if registration is being called form unit test
+ */
+ void processRegistration(Class<?> service, String jarPath,
+ List<YangNode> nodes,
+ Object appObj, boolean isFromUt) {
+
+ // process storing operations.
+ YangNode schemaNode = findNodeWhichShouldBeReg(service.getName(), nodes);
+ if (schemaNode != null) {
+ if (appObj != null) {
+ appObjectStore.put(service.getName(), appObj);
+ }
+ //Process application context for registrations.
+ processApplicationContext(schemaNode, service.getName(), isFromUt);
+ //Update YANG file store.
+ updateYangFileStore(schemaNode, jarPath);
+ }
+ }
+
+ /**
+ * Returns the node for which corresponding class is generated.
+ *
+ * @param name generated class name
+ * @param nodes list of yang nodes
+ * @return node for which corresponding class is generated
+ */
+ private YangNode findNodeWhichShouldBeReg(String name, List<YangNode> nodes) {
+ for (YangNode node : nodes) {
+ if (name.equals(getServiceName(node)) ||
+ name.equals(getInterfaceClassName(node))) {
+ return node;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Verifies if service class should be registered or not.
+ *
+ * @param appObject application object
+ * @param appClass application class
+ */
+ private void verifyApplicationRegistration(Object appObject,
+ Class<?> appClass) {
+ Class<?> managerClass = appObject.getClass();
+ Class<?>[] services = managerClass.getInterfaces();
+ List<Class<?>> classes = new ArrayList<>();
+ Collections.addAll(classes, services);
+ if (!classes.contains(appClass)) {
+ throw new RuntimeException("service class " + appClass.getName() +
+ "is not being implemented by " +
+ managerClass.getName());
+ }
+ }
+
+ /**
+ * Verifies if application is already registered with YMS.
+ *
+ * @param appClass application class
+ * @return true if application already registered
+ */
+ private boolean verifyIfApplicationAlreadyRegistered(Class<?> appClass) {
+ String appName = appClass.getName();
+ return appObjectStore.containsKey(appName) ||
+ interfaceNameKeyStore.containsKey(appName);
+ }
+
+ /**
+ * Updates yang file store for YANG node.
+ *
+ * @param node YANG node
+ * @param jarPath jar file path
+ */
+ private void updateYangFileStore(YangNode node, String jarPath) {
+ yangFileStore.put(getModuleIdentifier(node),
+ getYangFilePath(jarPath, node.getFileName()));
+ }
+
+ /**
+ * Returns yang file path.
+ *
+ * @param jarPath jar path
+ * @param metaDataFileName name of yang file from metadata
+ * @return yang file path
+ */
+ private String getYangFilePath(String jarPath, String metaDataFileName) {
+ String[] metaData = metaDataFileName.split(SLASH);
+ return jarPath + SLASH + metaData[metaData.length - 1];
+ }
+
+
+ /**
+ * Process an application an updates the maps for YANG schema registry.
+ *
+ * @param appNode application YANG schema nodes
+ * @param name class name
+ * @param isFormUt if method is being called from unit tests
+ */
+ private void processApplicationContext(YangSchemaNode appNode, String name,
+ boolean isFormUt) {
+
+ //Update map for which registrations is being called.
+ appNameKeyStore.put(name, appNode);
+
+ // Updates schema store.
+ addToSchemaStore(appNode);
+ // update interface store.
+ interfaceNameKeyStore.put(getInterfaceClassName(appNode), appNode);
+
+ //update op param store.
+ opParamNameKeyStore.put(getOpParamClassName(appNode), appNode);
+
+ //update namespaceSchema store.
+ nameSpaceSchemaStore.put(appNode.getNameSpace().getModuleNamespace(), appNode);
+
+ //Checks if notification is present then update notification store map.
+ String eventSubject = null;
+ try {
+ if (appNode.isNotificationPresent()) {
+ eventSubject = getEventClassName(appNode);
+ }
+ } catch (DataModelException e) {
+ log.error("failed to search notification from schema map : {}",
+ e.getLocalizedMessage());
+ }
+ if (eventSubject != null) {
+ eventNameKeyStore.put(eventSubject, appNode);
+ }
+ if (!isFormUt) {
+ log.info("successfully registered this application {}", name);
+ }
+ }
+
+ /**
+ * Returns jar path from bundle mvnLocationPath.
+ *
+ * @param mvnLocationPath mvnLocationPath of bundle
+ * @return path of jar
+ */
+ private String getJarPathFromBundleLocation(String mvnLocationPath,
+ String currentDirectory) {
+ String path = currentDirectory + SYSTEM;
+ if (mvnLocationPath.contains(MAVEN)) {
+ String[] strArray = mvnLocationPath.split(MAVEN);
+ if (strArray[1].contains(File.separator)) {
+ String[] split = strArray[1].split(File.separator);
+ if (split[0].contains(PERIOD)) {
+ String[] groupId = split[0].split(Pattern.quote(PERIOD));
+ return path + groupId[0] + SLASH + groupId[1] + SLASH + split[1] +
+ SLASH + split[2] + SLASH + split[1] + HYPHEN + split[2];
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns schema node based on the revision.
+ *
+ * @param name name of the schema node
+ * @return schema node based on the revision
+ */
+ private YangSchemaNode getSchemaNodeUsingSchemaNameWithRev(String name) {
+ ConcurrentMap<String, YangSchemaNode> revMap;
+ YangSchemaNode schemaNode;
+ if (name.contains(AT)) {
+ String[] revArray = name.split(AT);
+ revMap = yangSchemaStore.get(revArray[0]);
+ schemaNode = revMap.get(name);
+ if (schemaNode == null) {
+ log.error("{} not found.", name);
+ }
+ return schemaNode;
+ }
+ if (yangSchemaStore.containsKey(name)) {
+ revMap = yangSchemaStore.get(name);
+ if (revMap != null && !revMap.isEmpty()) {
+ YangSchemaNode node = revMap.get(name);
+ if (node != null) {
+ return node;
+ }
+ String revName = getLatestVersion(revMap);
+ return revMap.get(revName);
+ }
+ }
+ log.error("{} not found.", name);
+ return null;
+ }
+
+ private String getLatestVersion(ConcurrentMap<String, YangSchemaNode> revMap) {
+ List<String> keys = new ArrayList<>();
+ for (Map.Entry<String, YangSchemaNode> entry : revMap.entrySet()) {
+ keys.add(entry.getKey());
+ }
+ sort(keys);
+ return keys.get(keys.size() - 1);
+ }
+
+ /**
+ * Adds schema node when different revision of node has received.
+ *
+ * @param schemaNode schema node
+ */
+ private void addToSchemaStore(YangSchemaNode schemaNode) {
+
+ String date = getDateInStringFormat(schemaNode);
+ String name = schemaNode.getName();
+ String revName = name;
+ if (date != null) {
+ revName = name + AT + date;
+ }
+ //check if already present.
+ if (!yangSchemaStore.containsKey(name)) {
+ ConcurrentMap<String, YangSchemaNode> revStore =
+ new ConcurrentHashMap<>();
+ revStore.put(revName, schemaNode);
+ yangSchemaStore.put(name, revStore);
+ } else {
+ yangSchemaStore.get(name).put(revName, schemaNode);
+ }
+ }
+
+ /**
+ * Returns date in string format.
+ *
+ * @param schemaNode schema node
+ * @return date in string format
+ */
+ String getDateInStringFormat(YangSchemaNode schemaNode) {
+ if (schemaNode != null) {
+ if (((YangNode) schemaNode).getRevision() != null) {
+ return new SimpleDateFormat(DATE_FORMAT)
+ .format(((YangNode) schemaNode).getRevision()
+ .getRevDate());
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Removes schema node from schema map.
+ *
+ * @param removableNode schema node which needs to be removed
+ */
+ private void removeSchemaNode(YangSchemaNode removableNode) {
+ String name = removableNode.getName();
+ String revName = name;
+ String date = getDateInStringFormat(removableNode);
+ if (date != null) {
+ revName = name + AT + date;
+ }
+ ConcurrentMap<String, YangSchemaNode> revMap = yangSchemaStore.get(name);
+ if (revMap != null && !revMap.isEmpty() && revMap.size() != 1) {
+ revMap.remove(revName);
+ } else {
+ yangSchemaStore.remove(removableNode.getName());
+ }
+ }
+
+ /**
+ * Adds sub module identifier.
+ *
+ * @param node schema node
+ * @param information module information
+ */
+ private void addSubModuleIdentifier(
+ YangSchemaNode node, DefaultYangModuleInformation information) {
+ List<YangInclude> includeList = new ArrayList<>();
+ if (node instanceof YangModule) {
+ includeList = ((YangModule) node).getIncludeList();
+ } else if (node instanceof YangSubModule) {
+ includeList = ((YangSubModule) node).getIncludeList();
+ }
+ for (YangInclude include : includeList) {
+ information.addSubModuleIdentifiers(getModuleIdentifier(
+ include.getIncludedNode()));
+ }
+ }
+
+ /**
+ * Returns module identifier for schema node.
+ *
+ * @param schemaNode schema node
+ * @return module identifier for schema node
+ */
+ private YangModuleIdentifier getModuleIdentifier(
+ YangSchemaNode schemaNode) {
+ return new DefaultYangModuleIdentifier(
+ schemaNode.getName(), getDateInStringFormat(schemaNode));
+ }
+
+ /**
+ * Returns schema node's generated interface class name.
+ *
+ * @param schemaNode schema node
+ * @return schema node's generated interface class name
+ */
+ String getInterfaceClassName(YangSchemaNode schemaNode) {
+ return schemaNode.getJavaPackage() + PERIOD +
+ getCapitalCase(schemaNode.getJavaClassNameOrBuiltInType());
+ }
+
+ /**
+ * Returns schema node's generated op param class name.
+ *
+ * @param schemaNode schema node
+ * @return schema node's generated op param class name
+ */
+ private String getOpParamClassName(YangSchemaNode schemaNode) {
+ return getInterfaceClassName(schemaNode) + OP_PARAM;
+ }
+
+ /**
+ * Returns schema node's generated event class name.
+ *
+ * @param schemaNode schema node
+ * @return schema node's generated event class name
+ */
+ private String getEventClassName(YangSchemaNode schemaNode) {
+ return getInterfaceClassName(schemaNode).toLowerCase() + PERIOD +
+ getCapitalCase(schemaNode.getJavaClassNameOrBuiltInType()) +
+ EVENT_STRING;
+ }
+
+ /**
+ * Returns schema node's generated service class name.
+ *
+ * @param schemaNode schema node
+ * @return schema node's generated service class name
+ */
+ String getServiceName(YangSchemaNode schemaNode) {
+ return getInterfaceClassName(schemaNode) + SERVICE;
+ }
+
+ /**
+ * Removes YSR generated temporary resources.
+ *
+ * @param rscPath resource path
+ * @param appName application name
+ */
+ private void removeYsrGeneratedTemporaryResources(String rscPath,
+ String appName) {
+ if (rscPath != null) {
+ File jarPath = new File(rscPath);
+ if (jarPath.exists()) {
+ try {
+ deleteDirectory(jarPath);
+ } catch (IOException e) {
+ log.error("failed to delete ysr resources for {} : {}",
+ appName, e.getLocalizedMessage());
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/yms/app/ysr/package-info.java b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/yms/app/ysr/package-info.java
new file mode 100644
index 0000000..6e7ab5c
--- /dev/null
+++ b/drivers/microsemi/ea1000yang/src/test/java/org/onosproject/yms/app/ysr/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Package for Microsemi device drivers support for NETCONF for EA1000.
+ */
+package org.onosproject.yms.app.ysr;
\ No newline at end of file