diff --git a/apps/bgprouter/BUCK b/apps/bgprouter/BUCK index 0e1870f49f..211ae7abbe 100644 --- a/apps/bgprouter/BUCK +++ b/apps/bgprouter/BUCK @@ -6,7 +6,7 @@ COMPILE_DEPS = [ BUNDLES = [ '//apps/routing-api:onos-apps-routing-api', - '//apps/routing:onos-apps-routing', + '//apps/routing/common:onos-apps-routing-common', '//apps/bgprouter:onos-apps-bgprouter', ] @@ -20,4 +20,5 @@ onos_app ( url = 'http://onosproject.org', description = 'BGP router application.', included_bundles = BUNDLES, + required_apps = [ 'org.onosproject.fibinstaller' ], ) diff --git a/apps/bgprouter/app.xml b/apps/bgprouter/app.xml index 91e010ad1f..fafba351b5 100644 --- a/apps/bgprouter/app.xml +++ b/apps/bgprouter/app.xml @@ -17,7 +17,7 @@ + features="${project.artifactId}" apps="fibinstaller"> ${project.description} mvn:${project.groupId}/${project.artifactId}/${project.version} mvn:${project.groupId}/onos-app-routing-api/${project.version} diff --git a/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java b/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java index e6941c36d3..ce43a6a14c 100644 --- a/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java +++ b/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java @@ -94,9 +94,7 @@ public class BgpRouter { private static List components = new ArrayList<>(); static { components.add("org.onosproject.routing.bgp.BgpSessionManager"); - components.add("org.onosproject.routing.impl.Router"); components.add("org.onosproject.routing.impl.BgpSpeakerNeighbourHandler"); - components.add("org.onosproject.routing.impl.SingleSwitchFibInstaller"); } @Activate diff --git a/apps/castor/BUCK b/apps/castor/BUCK index 890b2913cd..1a3342aaeb 100644 --- a/apps/castor/BUCK +++ b/apps/castor/BUCK @@ -13,7 +13,7 @@ COMPILE_DEPS = [ BUNDLES = [ '//apps/castor:onos-apps-castor', '//apps/routing-api:onos-apps-routing-api', - '//apps/routing:onos-apps-routing', + '//apps/routing/common:onos-apps-routing-common', ] TEST_DEPS = [ diff --git a/apps/routing-api/BUCK b/apps/routing-api/BUCK index d9db85af95..4e4939b1f6 100644 --- a/apps/routing-api/BUCK +++ b/apps/routing-api/BUCK @@ -1,5 +1,6 @@ COMPILE_DEPS = [ '//lib:CORE_DEPS', + '//incubator/api:onos-incubator-api', ] TEST_DEPS = [ diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/AsyncDeviceFetcher.java b/apps/routing-api/src/main/java/org/onosproject/routing/AsyncDeviceFetcher.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/impl/AsyncDeviceFetcher.java rename to apps/routing-api/src/main/java/org/onosproject/routing/AsyncDeviceFetcher.java index f48fef07a7..fd5dfc321f 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/impl/AsyncDeviceFetcher.java +++ b/apps/routing-api/src/main/java/org/onosproject/routing/AsyncDeviceFetcher.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.onosproject.routing.impl; +package org.onosproject.routing; import org.onosproject.net.DeviceId; import org.onosproject.net.device.DeviceEvent; diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/NextHop.java b/apps/routing-api/src/main/java/org/onosproject/routing/NextHop.java similarity index 96% rename from apps/routing/src/main/java/org/onosproject/routing/impl/NextHop.java rename to apps/routing-api/src/main/java/org/onosproject/routing/NextHop.java index 71e02d6638..b8b800c330 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/impl/NextHop.java +++ b/apps/routing-api/src/main/java/org/onosproject/routing/NextHop.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.onosproject.routing.impl; +package org.onosproject.routing; import java.util.Objects; diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/NextHopGroupKey.java b/apps/routing-api/src/main/java/org/onosproject/routing/NextHopGroupKey.java similarity index 95% rename from apps/routing/src/main/java/org/onosproject/routing/impl/NextHopGroupKey.java rename to apps/routing-api/src/main/java/org/onosproject/routing/NextHopGroupKey.java index d2a693befd..12d993b300 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/impl/NextHopGroupKey.java +++ b/apps/routing-api/src/main/java/org/onosproject/routing/NextHopGroupKey.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.onosproject.routing.impl; +package org.onosproject.routing; import com.google.common.base.MoreObjects; import org.onlab.packet.IpAddress; diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/RouterInterfaceManager.java b/apps/routing-api/src/main/java/org/onosproject/routing/RouterInterfaceManager.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/impl/RouterInterfaceManager.java rename to apps/routing-api/src/main/java/org/onosproject/routing/RouterInterfaceManager.java index 87d3f560ee..8b1deffb7e 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/impl/RouterInterfaceManager.java +++ b/apps/routing-api/src/main/java/org/onosproject/routing/RouterInterfaceManager.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.onosproject.routing.impl; +package org.onosproject.routing; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; diff --git a/apps/routing/common/BUCK b/apps/routing/common/BUCK new file mode 100644 index 0000000000..8483685fb4 --- /dev/null +++ b/apps/routing/common/BUCK @@ -0,0 +1,20 @@ +COMPILE_DEPS = [ + '//lib:CORE_DEPS', + '//lib:org.apache.karaf.shell.console', + '//lib:concurrent-trees', + '//cli:onos-cli', + '//incubator/api:onos-incubator-api', + '//apps/routing-api:onos-apps-routing-api', + '//core/common:onos-core-common', +] + +TEST_DEPS = [ + '//lib:TEST_ADAPTERS', + '//incubator/api:onos-incubator-api-tests', + '//apps/routing-api:onos-apps-routing-api-tests', +] + +osgi_jar_with_tests ( + deps = COMPILE_DEPS, + test_deps = TEST_DEPS, +) diff --git a/apps/routing/common/pom.xml b/apps/routing/common/pom.xml new file mode 100644 index 0000000000..ed2d11522e --- /dev/null +++ b/apps/routing/common/pom.xml @@ -0,0 +1,91 @@ + + + + + onos-app-routing-parent + org.onosproject + 1.9.0-SNAPSHOT + + 4.0.0 + + onos-app-routing + bundle + + + + org.onosproject + onos-app-routing-api + ${project.version} + + + + org.onosproject + onos-app-routing-api + test + tests + ${project.version} + + + + org.onosproject + onos-incubator-api + ${project.version} + test + tests + + + + org.onosproject + onos-cli + ${project.version} + + + + org.onosproject + onlab-misc + + + + io.netty + netty + + + + org.osgi + org.osgi.compendium + + + + org.apache.karaf.shell + org.apache.karaf.shell.console + + + + org.osgi + org.osgi.core + + + + com.googlecode.concurrent-trees + concurrent-trees + compile + + + + diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpConstants.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpConstants.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpConstants.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpConstants.java index 504482f44a..0344b5402d 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpConstants.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; /** diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpFrameDecoder.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpFrameDecoder.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpFrameDecoder.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpFrameDecoder.java index 4cd2813b4e..d6c9d30b8d 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpFrameDecoder.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.jboss.netty.buffer.ChannelBuffer; diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpInfoService.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpInfoService.java similarity index 95% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpInfoService.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpInfoService.java index 938aa1522a..1fa303e152 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpInfoService.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpInfoService.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import java.util.Collection; diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpKeepalive.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpKeepalive.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpKeepalive.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpKeepalive.java index acb8a259ce..050a30ff0c 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpKeepalive.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpKeepalive.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.jboss.netty.buffer.ChannelBuffer; diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpMessage.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpMessage.java similarity index 97% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpMessage.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpMessage.java index cb67d8b243..cafbeb1e52 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpMessage.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.jboss.netty.buffer.ChannelBuffer; diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpNotification.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpNotification.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpNotification.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpNotification.java index 8507474b6e..0cf03a5ebb 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpNotification.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.jboss.netty.buffer.ChannelBuffer; diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpOpen.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpOpen.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpOpen.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpOpen.java index 6f496ee696..e5d4821e41 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpOpen.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpOpen.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.jboss.netty.buffer.ChannelBuffer; diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java index adf00904b9..15ac60c109 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import com.google.common.base.MoreObjects; diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java index 36b4b6efc3..96f3a92aea 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.onlab.packet.IpPrefix; diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSession.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSession.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSession.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSession.java index f9d2a20acf..25623ac673 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSession.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.jboss.netty.buffer.ChannelBuffer; diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionInfo.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSessionInfo.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionInfo.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSessionInfo.java index 0e1bc8aafa..af3a41f319 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionInfo.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSessionInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.onlab.packet.Ip4Address; diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java index fbecd68bc3..a8cf5d8e74 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.apache.felix.scr.annotations.Activate; diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpUpdate.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpUpdate.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpUpdate.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpUpdate.java index b30fb8d5d1..afde4d8242 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpUpdate.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpUpdate.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.apache.commons.lang3.tuple.Pair; diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/RouteEntry.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/RouteEntry.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/RouteEntry.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/RouteEntry.java index 8053ecd4d2..20d1298557 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/RouteEntry.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/RouteEntry.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import com.google.common.base.MoreObjects; diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/RouteUpdate.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/RouteUpdate.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/RouteUpdate.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/RouteUpdate.java index 332933d8eb..07cb58974f 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/RouteUpdate.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/RouteUpdate.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import com.google.common.base.MoreObjects; diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/package-info.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/package-info.java similarity index 92% rename from apps/routing/src/main/java/org/onosproject/routing/bgp/package-info.java rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/package-info.java index 4da087d563..d4b18ae86b 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/bgp/package-info.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/AddPeerCommand.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/AddPeerCommand.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/cli/AddPeerCommand.java rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/AddPeerCommand.java index 5a83f96124..8d89c45e94 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/cli/AddPeerCommand.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/AddPeerCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/AddSpeakerCommand.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/AddSpeakerCommand.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/cli/AddSpeakerCommand.java rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/AddSpeakerCommand.java index 55dc16838b..49fb4f4062 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/cli/AddSpeakerCommand.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/AddSpeakerCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpNeighborsListCommand.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpNeighborsListCommand.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/cli/BgpNeighborsListCommand.java rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpNeighborsListCommand.java index 05f04040f5..c7d6e1b9eb 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpNeighborsListCommand.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpNeighborsListCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.cli; import com.fasterxml.jackson.databind.JsonNode; diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java index 0b35241a1e..e140c9b8ae 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.cli; import com.fasterxml.jackson.databind.JsonNode; @@ -22,10 +23,10 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.karaf.shell.commands.Command; import org.apache.karaf.shell.commands.Option; import org.onosproject.cli.AbstractShellCommand; +import org.onosproject.routing.bgp.BgpConstants; import org.onosproject.routing.bgp.BgpInfoService; import org.onosproject.routing.bgp.BgpRouteEntry; import org.onosproject.routing.bgp.BgpSession; -import org.onosproject.routing.bgp.BgpConstants; import java.util.ArrayList; import java.util.Collection; diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpSpeakersListCommand.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpSpeakersListCommand.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/cli/BgpSpeakersListCommand.java rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpSpeakersListCommand.java index ce5a7af948..2e4de6f32c 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpSpeakersListCommand.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpSpeakersListCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/RemovePeerCommand.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/RemovePeerCommand.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/cli/RemovePeerCommand.java rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/RemovePeerCommand.java index 06293ef33b..204dfb757e 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/cli/RemovePeerCommand.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/RemovePeerCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/RemoveSpeakerCommand.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/RemoveSpeakerCommand.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/cli/RemoveSpeakerCommand.java rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/RemoveSpeakerCommand.java index 33120b9da1..cba02b6a58 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/cli/RemoveSpeakerCommand.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/RemoveSpeakerCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/package-info.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/package-info.java similarity index 92% rename from apps/routing/src/main/java/org/onosproject/routing/cli/package-info.java rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/package-info.java index db33684906..fc50db3755 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/cli/package-info.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java b/apps/routing/common/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java rename to apps/routing/common/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java index 5fbfe7f48f..d9b792d2e5 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.config.impl; import com.google.common.collect.ImmutableSet; diff --git a/apps/routing/src/main/java/org/onosproject/routing/config/impl/package-info.java b/apps/routing/common/src/main/java/org/onosproject/routing/config/impl/package-info.java similarity index 92% rename from apps/routing/src/main/java/org/onosproject/routing/config/impl/package-info.java rename to apps/routing/common/src/main/java/org/onosproject/routing/config/impl/package-info.java index d7d363a6e7..b7a9594960 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/config/impl/package-info.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/config/impl/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/BgpSpeakerNeighbourHandler.java b/apps/routing/common/src/main/java/org/onosproject/routing/impl/BgpSpeakerNeighbourHandler.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/impl/BgpSpeakerNeighbourHandler.java rename to apps/routing/common/src/main/java/org/onosproject/routing/impl/BgpSpeakerNeighbourHandler.java index a3e2e009b2..4ebaac2518 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/impl/BgpSpeakerNeighbourHandler.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/impl/BgpSpeakerNeighbourHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/DirectHostManager.java b/apps/routing/common/src/main/java/org/onosproject/routing/impl/DirectHostManager.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/impl/DirectHostManager.java rename to apps/routing/common/src/main/java/org/onosproject/routing/impl/DirectHostManager.java index a1a7d25c33..7356d95ddf 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/impl/DirectHostManager.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/impl/DirectHostManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/package-info.java b/apps/routing/common/src/main/java/org/onosproject/routing/impl/package-info.java similarity index 92% rename from apps/routing/src/main/java/org/onosproject/routing/impl/package-info.java rename to apps/routing/common/src/main/java/org/onosproject/routing/impl/package-info.java index c2d1e6b020..c1ecfc2d0a 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/impl/package-info.java +++ b/apps/routing/common/src/main/java/org/onosproject/routing/impl/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/apps/routing/common/src/main/resources/OSGI-INF/blueprint/shell-config.xml similarity index 93% rename from apps/routing/src/main/resources/OSGI-INF/blueprint/shell-config.xml rename to apps/routing/common/src/main/resources/OSGI-INF/blueprint/shell-config.xml index 44c99f140e..58e82f62c9 100644 --- a/apps/routing/src/main/resources/OSGI-INF/blueprint/shell-config.xml +++ b/apps/routing/common/src/main/resources/OSGI-INF/blueprint/shell-config.xml @@ -37,8 +37,5 @@ - - - diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/AsPathTest.java b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/AsPathTest.java similarity index 98% rename from apps/routing/src/test/java/org/onosproject/routing/bgp/AsPathTest.java rename to apps/routing/common/src/test/java/org/onosproject/routing/bgp/AsPathTest.java index a30405a633..8c567e085c 100644 --- a/apps/routing/src/test/java/org/onosproject/routing/bgp/AsPathTest.java +++ b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/AsPathTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.hamcrest.Matchers; @@ -21,7 +22,6 @@ import org.junit.Test; import java.util.ArrayList; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; /** @@ -212,7 +212,7 @@ public class AsPathTest { // BgpRouteEntry.AsPath asPath2 = new BgpRouteEntry.AsPath(pathSegments); - assertThat(asPath1, Matchers.is(not(asPath2))); + assertThat(asPath1, Matchers.is(Matchers.not(asPath2))); } /** diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpRouteEntryTest.java b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/BgpRouteEntryTest.java similarity index 99% rename from apps/routing/src/test/java/org/onosproject/routing/bgp/BgpRouteEntryTest.java rename to apps/routing/common/src/test/java/org/onosproject/routing/bgp/BgpRouteEntryTest.java index 9482704b72..5a05792d30 100644 --- a/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpRouteEntryTest.java +++ b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/BgpRouteEntryTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.easymock.EasyMock; @@ -25,7 +26,6 @@ import org.onlab.packet.Ip4Prefix; import java.util.ArrayList; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; /** @@ -499,7 +499,7 @@ public class BgpRouteEntryTest { localPref); bgpRouteEntry2.setMultiExitDisc(multiExitDisc); - assertThat(bgpRouteEntry1, Matchers.is(not(bgpRouteEntry2))); + assertThat(bgpRouteEntry1, Matchers.is(Matchers.not(bgpRouteEntry2))); } /** diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java similarity index 99% rename from apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java rename to apps/routing/common/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java index 7769f6ff1c..9f9ad3c821 100644 --- a/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java +++ b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import com.google.common.net.InetAddresses; diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/PathSegmentTest.java b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/PathSegmentTest.java similarity index 96% rename from apps/routing/src/test/java/org/onosproject/routing/bgp/PathSegmentTest.java rename to apps/routing/common/src/test/java/org/onosproject/routing/bgp/PathSegmentTest.java index 6df4f845e1..86051616b3 100644 --- a/apps/routing/src/test/java/org/onosproject/routing/bgp/PathSegmentTest.java +++ b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/PathSegmentTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.hamcrest.Matchers; @@ -21,7 +22,6 @@ import org.junit.Test; import java.util.ArrayList; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; /** @@ -114,7 +114,7 @@ public class PathSegmentTest { BgpRouteEntry.PathSegment pathSegment2 = new BgpRouteEntry.PathSegment(pathSegmentType, segmentAsNumbers); - assertThat(pathSegment1, Matchers.is(not(pathSegment2))); + assertThat(pathSegment1, Matchers.is(Matchers.not(pathSegment2))); } /** diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/RouteEntryTest.java b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/RouteEntryTest.java similarity index 99% rename from apps/routing/src/test/java/org/onosproject/routing/bgp/RouteEntryTest.java rename to apps/routing/common/src/test/java/org/onosproject/routing/bgp/RouteEntryTest.java index 95982a8014..901d6088f4 100644 --- a/apps/routing/src/test/java/org/onosproject/routing/bgp/RouteEntryTest.java +++ b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/RouteEntryTest.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.hamcrest.Matchers; diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/TestBgpPeerChannelHandler.java b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/TestBgpPeerChannelHandler.java similarity index 99% rename from apps/routing/src/test/java/org/onosproject/routing/bgp/TestBgpPeerChannelHandler.java rename to apps/routing/common/src/test/java/org/onosproject/routing/bgp/TestBgpPeerChannelHandler.java index a4ec1b4dda..5ce646242f 100644 --- a/apps/routing/src/test/java/org/onosproject/routing/bgp/TestBgpPeerChannelHandler.java +++ b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/TestBgpPeerChannelHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.jboss.netty.buffer.ChannelBuffer; diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/TestBgpPeerFrameDecoder.java b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/TestBgpPeerFrameDecoder.java similarity index 99% rename from apps/routing/src/test/java/org/onosproject/routing/bgp/TestBgpPeerFrameDecoder.java rename to apps/routing/common/src/test/java/org/onosproject/routing/bgp/TestBgpPeerFrameDecoder.java index d8fcc52310..ef9f1d3808 100644 --- a/apps/routing/src/test/java/org/onosproject/routing/bgp/TestBgpPeerFrameDecoder.java +++ b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/TestBgpPeerFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.bgp; import org.jboss.netty.buffer.ChannelBuffer; diff --git a/apps/routing/cpr/BUCK b/apps/routing/cpr/BUCK new file mode 100644 index 0000000000..89a499d91c --- /dev/null +++ b/apps/routing/cpr/BUCK @@ -0,0 +1,30 @@ +COMPILE_DEPS = [ + '//lib:CORE_DEPS', + '//incubator/api:onos-incubator-api', + '//apps/routing-api:onos-apps-routing-api', +] + +TEST_DEPS = [ + '//lib:TEST_ADAPTERS', + '//incubator/api:onos-incubator-api-tests', + '//apps/routing-api:onos-apps-routing-api-tests', +] + +osgi_jar_with_tests ( + deps = COMPILE_DEPS, + test_deps = TEST_DEPS, +) + +BUNDLES = [ + '//apps/routing/cpr:onos-apps-routing-cpr', + '//apps/routing-api:onos-apps-routing-api', +] + +onos_app ( + app_name = 'org.onosproject.cpr', + title = 'Control plane redirect', + category = 'Traffic Steering', + url = 'http://onosproject.org', + description = 'Redirects routing control traffic to a control plane', + included_bundles = BUNDLES, +) diff --git a/apps/routing/cpr/pom.xml b/apps/routing/cpr/pom.xml new file mode 100644 index 0000000000..cbc03df019 --- /dev/null +++ b/apps/routing/cpr/pom.xml @@ -0,0 +1,31 @@ + + + + + onos-app-routing-parent + org.onosproject + 1.9.0-SNAPSHOT + + 4.0.0 + + onos-apps-routing-cpr + bundle + + + diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/ControlPlaneRedirectManager.java b/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/ControlPlaneRedirectManager.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/impl/ControlPlaneRedirectManager.java rename to apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/ControlPlaneRedirectManager.java index f72963c386..e1d2d39c02 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/impl/ControlPlaneRedirectManager.java +++ b/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/ControlPlaneRedirectManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.onosproject.routing.impl; +package org.onosproject.routing.cpr; import com.google.common.collect.ImmutableSortedSet; import com.google.common.collect.Lists; @@ -57,6 +57,8 @@ import org.onosproject.net.host.HostEvent; import org.onosproject.net.host.HostListener; import org.onosproject.net.host.HostService; import org.onosproject.net.host.InterfaceIpAddress; +import org.onosproject.routing.AsyncDeviceFetcher; +import org.onosproject.routing.RouterInterfaceManager; import org.onosproject.routing.RoutingService; import org.onosproject.routing.config.RouterConfig; import org.slf4j.Logger; @@ -80,11 +82,13 @@ import static org.slf4j.LoggerFactory.getLogger; * Manages connectivity between peers redirecting control traffic to a routing * control plane available on the dataplane. */ -@Component(immediate = true, enabled = false) +@Component(immediate = true) public class ControlPlaneRedirectManager { private final Logger log = getLogger(getClass()); + public static final short ASSIGNED_VLAN = 4094; + private static final int MIN_IP_PRIORITY = 10; private static final int IPV4_PRIORITY = 2000; private static final int IPV6_PRIORITY = 500; @@ -140,6 +144,7 @@ public class ControlPlaneRedirectManager { processRouterConfig(); + // FIXME There can be an issue when this component is deactivated before vRouter applicationService.registerDeactivateHook(this.appId, () -> { if (interfaceManager != null) { @@ -239,10 +244,10 @@ public class ControlPlaneRedirectManager { int cpNextId, intfNextId; if (intf.vlan() == VlanId.NONE) { cpNextId = modifyNextObjective(deviceId, controlPlanePort, - VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN), + VlanId.vlanId(ASSIGNED_VLAN), true, install); intfNextId = modifyNextObjective(deviceId, intf.connectPoint().port(), - VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN), + VlanId.vlanId(ASSIGNED_VLAN), true, install); } else { cpNextId = modifyNextObjective(deviceId, controlPlanePort, @@ -365,7 +370,7 @@ public class ControlPlaneRedirectManager { int cpNextId; if (intf.vlan() == VlanId.NONE) { cpNextId = modifyNextObjective(deviceId, controlPlanePort, - VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN), + VlanId.vlanId(ASSIGNED_VLAN), true, install); } else { cpNextId = modifyNextObjective(deviceId, controlPlanePort, @@ -680,7 +685,7 @@ public class ControlPlaneRedirectManager { TrafficSelector.Builder metabuilder = DefaultTrafficSelector.builder(); VlanId matchVlanId = (vlanId.equals(VlanId.NONE)) ? - VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN) : + VlanId.vlanId(ASSIGNED_VLAN) : vlanId; metabuilder.matchVlanId(matchVlanId); nextObjBuilder.withMeta(metabuilder.build()); diff --git a/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/package-info.java b/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/package-info.java new file mode 100644 index 0000000000..b098961207 --- /dev/null +++ b/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2017-present Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Control plane redirect. + */ +package org.onosproject.routing.cpr; diff --git a/apps/routing/src/test/java/org/onosproject/routing/impl/ControlPlaneRedirectManagerTest.java b/apps/routing/cpr/src/test/java/org/onosproject/routing/cpr/ControlPlaneRedirectManagerTest.java similarity index 97% rename from apps/routing/src/test/java/org/onosproject/routing/impl/ControlPlaneRedirectManagerTest.java rename to apps/routing/cpr/src/test/java/org/onosproject/routing/cpr/ControlPlaneRedirectManagerTest.java index 08864c86ab..1291f8f11e 100644 --- a/apps/routing/src/test/java/org/onosproject/routing/impl/ControlPlaneRedirectManagerTest.java +++ b/apps/routing/cpr/src/test/java/org/onosproject/routing/cpr/ControlPlaneRedirectManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.onosproject.routing.impl; + +package org.onosproject.routing.cpr; import com.google.common.collect.Sets; import org.easymock.EasyMock; @@ -79,11 +80,11 @@ import static org.easymock.EasyMock.replay; import static org.easymock.EasyMock.verify; import static org.onlab.packet.ICMP6.NEIGHBOR_ADVERTISEMENT; import static org.onlab.packet.ICMP6.NEIGHBOR_SOLICITATION; -import static org.onosproject.routing.impl.ControlPlaneRedirectManager.ACL_PRIORITY; -import static org.onosproject.routing.impl.ControlPlaneRedirectManager.buildArpSelector; -import static org.onosproject.routing.impl.ControlPlaneRedirectManager.buildIPDstSelector; -import static org.onosproject.routing.impl.ControlPlaneRedirectManager.buildIPSrcSelector; -import static org.onosproject.routing.impl.ControlPlaneRedirectManager.buildNdpSelector; +import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.ACL_PRIORITY; +import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.buildArpSelector; +import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.buildIPDstSelector; +import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.buildIPSrcSelector; +import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.buildNdpSelector; /** * UnitTests for ControlPlaneRedirectManager. @@ -272,9 +273,9 @@ public class ControlPlaneRedirectManagerTest { int cpNextId, intfNextId; cpNextId = modifyNextObjective(deviceId, controlPlanePort, - VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN), true, install); + VlanId.vlanId(ControlPlaneRedirectManager.ASSIGNED_VLAN), true, install); intfNextId = modifyNextObjective(deviceId, intf.connectPoint().port(), - VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN), true, install); + VlanId.vlanId(ControlPlaneRedirectManager.ASSIGNED_VLAN), true, install); // IP to router TrafficSelector toSelector = buildIPDstSelector( diff --git a/apps/routing/fibinstaller/BUCK b/apps/routing/fibinstaller/BUCK new file mode 100644 index 0000000000..b77e51b98c --- /dev/null +++ b/apps/routing/fibinstaller/BUCK @@ -0,0 +1,30 @@ +COMPILE_DEPS = [ + '//lib:CORE_DEPS', + '//incubator/api:onos-incubator-api', + '//apps/routing-api:onos-apps-routing-api', +] + +TEST_DEPS = [ + '//lib:TEST_ADAPTERS', + '//incubator/api:onos-incubator-api-tests', + '//apps/routing-api:onos-apps-routing-api-tests', +] + +osgi_jar_with_tests ( + deps = COMPILE_DEPS, + test_deps = TEST_DEPS, +) + +BUNDLES = [ + '//apps/routing/fibinstaller:onos-apps-routing-fibinstaller', + '//apps/routing-api:onos-apps-routing-api', +] + +onos_app ( + app_name = 'org.onosproject.fibinstaller', + title = 'FIB installer app', + category = 'Traffic Steering', + url = 'http://onosproject.org', + description = 'Installs routing rules into switches', + included_bundles = BUNDLES, +) diff --git a/apps/routing/fibinstaller/pom.xml b/apps/routing/fibinstaller/pom.xml new file mode 100644 index 0000000000..5cb98e60be --- /dev/null +++ b/apps/routing/fibinstaller/pom.xml @@ -0,0 +1,31 @@ + + + + + onos-app-routing-parent + org.onosproject + 1.9.0-SNAPSHOT + + 4.0.0 + + onos-apps-routing-fibinstaller + bundle + + + diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/SingleSwitchFibInstaller.java b/apps/routing/fibinstaller/src/main/java/org/onosproject/routing/fibinstaller/SingleSwitchFibInstaller.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/impl/SingleSwitchFibInstaller.java rename to apps/routing/fibinstaller/src/main/java/org/onosproject/routing/fibinstaller/SingleSwitchFibInstaller.java index b55dba6aba..c6b3af4020 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/impl/SingleSwitchFibInstaller.java +++ b/apps/routing/fibinstaller/src/main/java/org/onosproject/routing/fibinstaller/SingleSwitchFibInstaller.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.onosproject.routing.impl; +package org.onosproject.routing.fibinstaller; import com.google.common.collect.ConcurrentHashMultiset; import com.google.common.collect.Maps; @@ -67,6 +67,10 @@ import org.onosproject.net.flowobjective.FlowObjectiveService; import org.onosproject.net.flowobjective.ForwardingObjective; import org.onosproject.net.flowobjective.NextObjective; import org.onosproject.net.flowobjective.ObjectiveContext; +import org.onosproject.routing.AsyncDeviceFetcher; +import org.onosproject.routing.NextHop; +import org.onosproject.routing.NextHopGroupKey; +import org.onosproject.routing.RouterInterfaceManager; import org.onosproject.routing.RoutingService; import org.onosproject.routing.config.RouterConfig; import org.osgi.service.component.ComponentContext; @@ -80,7 +84,7 @@ import java.util.Set; /** * Programs routes to a single OpenFlow switch. */ -@Component(immediate = true, enabled = false) +@Component(immediate = true) public class SingleSwitchFibInstaller { private final Logger log = LoggerFactory.getLogger(getClass()); diff --git a/apps/routing/fibinstaller/src/main/java/org/onosproject/routing/fibinstaller/package-info.java b/apps/routing/fibinstaller/src/main/java/org/onosproject/routing/fibinstaller/package-info.java new file mode 100644 index 0000000000..669754df08 --- /dev/null +++ b/apps/routing/fibinstaller/src/main/java/org/onosproject/routing/fibinstaller/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2017-present Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Single switch FIB installer. + */ +package org.onosproject.routing.fibinstaller; diff --git a/apps/routing/src/test/java/org/onosproject/routing/impl/SingleSwitchFibInstallerTest.java b/apps/routing/fibinstaller/src/test/java/org/onosproject/routing/fibinstaller/SingleSwitchFibInstallerTest.java similarity index 99% rename from apps/routing/src/test/java/org/onosproject/routing/impl/SingleSwitchFibInstallerTest.java rename to apps/routing/fibinstaller/src/test/java/org/onosproject/routing/fibinstaller/SingleSwitchFibInstallerTest.java index 1e6efb53b7..f7736f7cd8 100644 --- a/apps/routing/src/test/java/org/onosproject/routing/impl/SingleSwitchFibInstallerTest.java +++ b/apps/routing/fibinstaller/src/test/java/org/onosproject/routing/fibinstaller/SingleSwitchFibInstallerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.onosproject.routing.impl; + +package org.onosproject.routing.fibinstaller; import com.google.common.collect.Sets; import org.easymock.EasyMock; diff --git a/apps/routing/fpm/BUCK b/apps/routing/fpm/BUCK new file mode 100644 index 0000000000..b221d0e6e9 --- /dev/null +++ b/apps/routing/fpm/BUCK @@ -0,0 +1,30 @@ +COMPILE_DEPS = [ + '//lib:CORE_DEPS', + '//lib:org.apache.karaf.shell.console', + '//cli:onos-cli', + '//incubator/api:onos-incubator-api', + '//apps/routing-api:onos-apps-routing-api', +] + +TEST_DEPS = [ + '//lib:TEST_ADAPTERS', +] + +osgi_jar_with_tests ( + deps = COMPILE_DEPS, + test_deps = TEST_DEPS, +) + +BUNDLES = [ + '//apps/routing/fpm:onos-apps-routing-fpm', + '//apps/routing-api:onos-apps-routing-api', +] + +onos_app ( + app_name = 'org.onosproject.fpm', + title = 'FIB Push Manager (FPM) route reciever', + category = 'Utility', + url = 'http://onosproject.org', + description = 'Receives routes from external routing daemon over FPM protocol', + included_bundles = BUNDLES, +) diff --git a/apps/routing/fpm/pom.xml b/apps/routing/fpm/pom.xml new file mode 100644 index 0000000000..03427d7e0f --- /dev/null +++ b/apps/routing/fpm/pom.xml @@ -0,0 +1,48 @@ + + + + + onos-app-routing-parent + org.onosproject + 1.9.0-SNAPSHOT + + 4.0.0 + + onos-apps-fpm + bundle + + + + io.netty + netty + + + + org.onosproject + onos-cli + ${project.version} + + + + org.apache.karaf.shell + org.apache.karaf.shell.console + + + + diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmFrameDecoder.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmFrameDecoder.java similarity index 97% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/FpmFrameDecoder.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmFrameDecoder.java index 87907cd002..479b4da3b2 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmFrameDecoder.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmInfoService.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmInfoService.java similarity index 93% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/FpmInfoService.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmInfoService.java index 3f5068b718..018b1bb9ef 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmInfoService.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmInfoService.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmListener.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmListener.java similarity index 96% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/FpmListener.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmListener.java index c7fffd1890..37fe1f7482 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmListener.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmManager.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmManager.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/FpmManager.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmManager.java index 90650443e4..0ca21e6e91 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmManager.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onosproject.routing.fpm; import com.google.common.collect.ImmutableList; @@ -67,7 +68,7 @@ import static org.onlab.util.Tools.groupedThreads; * Forwarding Plane Manager (FPM) route source. */ @Service -@Component(immediate = true, enabled = false) +@Component(immediate = true) public class FpmManager implements FpmInfoService { private final Logger log = LoggerFactory.getLogger(getClass()); diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmSessionHandler.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmSessionHandler.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/FpmSessionHandler.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmSessionHandler.java index 35e482b9ba..33f845ec56 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmSessionHandler.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmSessionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java similarity index 92% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java index 9d180eba38..86dd44c8bb 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ public class FpmConnectionsList extends AbstractShellCommand { @Override protected void execute() { - FpmInfoService fpmInfo = get(FpmInfoService.class); + FpmInfoService fpmInfo = AbstractShellCommand.get(FpmInfoService.class); fpmInfo.peers().forEach((socketAddress, timestamp) -> { if (socketAddress instanceof InetSocketAddress) { diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/cli/package-info.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/package-info.java similarity index 92% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/cli/package-info.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/package-info.java index c1729abf27..8c4812d8cb 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/cli/package-info.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/package-info.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/package-info.java similarity index 92% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/package-info.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/package-info.java index 851f7f83c9..1f4f1de75b 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/package-info.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/FpmHeader.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/FpmHeader.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/FpmHeader.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/FpmHeader.java index ce8cf58d32..5bba9fb417 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/FpmHeader.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/FpmHeader.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/Netlink.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/Netlink.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/Netlink.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/Netlink.java index 08e1ee2536..79c23abc13 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/Netlink.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/Netlink.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/NetlinkMessageType.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/NetlinkMessageType.java similarity index 96% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/NetlinkMessageType.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/NetlinkMessageType.java index 9b27c0c1e2..0abb0bde4c 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/NetlinkMessageType.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/NetlinkMessageType.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttribute.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttribute.java similarity index 98% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttribute.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttribute.java index d8b047469f..cffb4226df 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttribute.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDecoder.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDecoder.java similarity index 95% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDecoder.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDecoder.java index e76f64bf35..f702c40150 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDecoder.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDst.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDst.java similarity index 97% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDst.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDst.java index 691345695c..d12f14c363 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDst.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDst.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeGateway.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeGateway.java similarity index 97% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeGateway.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeGateway.java index a9f6c49c1d..0f5d158c47 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeGateway.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeOif.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeOif.java similarity index 97% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeOif.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeOif.java index 36d28a7378..28c4b32728 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeOif.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeOif.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributePriority.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributePriority.java similarity index 97% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributePriority.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributePriority.java index 19d720b51c..8f324f9796 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributePriority.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributePriority.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RtNetlink.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RtNetlink.java similarity index 99% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RtNetlink.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RtNetlink.java index c3cf65accd..f914f0c72d 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RtNetlink.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RtNetlink.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RtProtocol.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RtProtocol.java similarity index 97% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RtProtocol.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RtProtocol.java index dd682d42fa..de8639464b 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RtProtocol.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RtProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/package-info.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/package-info.java similarity index 92% rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/package-info.java rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/package-info.java index 5d1876196e..fed7b1e334 100644 --- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/package-info.java +++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-present Open Networking Laboratory + * Copyright 2017-present Open Networking Laboratory * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/apps/routing/fpm/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/apps/routing/fpm/src/main/resources/OSGI-INF/blueprint/shell-config.xml new file mode 100644 index 0000000000..fe6f8f5f24 --- /dev/null +++ b/apps/routing/fpm/src/main/resources/OSGI-INF/blueprint/shell-config.xml @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/apps/routing/pom.xml b/apps/routing/pom.xml index 11db777b48..bfe163d7fd 100644 --- a/apps/routing/pom.xml +++ b/apps/routing/pom.xml @@ -24,10 +24,16 @@ 4.0.0 - onos-app-routing + onos-app-routing-parent - bundle + pom Libraries for routing applications + + fibinstaller + common + cpr + fpm + @@ -53,46 +59,8 @@ - org.onosproject - onos-cli - ${project.version} - - - - - com.googlecode.concurrent-trees - concurrent-trees - compile - - - - org.onosproject - onlab-misc - - - - com.fasterxml.jackson.core - jackson-annotations - - - - com.fasterxml.jackson.core - jackson-databind - - - - com.google.guava - guava - - - - org.apache.commons - commons-lang3 - - - - io.netty - netty + org.osgi + org.osgi.core @@ -100,16 +68,6 @@ org.osgi.compendium - - org.apache.karaf.shell - org.apache.karaf.shell.console - - - - org.osgi - org.osgi.core - - org.onosproject onlab-junit diff --git a/apps/sdnip/BUCK b/apps/sdnip/BUCK index e91ada39df..0067e192b6 100644 --- a/apps/sdnip/BUCK +++ b/apps/sdnip/BUCK @@ -10,7 +10,7 @@ COMPILE_DEPS = [ BUNDLES = [ '//apps/sdnip:onos-apps-sdnip', '//apps/routing-api:onos-apps-routing-api', - '//apps/routing:onos-apps-routing', + '//apps/routing/common:onos-apps-routing-common', ] TEST_DEPS = [ diff --git a/apps/vrouter/BUCK b/apps/vrouter/BUCK index e2322e3c91..267460abfe 100644 --- a/apps/vrouter/BUCK +++ b/apps/vrouter/BUCK @@ -5,7 +5,7 @@ COMPILE_DEPS = [ BUNDLES = [ '//apps/routing-api:onos-apps-routing-api', - '//apps/routing:onos-apps-routing', + '//apps/routing/common:onos-apps-routing-common', '//apps/vrouter:onos-apps-vrouter', ] @@ -19,4 +19,5 @@ onos_app ( url = 'http://onosproject.org', included_bundles = BUNDLES, description = 'Virtual router (vRouter) application.', + required_apps = [ 'org.onosproject.fibinstaller', 'org.onosproject.cpr', 'org.onosproject.fpm' ], ) diff --git a/apps/vrouter/src/main/java/org/onosproject/vrouter/Vrouter.java b/apps/vrouter/src/main/java/org/onosproject/vrouter/Vrouter.java index 331d04ab83..d694996782 100644 --- a/apps/vrouter/src/main/java/org/onosproject/vrouter/Vrouter.java +++ b/apps/vrouter/src/main/java/org/onosproject/vrouter/Vrouter.java @@ -19,20 +19,15 @@ import com.google.common.collect.Lists; import org.apache.felix.scr.annotations.Activate; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Deactivate; -import org.apache.felix.scr.annotations.Modified; -import org.apache.felix.scr.annotations.Property; import org.apache.felix.scr.annotations.Reference; import org.apache.felix.scr.annotations.ReferenceCardinality; -import org.onlab.util.Tools; import org.onosproject.cfg.ComponentConfigService; import org.onosproject.core.ApplicationId; import org.onosproject.core.CoreService; import org.onosproject.incubator.component.ComponentService; -import org.osgi.service.component.ComponentContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Dictionary; import java.util.List; /** @@ -44,9 +39,6 @@ public class Vrouter { private final Logger log = LoggerFactory.getLogger(getClass()); private static final String APP_NAME = "org.onosproject.vrouter"; - private static final String FPM_MANAGER = "org.onosproject.routing.fpm.FpmManager"; - private static final String FIB_INSTALLER = "org.onosproject.routing.impl.SingleSwitchFibInstaller"; - private static final String CP_REDIRECT = "org.onosproject.routing.impl.ControlPlaneRedirectManager"; private static final String DIRECT_HOST_MGR = "org.onosproject.routing.impl.DirectHostManager"; @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) @@ -58,32 +50,19 @@ public class Vrouter { @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) private ComponentConfigService componentConfigService; - /** - * vRouter will push flows to the switches when receiving routes by enabling - * FIB installer. - *

- * It should be turned off when vRouter is deployed in a scenario where - * other components that pushes the routes. - */ - @Property(name = "fibInstallerEnabled", boolValue = true, - label = "Enable single switch fib installer; default is true") - private boolean fibInstallerEnabled = true; - private ApplicationId appId; - private List baseComponents = Lists.newArrayList(FPM_MANAGER, CP_REDIRECT, DIRECT_HOST_MGR); + private List baseComponents = Lists.newArrayList(DIRECT_HOST_MGR); @Activate - protected void activate(ComponentContext context) { + protected void activate() { appId = coreService.registerApplication(APP_NAME); - componentConfigService.registerProperties(getClass()); componentConfigService.preSetProperty( "org.onosproject.incubator.store.routing.impl.RouteStoreImpl", "distributed", "true"); baseComponents.forEach(name -> componentService.activate(appId, name)); - modified(context); log.info("Started"); } @@ -96,28 +75,4 @@ public class Vrouter { log.info("Stopped"); } - - @Modified - private void modified(ComponentContext context) { - Dictionary properties = context.getProperties(); - if (properties == null) { - return; - } - - Boolean newFibInstallerEnabled = Tools.isPropertyEnabled(properties, "fibInstallerEnabled"); - if (newFibInstallerEnabled == null) { - log.info("fibInstallerEnabled is not configured, " + - "using current value of {}", fibInstallerEnabled); - } else { - fibInstallerEnabled = newFibInstallerEnabled; - log.info("Configured. fibInstallerEnabled set to {}, ", - fibInstallerEnabled ? "enabled" : "disabled"); - } - - if (fibInstallerEnabled) { - componentService.activate(appId, FIB_INSTALLER); - } else { - componentService.deactivate(appId, FIB_INSTALLER); - } - } } diff --git a/modules.defs b/modules.defs index 1640494895..1f8907293c 100644 --- a/modules.defs +++ b/modules.defs @@ -163,6 +163,9 @@ ONOS_APPS = [ '//apps/virtualbng:onos-apps-virtualbng-oar', '//apps/vpls:onos-apps-vpls-oar', '//apps/vrouter:onos-apps-vrouter-oar', + '//apps/routing/fibinstaller:onos-apps-routing-fibinstaller-oar', + '//apps/routing/cpr:onos-apps-routing-cpr-oar', + '//apps/routing/fpm:onos-apps-routing-fpm-oar', '//apps/vtn:onos-apps-vtn-oar', '//apps/faultmanagement:onos-apps-faultmanagement-oar', '//apps/openstacknode:onos-apps-openstacknode-oar', @@ -184,7 +187,7 @@ APP_JARS = [ '//apps/fwd:onos-apps-fwd', '//apps/iptopology-api:onos-apps-iptopology-api', '//apps/openstacknode:onos-apps-openstacknode', - '//apps/routing:onos-apps-routing', + '//apps/routing/common:onos-apps-routing-common', '//apps/vtn/vtnrsc:onos-apps-vtn-vtnrsc', '//apps/vtn/sfcmgr:onos-apps-vtn-sfcmgr', '//apps/vtn/vtnmgr:onos-apps-vtn-vtnmgr',