Andrea Campanella
Committed by Gerrit Code Review

ONOS-3758 restructuring driver module with sub-modules for different drivers

Change-Id: I3c65d19be87066448655610abf9d8b89385a4141
Showing 97 changed files with 870 additions and 142 deletions
...@@ -13,18 +13,13 @@ ...@@ -13,18 +13,13 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.driver; 16 +package org.onosproject.net.driver;
17 17
18 import org.apache.felix.scr.annotations.Activate; 18 import org.apache.felix.scr.annotations.Activate;
19 import org.apache.felix.scr.annotations.Component; 19 import org.apache.felix.scr.annotations.Component;
20 import org.apache.felix.scr.annotations.Deactivate; 20 import org.apache.felix.scr.annotations.Deactivate;
21 import org.apache.felix.scr.annotations.Reference; 21 import org.apache.felix.scr.annotations.Reference;
22 import org.apache.felix.scr.annotations.ReferenceCardinality; 22 import org.apache.felix.scr.annotations.ReferenceCardinality;
23 -import org.apache.felix.scr.annotations.Service;
24 -import org.onosproject.net.driver.DefaultDriverProviderService;
25 -import org.onosproject.net.driver.DriverAdminService;
26 -import org.onosproject.net.driver.DriverProvider;
27 -import org.onosproject.net.driver.XmlDriverLoader;
28 import org.slf4j.Logger; 23 import org.slf4j.Logger;
29 import org.slf4j.LoggerFactory; 24 import org.slf4j.LoggerFactory;
30 25
...@@ -33,13 +28,12 @@ import java.io.InputStream; ...@@ -33,13 +28,12 @@ import java.io.InputStream;
33 /** 28 /**
34 * Bootstrap for built in drivers. 29 * Bootstrap for built in drivers.
35 */ 30 */
36 -@Service 31 +@Component
37 -@Component(immediate = false) 32 +public abstract class AbstractDriverLoader {
38 -public class DefaultDrivers implements DefaultDriverProviderService {
39 33
40 private final Logger log = LoggerFactory.getLogger(getClass()); 34 private final Logger log = LoggerFactory.getLogger(getClass());
41 35
42 - private static final String DRIVERS_XML = "/onos-drivers.xml"; 36 + //private static final String DRIVERS_XML = "/onos-drivers.xml";
43 37
44 private DriverProvider provider; 38 private DriverProvider provider;
45 39
...@@ -48,11 +42,9 @@ public class DefaultDrivers implements DefaultDriverProviderService { ...@@ -48,11 +42,9 @@ public class DefaultDrivers implements DefaultDriverProviderService {
48 42
49 @Activate 43 @Activate
50 protected void activate() { 44 protected void activate() {
51 - ClassLoader classLoader = getClass().getClassLoader();
52 try { 45 try {
53 - InputStream stream = classLoader.getResourceAsStream(DRIVERS_XML); 46 + provider = new XmlDriverLoader(getClassLoaderInstance())
54 - provider = new XmlDriverLoader(classLoader) 47 + .loadDrivers(loadXMLDriversStream(), driverAdminService);
55 - .loadDrivers(stream, driverAdminService);
56 driverAdminService.registerProvider(provider); 48 driverAdminService.registerProvider(provider);
57 } catch (Exception e) { 49 } catch (Exception e) {
58 log.error("Unable to load default drivers", e); 50 log.error("Unable to load default drivers", e);
...@@ -66,4 +58,8 @@ public class DefaultDrivers implements DefaultDriverProviderService { ...@@ -66,4 +58,8 @@ public class DefaultDrivers implements DefaultDriverProviderService {
66 log.info("Stopped"); 58 log.info("Stopped");
67 } 59 }
68 60
61 + protected abstract InputStream loadXMLDriversStream();
62 +
63 + protected abstract ClassLoader getClassLoaderInstance();
64 +
69 } 65 }
......
...@@ -101,7 +101,6 @@ public class DefaultDriver implements Driver { ...@@ -101,7 +101,6 @@ public class DefaultDriver implements Driver {
101 public Driver merge(Driver other) { 101 public Driver merge(Driver other) {
102 checkArgument(parents == null || Objects.equals(parent(), other.parent()), 102 checkArgument(parents == null || Objects.equals(parent(), other.parent()),
103 "Parent drivers are not the same"); 103 "Parent drivers are not the same");
104 -
105 // Merge the behaviours. 104 // Merge the behaviours.
106 Map<Class<? extends Behaviour>, Class<? extends Behaviour>> 105 Map<Class<? extends Behaviour>, Class<? extends Behaviour>>
107 behaviours = Maps.newHashMap(); 106 behaviours = Maps.newHashMap();
...@@ -261,4 +260,23 @@ public class DefaultDriver implements Driver { ...@@ -261,4 +260,23 @@ public class DefaultDriver implements Driver {
261 .toString(); 260 .toString();
262 } 261 }
263 262
263 + @Override
264 + public boolean equals(Object driverToBeCompared) {
265 + if (this == driverToBeCompared) {
266 + return true;
267 + }
268 + if (driverToBeCompared == null || getClass() != driverToBeCompared.getClass()) {
269 + return false;
270 + }
271 +
272 + DefaultDriver driver = (DefaultDriver) driverToBeCompared;
273 +
274 + return name.equals(driver.name());
275 +
276 + }
277 +
278 + @Override
279 + public int hashCode() {
280 + return Objects.hashCode(name);
281 + }
264 } 282 }
......
1 +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 +<!--
3 + ~ Copyright 2016 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}">
18 + <feature name="${project.artifactId}" version="${project.version}"
19 + description="${project.description}">
20 + <feature>onos-api</feature>
21 + <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
22 +
23 + <bundle>mvn:${project.groupId}/onos-restsb-api/${project.version}</bundle>
24 +
25 + <bundle>mvn:${project.groupId}/onos-drivers-utilities/${project.version}</bundle>
26 + </feature>
27 +</features>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2016 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +
18 +<project xmlns="http://maven.apache.org/POM/4.0.0"
19 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21 + <parent>
22 + <artifactId>onos-drivers-general</artifactId>
23 + <groupId>org.onosproject</groupId>
24 + <version>1.5.0-SNAPSHOT</version>
25 + </parent>
26 + <modelVersion>4.0.0</modelVersion>
27 +
28 + <artifactId>onos-drivers-ciena</artifactId>
29 + <packaging>bundle</packaging>
30 +
31 + <description>Ciena device drivers</description>
32 +
33 + <properties>
34 + <onos.app.name>org.onosproject.drivers.ciena</onos.app.name>
35 + </properties>
36 +
37 + <dependencies>
38 + <dependency>
39 + <groupId>org.onosproject</groupId>
40 + <artifactId>onos-drivers-utilities</artifactId>
41 + <version>${project.version}</version>
42 + </dependency>
43 + <dependency>
44 + <groupId>org.onosproject</groupId>
45 + <artifactId>onos-restsb-api</artifactId>
46 + <version>${project.version}</version>
47 + </dependency>
48 + </dependencies>
49 +
50 +</project>
...\ No newline at end of file ...\ No newline at end of file
1 +/*
2 + * Copyright 2016 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +
17 +package org.onosproject.drivers.ciena;
18 +
19 +import org.apache.felix.scr.annotations.Component;
20 +import org.onosproject.net.driver.AbstractDriverLoader;
21 +
22 +import java.io.InputStream;
23 +
24 +/**
25 + * Loader for Ciena device drivers from specific xml.
26 + */
27 +@Component(immediate = true)
28 +public class CienaDriversLoader extends AbstractDriverLoader {
29 +
30 + private static final String DRIVERS_XML = "/ciena-drivers.xml";
31 +
32 + @Override
33 + protected InputStream loadXMLDriversStream() {
34 + return getClassLoaderInstance().getResourceAsStream(DRIVERS_XML);
35 + }
36 +
37 + @Override
38 + protected ClassLoader getClassLoaderInstance() {
39 + return getClass().getClassLoader();
40 + }
41 +}
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
16 * 16 *
17 */ 17 */
18 18
19 -package org.onosproject.driver.rest; 19 +package org.onosproject.drivers.ciena;
20 20
21 import com.google.common.collect.Lists; 21 import com.google.common.collect.Lists;
22 import org.apache.commons.configuration.HierarchicalConfiguration; 22 import org.apache.commons.configuration.HierarchicalConfiguration;
23 -import org.onosproject.driver.XmlConfigParser; 23 +import org.onosproject.drivers.utilities.XmlConfigParser;
24 import org.onosproject.net.AnnotationKeys; 24 import org.onosproject.net.AnnotationKeys;
25 import org.onosproject.net.CltSignalType; 25 import org.onosproject.net.CltSignalType;
26 import org.onosproject.net.DefaultAnnotations; 26 import org.onosproject.net.DefaultAnnotations;
......
...@@ -15,6 +15,6 @@ ...@@ -15,6 +15,6 @@
15 */ 15 */
16 16
17 /** 17 /**
18 - * Implementations of the REST driver behaviours. 18 + * Package for Ciena device drivers.
19 */ 19 */
20 -package org.onosproject.driver.rest;
...\ No newline at end of file ...\ No newline at end of file
20 +package org.onosproject.drivers.ciena;
...\ No newline at end of file ...\ No newline at end of file
......
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2016 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +<drivers>
18 + <driver name="restCiena" manufacturer="Ciena" hwVersion="1.0.0" swVersion="1.0.0">
19 + <behaviour api="org.onosproject.net.behaviour.PortDiscovery"
20 + impl="org.onosproject.drivers.ciena.PortDiscoveryCienaWaveserverImpl"/>
21 + </driver>
22 +</drivers>
23 +
...@@ -19,13 +19,8 @@ ...@@ -19,13 +19,8 @@
19 description="${project.description}"> 19 description="${project.description}">
20 <feature>onos-api</feature> 20 <feature>onos-api</feature>
21 <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle> 21 <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
22 - <bundle>mvn:${project.groupId}/onos-of-api/${project.version}</bundle>
23 -
24 - <bundle>mvn:${project.groupId}/onos-ovsdb-api/${project.version}</bundle>
25 - <bundle>mvn:${project.groupId}/onos-ovsdb-rfc/${project.version}</bundle>
26 22
27 - <bundle>mvn:${project.groupId}/onos-netconf-api/${project.version}</bundle> 23 + <bundle>mvn:${project.groupId}/onos-of-api/${project.version}</bundle>
28 24
29 - <bundle>mvn:${project.groupId}/onos-restsb-api/${project.version}</bundle>
30 </feature> 25 </feature>
31 </features> 26 </features>
......
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2016 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +
18 +<project xmlns="http://maven.apache.org/POM/4.0.0"
19 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21 + <parent>
22 + <artifactId>onos-drivers-general</artifactId>
23 + <groupId>org.onosproject</groupId>
24 + <version>1.5.0-SNAPSHOT</version>
25 + </parent>
26 + <modelVersion>4.0.0</modelVersion>
27 +
28 + <description>Default device drivers</description>
29 + <!--should be onos-drivers-default for clarity but left as onos-drivers for compatibility-->
30 + <artifactId>onos-drivers</artifactId>
31 + <packaging>bundle</packaging>
32 +
33 + <properties>
34 + <onos.app.name>org.onosproject.drivers</onos.app.name>
35 + </properties>
36 + <dependencies>
37 + <dependency>
38 + <groupId>org.onosproject</groupId>
39 + <artifactId>onos-of-api</artifactId>
40 + </dependency>
41 + </dependencies>
42 +</project>
...\ No newline at end of file ...\ No newline at end of file
1 +/*
2 + * Copyright 2016 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +
17 +package org.onosproject.driver;
18 +
19 +import org.apache.felix.scr.annotations.Component;
20 +import org.apache.felix.scr.annotations.Service;
21 +import org.onosproject.net.driver.AbstractDriverLoader;
22 +import org.onosproject.net.driver.DefaultDriverProviderService;
23 +
24 +import java.io.InputStream;
25 +
26 +/**
27 + * Loader for default device drivers from specific xml.
28 + */
29 +@Service
30 +@Component(immediate = true)
31 +public class DefaultDriversLoader extends AbstractDriverLoader implements DefaultDriverProviderService {
32 +
33 + private static final String DRIVERS_XML = "/onos-drivers.xml";
34 +
35 + @Override
36 + protected InputStream loadXMLDriversStream() {
37 + return getClassLoaderInstance().getResourceAsStream(DRIVERS_XML);
38 + }
39 +
40 + @Override
41 + protected ClassLoader getClassLoaderInstance() {
42 + return getClass().getClassLoader();
43 + }
44 +}
...@@ -15,15 +15,14 @@ ...@@ -15,15 +15,14 @@
15 */ 15 */
16 package org.onosproject.driver.extensions; 16 package org.onosproject.driver.extensions;
17 17
18 -import java.util.Map; 18 +import com.google.common.base.MoreObjects;
19 -import java.util.Objects; 19 +import com.google.common.collect.Maps;
20 -
21 import org.onlab.util.KryoNamespace; 20 import org.onlab.util.KryoNamespace;
22 import org.onosproject.net.flow.AbstractExtension; 21 import org.onosproject.net.flow.AbstractExtension;
23 import org.onosproject.net.flow.instructions.ExtensionTreatmentType; 22 import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
24 23
25 -import com.google.common.base.MoreObjects; 24 +import java.util.Map;
26 -import com.google.common.collect.Maps; 25 +import java.util.Objects;
27 26
28 /** 27 /**
29 * Default implementation of Move treatment. 28 * Default implementation of Move treatment.
......
...@@ -34,7 +34,6 @@ import org.onlab.packet.VlanId; ...@@ -34,7 +34,6 @@ import org.onlab.packet.VlanId;
34 import org.onlab.util.KryoNamespace; 34 import org.onlab.util.KryoNamespace;
35 import org.onosproject.core.ApplicationId; 35 import org.onosproject.core.ApplicationId;
36 import org.onosproject.core.CoreService; 36 import org.onosproject.core.CoreService;
37 -import org.onosproject.driver.pipeline.OFDPA2GroupHandler.OfdpaNextGroup;
38 import org.onosproject.net.DeviceId; 37 import org.onosproject.net.DeviceId;
39 import org.onosproject.net.Port; 38 import org.onosproject.net.Port;
40 import org.onosproject.net.PortNumber; 39 import org.onosproject.net.PortNumber;
...@@ -113,7 +112,7 @@ public class OFDPA2Pipeline extends AbstractHandlerBehaviour implements Pipeline ...@@ -113,7 +112,7 @@ public class OFDPA2Pipeline extends AbstractHandlerBehaviour implements Pipeline
113 .register(KryoNamespaces.API) 112 .register(KryoNamespaces.API)
114 .register(GroupKey.class) 113 .register(GroupKey.class)
115 .register(DefaultGroupKey.class) 114 .register(DefaultGroupKey.class)
116 - .register(OfdpaNextGroup.class) 115 + .register(OFDPA2GroupHandler.OfdpaNextGroup.class)
117 .register(byte[].class) 116 .register(byte[].class)
118 .register(ArrayDeque.class) 117 .register(ArrayDeque.class)
119 .build(); 118 .build();
......
...@@ -21,17 +21,11 @@ ...@@ -21,17 +21,11 @@
21 impl="org.onosproject.driver.pipeline.DefaultSingleTablePipeline"/> 21 impl="org.onosproject.driver.pipeline.DefaultSingleTablePipeline"/>
22 <behaviour api="org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver" 22 <behaviour api="org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver"
23 impl="org.onosproject.driver.handshaker.DefaultSwitchHandshaker"/> 23 impl="org.onosproject.driver.handshaker.DefaultSwitchHandshaker"/>
24 - <behaviour api="org.onosproject.net.behaviour.TunnelConfig"
25 - impl="org.onosproject.driver.ovsdb.OvsdbTunnelConfig"/>
26 - <behaviour api="org.onosproject.net.behaviour.BridgeConfig"
27 - impl="org.onosproject.driver.ovsdb.OvsdbBridgeConfig"/>
28 </driver> 24 </driver>
29 <driver name="ovs" extends="default" 25 <driver name="ovs" extends="default"
30 manufacturer="Nicira, Inc\." hwVersion="Open vSwitch" swVersion="2\..*"> 26 manufacturer="Nicira, Inc\." hwVersion="Open vSwitch" swVersion="2\..*">
31 <behaviour api="org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver" 27 <behaviour api="org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver"
32 impl="org.onosproject.driver.handshaker.NiciraSwitchHandshaker"/> 28 impl="org.onosproject.driver.handshaker.NiciraSwitchHandshaker"/>
33 - <behaviour api="org.onosproject.net.behaviour.ControllerConfig"
34 - impl="org.onosproject.driver.ovsdb.OvsdbControllerConfig"/>
35 <behaviour api="org.onosproject.openflow.controller.ExtensionTreatmentInterpreter" 29 <behaviour api="org.onosproject.openflow.controller.ExtensionTreatmentInterpreter"
36 impl="org.onosproject.driver.extensions.NiciraExtensionTreatmentInterpreter" /> 30 impl="org.onosproject.driver.extensions.NiciraExtensionTreatmentInterpreter" />
37 <behaviour api="org.onosproject.net.behaviour.ExtensionTreatmentResolver" 31 <behaviour api="org.onosproject.net.behaviour.ExtensionTreatmentResolver"
...@@ -45,20 +39,6 @@ ...@@ -45,20 +39,6 @@
45 <behaviour api="org.onosproject.net.behaviour.MplsQuery" 39 <behaviour api="org.onosproject.net.behaviour.MplsQuery"
46 impl="org.onosproject.driver.query.FullMplsAvailable" /> 40 impl="org.onosproject.driver.query.FullMplsAvailable" />
47 </driver> 41 </driver>
48 - <!--This driver is for simulated NETCONF devices through of-config tool on top og OVSDB-->
49 - <driver name="ovs-netconf" extends="default,ovs"
50 - manufacturer="" hwVersion="" swVersion="">
51 - <behaviour api="org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver"
52 - impl="org.onosproject.driver.handshaker.NiciraSwitchHandshaker"/>
53 - <behaviour api="org.onosproject.net.behaviour.ControllerConfig"
54 - impl="org.onosproject.driver.netconf.NetconfControllerConfig"/>
55 - <behaviour api="org.onosproject.net.behaviour.ConfigGetter"
56 - impl="org.onosproject.driver.netconf.NetconfConfigGetter"/>
57 - </driver>
58 - <driver name="netconf" extends="default">
59 - <behaviour api="org.onosproject.net.behaviour.ConfigGetter"
60 - impl="org.onosproject.driver.netconf.NetconfConfigGetter"/>
61 - </driver>
62 <driver name="ovs-corsa" extends="ovs" 42 <driver name="ovs-corsa" extends="ovs"
63 manufacturer="Corsa" hwVersion="emulation" swVersion="0.0.0"> 43 manufacturer="Corsa" hwVersion="emulation" swVersion="0.0.0">
64 <behaviour api="org.onosproject.net.behaviour.Pipeliner" 44 <behaviour api="org.onosproject.net.behaviour.Pipeliner"
...@@ -128,10 +108,6 @@ ...@@ -128,10 +108,6 @@
128 <behaviour api="org.onosproject.net.behaviour.Pipeliner" 108 <behaviour api="org.onosproject.net.behaviour.Pipeliner"
129 impl="org.onosproject.driver.pipeline.OltPipeline"/> 109 impl="org.onosproject.driver.pipeline.OltPipeline"/>
130 </driver> 110 </driver>
131 - <driver name="restCiena" manufacturer="Ciena" hwVersion="1.0.0" swVersion="1.0.0">
132 - <behaviour api="org.onosproject.net.behaviour.PortDiscovery"
133 - impl="org.onosproject.driver.rest.PortDiscoveryCienaWaveserverImpl"/>
134 - </driver>
135 <!-- The SoftRouter driver is meant to be used by any software/NPU based 111 <!-- The SoftRouter driver is meant to be used by any software/NPU based
136 ~ switch that wishes to implement a simple 2-table router. To use this 112 ~ switch that wishes to implement a simple 2-table router. To use this
137 ~ driver, configure ONOS with the dpid of the device, or extend the 113 ~ driver, configure ONOS with the dpid of the device, or extend the
......
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2016 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +
18 +<project xmlns="http://maven.apache.org/POM/4.0.0"
19 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21 + <parent>
22 + <artifactId>onos-drivers-general</artifactId>
23 + <groupId>org.onosproject</groupId>
24 + <version>1.5.0-SNAPSHOT</version>
25 + </parent>
26 + <modelVersion>4.0.0</modelVersion>
27 +
28 + <description>Fujitsu device drivers</description>
29 +
30 + <artifactId>onos-drivers-fujitsu</artifactId>
31 + <packaging>bundle</packaging>
32 +
33 + <properties>
34 + <onos.app.name>org.onosproject.drivers.fujitsu</onos.app.name>
35 + </properties>
36 +
37 +</project>
...\ No newline at end of file ...\ No newline at end of file
1 +/*
2 + * Copyright 2016 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +
17 +package org.onosproject.drivers.fujitsu;
18 +
19 +import org.apache.felix.scr.annotations.Component;
20 +import org.onosproject.net.driver.AbstractDriverLoader;
21 +
22 +import java.io.InputStream;
23 +
24 +/**
25 + * Loader for Fujitsu device drivers from specific xml.
26 + */
27 +@Component(immediate = true)
28 +public class FujitsuDriversLoader extends AbstractDriverLoader {
29 +
30 + private static final String DRIVERS_XML = "/fujitsu-drivers.xml";
31 +
32 + @Override
33 + protected InputStream loadXMLDriversStream() {
34 + return getClassLoaderInstance().getResourceAsStream(DRIVERS_XML);
35 + }
36 +
37 + @Override
38 + protected ClassLoader getClassLoaderInstance() {
39 + return getClass().getClassLoader();
40 + }
41 +}
1 /* 1 /*
2 - * Copyright 2015 Open Networking Laboratory 2 + * Copyright 2016 Open Networking Laboratory
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
...@@ -15,6 +15,6 @@ ...@@ -15,6 +15,6 @@
15 */ 15 */
16 16
17 /** 17 /**
18 - * Implementations of the Netconf driver behaviours. 18 + * Package for Ciena device drivers.
19 */ 19 */
20 -package org.onosproject.driver.netconf;
...\ No newline at end of file ...\ No newline at end of file
20 +package org.onosproject.drivers.fujitsu;
...\ No newline at end of file ...\ No newline at end of file
......
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2016 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +<drivers>
18 + <driver>
19 + </driver>
20 +</drivers>
21 +
1 +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 +
3 +<!--
4 + ~ Copyright 2016 Open Networking Laboratory
5 + ~
6 + ~ Licensed under the Apache License, Version 2.0 (the "License");
7 + ~ you may not use this file except in compliance with the License.
8 + ~ You may obtain a copy of the License at
9 + ~
10 + ~ http://www.apache.org/licenses/LICENSE-2.0
11 + ~
12 + ~ Unless required by applicable law or agreed to in writing, software
13 + ~ distributed under the License is distributed on an "AS IS" BASIS,
14 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 + ~ See the License for the specific language governing permissions and
16 + ~ limitations under the License.
17 + -->
18 +<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}">
19 + <feature name="${project.artifactId}" version="${project.version}"
20 + description="${project.description}">
21 + <feature>onos-api</feature>
22 + <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
23 +
24 + <bundle>mvn:${project.groupId}/onos-drivers-utilities/${project.version}</bundle>
25 +
26 + <bundle>mvn:${project.groupId}/onos-netconf-api/${project.version}</bundle>
27 + </feature>
28 +</features>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2016 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +
18 +<project xmlns="http://maven.apache.org/POM/4.0.0"
19 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21 + <parent>
22 + <artifactId>onos-drivers-general</artifactId>
23 + <groupId>org.onosproject</groupId>
24 + <version>1.5.0-SNAPSHOT</version>
25 + </parent>
26 + <modelVersion>4.0.0</modelVersion>
27 +
28 + <artifactId>onos-drivers-netconf</artifactId>
29 + <packaging>bundle</packaging>
30 +
31 + <description>Netconf device drivers</description>
32 +
33 + <properties>
34 + <onos.app.name>org.onosproject.drivers.netconf</onos.app.name>
35 + </properties>
36 +
37 + <dependencies>
38 + <dependency>
39 + <groupId>org.onosproject</groupId>
40 + <artifactId>onos-netconf-api</artifactId>
41 + <version>${project.version}</version>
42 + </dependency>
43 + <dependency>
44 + <groupId>org.onosproject</groupId>
45 + <artifactId>onos-drivers-utilities</artifactId>
46 + <version>${project.version}</version>
47 + </dependency>
48 + </dependencies>
49 +
50 +</project>
...\ No newline at end of file ...\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17 -package org.onosproject.driver.netconf; 17 +package org.onosproject.drivers.netconf;
18 18
19 import com.google.common.base.Preconditions; 19 import com.google.common.base.Preconditions;
20 import org.onosproject.net.DeviceId; 20 import org.onosproject.net.DeviceId;
...@@ -31,7 +31,6 @@ import static org.slf4j.LoggerFactory.getLogger; ...@@ -31,7 +31,6 @@ import static org.slf4j.LoggerFactory.getLogger;
31 /** 31 /**
32 * Gets the configuration of the specified type from the specified device. If a 32 * Gets the configuration of the specified type from the specified device. If a
33 * failure occurs it returns the error string found in UNABLE_TO_READ_CONFIG. 33 * failure occurs it returns the error string found in UNABLE_TO_READ_CONFIG.
34 - *
35 * This is a temporary development tool for use until yang integration is complete. 34 * This is a temporary development tool for use until yang integration is complete.
36 * This is not a properly specified behavior implementation. DO NOT USE AS AN EXAMPLE. 35 * This is not a properly specified behavior implementation. DO NOT USE AS AN EXAMPLE.
37 */ 36 */
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17 -package org.onosproject.driver.netconf; 17 +package org.onosproject.drivers.netconf;
18 18
19 import com.google.common.base.Preconditions; 19 import com.google.common.base.Preconditions;
20 -import org.onosproject.driver.XmlConfigParser; 20 +import org.onosproject.drivers.utilities.XmlConfigParser;
21 import org.onosproject.net.DeviceId; 21 import org.onosproject.net.DeviceId;
22 import org.onosproject.net.behaviour.ControllerConfig; 22 import org.onosproject.net.behaviour.ControllerConfig;
23 import org.onosproject.net.behaviour.ControllerInfo; 23 import org.onosproject.net.behaviour.ControllerInfo;
......
1 +/*
2 + * Copyright 2016 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +
17 +package org.onosproject.drivers.netconf;
18 +
19 +import org.apache.felix.scr.annotations.Component;
20 +import org.onosproject.net.driver.AbstractDriverLoader;
21 +
22 +import java.io.InputStream;
23 +
24 +/**
25 + * Loader for NETCONF device drivers from specific xml.
26 + */
27 +@Component(immediate = true)
28 +public class NetconfDriversLoader extends AbstractDriverLoader {
29 +
30 + private static final String DRIVERS_XML = "/netconf-drivers.xml";
31 +
32 + @Override
33 + protected InputStream loadXMLDriversStream() {
34 + return getClassLoaderInstance().getResourceAsStream(DRIVERS_XML);
35 + }
36 +
37 + @Override
38 + protected ClassLoader getClassLoaderInstance() {
39 + return getClass().getClassLoader();
40 + }
41 +}
1 /* 1 /*
2 - * Copyright 2015 Open Networking Laboratory 2 + * Copyright 2016 Open Networking Laboratory
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
...@@ -15,6 +15,6 @@ ...@@ -15,6 +15,6 @@
15 */ 15 */
16 16
17 /** 17 /**
18 - * Implementations of OVSDB protocol configurations. 18 + * Package for NETCONF device drivers.
19 */ 19 */
20 -package org.onosproject.driver.ovsdb;
...\ No newline at end of file ...\ No newline at end of file
20 +package org.onosproject.drivers.netconf;
...\ No newline at end of file ...\ No newline at end of file
......
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2016 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +<drivers>
18 + <!--This driver is for simulated NETCONF devices through of-config tool on top og OVSDB-->
19 + <driver name="ovs-netconf" extends="default,ovs"
20 + manufacturer="" hwVersion="" swVersion="">
21 + <behaviour api="org.onosproject.net.behaviour.ControllerConfig"
22 + impl="org.onosproject.drivers.netconf.NetconfControllerConfig"/>
23 + <behaviour api="org.onosproject.net.behaviour.ConfigGetter"
24 + impl="org.onosproject.drivers.netconf.NetconfConfigGetter"/>
25 + </driver>
26 + <driver name="netconf" extends="default">
27 + <behaviour api="org.onosproject.net.behaviour.ConfigGetter"
28 + impl="org.onosproject.drivers.netconf.NetconfConfigGetter"/>
29 + </driver>
30 +</drivers>
31 +
1 +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 +
3 +<!--
4 + ~ Copyright 2016 Open Networking Laboratory
5 + ~
6 + ~ Licensed under the Apache License, Version 2.0 (the "License");
7 + ~ you may not use this file except in compliance with the License.
8 + ~ You may obtain a copy of the License at
9 + ~
10 + ~ http://www.apache.org/licenses/LICENSE-2.0
11 + ~
12 + ~ Unless required by applicable law or agreed to in writing, software
13 + ~ distributed under the License is distributed on an "AS IS" BASIS,
14 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 + ~ See the License for the specific language governing permissions and
16 + ~ limitations under the License.
17 + -->
18 +
19 +<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}">
20 + <feature name="${project.artifactId}" version="${project.version}"
21 + description="${project.description}">
22 + <feature>onos-api</feature>
23 + <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
24 +
25 + <bundle>mvn:${project.groupId}/onos-ovsdb-api/${project.version}</bundle>
26 + <bundle>mvn:${project.groupId}/onos-ovsdb-rfc/${project.version}</bundle>
27 + </feature>
28 +</features>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2016 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +
18 +<project xmlns="http://maven.apache.org/POM/4.0.0"
19 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21 + <parent>
22 + <artifactId>onos-drivers-general</artifactId>
23 + <groupId>org.onosproject</groupId>
24 + <version>1.5.0-SNAPSHOT</version>
25 + </parent>
26 + <modelVersion>4.0.0</modelVersion>
27 +
28 + <artifactId>onos-drivers-ovsdb</artifactId>
29 + <packaging>bundle</packaging>
30 +
31 + <description>ovsdb device drivers</description>
32 +
33 + <properties>
34 + <onos.app.name>org.onosproject.drivers.ovsdb</onos.app.name>
35 + </properties>
36 +
37 + <dependencies>
38 + <dependency>
39 + <groupId>org.onosproject</groupId>
40 + <artifactId>onos-ovsdb-api</artifactId>
41 + <version>${project.version}</version>
42 + </dependency>
43 + <dependency>
44 + <groupId>org.onosproject</groupId>
45 + <artifactId>onos-ovsdb-api</artifactId>
46 + <version>${project.version}</version>
47 + <classifier>tests</classifier>
48 + <scope>test</scope>
49 + </dependency>
50 + </dependencies>
51 +</project>
...\ No newline at end of file ...\ No newline at end of file
1 /* 1 /*
2 - * Copyright 2015 Open Networking Laboratory 2 + * Copyright 2016 Open Networking Laboratory
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
...@@ -13,13 +13,8 @@ ...@@ -13,13 +13,8 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.driver.ovsdb;
17 16
18 -import java.util.ArrayList; 17 +package org.onosproject.drivers.ovsdb;
19 -import java.util.Collection;
20 -import java.util.List;
21 -import java.util.Set;
22 -import java.util.stream.Collectors;
23 18
24 import org.onlab.packet.IpAddress; 19 import org.onlab.packet.IpAddress;
25 import org.onosproject.net.DefaultAnnotations; 20 import org.onosproject.net.DefaultAnnotations;
...@@ -40,6 +35,12 @@ import org.onosproject.ovsdb.controller.OvsdbController; ...@@ -40,6 +35,12 @@ import org.onosproject.ovsdb.controller.OvsdbController;
40 import org.onosproject.ovsdb.controller.OvsdbNodeId; 35 import org.onosproject.ovsdb.controller.OvsdbNodeId;
41 import org.onosproject.ovsdb.controller.OvsdbPort; 36 import org.onosproject.ovsdb.controller.OvsdbPort;
42 37
38 +import java.util.ArrayList;
39 +import java.util.Collection;
40 +import java.util.List;
41 +import java.util.Set;
42 +import java.util.stream.Collectors;
43 +
43 /** 44 /**
44 * The implementation of BridageConfig. 45 * The implementation of BridageConfig.
45 */ 46 */
......
1 /* 1 /*
2 - * Copyright 2015 Open Networking Laboratory 2 + * Copyright 2016 Open Networking Laboratory
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17 -package org.onosproject.driver.ovsdb; 17 +package org.onosproject.drivers.ovsdb;
18 18
19 import com.google.common.collect.ImmutableSet; 19 import com.google.common.collect.ImmutableSet;
20 import org.onlab.packet.IpAddress; 20 import org.onlab.packet.IpAddress;
......
1 +/*
2 + * Copyright 2016 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +
17 +package org.onosproject.drivers.ovsdb;
18 +
19 +import org.apache.felix.scr.annotations.Component;
20 +import org.onosproject.net.driver.AbstractDriverLoader;
21 +
22 +import java.io.InputStream;
23 +
24 +/**
25 + * Loader for OVSDB device drivers from specific xml.
26 + */
27 +@Component(immediate = true)
28 +public class OvsdbDriversLoader extends AbstractDriverLoader {
29 +
30 + private static final String DRIVERS_XML = "/ovsdb-drivers.xml";
31 +
32 + @Override
33 + protected InputStream loadXMLDriversStream() {
34 + return getClassLoaderInstance().getResourceAsStream(DRIVERS_XML);
35 + }
36 +
37 + @Override
38 + protected ClassLoader getClassLoaderInstance() {
39 + return getClass().getClassLoader();
40 + }
41 +}
1 /* 1 /*
2 - * Copyright 2015 Open Networking Laboratory 2 + * Copyright 2016 Open Networking Laboratory
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
...@@ -13,12 +13,8 @@ ...@@ -13,12 +13,8 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.driver.ovsdb;
17 16
18 -import java.util.Collection; 17 +package org.onosproject.drivers.ovsdb;
19 -import java.util.Map;
20 -import java.util.Set;
21 -import java.util.stream.Collectors;
22 18
23 import org.onlab.packet.IpAddress; 19 import org.onlab.packet.IpAddress;
24 import org.onosproject.net.DefaultAnnotations; 20 import org.onosproject.net.DefaultAnnotations;
...@@ -36,6 +32,11 @@ import org.onosproject.ovsdb.controller.OvsdbController; ...@@ -36,6 +32,11 @@ import org.onosproject.ovsdb.controller.OvsdbController;
36 import org.onosproject.ovsdb.controller.OvsdbNodeId; 32 import org.onosproject.ovsdb.controller.OvsdbNodeId;
37 import org.onosproject.ovsdb.controller.OvsdbTunnel; 33 import org.onosproject.ovsdb.controller.OvsdbTunnel;
38 34
35 +import java.util.Collection;
36 +import java.util.Map;
37 +import java.util.Set;
38 +import java.util.stream.Collectors;
39 +
39 /** 40 /**
40 * OVSDB-based implementation of tunnel config behaviour. 41 * OVSDB-based implementation of tunnel config behaviour.
41 */ 42 */
......
1 +/*
2 + * Copyright 2016 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +
17 +/**
18 + * Package for OVSDB device drivers.
19 + */
20 +package org.onosproject.drivers.ovsdb;
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2015 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +<drivers>
18 + <driver name="default"
19 + manufacturer="ON.Lab" hwVersion="0.0.1" swVersion="0.0.1">
20 + <behaviour api="org.onosproject.net.behaviour.TunnelConfig"
21 + impl="org.onosproject.drivers.ovsdb.OvsdbTunnelConfig"/>
22 + <behaviour api="org.onosproject.net.behaviour.BridgeConfig"
23 + impl="org.onosproject.drivers.ovsdb.OvsdbBridgeConfig"/>
24 + </driver>
25 + <driver name="ovs" extends="default"
26 + manufacturer="Nicira, Inc\." hwVersion="Open vSwitch" swVersion="2\..*">
27 + <behaviour api="org.onosproject.net.behaviour.ControllerConfig"
28 + impl="org.onosproject.drivers.ovsdb.OvsdbControllerConfig"/>
29 + </driver>
30 +</drivers>
31 +
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17 -package org.onosproject.driver.ovsdb; 17 +package org.onosproject.drivers.ovsdb;
18 18
19 import com.google.common.collect.ImmutableMap; 19 import com.google.common.collect.ImmutableMap;
20 import org.junit.Before; 20 import org.junit.Before;
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
19 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 19 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
20 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
21 21
22 -
23 <parent> 22 <parent>
24 <groupId>org.onosproject</groupId> 23 <groupId>org.onosproject</groupId>
25 <artifactId>onos</artifactId> 24 <artifactId>onos</artifactId>
...@@ -27,14 +26,23 @@ ...@@ -27,14 +26,23 @@
27 <relativePath>../pom.xml</relativePath> 26 <relativePath>../pom.xml</relativePath>
28 </parent> 27 </parent>
29 28
30 - <artifactId>onos-drivers</artifactId> 29 + <artifactId>onos-drivers-general</artifactId>
31 - <packaging>bundle</packaging> 30 + <packaging>pom</packaging>
31 +
32 + <description>Builtin device drivers general module</description>
32 33
33 - <description>Builtin device drivers</description> 34 + <modules>
35 + <module>default</module>
36 + <module>ciena</module>
37 + <module>fujitsu</module>
38 + <module>netconf</module>
39 + <module>ovsdb</module>
40 + <module>utilities</module>
41 + </modules>
34 42
35 - <properties> 43 + <!--<properties>
36 <onos.app.name>org.onosproject.drivers</onos.app.name> 44 <onos.app.name>org.onosproject.drivers</onos.app.name>
37 - </properties> 45 + </properties>-->
38 46
39 <dependencies> 47 <dependencies>
40 <dependency> 48 <dependency>
...@@ -49,36 +57,15 @@ ...@@ -49,36 +57,15 @@
49 57
50 <dependency> 58 <dependency>
51 <groupId>org.onosproject</groupId> 59 <groupId>org.onosproject</groupId>
52 - <artifactId>onos-of-api</artifactId>
53 - </dependency>
54 -
55 - <dependency>
56 - <groupId>org.onosproject</groupId>
57 <artifactId>onos-core-serializers</artifactId> 60 <artifactId>onos-core-serializers</artifactId>
58 <version>${project.version}</version> 61 <version>${project.version}</version>
59 </dependency> 62 </dependency>
60 <dependency> 63 <dependency>
61 - <groupId>org.onosproject</groupId>
62 - <artifactId>onos-ovsdb-api</artifactId>
63 - <version>${project.version}</version>
64 - </dependency>
65 - <dependency>
66 <groupId>org.easymock</groupId> 64 <groupId>org.easymock</groupId>
67 <artifactId>easymock</artifactId> 65 <artifactId>easymock</artifactId>
68 <scope>test</scope> 66 <scope>test</scope>
69 </dependency> 67 </dependency>
70 <dependency> 68 <dependency>
71 - <groupId>org.onosproject</groupId>
72 - <artifactId>onos-restsb-api</artifactId>
73 - <version>${project.version}</version>
74 - </dependency>
75 - <dependency>
76 - <groupId>org.onosproject</groupId>
77 - <artifactId>onos-netconf-api</artifactId>
78 - <version>${project.version}</version>
79 - </dependency>
80 -
81 - <dependency>
82 <groupId>org.apache.felix</groupId> 69 <groupId>org.apache.felix</groupId>
83 <artifactId>org.apache.felix.scr.annotations</artifactId> 70 <artifactId>org.apache.felix.scr.annotations</artifactId>
84 </dependency> 71 </dependency>
...@@ -94,13 +81,6 @@ ...@@ -94,13 +81,6 @@
94 <artifactId>onlab-junit</artifactId> 81 <artifactId>onlab-junit</artifactId>
95 <scope>test</scope> 82 <scope>test</scope>
96 </dependency> 83 </dependency>
97 - <dependency>
98 - <groupId>org.onosproject</groupId>
99 - <artifactId>onos-ovsdb-api</artifactId>
100 - <version>${project.version}</version>
101 - <classifier>tests</classifier>
102 - <scope>test</scope>
103 - </dependency>
104 </dependencies> 84 </dependencies>
105 85
106 <build> 86 <build>
......
1 +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 +
3 +<!--
4 + ~ Copyright 2016 Open Networking Laboratory
5 + ~
6 + ~ Licensed under the Apache License, Version 2.0 (the "License");
7 + ~ you may not use this file except in compliance with the License.
8 + ~ You may obtain a copy of the License at
9 + ~
10 + ~ http://www.apache.org/licenses/LICENSE-2.0
11 + ~
12 + ~ Unless required by applicable law or agreed to in writing, software
13 + ~ distributed under the License is distributed on an "AS IS" BASIS,
14 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 + ~ See the License for the specific language governing permissions and
16 + ~ limitations under the License.
17 + -->
18 +
19 +<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}">
20 + <feature name="${project.artifactId}" version="${project.version}"
21 + description="${project.description}">
22 + <feature>onos-api</feature>
23 + <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
24 + </feature>
25 +</features>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2016 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +
18 +<project xmlns="http://maven.apache.org/POM/4.0.0"
19 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21 + <parent>
22 + <artifactId>onos-drivers-general</artifactId>
23 + <groupId>org.onosproject</groupId>
24 + <version>1.5.0-SNAPSHOT</version>
25 + </parent>
26 + <modelVersion>4.0.0</modelVersion>
27 +
28 + <description>Device drivers utilities</description>
29 +
30 + <artifactId>onos-drivers-utilities</artifactId>
31 + <packaging>bundle</packaging>
32 +
33 +</project>
...\ No newline at end of file ...\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17 -package org.onosproject.driver; 17 +package org.onosproject.drivers.utilities;
18 18
19 import com.google.common.collect.Lists; 19 import com.google.common.collect.Lists;
20 import org.apache.commons.configuration.ConfigurationException; 20 import org.apache.commons.configuration.ConfigurationException;
......
1 +/*
2 + * Copyright 2016 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +
17 +/**
18 + * Package for device drivers utilities.
19 + */
20 +package org.onosproject.drivers.utilities;
...\ No newline at end of file ...\ No newline at end of file
1 +<!--
2 + ~ Copyright 2015 Open Networking Laboratory
3 + ~
4 + ~ Licensed under the Apache License, Version 2.0 (the "License");
5 + ~ you may not use this file except in compliance with the License.
6 + ~ You may obtain a copy of the License at
7 + ~
8 + ~ http://www.apache.org/licenses/LICENSE-2.0
9 + ~
10 + ~ Unless required by applicable law or agreed to in writing, software
11 + ~ distributed under the License is distributed on an "AS IS" BASIS,
12 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + ~ See the License for the specific language governing permissions and
14 + ~ limitations under the License.
15 + -->
16 +
17 +<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
18 + <edit-config>
19 + <target>
20 + </target>
21 + <default-operation>
22 + </default-operation>
23 + <config>
24 + <capable-switch xmlns="urn:onf:config:yang">
25 + <id></id>
26 + <logical-switches>
27 + <switch>
28 + <id></id>
29 + <controllers>
30 + </controllers>
31 + </switch>
32 + </logical-switches>
33 + </capable-switch>
34 + </config>
35 + </edit-config>
36 +</rpc>
...\ No newline at end of file ...\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17 -package org.onosproject.driver; 17 +package org.onosproject.drivers.utilities;
18 18
19 import org.junit.Test; 19 import org.junit.Test;
20 import org.onlab.packet.IpAddress; 20 import org.onlab.packet.IpAddress;
...@@ -27,7 +27,6 @@ import java.util.Arrays; ...@@ -27,7 +27,6 @@ import java.util.Arrays;
27 import java.util.List; 27 import java.util.List;
28 28
29 import static org.junit.Assert.assertTrue; 29 import static org.junit.Assert.assertTrue;
30 -import static org.onosproject.driver.XmlConfigParser.*;
31 30
32 /** 31 /**
33 * Test the XML document Parsing for netconf configuration. 32 * Test the XML document Parsing for netconf configuration.
...@@ -37,8 +36,9 @@ public class XmlConfigParserTest { ...@@ -37,8 +36,9 @@ public class XmlConfigParserTest {
37 36
38 @Test 37 @Test
39 public void basics() throws IOException { 38 public void basics() throws IOException {
40 - InputStream stream = getClass().getResourceAsStream("testConfig.xml"); 39 + InputStream stream = getClass().getResourceAsStream("/testConfig.xml");
41 - List<ControllerInfo> controllers = parseStreamControllers(loadXml(stream)); 40 + List<ControllerInfo> controllers = XmlConfigParser
41 + .parseStreamControllers(XmlConfigParser.loadXml(stream));
42 assertTrue(controllers.get(0).equals(new ControllerInfo( 42 assertTrue(controllers.get(0).equals(new ControllerInfo(
43 IpAddress.valueOf("10.128.12.1"), 6653, "tcp"))); 43 IpAddress.valueOf("10.128.12.1"), 6653, "tcp")));
44 assertTrue(controllers.get(1).equals(new ControllerInfo( 44 assertTrue(controllers.get(1).equals(new ControllerInfo(
...@@ -48,28 +48,34 @@ public class XmlConfigParserTest { ...@@ -48,28 +48,34 @@ public class XmlConfigParserTest {
48 48
49 @Test 49 @Test
50 public void switchId() { 50 public void switchId() {
51 - InputStream stream = getClass().getResourceAsStream("testConfig.xml"); 51 + InputStream stream = getClass().getResourceAsStream("/testConfig.xml");
52 - String switchId = parseSwitchId(loadXml(stream)); 52 + String switchId = XmlConfigParser.parseSwitchId(XmlConfigParser
53 + .loadXml(stream));
53 assertTrue(switchId.equals("ofc-bridge")); 54 assertTrue(switchId.equals("ofc-bridge"));
54 } 55 }
55 56
56 @Test 57 @Test
57 public void capableSwitchId() { 58 public void capableSwitchId() {
58 - InputStream stream = getClass().getResourceAsStream("testConfig.xml"); 59 + InputStream stream = getClass().getResourceAsStream("/testConfig.xml");
59 - String capableSwitchId = parseCapableSwitchId(loadXml(stream)); 60 + String capableSwitchId = XmlConfigParser
61 + .parseCapableSwitchId(XmlConfigParser.loadXml(stream));
60 assertTrue(capableSwitchId.equals("openvswitch")); 62 assertTrue(capableSwitchId.equals("openvswitch"));
61 } 63 }
62 64
63 @Test 65 @Test
64 public void controllersConfig() { 66 public void controllersConfig() {
65 - InputStream streamOrig = getClass().getResourceAsStream("testConfig.xml"); 67 + InputStream streamOrig = getClass().getResourceAsStream("/testConfig.xml");
66 - InputStream streamCFG = XmlConfigParser.class 68 + InputStream streamCFG = XmlConfigParser.class.getResourceAsStream("/controllers.xml");
67 - .getResourceAsStream("controllers.xml"); 69 + String config = XmlConfigParser
68 - String config = createControllersConfig(loadXml(streamCFG), 70 + .createControllersConfig(XmlConfigParser.loadXml(streamCFG),
69 - loadXml(streamOrig), "running", "merge", 71 + XmlConfigParser.loadXml(streamOrig),
70 - "create", new ArrayList<>(Arrays.asList( 72 + "running", "merge", "create",
71 - new ControllerInfo(IpAddress.valueOf("192.168.1.1"), 73 + new ArrayList<>(
72 - 5000, "tcp")))); 74 + Arrays.asList(
75 + new ControllerInfo(
76 + IpAddress.valueOf(
77 + "192.168.1.1"),
78 + 5000, "tcp"))));
73 assertTrue(config.contains("192.168.1.1")); 79 assertTrue(config.contains("192.168.1.1"));
74 assertTrue(config.contains("tcp")); 80 assertTrue(config.contains("tcp"));
75 assertTrue(config.contains("5000")); 81 assertTrue(config.contains("5000"));
......
...@@ -15,16 +15,13 @@ ...@@ -15,16 +15,13 @@
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 <app name="org.onosproject.netconf" origin="ON.Lab" version="${project.version}" 17 <app name="org.onosproject.netconf" origin="ON.Lab" version="${project.version}"
18 - category="default" url="http://onosproject.org" 18 + category="default" url="http://onosproject.org" apps="org.onosproject.drivers.netconf"
19 featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features" 19 featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
20 features="${project.artifactId}"> 20 features="${project.artifactId}">
21 <description>${project.description}</description> 21 <description>${project.description}</description>
22 <artifact>mvn:${project.groupId}/onos-netconf-api/${project.version}</artifact> 22 <artifact>mvn:${project.groupId}/onos-netconf-api/${project.version}</artifact>
23 <artifact>mvn:${project.groupId}/onos-netconf-ctl/${project.version}</artifact> 23 <artifact>mvn:${project.groupId}/onos-netconf-ctl/${project.version}</artifact>
24 - <artifact>mvn:${project.groupId}/onos-drivers/${project.version}</artifact>
25 24
26 <artifact>mvn:${project.groupId}/onos-netconf-provider-device/${project.version}</artifact> 25 <artifact>mvn:${project.groupId}/onos-netconf-provider-device/${project.version}</artifact>
27 26
28 - <!--<artifact>mvn:${project.groupId}/onos-netconf-provider-device/${project.version}</artifact>-->
29 - <!-- Question: should there be the jnc stuff here? Or is it just for testing -->
30 </app> 27 </app>
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
23 <bundle>mvn:${project.groupId}/onos-netconf-ctl/${project.version}</bundle> 23 <bundle>mvn:${project.groupId}/onos-netconf-ctl/${project.version}</bundle>
24 24
25 <bundle>mvn:${project.groupId}/onos-netconf-provider-device/${project.version}</bundle> 25 <bundle>mvn:${project.groupId}/onos-netconf-provider-device/${project.version}</bundle>
26 - <!-- Question: should there be the jnc stuff here? Or is it just for testing -->
27 </feature> 26 </feature>
28 </features> 27 </features>
29 28
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
22 <artifact>mvn:${project.groupId}/onos-ovsdb-rfc/${project.version}</artifact> 22 <artifact>mvn:${project.groupId}/onos-ovsdb-rfc/${project.version}</artifact>
23 <artifact>mvn:${project.groupId}/onos-ovsdb-api/${project.version}</artifact> 23 <artifact>mvn:${project.groupId}/onos-ovsdb-api/${project.version}</artifact>
24 <artifact>mvn:${project.groupId}/onos-ovsdb-ctl/${project.version}</artifact> 24 <artifact>mvn:${project.groupId}/onos-ovsdb-ctl/${project.version}</artifact>
25 - <artifact>mvn:${project.groupId}/onos-drivers/${project.version}</artifact> 25 + <artifact>mvn:${project.groupId}/onos-drivers-ovsdb/${project.version}</artifact>
26 26
27 <artifact>mvn:${project.groupId}/onos-ovsdb-provider-device/${project.version}</artifact> 27 <artifact>mvn:${project.groupId}/onos-ovsdb-provider-device/${project.version}</artifact>
28 <artifact>mvn:${project.groupId}/onos-ovsdb-provider-tunnel/${project.version}</artifact> 28 <artifact>mvn:${project.groupId}/onos-ovsdb-provider-tunnel/${project.version}</artifact>
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
27 <bundle>mvn:${project.groupId}/onos-ovsdb-api/${project.version}</bundle> 27 <bundle>mvn:${project.groupId}/onos-ovsdb-api/${project.version}</bundle>
28 <bundle>mvn:${project.groupId}/onos-ovsdb-ctl/${project.version}</bundle> 28 <bundle>mvn:${project.groupId}/onos-ovsdb-ctl/${project.version}</bundle>
29 29
30 + <bundle>mvn:${project.groupId}/onos-drivers-ovsdb/${project.version}</bundle>
31 +
30 <bundle>mvn:${project.groupId}/onos-ovsdb-provider-device/${project.version}</bundle> 32 <bundle>mvn:${project.groupId}/onos-ovsdb-provider-device/${project.version}</bundle>
31 <bundle>mvn:${project.groupId}/onos-ovsdb-provider-tunnel/${project.version}</bundle> 33 <bundle>mvn:${project.groupId}/onos-ovsdb-provider-tunnel/${project.version}</bundle>
32 </feature> 34 </feature>
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
49 </dependency> 49 </dependency>
50 <dependency> 50 <dependency>
51 <groupId>org.onosproject</groupId> 51 <groupId>org.onosproject</groupId>
52 - <artifactId>onos-drivers</artifactId> 52 + <artifactId>onos-drivers-ovsdb</artifactId>
53 <version>${project.version}</version> 53 <version>${project.version}</version>
54 </dependency> 54 </dependency>
55 <dependency> 55 <dependency>
......
...@@ -15,13 +15,12 @@ ...@@ -15,13 +15,12 @@
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 <app name="org.onosproject.restsb" origin="ON.Lab" version="${project.version}" 17 <app name="org.onosproject.restsb" origin="ON.Lab" version="${project.version}"
18 - category="default" url="http://onosproject.org" 18 + category="default" url="http://onosproject.org" apps="org.onosproject.drivers.ciena"
19 featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features" 19 featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
20 features="${project.artifactId}"> 20 features="${project.artifactId}">
21 <description>${project.description}</description> 21 <description>${project.description}</description>
22 <artifact>mvn:${project.groupId}/onos-restsb-api/${project.version}</artifact> 22 <artifact>mvn:${project.groupId}/onos-restsb-api/${project.version}</artifact>
23 <artifact>mvn:${project.groupId}/onos-restsb-ctl/${project.version}</artifact> 23 <artifact>mvn:${project.groupId}/onos-restsb-ctl/${project.version}</artifact>
24 - <artifact>mvn:${project.groupId}/onos-drivers/${project.version}</artifact>
25 24
26 <artifact>mvn:${project.groupId}/onos-restsb-provider-device/${project.version}</artifact> 25 <artifact>mvn:${project.groupId}/onos-restsb-provider-device/${project.version}</artifact>
27 26
......