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