Committed by
Gerrit Code Review
[ONOS-3114] sfc Service and Manager
Change-Id: Iaa44ee134de8b30397a1fb808523c81d2c370cd9
Showing
8 changed files
with
218 additions
and
36 deletions
| ... | @@ -32,6 +32,7 @@ | ... | @@ -32,6 +32,7 @@ |
| 32 | <description>ONOS framework applications</description> | 32 | <description>ONOS framework applications</description> |
| 33 | 33 | ||
| 34 | <modules> | 34 | <modules> |
| 35 | + <module>sfcmgr</module> | ||
| 35 | <module>vtnrsc</module> | 36 | <module>vtnrsc</module> |
| 36 | <module>vtnmgr</module> | 37 | <module>vtnmgr</module> |
| 37 | <module>vtnweb</module> | 38 | <module>vtnweb</module> | ... | ... |
apps/vtn/sfcmgr/pom.xml
0 → 100644
| 1 | +<?xml version="1.0"?> | ||
| 2 | +<!-- | ||
| 3 | + ~ Copyright 2015 Open Networking Laboratory | ||
| 4 | + ~ | ||
| 5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | + ~ you may not use this file except in compliance with the License. | ||
| 7 | + ~ You may obtain a copy of the License at | ||
| 8 | + ~ | ||
| 9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | + ~ | ||
| 11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | + ~ See the License for the specific language governing permissions and | ||
| 15 | + ~ limitations under the License. | ||
| 16 | + --> | ||
| 17 | +<project | ||
| 18 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" | ||
| 19 | + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
| 20 | + <modelVersion>4.0.0</modelVersion> | ||
| 21 | + <parent> | ||
| 22 | + <groupId>org.onosproject</groupId> | ||
| 23 | + <artifactId>onos-app-vtn</artifactId> | ||
| 24 | + <version>1.4.0-SNAPSHOT</version> | ||
| 25 | + <relativePath>../pom.xml</relativePath> | ||
| 26 | + </parent> | ||
| 27 | + | ||
| 28 | + <artifactId>onos-app-sfc-mgr</artifactId> | ||
| 29 | + <packaging>bundle</packaging> | ||
| 30 | + | ||
| 31 | + <dependencies> | ||
| 32 | + <dependency> | ||
| 33 | + <groupId>org.onosproject</groupId> | ||
| 34 | + <artifactId>onos-api</artifactId> | ||
| 35 | + </dependency> | ||
| 36 | + <dependency> | ||
| 37 | + <groupId>org.apache.felix</groupId> | ||
| 38 | + <artifactId>org.apache.felix.scr.annotations</artifactId> | ||
| 39 | + </dependency> | ||
| 40 | + <dependency> | ||
| 41 | + <groupId>org.onosproject</groupId> | ||
| 42 | + <artifactId>onos-core-serializers</artifactId> | ||
| 43 | + <version>${project.version}</version> | ||
| 44 | + </dependency> | ||
| 45 | + <dependency> | ||
| 46 | + <groupId>org.onosproject</groupId> | ||
| 47 | + <artifactId>onos-app-vtn-rsc</artifactId> | ||
| 48 | + <version>${project.version}</version> | ||
| 49 | + </dependency> | ||
| 50 | + </dependencies> | ||
| 51 | + | ||
| 52 | + <build> | ||
| 53 | + <plugins> | ||
| 54 | + <plugin> | ||
| 55 | + <groupId>org.apache.felix</groupId> | ||
| 56 | + <artifactId>maven-bundle-plugin</artifactId> | ||
| 57 | + <configuration> | ||
| 58 | + <instructions> | ||
| 59 | + <Export-Package> | ||
| 60 | + org.onosproject.openflow.*,org.projectfloodlight.openflow.* | ||
| 61 | + </Export-Package> | ||
| 62 | + </instructions> | ||
| 63 | + </configuration> | ||
| 64 | + </plugin> | ||
| 65 | + </plugins> | ||
| 66 | + </build> | ||
| 67 | +</project> |
| 1 | +/* | ||
| 2 | + * Copyright 2015 Open Networking Laboratory | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * Service function forwarder for SFC. | ||
| 19 | + */ | ||
| 20 | +package org.onosproject.sfc.forwarder; |
| 1 | +/* | ||
| 2 | + * Copyright 2015 Open Networking Laboratory | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * Service for installing flow classifier rules in OVS. | ||
| 19 | + */ | ||
| 20 | +package org.onosproject.sfc.installer; |
| ... | @@ -13,40 +13,58 @@ | ... | @@ -13,40 +13,58 @@ |
| 13 | * See the License for the specific language governing permissions and | 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. | 14 | * limitations under the License. |
| 15 | */ | 15 | */ |
| 16 | -package org.onosproject.sfc; | 16 | +package org.onosproject.sfc.manager; |
| 17 | - | ||
| 18 | -import org.onosproject.vtnrsc.PortChain; | ||
| 19 | 17 | ||
| 20 | /** | 18 | /** |
| 21 | * SFC application that applies flows to the device. | 19 | * SFC application that applies flows to the device. |
| 22 | */ | 20 | */ |
| 23 | public interface SfcService { | 21 | public interface SfcService { |
| 22 | + | ||
| 24 | /** | 23 | /** |
| 25 | - * Applies flow classification to OVS. | 24 | + * When port-pair is created, check whether Forwarding Rule needs to be |
| 26 | - * | 25 | + * updated in OVS. |
| 27 | - * @param portChain Port-Chain. | ||
| 28 | */ | 26 | */ |
| 29 | - void InstallFlowClassification(PortChain portChain); | 27 | + public void onPortPairCreated(); |
| 30 | 28 | ||
| 29 | + /** | ||
| 30 | + * When port-pair is deleted, check whether Forwarding Rule needs to be | ||
| 31 | + * updated in OVS. | ||
| 32 | + */ | ||
| 33 | + public void onPortPairDeleted(); | ||
| 31 | 34 | ||
| 32 | /** | 35 | /** |
| 33 | - * Remove flow classification from OVS. | 36 | + * When port-pair-group is created, check whether Forwarding Rule needs to |
| 34 | - * | 37 | + * be updated in OVS. |
| 35 | - * @param portChain Port-Chain. | ||
| 36 | */ | 38 | */ |
| 37 | - void UnInstallFlowClassification(PortChain portChain); | 39 | + public void onPortPairGroupCreated(); |
| 38 | 40 | ||
| 39 | /** | 41 | /** |
| 40 | - * Applies Service Function chain to OVS. | 42 | + * When port-pair-group is deleted, check whether Forwarding Rule needs to |
| 41 | - * | 43 | + * be updated in OVS. |
| 42 | - * @param portChain Port-Chain. | ||
| 43 | */ | 44 | */ |
| 44 | - void InstallServiceFunctionChain(PortChain portChain); | 45 | + public void onPortPairGroupDeleted(); |
| 45 | 46 | ||
| 46 | /** | 47 | /** |
| 47 | - * Remove Service Function chain from OVS. | 48 | + * When flow-classifier is created, check whether Forwarding Rule needs to |
| 48 | - * | 49 | + * be updated in OVS. |
| 49 | - * @param portChain Port-Chain. | 50 | + */ |
| 51 | + public void onFlowClassifierCreated(); | ||
| 52 | + | ||
| 53 | + /** | ||
| 54 | + * When flow-classifier is deleted, check whether Forwarding Rule needs to | ||
| 55 | + * be updated in OVS. | ||
| 56 | + */ | ||
| 57 | + public void onFlowClassifierDeleted(); | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * When port-chain is created, check whether Forwarding Rule needs to be | ||
| 61 | + * updated in OVS. | ||
| 62 | + */ | ||
| 63 | + public void onPortChainCreated(); | ||
| 64 | + | ||
| 65 | + /** | ||
| 66 | + * When port-chain is deleted, check whether Forwarding Rule needs to be | ||
| 67 | + * updated in OVS. | ||
| 50 | */ | 68 | */ |
| 51 | - void UnInstallServiceFunctionChain(PortChain portChain); | 69 | + public void onPortChainDeleted(); |
| 52 | } | 70 | } | ... | ... |
| ... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
| 13 | * See the License for the specific language governing permissions and | 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. | 14 | * limitations under the License. |
| 15 | */ | 15 | */ |
| 16 | -package org.onosproject.sfc.impl; | 16 | +package org.onosproject.sfc.manager.impl; |
| 17 | 17 | ||
| 18 | import static org.slf4j.LoggerFactory.getLogger; | 18 | import static org.slf4j.LoggerFactory.getLogger; |
| 19 | 19 | ||
| ... | @@ -21,7 +21,8 @@ import org.apache.felix.scr.annotations.Activate; | ... | @@ -21,7 +21,8 @@ import org.apache.felix.scr.annotations.Activate; |
| 21 | import org.apache.felix.scr.annotations.Component; | 21 | import org.apache.felix.scr.annotations.Component; |
| 22 | import org.apache.felix.scr.annotations.Deactivate; | 22 | import org.apache.felix.scr.annotations.Deactivate; |
| 23 | import org.apache.felix.scr.annotations.Service; | 23 | import org.apache.felix.scr.annotations.Service; |
| 24 | -import org.onosproject.vtnrsc.sfc.PortChain; | 24 | +import org.onosproject.sfc.manager.SfcService; |
| 25 | +import org.onosproject.vtnrsc.PortChain; | ||
| 25 | import org.slf4j.Logger; | 26 | import org.slf4j.Logger; |
| 26 | 27 | ||
| 27 | /** | 28 | /** |
| ... | @@ -31,7 +32,7 @@ import org.slf4j.Logger; | ... | @@ -31,7 +32,7 @@ import org.slf4j.Logger; |
| 31 | @Service | 32 | @Service |
| 32 | public class SfcManager implements SfcService { | 33 | public class SfcManager implements SfcService { |
| 33 | 34 | ||
| 34 | - private final Logger log = getLogger(SfcManager.class); | 35 | + private final Logger log = getLogger(getClass()); |
| 35 | 36 | ||
| 36 | @Activate | 37 | @Activate |
| 37 | public void activate() { | 38 | public void activate() { |
| ... | @@ -44,26 +45,81 @@ public class SfcManager implements SfcService { | ... | @@ -44,26 +45,81 @@ public class SfcManager implements SfcService { |
| 44 | } | 45 | } |
| 45 | 46 | ||
| 46 | @Override | 47 | @Override |
| 47 | - public void InstallFlowClassification(PortChain portChain) { | 48 | + public void onPortPairCreated() { |
| 48 | - log.debug("InstallFlowClassification"); | 49 | + log.debug("onPortPairCreated"); |
| 49 | - //TODO: Installation of flow classification into OVS. | 50 | + // TODO: Process port-pair on creation. |
| 51 | + // TODO: Parameter also needs to be modified. | ||
| 50 | } | 52 | } |
| 51 | 53 | ||
| 52 | @Override | 54 | @Override |
| 53 | - public void UnInstallFlowClassification(PortChain portChain) { | 55 | + public void onPortPairDeleted() { |
| 54 | - log.debug("UnInstallFlowClassification"); | 56 | + log.debug("onPortPairDeleted"); |
| 55 | - //TODO: Un-installation flow classification from OVS | 57 | + // TODO: Process port-pair on deletion. |
| 58 | + // TODO: Parameter also needs to be modified. | ||
| 56 | } | 59 | } |
| 57 | 60 | ||
| 58 | @Override | 61 | @Override |
| 59 | - public void InstallServiceFunctionChain(PortChain portChain) { | 62 | + public void onPortPairGroupCreated() { |
| 60 | - log.debug("InstallServiceFunctionChain"); | 63 | + log.debug("onPortPairGroupCreated"); |
| 61 | - //TODO: Installation of Service Function chain into OVS. | 64 | + // TODO: Process port-pair-group on creation. |
| 65 | + // TODO: Parameter also needs to be modified. | ||
| 62 | } | 66 | } |
| 63 | 67 | ||
| 64 | @Override | 68 | @Override |
| 65 | - public void UnInstallServiceFunctionChain(PortChain portChain) { | 69 | + public void onPortPairGroupDeleted() { |
| 66 | - log.debug("UnInstallServiceFunctionChain"); | 70 | + log.debug("onPortPairGroupDeleted"); |
| 67 | - //TODO: Un-installation of Service Function chain from OVS. | 71 | + // TODO: Process port-pair-group on deletion. |
| 72 | + // TODO: Parameter also needs to be modified. | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + @Override | ||
| 76 | + public void onFlowClassifierCreated() { | ||
| 77 | + log.debug("onFlowClassifierCreated"); | ||
| 78 | + // TODO: Process flow-classifier on creation. | ||
| 79 | + // TODO: Parameter also needs to be modified. | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + @Override | ||
| 83 | + public void onFlowClassifierDeleted() { | ||
| 84 | + log.debug("onFlowClassifierDeleted"); | ||
| 85 | + // TODO: Process flow-classifier on deletion. | ||
| 86 | + // TODO: Parameter also needs to be modified. | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + @Override | ||
| 90 | + public void onPortChainCreated() { | ||
| 91 | + log.debug("onPortChainCreated"); | ||
| 92 | + // TODO: Process port-chain on creation. | ||
| 93 | + // TODO: Parameter also needs to be modified. | ||
| 94 | + | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + @Override | ||
| 98 | + public void onPortChainDeleted() { | ||
| 99 | + log.debug("onPortChainDeleted"); | ||
| 100 | + // TODO: Process port-chain on deletion. | ||
| 101 | + // TODO: Parameter also needs to be modified. | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + /** | ||
| 105 | + * Install SF Forwarding rule into OVS. | ||
| 106 | + * | ||
| 107 | + * @param portChain | ||
| 108 | + * port chain | ||
| 109 | + */ | ||
| 110 | + public void installForwardingRule(PortChain portChain) { | ||
| 111 | + log.debug("installForwardingRule"); | ||
| 112 | + // TODO: Installation of SF Forwarding rule into OVS. | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + /** | ||
| 116 | + * Uninstall SF Forwarding rule from OVS. | ||
| 117 | + * | ||
| 118 | + * @param portChain | ||
| 119 | + * port chain | ||
| 120 | + */ | ||
| 121 | + public void unInstallForwardingRule(PortChain portChain) { | ||
| 122 | + log.debug("unInstallForwardingRule"); | ||
| 123 | + // TODO: Uninstallation of SF Forwarding rule from OVS. | ||
| 68 | } | 124 | } |
| 69 | } | 125 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment