jiangrui | e3d60b1 | 2015-11-25 16:27:04 +0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame^] | 2 | * Copyright 2015-present Open Networking Laboratory |
jiangrui | e3d60b1 | 2015-11-25 16:27:04 +0800 | [diff] [blame] | 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 | package org.onosproject.vtnrsc.service; |
| 17 | |
jiangrui | e3d60b1 | 2015-11-25 16:27:04 +0800 | [diff] [blame] | 18 | import org.onlab.packet.MacAddress; |
Mahesh Poojary S | cc11f72 | 2015-11-29 16:09:56 +0530 | [diff] [blame] | 19 | import org.onosproject.event.ListenerService; |
jiangrui | e3d60b1 | 2015-11-25 16:27:04 +0800 | [diff] [blame] | 20 | import org.onosproject.net.Device; |
| 21 | import org.onosproject.net.DeviceId; |
lishuai | b43dbf7 | 2016-01-06 11:11:35 +0800 | [diff] [blame] | 22 | import org.onosproject.net.Host; |
jiangrui | e3d60b1 | 2015-11-25 16:27:04 +0800 | [diff] [blame] | 23 | import org.onosproject.net.HostId; |
| 24 | import org.onosproject.vtnrsc.SegmentationId; |
| 25 | import org.onosproject.vtnrsc.TenantId; |
| 26 | import org.onosproject.vtnrsc.VirtualPortId; |
Mahesh Poojary S | cc11f72 | 2015-11-29 16:09:56 +0530 | [diff] [blame] | 27 | import org.onosproject.vtnrsc.event.VtnRscEvent; |
jiangrui | e3d60b1 | 2015-11-25 16:27:04 +0800 | [diff] [blame] | 28 | import org.onosproject.vtnrsc.event.VtnRscListener; |
| 29 | |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 30 | import java.util.Iterator; |
| 31 | |
jiangrui | e3d60b1 | 2015-11-25 16:27:04 +0800 | [diff] [blame] | 32 | /** |
| 33 | * Service for interacting with the inventory of Vtn resource. |
| 34 | */ |
Mahesh Poojary S | cc11f72 | 2015-11-29 16:09:56 +0530 | [diff] [blame] | 35 | public interface VtnRscService extends ListenerService<VtnRscEvent, VtnRscListener> { |
jiangrui | e3d60b1 | 2015-11-25 16:27:04 +0800 | [diff] [blame] | 36 | /** |
| 37 | * Returns the SegmentationId of tenant. |
| 38 | * |
| 39 | * @param tenantId tenant identifier |
| 40 | * @return SegmentationId the SegmentationId of tenant |
| 41 | */ |
| 42 | SegmentationId getL3vni(TenantId tenantId); |
| 43 | |
| 44 | /** |
| 45 | * Returns Classifier Ovs list of the specific tenant. |
| 46 | * |
| 47 | * @param tenantId tenant identifier |
| 48 | * @return iterable collection of Device |
| 49 | */ |
| 50 | Iterator<Device> getClassifierOfTenant(TenantId tenantId); |
| 51 | |
| 52 | /** |
| 53 | * Returns Service function forwarders Ovs list of the specific tenant. |
| 54 | * |
| 55 | * @param tenantId tenant identifier |
| 56 | * @return iterable collection of Device |
| 57 | */ |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 58 | Iterator<Device> getSffOfTenant(TenantId tenantId); |
jiangrui | e3d60b1 | 2015-11-25 16:27:04 +0800 | [diff] [blame] | 59 | |
| 60 | /** |
| 61 | * Returns gateway mac address of the specific host. |
| 62 | * |
| 63 | * @param hostId host identifier |
| 64 | * @return MacAddress of host |
| 65 | */ |
| 66 | MacAddress getGatewayMac(HostId hostId); |
| 67 | |
| 68 | /** |
| 69 | * Checks if a specific port is a service function. |
| 70 | * |
| 71 | * @param portId port identifier |
| 72 | * @return true or false |
| 73 | */ |
| 74 | boolean isServiceFunction(VirtualPortId portId); |
| 75 | |
| 76 | /** |
| 77 | * Returns device identifier mapping to the specific port. |
| 78 | * |
| 79 | * @param portId port identifier |
| 80 | * @return device identifier |
| 81 | */ |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 82 | DeviceId getSfToSffMaping(VirtualPortId portId); |
lishuai | b43dbf7 | 2016-01-06 11:11:35 +0800 | [diff] [blame] | 83 | |
| 84 | /** |
| 85 | * Adds specify Device identifier to Service Function Forward OvsMap |
| 86 | * or Classifier OvsMap. |
| 87 | * |
| 88 | * @param virtualPortId the VirtualPort identifier |
| 89 | * @param tenantId the tenant identifier |
| 90 | * @param deviceId the device identifier |
| 91 | */ |
| 92 | void addDeviceIdOfOvsMap(VirtualPortId virtualPortId, TenantId tenantId, DeviceId deviceId); |
| 93 | |
| 94 | /** |
| 95 | * Removes specify Device identifier from Service Function Forward OvsMap |
| 96 | * or Classifier OvsMap. |
| 97 | * |
| 98 | * @param host Host |
| 99 | * @param tenantId the tenant identifier |
| 100 | * @param deviceId the device identifier |
| 101 | */ |
| 102 | void removeDeviceIdOfOvsMap(Host host, TenantId tenantId, DeviceId deviceId); |
jiangrui | e3d60b1 | 2015-11-25 16:27:04 +0800 | [diff] [blame] | 103 | } |