blob: fd81987368b7505845190d535d9c6f7504d429dc [file] [log] [blame]
jiangruie3d60b12015-11-25 16:27:04 +08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
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;
lishuai8798bbe2016-05-05 16:02:03 +080026import org.onosproject.vtnrsc.TenantRouter;
jiangruie3d60b12015-11-25 16:27:04 +080027import org.onosproject.vtnrsc.VirtualPortId;
Mahesh Poojary Scc11f722015-11-29 16:09:56 +053028import org.onosproject.vtnrsc.event.VtnRscEvent;
jiangruie3d60b12015-11-25 16:27:04 +080029import org.onosproject.vtnrsc.event.VtnRscListener;
30
Jonathan Hart51539b82015-10-29 09:53:04 -070031import java.util.Iterator;
32
jiangruie3d60b12015-11-25 16:27:04 +080033/**
34 * Service for interacting with the inventory of Vtn resource.
35 */
Mahesh Poojary Scc11f722015-11-29 16:09:56 +053036public interface VtnRscService extends ListenerService<VtnRscEvent, VtnRscListener> {
jiangruie3d60b12015-11-25 16:27:04 +080037 /**
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 /**
lishuai8798bbe2016-05-05 16:02:03 +080046 * 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 /**
jiangruie3d60b12015-11-25 16:27:04 +080054 * 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 Hart51539b82015-10-29 09:53:04 -070067 Iterator<Device> getSffOfTenant(TenantId tenantId);
jiangruie3d60b12015-11-25 16:27:04 +080068
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 Hart51539b82015-10-29 09:53:04 -070091 DeviceId getSfToSffMaping(VirtualPortId portId);
lishuaib43dbf72016-01-06 11:11:35 +080092
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);
jiangruie3d60b12015-11-25 16:27:04 +0800112}