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