Make vRouter components into separate apps.

This allows us to leverage the ONOS app subsystem for selecting which
components to load.

CORD-710

Change-Id: Ibd7c4c1afd2caa137b44c085e7b6b5b4a1082521
This commit is contained in:
Jonathan Hart 2017-01-27 15:11:18 -08:00 committed by Ray Milkey
parent a4ef01d075
commit f4bd048b05
86 changed files with 521 additions and 199 deletions

View File

@ -6,7 +6,7 @@ COMPILE_DEPS = [
BUNDLES = [ BUNDLES = [
'//apps/routing-api:onos-apps-routing-api', '//apps/routing-api:onos-apps-routing-api',
'//apps/routing:onos-apps-routing', '//apps/routing/common:onos-apps-routing-common',
'//apps/bgprouter:onos-apps-bgprouter', '//apps/bgprouter:onos-apps-bgprouter',
] ]
@ -20,4 +20,5 @@ onos_app (
url = 'http://onosproject.org', url = 'http://onosproject.org',
description = 'BGP router application.', description = 'BGP router application.',
included_bundles = BUNDLES, included_bundles = BUNDLES,
required_apps = [ 'org.onosproject.fibinstaller' ],
) )

View File

@ -17,7 +17,7 @@
<app name="org.onosproject.bgprouter" origin="ON.Lab" version="${project.version}" <app name="org.onosproject.bgprouter" origin="ON.Lab" version="${project.version}"
category="Traffic Steering" url="http://onosproject.org" title="BGP Router App" category="Traffic Steering" url="http://onosproject.org" title="BGP Router App"
featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features" featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
features="${project.artifactId}"> features="${project.artifactId}" apps="fibinstaller">
<description>${project.description}</description> <description>${project.description}</description>
<artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact> <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
<artifact>mvn:${project.groupId}/onos-app-routing-api/${project.version}</artifact> <artifact>mvn:${project.groupId}/onos-app-routing-api/${project.version}</artifact>

View File

@ -94,9 +94,7 @@ public class BgpRouter {
private static List<String> components = new ArrayList<>(); private static List<String> components = new ArrayList<>();
static { static {
components.add("org.onosproject.routing.bgp.BgpSessionManager"); 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.BgpSpeakerNeighbourHandler");
components.add("org.onosproject.routing.impl.SingleSwitchFibInstaller");
} }
@Activate @Activate

View File

@ -13,7 +13,7 @@ COMPILE_DEPS = [
BUNDLES = [ BUNDLES = [
'//apps/castor:onos-apps-castor', '//apps/castor:onos-apps-castor',
'//apps/routing-api:onos-apps-routing-api', '//apps/routing-api:onos-apps-routing-api',
'//apps/routing:onos-apps-routing', '//apps/routing/common:onos-apps-routing-common',
] ]
TEST_DEPS = [ TEST_DEPS = [

View File

@ -1,5 +1,6 @@
COMPILE_DEPS = [ COMPILE_DEPS = [
'//lib:CORE_DEPS', '//lib:CORE_DEPS',
'//incubator/api:onos-incubator-api',
] ]
TEST_DEPS = [ TEST_DEPS = [

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.impl; package org.onosproject.routing;
import org.onosproject.net.DeviceId; import org.onosproject.net.DeviceId;
import org.onosproject.net.device.DeviceEvent; import org.onosproject.net.device.DeviceEvent;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.impl; package org.onosproject.routing;
import java.util.Objects; import java.util.Objects;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.impl; package org.onosproject.routing;
import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects;
import org.onlab.packet.IpAddress; import org.onlab.packet.IpAddress;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.impl; package org.onosproject.routing;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;

20
apps/routing/common/BUCK Normal file
View File

@ -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,
)

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>onos-app-routing-parent</artifactId>
<groupId>org.onosproject</groupId>
<version>1.9.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>onos-app-routing</artifactId>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-app-routing-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-app-routing-api</artifactId>
<scope>test</scope>
<classifier>tests</classifier>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-incubator-api</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-cli</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onlab-misc</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
</dependency>
<dependency>
<groupId>org.apache.karaf.shell</groupId>
<artifactId>org.apache.karaf.shell.console</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
</dependency>
<dependency>
<groupId>com.googlecode.concurrent-trees</groupId>
<artifactId>concurrent-trees</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
/** /**

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffer;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import java.util.Collection; import java.util.Collection;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffer;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffer;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffer;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffer;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.onlab.packet.IpPrefix; import org.onlab.packet.IpPrefix;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffer;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.onlab.packet.Ip4Address; import org.onlab.packet.Ip4Address;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.apache.felix.scr.annotations.Activate; import org.apache.felix.scr.annotations.Activate;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects;

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.cli; package org.onosproject.routing.cli;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.cli; package org.onosproject.routing.cli;
import com.fasterxml.jackson.databind.JsonNode; 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.Command;
import org.apache.karaf.shell.commands.Option; import org.apache.karaf.shell.commands.Option;
import org.onosproject.cli.AbstractShellCommand; import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.routing.bgp.BgpConstants;
import org.onosproject.routing.bgp.BgpInfoService; import org.onosproject.routing.bgp.BgpInfoService;
import org.onosproject.routing.bgp.BgpRouteEntry; import org.onosproject.routing.bgp.BgpRouteEntry;
import org.onosproject.routing.bgp.BgpSession; import org.onosproject.routing.bgp.BgpSession;
import org.onosproject.routing.bgp.BgpConstants;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.config.impl; package org.onosproject.routing.config.impl;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -37,8 +37,5 @@
<command> <command>
<action class="org.onosproject.routing.cli.RemovePeerCommand"/> <action class="org.onosproject.routing.cli.RemovePeerCommand"/>
</command> </command>
<command>
<action class="org.onosproject.routing.fpm.cli.FpmConnectionsList"/>
</command>
</command-bundle> </command-bundle>
</blueprint> </blueprint>

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.hamcrest.Matchers; import org.hamcrest.Matchers;
@ -21,7 +22,6 @@ import org.junit.Test;
import java.util.ArrayList; import java.util.ArrayList;
import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertThat; import static org.junit.Assert.assertThat;
/** /**
@ -212,7 +212,7 @@ public class AsPathTest {
// //
BgpRouteEntry.AsPath asPath2 = new BgpRouteEntry.AsPath(pathSegments); BgpRouteEntry.AsPath asPath2 = new BgpRouteEntry.AsPath(pathSegments);
assertThat(asPath1, Matchers.is(not(asPath2))); assertThat(asPath1, Matchers.is(Matchers.not(asPath2)));
} }
/** /**

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.easymock.EasyMock; import org.easymock.EasyMock;
@ -25,7 +26,6 @@ import org.onlab.packet.Ip4Prefix;
import java.util.ArrayList; import java.util.ArrayList;
import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertThat; import static org.junit.Assert.assertThat;
/** /**
@ -499,7 +499,7 @@ public class BgpRouteEntryTest {
localPref); localPref);
bgpRouteEntry2.setMultiExitDisc(multiExitDisc); bgpRouteEntry2.setMultiExitDisc(multiExitDisc);
assertThat(bgpRouteEntry1, Matchers.is(not(bgpRouteEntry2))); assertThat(bgpRouteEntry1, Matchers.is(Matchers.not(bgpRouteEntry2)));
} }
/** /**

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import com.google.common.net.InetAddresses; import com.google.common.net.InetAddresses;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.hamcrest.Matchers; import org.hamcrest.Matchers;
@ -21,7 +22,6 @@ import org.junit.Test;
import java.util.ArrayList; import java.util.ArrayList;
import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertThat; import static org.junit.Assert.assertThat;
/** /**
@ -114,7 +114,7 @@ public class PathSegmentTest {
BgpRouteEntry.PathSegment pathSegment2 = BgpRouteEntry.PathSegment pathSegment2 =
new BgpRouteEntry.PathSegment(pathSegmentType, segmentAsNumbers); new BgpRouteEntry.PathSegment(pathSegmentType, segmentAsNumbers);
assertThat(pathSegment1, Matchers.is(not(pathSegment2))); assertThat(pathSegment1, Matchers.is(Matchers.not(pathSegment2)));
} }
/** /**

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.hamcrest.Matchers; import org.hamcrest.Matchers;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffer;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.bgp; package org.onosproject.routing.bgp;
import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffer;

30
apps/routing/cpr/BUCK Normal file
View File

@ -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,
)

31
apps/routing/cpr/pom.xml Normal file
View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>onos-app-routing-parent</artifactId>
<groupId>org.onosproject</groupId>
<version>1.9.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>onos-apps-routing-cpr</artifactId>
<packaging>bundle</packaging>
</project>

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
* limitations under the License. * 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.ImmutableSortedSet;
import com.google.common.collect.Lists; 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.HostListener;
import org.onosproject.net.host.HostService; import org.onosproject.net.host.HostService;
import org.onosproject.net.host.InterfaceIpAddress; 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.RoutingService;
import org.onosproject.routing.config.RouterConfig; import org.onosproject.routing.config.RouterConfig;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -80,11 +82,13 @@ import static org.slf4j.LoggerFactory.getLogger;
* Manages connectivity between peers redirecting control traffic to a routing * Manages connectivity between peers redirecting control traffic to a routing
* control plane available on the dataplane. * control plane available on the dataplane.
*/ */
@Component(immediate = true, enabled = false) @Component(immediate = true)
public class ControlPlaneRedirectManager { public class ControlPlaneRedirectManager {
private final Logger log = getLogger(getClass()); 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 MIN_IP_PRIORITY = 10;
private static final int IPV4_PRIORITY = 2000; private static final int IPV4_PRIORITY = 2000;
private static final int IPV6_PRIORITY = 500; private static final int IPV6_PRIORITY = 500;
@ -140,6 +144,7 @@ public class ControlPlaneRedirectManager {
processRouterConfig(); processRouterConfig();
// FIXME There can be an issue when this component is deactivated before vRouter // FIXME There can be an issue when this component is deactivated before vRouter
applicationService.registerDeactivateHook(this.appId, () -> { applicationService.registerDeactivateHook(this.appId, () -> {
if (interfaceManager != null) { if (interfaceManager != null) {
@ -239,10 +244,10 @@ public class ControlPlaneRedirectManager {
int cpNextId, intfNextId; int cpNextId, intfNextId;
if (intf.vlan() == VlanId.NONE) { if (intf.vlan() == VlanId.NONE) {
cpNextId = modifyNextObjective(deviceId, controlPlanePort, cpNextId = modifyNextObjective(deviceId, controlPlanePort,
VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN), VlanId.vlanId(ASSIGNED_VLAN),
true, install); true, install);
intfNextId = modifyNextObjective(deviceId, intf.connectPoint().port(), intfNextId = modifyNextObjective(deviceId, intf.connectPoint().port(),
VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN), VlanId.vlanId(ASSIGNED_VLAN),
true, install); true, install);
} else { } else {
cpNextId = modifyNextObjective(deviceId, controlPlanePort, cpNextId = modifyNextObjective(deviceId, controlPlanePort,
@ -365,7 +370,7 @@ public class ControlPlaneRedirectManager {
int cpNextId; int cpNextId;
if (intf.vlan() == VlanId.NONE) { if (intf.vlan() == VlanId.NONE) {
cpNextId = modifyNextObjective(deviceId, controlPlanePort, cpNextId = modifyNextObjective(deviceId, controlPlanePort,
VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN), VlanId.vlanId(ASSIGNED_VLAN),
true, install); true, install);
} else { } else {
cpNextId = modifyNextObjective(deviceId, controlPlanePort, cpNextId = modifyNextObjective(deviceId, controlPlanePort,
@ -680,7 +685,7 @@ public class ControlPlaneRedirectManager {
TrafficSelector.Builder metabuilder = DefaultTrafficSelector.builder(); TrafficSelector.Builder metabuilder = DefaultTrafficSelector.builder();
VlanId matchVlanId = (vlanId.equals(VlanId.NONE)) ? VlanId matchVlanId = (vlanId.equals(VlanId.NONE)) ?
VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN) : VlanId.vlanId(ASSIGNED_VLAN) :
vlanId; vlanId;
metabuilder.matchVlanId(matchVlanId); metabuilder.matchVlanId(matchVlanId);
nextObjBuilder.withMeta(metabuilder.build()); nextObjBuilder.withMeta(metabuilder.build());

View File

@ -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;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.impl;
package org.onosproject.routing.cpr;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import org.easymock.EasyMock; import org.easymock.EasyMock;
@ -79,11 +80,11 @@ import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify; import static org.easymock.EasyMock.verify;
import static org.onlab.packet.ICMP6.NEIGHBOR_ADVERTISEMENT; import static org.onlab.packet.ICMP6.NEIGHBOR_ADVERTISEMENT;
import static org.onlab.packet.ICMP6.NEIGHBOR_SOLICITATION; import static org.onlab.packet.ICMP6.NEIGHBOR_SOLICITATION;
import static org.onosproject.routing.impl.ControlPlaneRedirectManager.ACL_PRIORITY; import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.ACL_PRIORITY;
import static org.onosproject.routing.impl.ControlPlaneRedirectManager.buildArpSelector; import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.buildArpSelector;
import static org.onosproject.routing.impl.ControlPlaneRedirectManager.buildIPDstSelector; import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.buildIPDstSelector;
import static org.onosproject.routing.impl.ControlPlaneRedirectManager.buildIPSrcSelector; import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.buildIPSrcSelector;
import static org.onosproject.routing.impl.ControlPlaneRedirectManager.buildNdpSelector; import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.buildNdpSelector;
/** /**
* UnitTests for ControlPlaneRedirectManager. * UnitTests for ControlPlaneRedirectManager.
@ -272,9 +273,9 @@ public class ControlPlaneRedirectManagerTest {
int cpNextId, intfNextId; int cpNextId, intfNextId;
cpNextId = modifyNextObjective(deviceId, controlPlanePort, cpNextId = modifyNextObjective(deviceId, controlPlanePort,
VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN), true, install); VlanId.vlanId(ControlPlaneRedirectManager.ASSIGNED_VLAN), true, install);
intfNextId = modifyNextObjective(deviceId, intf.connectPoint().port(), intfNextId = modifyNextObjective(deviceId, intf.connectPoint().port(),
VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN), true, install); VlanId.vlanId(ControlPlaneRedirectManager.ASSIGNED_VLAN), true, install);
// IP to router // IP to router
TrafficSelector toSelector = buildIPDstSelector( TrafficSelector toSelector = buildIPDstSelector(

View File

@ -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,
)

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>onos-app-routing-parent</artifactId>
<groupId>org.onosproject</groupId>
<version>1.9.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>onos-apps-routing-fibinstaller</artifactId>
<packaging>bundle</packaging>
</project>

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
* limitations under the License. * 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.ConcurrentHashMultiset;
import com.google.common.collect.Maps; 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.ForwardingObjective;
import org.onosproject.net.flowobjective.NextObjective; import org.onosproject.net.flowobjective.NextObjective;
import org.onosproject.net.flowobjective.ObjectiveContext; 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.RoutingService;
import org.onosproject.routing.config.RouterConfig; import org.onosproject.routing.config.RouterConfig;
import org.osgi.service.component.ComponentContext; import org.osgi.service.component.ComponentContext;
@ -80,7 +84,7 @@ import java.util.Set;
/** /**
* Programs routes to a single OpenFlow switch. * Programs routes to a single OpenFlow switch.
*/ */
@Component(immediate = true, enabled = false) @Component(immediate = true)
public class SingleSwitchFibInstaller { public class SingleSwitchFibInstaller {
private final Logger log = LoggerFactory.getLogger(getClass()); private final Logger log = LoggerFactory.getLogger(getClass());

View File

@ -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;

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.impl;
package org.onosproject.routing.fibinstaller;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import org.easymock.EasyMock; import org.easymock.EasyMock;

30
apps/routing/fpm/BUCK Normal file
View File

@ -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,
)

48
apps/routing/fpm/pom.xml Normal file
View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>onos-app-routing-parent</artifactId>
<groupId>org.onosproject</groupId>
<version>1.9.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>onos-apps-fpm</artifactId>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-cli</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.karaf.shell</groupId>
<artifactId>org.apache.karaf.shell.console</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.onosproject.routing.fpm; package org.onosproject.routing.fpm;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
@ -67,7 +68,7 @@ import static org.onlab.util.Tools.groupedThreads;
* Forwarding Plane Manager (FPM) route source. * Forwarding Plane Manager (FPM) route source.
*/ */
@Service @Service
@Component(immediate = true, enabled = false) @Component(immediate = true)
public class FpmManager implements FpmInfoService { public class FpmManager implements FpmInfoService {
private final Logger log = LoggerFactory.getLogger(getClass()); private final Logger log = LoggerFactory.getLogger(getClass());

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -34,7 +34,7 @@ public class FpmConnectionsList extends AbstractShellCommand {
@Override @Override
protected void execute() { protected void execute() {
FpmInfoService fpmInfo = get(FpmInfoService.class); FpmInfoService fpmInfo = AbstractShellCommand.get(FpmInfoService.class);
fpmInfo.peers().forEach((socketAddress, timestamp) -> { fpmInfo.peers().forEach((socketAddress, timestamp) -> {
if (socketAddress instanceof InetSocketAddress) { if (socketAddress instanceof InetSocketAddress) {

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -0,0 +1,23 @@
<!--
~ 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.
-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
<command>
<action class="org.onosproject.routing.fpm.cli.FpmConnectionsList"/>
</command>
</command-bundle>
</blueprint>

View File

@ -24,10 +24,16 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>onos-app-routing</artifactId> <artifactId>onos-app-routing-parent</artifactId>
<packaging>bundle</packaging> <packaging>pom</packaging>
<description>Libraries for routing applications</description> <description>Libraries for routing applications</description>
<modules>
<module>fibinstaller</module>
<module>common</module>
<module>cpr</module>
<module>fpm</module>
</modules>
<dependencies> <dependencies>
<dependency> <dependency>
@ -53,46 +59,8 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.onosproject</groupId> <groupId>org.osgi</groupId>
<artifactId>onos-cli</artifactId> <artifactId>org.osgi.core</artifactId>
<version>${project.version}</version>
</dependency>
<!-- FIXME: not OSGi-ready -->
<dependency>
<groupId>com.googlecode.concurrent-trees</groupId>
<artifactId>concurrent-trees</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onlab-misc</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
</dependency> </dependency>
<dependency> <dependency>
@ -100,16 +68,6 @@
<artifactId>org.osgi.compendium</artifactId> <artifactId>org.osgi.compendium</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.karaf.shell</groupId>
<artifactId>org.apache.karaf.shell.console</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.onosproject</groupId> <groupId>org.onosproject</groupId>
<artifactId>onlab-junit</artifactId> <artifactId>onlab-junit</artifactId>

View File

@ -10,7 +10,7 @@ COMPILE_DEPS = [
BUNDLES = [ BUNDLES = [
'//apps/sdnip:onos-apps-sdnip', '//apps/sdnip:onos-apps-sdnip',
'//apps/routing-api:onos-apps-routing-api', '//apps/routing-api:onos-apps-routing-api',
'//apps/routing:onos-apps-routing', '//apps/routing/common:onos-apps-routing-common',
] ]
TEST_DEPS = [ TEST_DEPS = [

View File

@ -5,7 +5,7 @@ COMPILE_DEPS = [
BUNDLES = [ BUNDLES = [
'//apps/routing-api:onos-apps-routing-api', '//apps/routing-api:onos-apps-routing-api',
'//apps/routing:onos-apps-routing', '//apps/routing/common:onos-apps-routing-common',
'//apps/vrouter:onos-apps-vrouter', '//apps/vrouter:onos-apps-vrouter',
] ]
@ -19,4 +19,5 @@ onos_app (
url = 'http://onosproject.org', url = 'http://onosproject.org',
included_bundles = BUNDLES, included_bundles = BUNDLES,
description = 'Virtual router (vRouter) application.', description = 'Virtual router (vRouter) application.',
required_apps = [ 'org.onosproject.fibinstaller', 'org.onosproject.cpr', 'org.onosproject.fpm' ],
) )

View File

@ -19,20 +19,15 @@ import com.google.common.collect.Lists;
import org.apache.felix.scr.annotations.Activate; import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate; 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.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality; import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.onlab.util.Tools;
import org.onosproject.cfg.ComponentConfigService; import org.onosproject.cfg.ComponentConfigService;
import org.onosproject.core.ApplicationId; import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService; import org.onosproject.core.CoreService;
import org.onosproject.incubator.component.ComponentService; import org.onosproject.incubator.component.ComponentService;
import org.osgi.service.component.ComponentContext;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.Dictionary;
import java.util.List; import java.util.List;
/** /**
@ -44,9 +39,6 @@ public class Vrouter {
private final Logger log = LoggerFactory.getLogger(getClass()); private final Logger log = LoggerFactory.getLogger(getClass());
private static final String APP_NAME = "org.onosproject.vrouter"; 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"; private static final String DIRECT_HOST_MGR = "org.onosproject.routing.impl.DirectHostManager";
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
@ -58,32 +50,19 @@ public class Vrouter {
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
private ComponentConfigService componentConfigService; private ComponentConfigService componentConfigService;
/**
* vRouter will push flows to the switches when receiving routes by enabling
* FIB installer.
* <p>
* 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 ApplicationId appId;
private List<String> baseComponents = Lists.newArrayList(FPM_MANAGER, CP_REDIRECT, DIRECT_HOST_MGR); private List<String> baseComponents = Lists.newArrayList(DIRECT_HOST_MGR);
@Activate @Activate
protected void activate(ComponentContext context) { protected void activate() {
appId = coreService.registerApplication(APP_NAME); appId = coreService.registerApplication(APP_NAME);
componentConfigService.registerProperties(getClass());
componentConfigService.preSetProperty( componentConfigService.preSetProperty(
"org.onosproject.incubator.store.routing.impl.RouteStoreImpl", "org.onosproject.incubator.store.routing.impl.RouteStoreImpl",
"distributed", "true"); "distributed", "true");
baseComponents.forEach(name -> componentService.activate(appId, name)); baseComponents.forEach(name -> componentService.activate(appId, name));
modified(context);
log.info("Started"); log.info("Started");
} }
@ -96,28 +75,4 @@ public class Vrouter {
log.info("Stopped"); 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);
}
}
} }

View File

@ -163,6 +163,9 @@ ONOS_APPS = [
'//apps/virtualbng:onos-apps-virtualbng-oar', '//apps/virtualbng:onos-apps-virtualbng-oar',
'//apps/vpls:onos-apps-vpls-oar', '//apps/vpls:onos-apps-vpls-oar',
'//apps/vrouter:onos-apps-vrouter-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/vtn:onos-apps-vtn-oar',
'//apps/faultmanagement:onos-apps-faultmanagement-oar', '//apps/faultmanagement:onos-apps-faultmanagement-oar',
'//apps/openstacknode:onos-apps-openstacknode-oar', '//apps/openstacknode:onos-apps-openstacknode-oar',
@ -184,7 +187,7 @@ APP_JARS = [
'//apps/fwd:onos-apps-fwd', '//apps/fwd:onos-apps-fwd',
'//apps/iptopology-api:onos-apps-iptopology-api', '//apps/iptopology-api:onos-apps-iptopology-api',
'//apps/openstacknode:onos-apps-openstacknode', '//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/vtnrsc:onos-apps-vtn-vtnrsc',
'//apps/vtn/sfcmgr:onos-apps-vtn-sfcmgr', '//apps/vtn/sfcmgr:onos-apps-vtn-sfcmgr',
'//apps/vtn/vtnmgr:onos-apps-vtn-vtnmgr', '//apps/vtn/vtnmgr:onos-apps-vtn-vtnmgr',