blob: 5b1eea330893b079fe07846541c48cdf98d3cee4 [file] [log] [blame]
Andrea Campanella31bcdcd2017-09-19 16:35:44 +09001/*
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
17package org.onosproject.pi.demo.app.tor;
18
19import com.google.common.collect.ImmutableList;
20import com.google.common.collect.Maps;
21import org.apache.felix.scr.annotations.Component;
22import org.onosproject.net.DeviceId;
23import org.onosproject.net.Host;
24import org.onosproject.net.PortNumber;
25import org.onosproject.net.flow.FlowRule;
26import org.onosproject.net.topology.Topology;
27import org.onosproject.pi.demo.app.common.AbstractUpgradableFabricApp;
28
29import java.util.Collection;
30import java.util.List;
31import java.util.Map;
32import java.util.Set;
33
34
35/**
36 * Implementation of an upgradable fabric app for TOR configuration.
37 */
38//TODO implement
39@Component(immediate = true)
40public 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}