Charles Chan | c7b3c45 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-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 | package org.onosproject.segmentrouting.xconnect.api; |
| 17 | |
Charles Chan | d5814aa | 2018-08-19 19:21:46 -0700 | [diff] [blame] | 18 | import com.google.common.collect.ImmutableMap; |
Charles Chan | c7b3c45 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 19 | import org.apache.felix.scr.annotations.Service; |
| 20 | import org.onlab.packet.VlanId; |
| 21 | import org.onosproject.net.ConnectPoint; |
| 22 | import org.onosproject.net.DeviceId; |
| 23 | import org.onosproject.net.PortNumber; |
| 24 | |
| 25 | import java.util.Set; |
| 26 | |
| 27 | /** |
| 28 | * VLAN cross connect between exactly two ports. |
| 29 | */ |
| 30 | @Service |
| 31 | public interface XconnectService { |
| 32 | |
| 33 | /** |
| 34 | * VLAN cross-connect ACL priority. |
| 35 | */ |
| 36 | int XCONNECT_ACL_PRIORITY = 60000; |
| 37 | |
| 38 | /** |
| 39 | * VLAN cross-connect Bridging priority. |
| 40 | */ |
| 41 | int XCONNECT_PRIORITY = 1000; |
| 42 | |
| 43 | /** |
| 44 | * Creates or updates Xconnect. |
| 45 | * |
| 46 | * @param deviceId device ID |
| 47 | * @param vlanId VLAN ID |
| 48 | * @param ports set of ports |
| 49 | */ |
| 50 | void addOrUpdateXconnect(DeviceId deviceId, VlanId vlanId, Set<PortNumber> ports); |
| 51 | |
| 52 | /** |
| 53 | * Deletes Xconnect. |
| 54 | * |
| 55 | * @param deviceId device ID |
| 56 | * @param vlanId VLAN ID |
| 57 | */ |
| 58 | void removeXonnect(DeviceId deviceId, VlanId vlanId); |
| 59 | |
| 60 | /** |
| 61 | * Gets Xconnects. |
| 62 | * |
| 63 | * @return set of Xconnect descriptions |
| 64 | */ |
| 65 | Set<XconnectDesc> getXconnects(); |
| 66 | |
| 67 | /** |
| 68 | * Check if there is Xconnect configured on given connect point. |
| 69 | * |
| 70 | * @param cp connect point |
| 71 | * @return true if there is Xconnect configured on the connect point |
| 72 | */ |
| 73 | boolean hasXconnect(ConnectPoint cp); |
| 74 | |
Charles Chan | d5814aa | 2018-08-19 19:21:46 -0700 | [diff] [blame] | 75 | /** |
| 76 | * Returns the Xconnect next objective store. |
| 77 | * |
| 78 | * @return current contents of the xconnectNextObjStore |
| 79 | */ |
Charles Chan | 3e56d9f | 2018-09-21 11:29:12 -0700 | [diff] [blame] | 80 | ImmutableMap<XconnectKey, Integer> getNext(); |
Charles Chan | d5814aa | 2018-08-19 19:21:46 -0700 | [diff] [blame] | 81 | |
| 82 | /** |
| 83 | * Removes given next ID from Xconnect next objective store. |
| 84 | * |
| 85 | * @param nextId next ID |
| 86 | */ |
| 87 | void removeNextId(int nextId); |
| 88 | |
Charles Chan | c7b3c45 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 89 | } |