blob: cd39785fd5a35882e28c39f06fcd1ea2668f623d [file] [log] [blame]
jiangruie3d60b12015-11-25 16:27:04 +08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
jiangruie3d60b12015-11-25 16:27:04 +08003 *
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 */
16package org.onosproject.vtnrsc.service;
17
jiangruie3d60b12015-11-25 16:27:04 +080018import org.onlab.packet.MacAddress;
Mahesh Poojary Scc11f722015-11-29 16:09:56 +053019import org.onosproject.event.ListenerService;
jiangruie3d60b12015-11-25 16:27:04 +080020import org.onosproject.net.Device;
21import org.onosproject.net.DeviceId;
lishuaib43dbf72016-01-06 11:11:35 +080022import org.onosproject.net.Host;
jiangruie3d60b12015-11-25 16:27:04 +080023import org.onosproject.net.HostId;
24import org.onosproject.vtnrsc.SegmentationId;
25import org.onosproject.vtnrsc.TenantId;
26import org.onosproject.vtnrsc.VirtualPortId;
Mahesh Poojary Scc11f722015-11-29 16:09:56 +053027import org.onosproject.vtnrsc.event.VtnRscEvent;
jiangruie3d60b12015-11-25 16:27:04 +080028import org.onosproject.vtnrsc.event.VtnRscListener;
29
Jonathan Hart51539b82015-10-29 09:53:04 -070030import java.util.Iterator;
31
jiangruie3d60b12015-11-25 16:27:04 +080032/**
33 * Service for interacting with the inventory of Vtn resource.
34 */
Mahesh Poojary Scc11f722015-11-29 16:09:56 +053035public interface VtnRscService extends ListenerService<VtnRscEvent, VtnRscListener> {
jiangruie3d60b12015-11-25 16:27:04 +080036 /**
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 Hart51539b82015-10-29 09:53:04 -070058 Iterator<Device> getSffOfTenant(TenantId tenantId);
jiangruie3d60b12015-11-25 16:27:04 +080059
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 Hart51539b82015-10-29 09:53:04 -070082 DeviceId getSfToSffMaping(VirtualPortId portId);
lishuaib43dbf72016-01-06 11:11:35 +080083
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);
jiangruie3d60b12015-11-25 16:27:04 +0800103}