ONOS-7647 - add mock tests for ciena driver

Change-Id: I6e5b0d1333c5d138c2fb3bcdbf9b9ccecc86ce54
This commit is contained in:
David K. Bainbridge 2018-05-07 12:32:27 -07:00 committed by Ray Milkey
parent 2eb9167f47
commit 1a10d62652
22 changed files with 21727 additions and 28 deletions

View File

@ -13,6 +13,7 @@ TEST_DEPS = [
'//lib:TEST_ADAPTERS',
'//core/api:onos-api-tests',
'//drivers/netconf:onos-drivers-netconf-tests',
'//lib:slf4j-jdk14',
]
BUNDLES = [
@ -32,7 +33,7 @@ osgi_jar_with_tests (
deps = COMPILE_DEPS,
test_deps = TEST_DEPS,
resources_root = 'src/main/resources',
resources = glob(['src/main/resources/**']),
resources = glob(['src/*/resources/**']),
)
onos_app (

View File

@ -54,6 +54,13 @@
<artifactId>onos-drivers-netconf</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-drivers-netconf</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
</dependencies>
</project>

View File

@ -65,7 +65,7 @@ import org.w3c.dom.NodeList;
public class Ciena5162DeviceDescription extends AbstractHandlerBehaviour
implements DeviceDescriptionDiscovery, PortStatisticsDiscovery, LinkDiscovery {
private static final Logger log = getLogger(Ciena5162DeviceDescription.class);
private static final TemplateManager TEMPLATE_MANAGER = new TemplateManager();
static final TemplateManager TEMPLATE_MANAGER = new TemplateManager();
static {
TEMPLATE_MANAGER.load(Ciena5162DeviceDescription.class, "/templates/requests/%s.j2", "systemInfo",

View File

@ -0,0 +1,165 @@
/*
* Copyright 2018-present Open Networking Foundation
*
* 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.ciena.c5162.netconf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.slf4j.LoggerFactory.getLogger;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import org.junit.Before;
import org.junit.Test;
import org.onosproject.drivers.ciena.c5162.Ciena5162DriversLoader;
import org.onosproject.drivers.netconf.MockCoreService;
import org.onosproject.drivers.netconf.MockDevice;
import org.onosproject.drivers.netconf.MockDeviceService;
import org.onosproject.drivers.netconf.MockDriverHandler;
import org.onosproject.drivers.netconf.MockTemplateRequestDriver;
import org.onosproject.net.DeviceId;
import org.onosproject.net.device.DeviceDescription;
import org.onosproject.net.device.PortDescription;
import org.onosproject.net.device.PortStatistics;
import org.onosproject.net.link.LinkDescription;
import org.onosproject.netconf.NetconfController;
import org.onosproject.netconf.NetconfException;
import org.slf4j.Logger;
public class DeviceDiscoveryTest {
Map<DeviceId, MockDriverHandler> mockDriverHandlers = new HashMap<DeviceId, MockDriverHandler>();
MockTemplateRequestDriver mockRequestDriver = new MockTemplateRequestDriver();
MockDeviceService deviceService = new MockDeviceService();
Logger log = getLogger(DeviceDiscoveryTest.class);
@Before
public void setup() throws NetconfException {
MockCoreService coreService = new MockCoreService(101, "org.onosproject.drivers.netconf",
"org.onosproject.linkdiscovery", "org.onosproject.drivers.ciena.c5162");
// Load the mock responses for mock device "netconf:1.2.3.4:830"
DeviceId mId = DeviceId.deviceId("netconf:1.2.3.4:830");
mockRequestDriver.load(DeviceDiscoveryTest.class, "/templates/responses/device_1_2_3_4/%s.j2", mId,
"systemInfo", "softwareVersion", "logicalPorts", "link-info", "port-stats");
MockDriverHandler mockDriverHandler = new MockDriverHandler(Ciena5162DriversLoader.class,
"/ciena-5162-drivers.xml", mId, coreService, deviceService);
NetconfController controller = mockDriverHandler.get(NetconfController.class);
mockDriverHandlers.put(mId, mockDriverHandler);
mockRequestDriver.setDeviceMap(controller.getDevicesMap());
// Load the mock responses for mock device "netconf:5.6.7.8:830"
mId = DeviceId.deviceId("netconf:5.6.7.8:830");
mockRequestDriver.load(DeviceDiscoveryTest.class, "/templates/responses/device_5_6_7_8/%s.j2", mId,
"systemInfo", "softwareVersion", "logicalPorts", "link-info");
mockDriverHandler = new MockDriverHandler(Ciena5162DriversLoader.class, "/ciena-5162-drivers.xml", mId,
coreService, deviceService);
controller = mockDriverHandler.get(NetconfController.class);
mockDriverHandlers.put(mId, mockDriverHandler);
mockRequestDriver.setDeviceMap(controller.getDevicesMap());
}
@Test
public void deviceDescriptionTest() {
Ciena5162DeviceDescription targetUnderTest = new Ciena5162DeviceDescription();
Ciena5162DeviceDescription.TEMPLATE_MANAGER.setRequestDriver(mockRequestDriver);
targetUnderTest.setHandler(mockDriverHandlers.get(DeviceId.deviceId("netconf:1.2.3.4:830")));
DeviceDescription desc = targetUnderTest.discoverDeviceDetails();
assertEquals("Chassis ID", "1C1161EDB480", desc.chassisId().toString().toUpperCase());
assertEquals("Manufacturer", "Ciena", desc.manufacturer());
assertEquals("HW Version", "5162", desc.hwVersion());
assertEquals("Serial Number", "M9258605", desc.serialNumber());
assertEquals("SW Version", "saos-01-01-00-0025", desc.swVersion());
}
@Test
public void discoverPortDetailsTest() {
Ciena5162DeviceDescription targetUnderTest = new Ciena5162DeviceDescription();
Ciena5162DeviceDescription.TEMPLATE_MANAGER.setRequestDriver(mockRequestDriver);
targetUnderTest.setHandler(mockDriverHandlers.get(DeviceId.deviceId("netconf:1.2.3.4:830")));
List<PortDescription> ports = targetUnderTest.discoverPortDetails();
assertEquals(42, ports.size());
Map<Long, Integer> speedCounts = new HashMap<Long, Integer>();
for (PortDescription port : ports) {
if (port.portNumber().toLong() == 1L || port.portNumber().toLong() == 38L
|| port.portNumber().toLong() == 40L || port.portNumber().toLong() == 41L) {
assertEquals(String.format("PORT %s enable status", port.portNumber()), true, port.isEnabled());
} else {
assertEquals(String.format("PORT %s enable status", port.portNumber()), false, port.isEnabled());
}
Long speed = port.portSpeed();
Integer count = speedCounts.get(speed);
if (count == null) {
speedCounts.put(speed, 1);
} else {
speedCounts.put(speed, count + 1);
}
}
assertEquals("PORT count with speed 1G", new Integer(40), speedCounts.get(10000L));
assertEquals("PORT count with speed 10G", new Integer(2), speedCounts.get(100000L));
}
@Test
public void discoverPortStatisticsTest() {
Ciena5162DeviceDescription targetUnderTest = new Ciena5162DeviceDescription();
Ciena5162DeviceDescription.TEMPLATE_MANAGER.setRequestDriver(mockRequestDriver);
targetUnderTest.setHandler(mockDriverHandlers.get(DeviceId.deviceId("netconf:1.2.3.4:830")));
Collection<PortStatistics> stats = targetUnderTest.discoverPortStatistics();
assertEquals("PORT STAT COUNT", 42, stats.size());
Optional<PortStatistics> stat = stats.stream().filter(s -> s.portNumber().toLong() == 1L).findFirst();
assertTrue("Port 1 stats exist", stat.isPresent());
assertEquals("Port 1 pkt out", 12730184135L, stat.get().packetsSent());
assertEquals("Port 1 pkt in", 5418L, stat.get().packetsReceived());
assertEquals("Port 1 bytes out", 3258925768591L, stat.get().bytesSent());
assertEquals("Port 1 bytes in", 461251L, stat.get().bytesReceived());
assertEquals("Port 1 bytes out", 0L, stat.get().packetsTxErrors());
assertEquals("Port 1 bytes in", 0L, stat.get().packetsRxErrors());
}
@Test
public void getLinksTest() {
Ciena5162DeviceDescription targetUnderTest1 = new Ciena5162DeviceDescription();
Ciena5162DeviceDescription targetUnderTest2 = new Ciena5162DeviceDescription();
Ciena5162DeviceDescription.TEMPLATE_MANAGER.setRequestDriver(mockRequestDriver);
DeviceId mId = DeviceId.deviceId("netconf:1.2.3.4:830");
targetUnderTest1.setHandler(mockDriverHandlers.get(mId));
deviceService.addDevice(new MockDevice(mId, targetUnderTest1.discoverDeviceDetails()));
mId = DeviceId.deviceId("netconf:5.6.7.8:830");
targetUnderTest2.setHandler(mockDriverHandlers.get(mId));
deviceService.addDevice(new MockDevice(mId, targetUnderTest2.discoverDeviceDetails()));
Set<LinkDescription> links1 = targetUnderTest1.getLinks();
Set<LinkDescription> links2 = targetUnderTest2.getLinks();
assertEquals("A to B link count", 1, links1.size());
assertEquals("B to A link count", 1, links2.size());
LinkDescription a2b = links1.toArray(new LinkDescription[0])[0];
LinkDescription b2a = links2.toArray(new LinkDescription[0])[0];
assertEquals("A to B src and dest", a2b.src(), b2a.dst());
assertEquals("B to A src and dest", b2a.src(), a2b.dst());
}
}

View File

@ -0,0 +1,577 @@
<?xml version="1.0" encoding="utf-8"?>
<rpc-reply xmlns:ncx="http://netconfcentral.org/ns/yuma-ncx"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
message-id="6"
ncx:last-modified="2018-05-07T04:10:32Z"
ncx:etag="147">
<data>
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>1</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>2</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>3</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>4</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>5</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>6</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>7</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>8</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>9</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>10</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>11</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>12</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>13</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>14</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>15</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>16</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>17</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>18</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>19</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>20</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>21</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>22</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>23</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>24</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>25</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>26</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>27</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>28</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>29</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>30</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>31</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>32</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>33</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>34</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>35</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>36</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>37</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>38</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>39</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>40</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<chassis-id-subtype>mac-address</chassis-id-subtype>
<chassis-id>1C1161EDB400</chassis-id>
<port-id-subtype>interface-name</port-id-subtype>
<port-id>40</port-id>
<port-desc>SFP 10 Gig Ethernet Port</port-desc>
<system-name>Tokyo-5162</system-name>
<system-description>5162</system-description>
<system-capability-supported>bridge</system-capability-supported>
<system-capability-enabled>bridge</system-capability-enabled>
<dot3-remote-entry>
<auto-neg-supported>true</auto-neg-supported>
<auto-neg-enabled>false</auto-neg-enabled>
<oper-mau-type>33</oper-mau-type>
<port-class>p-class-pd</port-class>
<mdi-supported>false</mdi-supported>
<mdi-enabled>false</mdi-enabled>
<pair-controlable>false</pair-controlable>
<agg-status>capable</agg-status>
<max-frame-size>1526</max-frame-size>
</dot3-remote-entry>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>41</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<chassis-id-subtype>mac-address</chassis-id-subtype>
<chassis-id>1C1161D07880</chassis-id>
<port-id-subtype>interface-name</port-id-subtype>
<port-id>43</port-id>
<port-desc>QSFP28 100 Gig Ethernet Port</port-desc>
<system-name>Paris-5170</system-name>
<system-description>CN5170</system-description>
<system-capability-supported>bridge</system-capability-supported>
<system-capability-enabled>bridge</system-capability-enabled>
<dot3-remote-entry>
<auto-neg-supported>true</auto-neg-supported>
<auto-neg-enabled>false</auto-neg-enabled>
<oper-mau-type>0</oper-mau-type>
<port-class>p-class-pd</port-class>
<mdi-supported>false</mdi-supported>
<mdi-enabled>false</mdi-enabled>
<pair-controlable>false</pair-controlable>
<agg-status>capable</agg-status>
<max-frame-size>1526</max-frame-size>
</dot3-remote-entry>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>42</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>mgmtbr0</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>S5_S10</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>S9_S10</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>L3VPN_RED_1</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>L3VPN_BLUE</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>L3VPN_GREEN</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
</interfaces>
</data>
</rpc-reply>

View File

@ -0,0 +1,218 @@
<?xml version="1.0" encoding="utf-8"?>
<rpc-reply xmlns:ncx="http://netconfcentral.org/ns/yuma-ncx"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
message-id="64"
ncx:last-modified="2018-05-07T03:55:23Z"
ncx:etag="162">
<data>
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>1</name>
<config>
<name>1</name>
<description>1</description>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
<admin-status xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">true</admin-status>
<mode xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">auto</mode>
<link-flap-detect xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">false</link-flap-detect>
<link-flap-count xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">5</link-flap-count>
<link-flap-detect-time xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">10</link-flap-detect-time>
<link-flap-hold-time xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">300</link-flap-hold-time>
<duplex xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">full</duplex>
<port-speed xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">10Gb</port-speed>
<flow-control xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">off</flow-control>
<auto-negotiation xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">false</auto-negotiation>
<lldp-port-config xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<admin-status>tx-and-rx</admin-status>
<notify>false</notify>
<send-port-desc-tlv>true</send-port-desc-tlv>
<send-sys-name-tlv>true</send-sys-name-tlv>
<send-sys-desc-tlv>true</send-sys-desc-tlv>
<send-sys-cap-tlv>true</send-sys-cap-tlv>
<man-add-local-ipv4>true</man-add-local-ipv4>
<man-add-local-ipv6>true</man-add-local-ipv6>
<man-add-remote-ipv4>true</man-add-remote-ipv4>
<man-add-remote-ipv6>true</man-add-remote-ipv6>
</lldp-port-config>
<dot3-port-config xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<send-mac-phy-status-tlv>true</send-mac-phy-status-tlv>
<send-power-via-mdi-tlv>true</send-power-via-mdi-tlv>
<send-link-aggregation-tlv>true</send-link-aggregation-tlv>
<send-max-frame-size-tlv>true</send-max-frame-size-tlv>
</dot3-port-config>
<eoam-port-config xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam">
<admin-status>disable</admin-status>
<mode>active</mode>
<pdu-timer>1000</pdu-timer>
<link-lost-timer>5000</link-lost-timer>
</eoam-port-config>
<eoam-loopback-port-config xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam">
<loopback-ignore-rx>ignore</loopback-ignore-rx>
</eoam-loopback-port-config>
<eoam-port-event-config xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam">
<error-frame-period-threshold>1</error-frame-period-threshold>
<error-frame-period-event-notification>false</error-frame-period-event-notification>
<error-frame-window>10</error-frame-window>
<error-frame-threshold>1</error-frame-threshold>
<error-frame-event-notification>false</error-frame-event-notification>
<error-frame-seconds-summary-window>600</error-frame-seconds-summary-window>
<error-frame-seconds-summary-threshold>1</error-frame-seconds-summary-threshold>
<error-frame-seconds-event-notification>false</error-frame-seconds-event-notification>
<dying-gasp>false</dying-gasp>
<critical-event>false</critical-event>
</eoam-port-event-config>
</config>
<state>
<ifindex>1</ifindex>
<oper-status>UP</oper-status>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>124766</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">991</out-pkts>
</counters>
<mac-address xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">1c:11:61:ed:b4:0a</mac-address>
<duplex xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">full</duplex>
<flow-control xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">off</flow-control>
<speed xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">10000000000</speed>
<lldp-tx-stats xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<total-frames>984</total-frames>
</lldp-tx-stats>
<lldp-rx-stats xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<total-discards>0</total-discards>
<total-errors>0</total-errors>
<total-frames>0</total-frames>
<total-tlv-discards>0</total-tlv-discards>
<total-tlv-unrecognized>0</total-tlv-unrecognized>
<total-tlv-ageouts>0</total-tlv-ageouts>
</lldp-rx-stats>
<lldp-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<port-id-subtype>interface-name</port-id-subtype>
<port-id>1</port-id>
<port-desc>SFP 10 Gig Ethernet Port</port-desc>
</lldp-port-operational>
<lldp-dot3-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<auto-neg-supported>true</auto-neg-supported>
<auto-neg-enabled>false</auto-neg-enabled>
<oper-mau-type>33</oper-mau-type>
<port-class>p-class-pd</port-class>
<mdi-supported>false</mdi-supported>
<mdi-enabled>false</mdi-enabled>
<pair-controlable>false</pair-controlable>
<agg-status>capable</agg-status>
<max-frame-size>1526</max-frame-size>
</lldp-dot3-port-operational>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
<eoam-port-status xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam">
<port-oper-status>disabled</port-oper-status>
<max-pdu-size>1518</max-pdu-size>
<configuration-revision>0</configuration-revision>
<pdu-timer>1000</pdu-timer>
<link-lost-timer>5000</link-lost-timer>
<local-functions-supported/>
</eoam-port-status>
<eoam-peer-information xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam">
<peer-status>inactive</peer-status>
<peer-mac-address>00:00:00:00:00:00</peer-mac-address>
<peer-vendor-oui>00 00 00</peer-vendor-oui>
<vendor-info>0</vendor-info>
<peer-mode>unknown</peer-mode>
<peer-max-pdu-size>0</peer-max-pdu-size>
<peer-configuration-revision>0</peer-configuration-revision>
<peer-functions-supported/>
</eoam-peer-information>
<eoam-loopback-port-status xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam"/>
<eoam-port-statistics xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam">
<information-transmitted>0</information-transmitted>
<information-received>0</information-received>
<unique-event-notification-transmitted>0</unique-event-notification-transmitted>
<unique-event-notification-received>0</unique-event-notification-received>
<loopback-control-transmitted>0</loopback-control-transmitted>
<loopback-control-received>0</loopback-control-received>
<variable-request-transmitted>0</variable-request-transmitted>
<variable-request-received>0</variable-request-received>
<variable-response-transmitted>0</variable-response-transmitted>
<variable-response-received>0</variable-response-received>
<organization-specific-transmitted>0</organization-specific-transmitted>
<organization-specific-received>0</organization-specific-received>
<duplicate-event-notifications-transmitted>0</duplicate-event-notifications-transmitted>
<duplicate-event-notifications-received>0</duplicate-event-notifications-received>
</eoam-port-statistics>
<eoam-port-event-log xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam">
<event-entry>
<index>5</index>
<timestamp>0</timestamp>
<oui>000</oui>
<event-type>0</event-type>
<window-hi>0</window-hi>
<window-lo>0</window-lo>
<threshold-hi>0</threshold-hi>
<threshold-lo>0</threshold-lo>
<value>0</value>
<running-total>0</running-total>
<total>0</total>
</event-entry>
<event-entry>
<index>4</index>
<timestamp>0</timestamp>
<oui>000</oui>
<event-type>0</event-type>
<window-hi>0</window-hi>
<window-lo>0</window-lo>
<threshold-hi>0</threshold-hi>
<threshold-lo>0</threshold-lo>
<value>0</value>
<running-total>0</running-total>
<total>0</total>
</event-entry>
<event-entry>
<index>3</index>
<timestamp>0</timestamp>
<oui>000</oui>
<event-type>0</event-type>
<window-hi>0</window-hi>
<window-lo>0</window-lo>
<threshold-hi>0</threshold-hi>
<threshold-lo>0</threshold-lo>
<value>0</value>
<running-total>0</running-total>
<total>0</total>
</event-entry>
<event-entry>
<index>2</index>
<timestamp>0</timestamp>
<oui>000</oui>
<event-type>0</event-type>
<window-hi>0</window-hi>
<window-lo>0</window-lo>
<threshold-hi>0</threshold-hi>
<threshold-lo>0</threshold-lo>
<value>0</value>
<running-total>0</running-total>
<total>0</total>
</event-entry>
<event-entry>
<index>1</index>
<timestamp>0</timestamp>
<oui>000</oui>
<event-type>0</event-type>
<window-hi>0</window-hi>
<window-lo>0</window-lo>
<threshold-hi>0</threshold-hi>
<threshold-lo>0</threshold-lo>
<value>0</value>
<running-total>0</running-total>
<total>0</total>
</event-entry>
</eoam-port-event-log>
</state>
</interface>
</interfaces>
</data>
</rpc-reply>

View File

@ -0,0 +1,863 @@
<?xml version="1.0" encoding="utf-8"?>
<rpc-reply xmlns:ncx="http://netconfcentral.org/ns/yuma-ncx"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
message-id="94"
ncx:last-modified="2018-05-07T04:10:32Z"
ncx:etag="147">
<data>
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>1</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>461251</in-octets>
<in-unicast-pkts>5366</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>3258925768591</out-octets>
<out-unicast-pkts>12730182869</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">5418</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">12730184135</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>2</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>3</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>4</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>5</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>6</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>7</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>8</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>9</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>10</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>11</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>12</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>13</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>14</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>15</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>16</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>17</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>18</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>19</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>20</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>21</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>22</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>23</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>24</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>25</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>26</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>27</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>28</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>29</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>30</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>31</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>32</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>33</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>34</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>35</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>36</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>37</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>38</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>794</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">7</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>39</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>40</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>5668138</in-octets>
<in-unicast-pkts>8</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>18325713</out-octets>
<out-unicast-pkts>7</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">5006</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">16411</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>41</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>3309851811461</in-octets>
<in-unicast-pkts>12730178322</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>18379982</out-octets>
<out-unicast-pkts>1896</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">12730183882</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">17795</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>42</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</out-pkts>
</counters>
</state>
</interface>
<interface>
<name>mgmtbr0</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
</counters>
</state>
</interface>
<interface>
<name>S5_S10</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
</counters>
</state>
</interface>
<interface>
<name>S9_S10</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
</counters>
</state>
</interface>
<interface>
<name>L3VPN_RED_1</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
</counters>
</state>
</interface>
<interface>
<name>L3VPN_BLUE</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
</counters>
</state>
</interface>
<interface>
<name>L3VPN_GREEN</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>0</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
</counters>
</state>
</interface>
</interfaces>
</data>
</rpc-reply>

View File

@ -0,0 +1,13 @@
<rpc-reply xmlns:ncx="http://netconfcentral.org/ns/yuma-ncx"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
message-id="123"
ncx:last-modified="2018-05-02T16:44:46Z"
ncx:etag="153">
<data>
<software-state xmlns="http://www.ciena.com/ns/yang/ciena-software-mgmt">
<running-package>
<package-version>saos-01-01-00-0025</package-version>
</running-package>
</software-state>
</data>
</rpc-reply>

View File

@ -0,0 +1,32 @@
<rpc-reply xmlns:ncx="http://netconfcentral.org/ns/yuma-ncx"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
message-id="6"
ncx:last-modified="2018-05-02T16:44:46Z"
ncx:etag="153">
<data>
<components xmlns="http://openconfig.net/yang/platform">
<component>
<name>5162</name>
<properties>
<property>
<name>base-mac</name>
<config>
<name>base-mac</name>
</config>
<state>
<name>base-mac</name>
<value>1C1161EDB480</value>
<configurable>false</configurable>
</state>
</property>
</properties>
<state>
<mfg-name>Ciena</mfg-name>
<name>5162</name>
<serial-no>M9258605</serial-no>
<version>2</version>
</state>
</component>
</components>
</data>
</rpc-reply>

View File

@ -0,0 +1,637 @@
<?xml version="1.0" encoding="utf-8"?>
<rpc-reply xmlns:ncx="http://netconfcentral.org/ns/yuma-ncx"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
message-id="106"
ncx:last-modified="2018-05-07T03:55:23Z"
ncx:etag="162">
<data>
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>1</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>2</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>3</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>4</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>5</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>6</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>7</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>8</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>9</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>10</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>11</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>12</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>13</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>14</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>15</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>16</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>17</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>18</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>19</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>20</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>21</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>22</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>23</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>24</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>25</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>26</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>27</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>28</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>29</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>30</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>31</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>32</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>33</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>34</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>35</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>36</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<chassis-id-subtype>mac-address</chassis-id-subtype>
<chassis-id>1C1161D07880</chassis-id>
<port-id-subtype>interface-name</port-id-subtype>
<port-id>36</port-id>
<port-desc>SFP 10 Gig Ethernet Port</port-desc>
<system-name>Paris-5170</system-name>
<system-description>CN5170</system-description>
<system-capability-supported>bridge</system-capability-supported>
<system-capability-enabled>bridge</system-capability-enabled>
<dot3-remote-entry>
<auto-neg-supported>true</auto-neg-supported>
<auto-neg-enabled>false</auto-neg-enabled>
<oper-mau-type>33</oper-mau-type>
<port-class>p-class-pd</port-class>
<mdi-supported>false</mdi-supported>
<mdi-enabled>false</mdi-enabled>
<pair-controlable>false</pair-controlable>
<agg-status>capable</agg-status>
<max-frame-size>1526</max-frame-size>
</dot3-remote-entry>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>37</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>38</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>39</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<chassis-id-subtype>mac-address</chassis-id-subtype>
<chassis-id>1C1161EC5900</chassis-id>
<port-id-subtype>interface-name</port-id-subtype>
<port-id>39</port-id>
<port-desc>SFP 10 Gig Ethernet Port</port-desc>
<system-name>Dehli-5162</system-name>
<system-description>5162</system-description>
<system-capability-supported>bridge</system-capability-supported>
<system-capability-enabled>bridge</system-capability-enabled>
<dot3-remote-entry>
<auto-neg-supported>true</auto-neg-supported>
<auto-neg-enabled>false</auto-neg-enabled>
<oper-mau-type>33</oper-mau-type>
<port-class>p-class-pd</port-class>
<mdi-supported>false</mdi-supported>
<mdi-enabled>false</mdi-enabled>
<pair-controlable>false</pair-controlable>
<agg-status>capable</agg-status>
<max-frame-size>1526</max-frame-size>
</dot3-remote-entry>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>40</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<chassis-id-subtype>mac-address</chassis-id-subtype>
<chassis-id>1C1161EDB480</chassis-id>
<port-id-subtype>interface-name</port-id-subtype>
<port-id>40</port-id>
<port-desc>SFP 10 Gig Ethernet Port</port-desc>
<system-name>Maui-5162</system-name>
<system-description>5162</system-description>
<system-capability-supported>bridge</system-capability-supported>
<system-capability-enabled>bridge</system-capability-enabled>
<dot3-remote-entry>
<auto-neg-supported>true</auto-neg-supported>
<auto-neg-enabled>false</auto-neg-enabled>
<oper-mau-type>33</oper-mau-type>
<port-class>p-class-pd</port-class>
<mdi-supported>false</mdi-supported>
<mdi-enabled>false</mdi-enabled>
<pair-controlable>false</pair-controlable>
<agg-status>capable</agg-status>
<max-frame-size>1526</max-frame-size>
</dot3-remote-entry>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>41</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<chassis-id-subtype>mac-address</chassis-id-subtype>
<chassis-id>1C1161D07880</chassis-id>
<port-id-subtype>interface-name</port-id-subtype>
<port-id>42</port-id>
<port-desc>QSFP28 100 Gig Ethernet Port</port-desc>
<system-name>Paris-5170</system-name>
<system-description>CN5170</system-description>
<system-capability-supported>bridge</system-capability-supported>
<system-capability-enabled>bridge</system-capability-enabled>
<dot3-remote-entry>
<auto-neg-supported>true</auto-neg-supported>
<auto-neg-enabled>false</auto-neg-enabled>
<oper-mau-type>0</oper-mau-type>
<port-class>p-class-pd</port-class>
<mdi-supported>false</mdi-supported>
<mdi-enabled>false</mdi-enabled>
<pair-controlable>false</pair-controlable>
<agg-status>capable</agg-status>
<max-frame-size>1526</max-frame-size>
</dot3-remote-entry>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>42</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>mgmtbr0</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>S5_S9_1</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>S5_S9_2</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>S8_S9</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>S9_S10</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>L3VPN_RED</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>L3VPN_BLUE</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
<interface>
<name>L3VPN_GREEN</name>
<config>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ip</type>
</config>
<state>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
</state>
</interface>
</interfaces>
</data>
</rpc-reply>

View File

@ -0,0 +1,218 @@
<?xml version="1.0" encoding="utf-8"?>
<rpc-reply xmlns:ncx="http://netconfcentral.org/ns/yuma-ncx"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
message-id="64"
ncx:last-modified="2018-05-07T03:55:23Z"
ncx:etag="162">
<data>
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>1</name>
<config>
<name>1</name>
<description>1</description>
<type xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">ettp</type>
<admin-status xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">true</admin-status>
<mode xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">auto</mode>
<link-flap-detect xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">false</link-flap-detect>
<link-flap-count xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">5</link-flap-count>
<link-flap-detect-time xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">10</link-flap-detect-time>
<link-flap-hold-time xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">300</link-flap-hold-time>
<duplex xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">full</duplex>
<port-speed xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">10Gb</port-speed>
<flow-control xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">off</flow-control>
<auto-negotiation xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">false</auto-negotiation>
<lldp-port-config xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<admin-status>tx-and-rx</admin-status>
<notify>false</notify>
<send-port-desc-tlv>true</send-port-desc-tlv>
<send-sys-name-tlv>true</send-sys-name-tlv>
<send-sys-desc-tlv>true</send-sys-desc-tlv>
<send-sys-cap-tlv>true</send-sys-cap-tlv>
<man-add-local-ipv4>true</man-add-local-ipv4>
<man-add-local-ipv6>true</man-add-local-ipv6>
<man-add-remote-ipv4>true</man-add-remote-ipv4>
<man-add-remote-ipv6>true</man-add-remote-ipv6>
</lldp-port-config>
<dot3-port-config xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<send-mac-phy-status-tlv>true</send-mac-phy-status-tlv>
<send-power-via-mdi-tlv>true</send-power-via-mdi-tlv>
<send-link-aggregation-tlv>true</send-link-aggregation-tlv>
<send-max-frame-size-tlv>true</send-max-frame-size-tlv>
</dot3-port-config>
<eoam-port-config xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam">
<admin-status>disable</admin-status>
<mode>active</mode>
<pdu-timer>1000</pdu-timer>
<link-lost-timer>5000</link-lost-timer>
</eoam-port-config>
<eoam-loopback-port-config xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam">
<loopback-ignore-rx>ignore</loopback-ignore-rx>
</eoam-loopback-port-config>
<eoam-port-event-config xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam">
<error-frame-period-threshold>1</error-frame-period-threshold>
<error-frame-period-event-notification>false</error-frame-period-event-notification>
<error-frame-window>10</error-frame-window>
<error-frame-threshold>1</error-frame-threshold>
<error-frame-event-notification>false</error-frame-event-notification>
<error-frame-seconds-summary-window>600</error-frame-seconds-summary-window>
<error-frame-seconds-summary-threshold>1</error-frame-seconds-summary-threshold>
<error-frame-seconds-event-notification>false</error-frame-seconds-event-notification>
<dying-gasp>false</dying-gasp>
<critical-event>false</critical-event>
</eoam-port-event-config>
</config>
<state>
<ifindex>1</ifindex>
<oper-status>UP</oper-status>
<counters>
<in-octets>0</in-octets>
<in-unicast-pkts>0</in-unicast-pkts>
<in-errors>0</in-errors>
<out-octets>124766</out-octets>
<out-unicast-pkts>0</out-unicast-pkts>
<out-errors>0</out-errors>
<in-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">0</in-pkts>
<out-pkts xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">991</out-pkts>
</counters>
<mac-address xmlns="http://ciena.com/ns/yang/ciena-openconfig-interfaces">1c:11:61:ed:b4:0a</mac-address>
<duplex xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">full</duplex>
<flow-control xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">off</flow-control>
<speed xmlns="http://ciena.com/ns/yang/ciena-openconfig-if-ethernet-port">10000000000</speed>
<lldp-tx-stats xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<total-frames>984</total-frames>
</lldp-tx-stats>
<lldp-rx-stats xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<total-discards>0</total-discards>
<total-errors>0</total-errors>
<total-frames>0</total-frames>
<total-tlv-discards>0</total-tlv-discards>
<total-tlv-unrecognized>0</total-tlv-unrecognized>
<total-tlv-ageouts>0</total-tlv-ageouts>
</lldp-rx-stats>
<lldp-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<port-id-subtype>interface-name</port-id-subtype>
<port-id>1</port-id>
<port-desc>SFP 10 Gig Ethernet Port</port-desc>
</lldp-port-operational>
<lldp-dot3-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<auto-neg-supported>true</auto-neg-supported>
<auto-neg-enabled>false</auto-neg-enabled>
<oper-mau-type>33</oper-mau-type>
<port-class>p-class-pd</port-class>
<mdi-supported>false</mdi-supported>
<mdi-enabled>false</mdi-enabled>
<pair-controlable>false</pair-controlable>
<agg-status>capable</agg-status>
<max-frame-size>1526</max-frame-size>
</lldp-dot3-port-operational>
<lldp-remote-port-operational xmlns="urn:ciena:params:xml:ns:yang:ciena-pn::ciena-ieee-lldp">
<dot3-remote-entry/>
</lldp-remote-port-operational>
<eoam-port-status xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam">
<port-oper-status>disabled</port-oper-status>
<max-pdu-size>1518</max-pdu-size>
<configuration-revision>0</configuration-revision>
<pdu-timer>1000</pdu-timer>
<link-lost-timer>5000</link-lost-timer>
<local-functions-supported/>
</eoam-port-status>
<eoam-peer-information xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam">
<peer-status>inactive</peer-status>
<peer-mac-address>00:00:00:00:00:00</peer-mac-address>
<peer-vendor-oui>00 00 00</peer-vendor-oui>
<vendor-info>0</vendor-info>
<peer-mode>unknown</peer-mode>
<peer-max-pdu-size>0</peer-max-pdu-size>
<peer-configuration-revision>0</peer-configuration-revision>
<peer-functions-supported/>
</eoam-peer-information>
<eoam-loopback-port-status xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam"/>
<eoam-port-statistics xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam">
<information-transmitted>0</information-transmitted>
<information-received>0</information-received>
<unique-event-notification-transmitted>0</unique-event-notification-transmitted>
<unique-event-notification-received>0</unique-event-notification-received>
<loopback-control-transmitted>0</loopback-control-transmitted>
<loopback-control-received>0</loopback-control-received>
<variable-request-transmitted>0</variable-request-transmitted>
<variable-request-received>0</variable-request-received>
<variable-response-transmitted>0</variable-response-transmitted>
<variable-response-received>0</variable-response-received>
<organization-specific-transmitted>0</organization-specific-transmitted>
<organization-specific-received>0</organization-specific-received>
<duplicate-event-notifications-transmitted>0</duplicate-event-notifications-transmitted>
<duplicate-event-notifications-received>0</duplicate-event-notifications-received>
</eoam-port-statistics>
<eoam-port-event-log xmlns="urn:ciena:params:xml:ns:yang:ciena-pn:ciena-ieee:ns:yang:ieee-port-eoam">
<event-entry>
<index>5</index>
<timestamp>0</timestamp>
<oui>000</oui>
<event-type>0</event-type>
<window-hi>0</window-hi>
<window-lo>0</window-lo>
<threshold-hi>0</threshold-hi>
<threshold-lo>0</threshold-lo>
<value>0</value>
<running-total>0</running-total>
<total>0</total>
</event-entry>
<event-entry>
<index>4</index>
<timestamp>0</timestamp>
<oui>000</oui>
<event-type>0</event-type>
<window-hi>0</window-hi>
<window-lo>0</window-lo>
<threshold-hi>0</threshold-hi>
<threshold-lo>0</threshold-lo>
<value>0</value>
<running-total>0</running-total>
<total>0</total>
</event-entry>
<event-entry>
<index>3</index>
<timestamp>0</timestamp>
<oui>000</oui>
<event-type>0</event-type>
<window-hi>0</window-hi>
<window-lo>0</window-lo>
<threshold-hi>0</threshold-hi>
<threshold-lo>0</threshold-lo>
<value>0</value>
<running-total>0</running-total>
<total>0</total>
</event-entry>
<event-entry>
<index>2</index>
<timestamp>0</timestamp>
<oui>000</oui>
<event-type>0</event-type>
<window-hi>0</window-hi>
<window-lo>0</window-lo>
<threshold-hi>0</threshold-hi>
<threshold-lo>0</threshold-lo>
<value>0</value>
<running-total>0</running-total>
<total>0</total>
</event-entry>
<event-entry>
<index>1</index>
<timestamp>0</timestamp>
<oui>000</oui>
<event-type>0</event-type>
<window-hi>0</window-hi>
<window-lo>0</window-lo>
<threshold-hi>0</threshold-hi>
<threshold-lo>0</threshold-lo>
<value>0</value>
<running-total>0</running-total>
<total>0</total>
</event-entry>
</eoam-port-event-log>
</state>
</interface>
</interfaces>
</data>
</rpc-reply>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<rpc-reply xmlns:ncx="http://netconfcentral.org/ns/yuma-ncx"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
message-id="8"
ncx:last-modified="2018-05-07T03:55:23Z"
ncx:etag="162">
<data>
<software-state xmlns="http://www.ciena.com/ns/yang/ciena-software-mgmt">
<running-package>
<package-version>saos-01-01-00-0025</package-version>
</running-package>
</software-state>
</data>
</rpc-reply>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<rpc-reply xmlns:ncx="http://netconfcentral.org/ns/yuma-ncx"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
message-id="9"
ncx:last-modified="2018-05-07T03:55:23Z"
ncx:etag="162">
<data>
<components xmlns="http://openconfig.net/yang/platform">
<component>
<name>5162</name>
<properties>
<property>
<name>base-mac</name>
<config>
<name>base-mac</name>
</config>
<state>
<name>base-mac</name>
<value>1C1161EDB400</value>
<configurable>false</configurable>
</state>
</property>
</properties>
<state>
<mfg-name>Ciena</mfg-name>
<name>5162</name>
<serial-no>M9258604</serial-no>
<version>2</version>
</state>
</component>
</components>
</data>
</rpc-reply>

View File

@ -6,6 +6,7 @@ COMPILE_DEPS = [
TEST_DEPS = [
'//lib:TEST_ADAPTERS',
'//lib:slf4j-jdk14',
'//core/api:onos-api-tests',
]

View File

@ -119,7 +119,7 @@ public final class TemplateManager {
resource = String.format(pattern, name);
}
log.error("LOAD TEMPLATE: '{}' as '{}' from '{}", name, key, resource);
log.debug("LOAD TEMPLATE: '{}' as '{}' from '{}", name, key, resource);
try {
templates.put(name,

View File

@ -15,6 +15,9 @@
*/
package org.onosproject.drivers.netconf;
import java.util.HashSet;
import java.util.Set;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService;
import org.onosproject.core.DefaultApplicationId;
@ -22,19 +25,25 @@ import org.onosproject.core.IdGenerator;
import org.onosproject.core.Version;
import org.onosproject.net.intent.MockIdGenerator;
import java.util.HashSet;
import java.util.Set;
public class MockCoreService implements CoreService {
private HashSet<ApplicationId> appIds;
private Version version;
private IdGenerator idGenerator;
private int nextAppId = 101;
public MockCoreService(int baseId, String... apps) {
nextAppId = baseId;
appIds = new HashSet<ApplicationId>();
for (String app : apps) {
appIds.add(new DefaultApplicationId(nextAppId, app));
nextAppId += 1;
}
version = Version.version(1, 1, "1", "1");
}
public MockCoreService() {
this(101, "org.onosproject.drivers.netconf");
appIds = new HashSet<ApplicationId>();
appIds.add(new DefaultApplicationId(101, "org.onosproject.drivers.netconf"));
version = Version.version(1, 1, "1", "1");
}
@Override
@ -49,7 +58,7 @@ public class MockCoreService implements CoreService {
@Override
public ApplicationId getAppId(Short id) {
for (ApplicationId appId:appIds) {
for (ApplicationId appId : appIds) {
if (appId.id() == id.shortValue()) {
return appId;
}
@ -59,7 +68,7 @@ public class MockCoreService implements CoreService {
@Override
public ApplicationId getAppId(String name) {
for (ApplicationId appId:appIds) {
for (ApplicationId appId : appIds) {
if (appId.name().equalsIgnoreCase(name)) {
return appId;
}
@ -69,8 +78,13 @@ public class MockCoreService implements CoreService {
@Override
public ApplicationId registerApplication(String name) {
ApplicationId appId = new DefaultApplicationId(101, name);
appIds.add(appId);
// Check if the app already exists
ApplicationId appId = getAppId(name);
if (appId == null) {
appId = new DefaultApplicationId(nextAppId, name);
nextAppId += 1;
appIds.add(appId);
}
return appId;
}

View File

@ -0,0 +1,94 @@
/*
* Copyright 2018-present Open Networking Foundation
*
* 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.netconf;
import org.onlab.packet.ChassisId;
import org.onosproject.net.Annotations;
import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
import org.onosproject.net.device.DeviceDescription;
import org.onosproject.net.driver.Behaviour;
import org.onosproject.net.provider.ProviderId;
public class MockDevice implements Device {
private final DeviceDescription desc;
private final DeviceId id;
public MockDevice(DeviceId id, DeviceDescription desc) {
this.desc = desc;
this.id = id;
}
@Override
public Annotations annotations() {
return desc.annotations();
}
@Override
public ProviderId providerId() {
// TODO Auto-generated method stub
return null;
}
@Override
public <B extends Behaviour> B as(Class<B> projectionClass) {
// TODO Auto-generated method stub
return null;
}
@Override
public <B extends Behaviour> boolean is(Class<B> projectionClass) {
// TODO Auto-generated method stub
return false;
}
@Override
public DeviceId id() {
return id;
}
@Override
public Type type() {
return desc.type();
}
@Override
public String manufacturer() {
return desc.manufacturer();
}
@Override
public String hwVersion() {
return desc.hwVersion();
}
@Override
public String swVersion() {
return desc.swVersion();
}
@Override
public String serialNumber() {
return desc.serialNumber();
}
@Override
public ChassisId chassisId() {
return desc.chassisId();
}
}

View File

@ -0,0 +1,133 @@
/*
* Copyright 2018-present Open Networking Foundation
*
* 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.netconf;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import org.onosproject.net.Device;
import org.onosproject.net.Device.Type;
import org.onosproject.net.DeviceId;
import org.onosproject.net.MastershipRole;
import org.onosproject.net.Port;
import org.onosproject.net.PortNumber;
import org.onosproject.net.device.DeviceListener;
import org.onosproject.net.device.DeviceService;
import org.onosproject.net.device.PortStatistics;
public class MockDeviceService implements DeviceService {
private List<Device> devices = new ArrayList<Device>();
public void addDevice(Device device) {
if (!devices.contains(device)) {
devices.add(device);
}
}
@Override
public void addListener(DeviceListener listener) {
// TODO Auto-generated method stub
}
@Override
public void removeListener(DeviceListener listener) {
// TODO Auto-generated method stub
}
@Override
public int getDeviceCount() {
return devices.size();
}
@Override
public Iterable<Device> getDevices() {
return new ArrayList<Device>(devices);
}
@Override
public Iterable<Device> getDevices(Type type) {
return devices.stream().filter(d -> d.type() == type).collect(Collectors.toList());
}
@Override
public Iterable<Device> getAvailableDevices() {
return new ArrayList<Device>(devices);
}
@Override
public Iterable<Device> getAvailableDevices(Type type) {
return devices.stream().filter(d -> d.type() == type).collect(Collectors.toList());
}
@Override
public Device getDevice(DeviceId deviceId) {
// TODO Auto-generated method stub
return null;
}
@Override
public MastershipRole getRole(DeviceId deviceId) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Port> getPorts(DeviceId deviceId) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<PortStatistics> getPortStatistics(DeviceId deviceId) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<PortStatistics> getPortDeltaStatistics(DeviceId deviceId) {
// TODO Auto-generated method stub
return null;
}
@Override
public Port getPort(DeviceId deviceId, PortNumber portNumber) {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean isAvailable(DeviceId deviceId) {
// TODO Auto-generated method stub
return false;
}
@Override
public String localStatus(DeviceId deviceId) {
// TODO Auto-generated method stub
return null;
}
@Override
public long getLastUpdatedInstant(DeviceId deviceId) {
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -15,12 +15,25 @@
*/
package org.onosproject.drivers.netconf;
import static org.junit.Assert.fail;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
import org.apache.commons.io.IOUtils;
import org.onosproject.core.CoreService;
import org.onosproject.mastership.MastershipService;
import org.onosproject.net.DeviceId;
import org.onosproject.net.device.DeviceService;
import org.onosproject.net.driver.AbstractDriverLoader;
import org.onosproject.net.driver.Behaviour;
import org.onosproject.net.driver.DefaultDriver;
import org.onosproject.net.driver.DefaultDriverData;
@ -30,33 +43,78 @@ import org.onosproject.net.driver.DriverHandler;
import org.onosproject.net.flow.FlowRuleProgrammable;
import org.onosproject.netconf.NetconfController;
import org.onosproject.netconf.NetconfException;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.google.common.io.Resources;
public class MockDriverHandler implements DriverHandler {
private DriverData mockDriverData;
private NetconfController ncc;
private CoreService coreService;
private DeviceService deviceService;
private MastershipService mastershipService;
public MockDriverHandler() throws NetconfException {
Map<Class<? extends Behaviour>, Class<? extends Behaviour>> behaviours =
new HashMap<Class<? extends Behaviour>, Class<? extends Behaviour>>();
behaviours.put(FlowRuleProgrammable.class, FlowRuleProgrammable.class);
// Centralize some initialization.
private void init(Map<Class<? extends Behaviour>, Class<? extends Behaviour>> behaviours, DeviceId mockDeviceId,
CoreService mockCoreService, DeviceService mockDeviceService) throws NetconfException {
Map<String, String> properties = new HashMap<String, String>();
Driver mockDriver =
new DefaultDriver("mockDriver", null, "ONOSProject", "1.0.0", "1.0.0", behaviours, properties);
DeviceId mockDeviceId = DeviceId.deviceId("netconf:1.2.3.4:830");
Driver mockDriver = new DefaultDriver("mockDriver", null, "ONOSProject", "1.0.0", "1.0.0", behaviours,
properties);
mockDriverData = new DefaultDriverData(mockDriver, mockDeviceId);
ncc = new MockNetconfController();
ncc.connectDevice(mockDeviceId);
coreService = new MockCoreService();
coreService = mockCoreService;
mastershipService = new MockMastershipService();
deviceService = mockDeviceService;
}
@SuppressWarnings("unchecked")
public MockDriverHandler(Class<? extends AbstractDriverLoader> loaderClass, String behaviorSpec,
DeviceId mockDeviceId, CoreService mockCoreService, DeviceService mockDeviceService) {
// Had to split into declaration and initialization to make stylecheck happy
// else line was considered too long
// and auto format couldn't be tweak to make it correct
Map<Class<? extends Behaviour>, Class<? extends Behaviour>> behaviours;
behaviours = new HashMap<Class<? extends Behaviour>, Class<? extends Behaviour>>();
try {
String data = Resources.toString(Resources.getResource(loaderClass, behaviorSpec), StandardCharsets.UTF_8);
InputStream resp = IOUtils.toInputStream(data, StandardCharsets.UTF_8);
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = builderFactory.newDocumentBuilder();
Document document = builder.parse(resp);
XPath xp = XPathFactory.newInstance().newXPath();
NodeList list = (NodeList) xp.evaluate("//behaviour", document, XPathConstants.NODESET);
for (int i = 0; i < list.getLength(); i += 1) {
Node node = list.item(i);
NamedNodeMap attrs = node.getAttributes();
Class<? extends Behaviour> api = (Class<? extends Behaviour>) Class
.forName(attrs.getNamedItem("api").getNodeValue());
Class<? extends Behaviour> impl = (Class<? extends Behaviour>) Class
.forName(attrs.getNamedItem("impl").getNodeValue());
behaviours.put(api, impl);
}
init(behaviours, mockDeviceId, mockCoreService, mockDeviceService);
} catch (Exception e) {
fail(e.toString());
}
}
public MockDriverHandler() throws NetconfException {
Map<Class<? extends Behaviour>, Class<? extends Behaviour>> behaviours;
behaviours = new HashMap<Class<? extends Behaviour>, Class<? extends Behaviour>>();
behaviours.put(FlowRuleProgrammable.class, FlowRuleProgrammable.class);
DeviceId mockDeviceId = DeviceId.deviceId("netconf:1.2.3.4:830");
coreService = new MockCoreService();
init(behaviours, mockDeviceId, coreService, null);
}
@Override
@ -75,17 +133,17 @@ public class MockDriverHandler implements DriverHandler {
return null;
}
@SuppressWarnings("unchecked")
@Override
public <T> T get(Class<T> serviceClass) {
if (serviceClass.equals(NetconfController.class)) {
return (T) ncc;
} else if (serviceClass.equals(CoreService.class)) {
return (T) coreService;
} else if (serviceClass.equals(MastershipService.class)) {
return (T) mastershipService;
} else if (serviceClass.equals(DeviceService.class)) {
return (T) deviceService;
}
return null;

View File

@ -0,0 +1,130 @@
/*
* Copyright 2018-present Open Networking Foundation
*
* 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.netconf;
import static org.slf4j.LoggerFactory.getLogger;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathFactory;
import org.apache.commons.io.IOUtils;
import org.onosproject.net.DeviceId;
import org.onosproject.netconf.NetconfDevice;
import org.onosproject.netconf.NetconfException;
import org.onosproject.netconf.NetconfSession;
import org.slf4j.Logger;
import org.w3c.dom.Document;
import com.google.common.io.Resources;
public class MockTemplateRequestDriver implements TemplateRequestDriver {
private static final Logger log = getLogger(MockTemplateRequestDriver.class);
private static final DeviceId DEFAULT_RESPONSES_ID = DeviceId.deviceId("mock:default:1234");
private Map<DeviceId, Map<String, String>> responses = new HashMap<DeviceId, Map<String, String>>();
private Map<NetconfSession, DeviceId> sessionMap = new HashMap<NetconfSession, DeviceId>();
@Override
public Object doRequest(NetconfSession session, String templateName, Map<String, Object> templateContext,
String baseXPath, QName returnType) throws NetconfException {
try {
DeviceId deviceId = sessionMap.get(session);
Map<String, String> deviceResponses = responses.get(deviceId);
String responseTemplate = null;
if (deviceResponses != null) {
responseTemplate = deviceResponses.get(templateName);
}
if (responseTemplate == null) {
deviceResponses = responses.get(DEFAULT_RESPONSES_ID);
if (deviceResponses != null) {
responseTemplate = deviceResponses.get(templateName);
}
}
if (responseTemplate == null) {
throw new Exception(
String.format("Reponse template '%s' for device '%s' not found", templateName, deviceId));
}
InputStream resp = IOUtils.toInputStream(responseTemplate, StandardCharsets.UTF_8);
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = builderFactory.newDocumentBuilder();
Document document = builder.parse(resp);
XPath xp = XPathFactory.newInstance().newXPath();
return xp.evaluate(baseXPath, document, returnType);
} catch (Exception e) {
NetconfException ne = new NetconfException(e.getMessage(), e);
throw ne;
}
}
public void load(Class<? extends Object> reference, String pattern, DeviceId id, String... reponseNames) {
for (String name : reponseNames) {
String key = name;
String resource;
// If the template name begins with a '/', then assume it is a full path
// specification
if (name.charAt(0) == '/') {
int start = name.lastIndexOf('/') + 1;
int end = name.lastIndexOf('.');
if (end == -1) {
key = name.substring(start);
} else {
key = name.substring(start, end);
}
resource = name;
} else {
resource = String.format(pattern, name);
}
log.debug("LOAD RESPONSE TEMPLATE: '{}' as '{}' from '{}'", name, key, resource);
try {
DeviceId use = id;
if (use == null) {
use = DEFAULT_RESPONSES_ID;
}
Map<String, String> deviceResponses = responses.get(use);
if (deviceResponses == null) {
deviceResponses = new HashMap<String, String>();
responses.put(use, deviceResponses);
}
deviceResponses.put(name,
Resources.toString(Resources.getResource(reference, resource), StandardCharsets.UTF_8));
} catch (IOException ioe) {
log.error("Unable to load NETCONF response template '{}' from '{}'", key, resource, ioe);
}
}
}
public void setDeviceMap(Map<DeviceId, NetconfDevice> devicesMap) {
// sessionMap.clear();
for (Map.Entry<DeviceId, NetconfDevice> entry : devicesMap.entrySet()) {
sessionMap.put(entry.getValue().getSession(), entry.getKey());
}
}
}