Andrea Campanella | 31bcdcd | 2017-09-19 16:35:44 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package org.onosproject.pi.demo.app.tor; |
| 18 | |
| 19 | import com.google.common.collect.ImmutableList; |
| 20 | import com.google.common.collect.Maps; |
| 21 | import org.apache.felix.scr.annotations.Component; |
| 22 | import org.onosproject.net.DeviceId; |
| 23 | import org.onosproject.net.Host; |
| 24 | import org.onosproject.net.PortNumber; |
| 25 | import org.onosproject.net.flow.FlowRule; |
| 26 | import org.onosproject.net.topology.Topology; |
| 27 | import org.onosproject.pi.demo.app.common.AbstractUpgradableFabricApp; |
| 28 | |
| 29 | import java.util.Collection; |
| 30 | import java.util.List; |
| 31 | import java.util.Map; |
| 32 | import java.util.Set; |
| 33 | |
| 34 | |
| 35 | /** |
| 36 | * Implementation of an upgradable fabric app for TOR configuration. |
| 37 | */ |
| 38 | //TODO implement |
| 39 | @Component(immediate = true) |
| 40 | public class TorApp extends AbstractUpgradableFabricApp { |
| 41 | |
| 42 | private static final String APP_NAME = "org.onosproject.pi-tor"; |
| 43 | |
| 44 | private static final Map<DeviceId, Map<Set<PortNumber>, Short>> DEVICE_GROUP_ID_MAP = Maps.newHashMap(); |
| 45 | |
| 46 | public TorApp() { |
| 47 | super(APP_NAME, TorPipeconfFactory.getAll()); |
| 48 | } |
| 49 | |
| 50 | @Override |
| 51 | public boolean initDevice(DeviceId deviceId) { |
| 52 | // Nothing to do. |
| 53 | return true; |
| 54 | } |
| 55 | |
| 56 | @Override |
| 57 | public List<FlowRule> generateLeafRules(DeviceId leaf, Host srcHost, Collection<Host> dstHosts, |
| 58 | Collection<DeviceId> availableSpines, Topology topo) |
| 59 | throws FlowRuleGeneratorException { |
| 60 | |
| 61 | return ImmutableList.of(); |
| 62 | } |
| 63 | |
| 64 | @Override |
| 65 | public List<FlowRule> generateSpineRules(DeviceId deviceId, Collection<Host> dstHosts, Topology topo) |
| 66 | throws FlowRuleGeneratorException { |
| 67 | |
| 68 | return ImmutableList.of(); |
| 69 | } |
| 70 | |
| 71 | } |