sangho | 1e57565 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
sangho | 1e57565 | 2015-05-14 00:39:53 -0700 | [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.segmentrouting; |
| 17 | |
Charles Chan | c7b3c45 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 18 | import com.google.common.annotations.Beta; |
Pier | b1fe738 | 2018-04-17 17:25:22 +0200 | [diff] [blame] | 19 | import com.google.common.collect.Multimap; |
Charles Chan | c7b3c45 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 20 | import org.apache.commons.lang3.NotImplementedException; |
Pier Luigi | b29144d | 2018-01-15 18:06:43 +0100 | [diff] [blame] | 21 | import org.onlab.packet.IpAddress; |
Pier Ventre | 10bd8d1 | 2016-11-26 21:05:22 -0800 | [diff] [blame] | 22 | import org.onlab.packet.IpPrefix; |
Charles Chan | c7b3c45 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 23 | import org.onlab.packet.VlanId; |
Pier | 96f63cb | 2018-04-17 16:29:56 +0200 | [diff] [blame] | 24 | import org.onosproject.cluster.NodeId; |
Charles Chan | c7b3c45 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 25 | import org.onosproject.core.ApplicationId; |
Pier Luigi | b29144d | 2018-01-15 18:06:43 +0100 | [diff] [blame] | 26 | import org.onosproject.net.ConnectPoint; |
Charles Chan | c81c45b | 2016-10-20 17:02:44 -0700 | [diff] [blame] | 27 | import org.onosproject.net.DeviceId; |
Saurav Das | c568c34 | 2018-01-25 09:49:01 -0800 | [diff] [blame] | 28 | import org.onosproject.net.Link; |
| 29 | import org.onosproject.net.PortNumber; |
Saurav Das | 7bcbe70 | 2017-06-13 15:35:54 -0700 | [diff] [blame] | 30 | import org.onosproject.segmentrouting.grouphandler.NextNeighbors; |
Pier Luigi | 96fe077 | 2018-02-28 12:10:50 +0100 | [diff] [blame] | 31 | import org.onosproject.segmentrouting.mcast.McastRole; |
Pier | 3e79375 | 2018-04-19 16:47:06 +0200 | [diff] [blame] | 32 | import org.onosproject.segmentrouting.mcast.McastRoleStoreKey; |
Andreas Pantelopoulos | ff691b7 | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 33 | import org.onosproject.segmentrouting.pwaas.DefaultL2TunnelDescription; |
Andreas Pantelopoulos | b21547d | 2018-02-22 12:32:42 -0800 | [diff] [blame] | 34 | import org.onosproject.segmentrouting.pwaas.L2Tunnel; |
Andreas Pantelopoulos | 27532cd | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 35 | import org.onosproject.segmentrouting.pwaas.L2TunnelHandler; |
Andreas Pantelopoulos | b21547d | 2018-02-22 12:32:42 -0800 | [diff] [blame] | 36 | import org.onosproject.segmentrouting.pwaas.L2TunnelPolicy; |
Andreas Pantelopoulos | cd33959 | 2018-02-23 14:18:00 -0800 | [diff] [blame] | 37 | import org.onosproject.segmentrouting.pwaas.L2TunnelDescription; |
Saurav Das | 7bcbe70 | 2017-06-13 15:35:54 -0700 | [diff] [blame] | 38 | import org.onosproject.segmentrouting.storekey.DestinationSetNextObjectiveStoreKey; |
Saurav Das | c88d466 | 2017-05-15 15:34:25 -0700 | [diff] [blame] | 39 | |
| 40 | import com.google.common.collect.ImmutableMap; |
Pier | 3e79375 | 2018-04-19 16:47:06 +0200 | [diff] [blame] | 41 | import org.onosproject.segmentrouting.mcast.McastStoreKey; |
Charles Chan | c81c45b | 2016-10-20 17:02:44 -0700 | [diff] [blame] | 42 | |
sangho | 1e57565 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 43 | import java.util.List; |
Charles Chan | c81c45b | 2016-10-20 17:02:44 -0700 | [diff] [blame] | 44 | import java.util.Map; |
Charles Chan | c7b3c45 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 45 | import java.util.Optional; |
Charles Chan | c81c45b | 2016-10-20 17:02:44 -0700 | [diff] [blame] | 46 | import java.util.Set; |
sangho | 1e57565 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 47 | |
| 48 | /** |
| 49 | * Segment Routing Service for REST API. |
| 50 | */ |
| 51 | public interface SegmentRoutingService { |
Charles Chan | 5270ed0 | 2016-01-30 23:22:37 -0800 | [diff] [blame] | 52 | /** |
Charles Chan | f76de30 | 2018-06-15 18:54:18 -0700 | [diff] [blame] | 53 | * VLAN cross-connect ACL priority. |
Charles Chan | c7b3c45 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 54 | * |
| 55 | * @deprecated in ONOS 1.12. Replaced by {@link org.onosproject.segmentrouting.xconnect.api.XconnectService} |
Charles Chan | f76de30 | 2018-06-15 18:54:18 -0700 | [diff] [blame] | 56 | */ |
Charles Chan | c7b3c45 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 57 | @Deprecated |
Charles Chan | f76de30 | 2018-06-15 18:54:18 -0700 | [diff] [blame] | 58 | int XCONNECT_ACL_PRIORITY = 60000; |
| 59 | |
| 60 | /** |
| 61 | * VLAN cross-connect Bridging priority. |
Charles Chan | c7b3c45 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 62 | * |
| 63 | * @deprecated in ONOS 1.12. Replaced by {@link org.onosproject.segmentrouting.xconnect.api.XconnectService} |
Charles Chan | 5270ed0 | 2016-01-30 23:22:37 -0800 | [diff] [blame] | 64 | */ |
Charles Chan | c7b3c45 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 65 | @Deprecated |
Charles Chan | 5270ed0 | 2016-01-30 23:22:37 -0800 | [diff] [blame] | 66 | int XCONNECT_PRIORITY = 1000; |
| 67 | |
| 68 | /** |
| 69 | * Default flow priority. |
| 70 | */ |
| 71 | int DEFAULT_PRIORITY = 100; |
| 72 | |
| 73 | /** |
| 74 | * Minimum IP priority. |
| 75 | * |
Charles Chan | b54e8ba | 2016-02-18 10:43:46 -0800 | [diff] [blame] | 76 | * Should < 0 such that priority of /0 will not conflict with lowest |
Charles Chan | 5270ed0 | 2016-01-30 23:22:37 -0800 | [diff] [blame] | 77 | * priority default entries. |
| 78 | */ |
| 79 | int MIN_IP_PRIORITY = 10; |
| 80 | |
| 81 | /** |
| 82 | * Subnet flooding flow priority. |
| 83 | */ |
| 84 | int FLOOD_PRIORITY = 5; |
| 85 | |
sangho | 1e57565 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 86 | /** |
| 87 | * Returns all tunnels. |
| 88 | * |
| 89 | * @return list of tunnels |
| 90 | */ |
| 91 | List<Tunnel> getTunnels(); |
| 92 | |
| 93 | /** |
| 94 | * Creates a tunnel. |
| 95 | * |
| 96 | * @param tunnel tunnel reference to create |
sangho | 71abe1b | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 97 | * @return WRONG_PATH if the tunnel path is wrong, ID_EXISTS if the tunnel ID |
| 98 | * exists already, TUNNEL_EXISTS if the same tunnel exists, INTERNAL_ERROR |
| 99 | * if the tunnel creation failed internally, SUCCESS if the tunnel is created |
| 100 | * successfully |
sangho | 1e57565 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 101 | */ |
sangho | 71abe1b | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 102 | TunnelHandler.Result createTunnel(Tunnel tunnel); |
sangho | 1e57565 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 103 | |
| 104 | /** |
| 105 | * Returns all policies. |
| 106 | * |
| 107 | * @return list of policy |
| 108 | */ |
| 109 | List<Policy> getPolicies(); |
| 110 | |
| 111 | /** |
Andreas Pantelopoulos | ff691b7 | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 112 | * Returns the l2 tunnel descriptions. |
| 113 | * |
Andreas Pantelopoulos | 811bbae | 2018-03-15 16:56:09 -0700 | [diff] [blame] | 114 | * @param pending if true fetch pending pseudowires, else fetch installed |
Andreas Pantelopoulos | ff691b7 | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 115 | * @return set of l2 tunnel descriptions. |
| 116 | */ |
Andreas Pantelopoulos | 811bbae | 2018-03-15 16:56:09 -0700 | [diff] [blame] | 117 | Set<L2TunnelDescription> getL2TunnelDescriptions(boolean pending); |
Andreas Pantelopoulos | ff691b7 | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 118 | |
| 119 | /** |
Andreas Pantelopoulos | 27532cd | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 120 | * Returns all l2 tunnels of pseudowires. |
| 121 | * |
| 122 | * @return list of l2 tunnels |
| 123 | */ |
Andreas Pantelopoulos | b21547d | 2018-02-22 12:32:42 -0800 | [diff] [blame] | 124 | List<L2Tunnel> getL2Tunnels(); |
Andreas Pantelopoulos | 27532cd | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 125 | |
| 126 | /** |
| 127 | * Returns all l2 policie of pseudowires. |
| 128 | * |
| 129 | * @return list of l2 policies. |
| 130 | */ |
Andreas Pantelopoulos | b21547d | 2018-02-22 12:32:42 -0800 | [diff] [blame] | 131 | List<L2TunnelPolicy> getL2Policies(); |
Andreas Pantelopoulos | 27532cd | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 132 | |
| 133 | /** |
Andreas Pantelopoulos | ff691b7 | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 134 | * Removes pseudowire. |
Andreas Pantelopoulos | 27532cd | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 135 | * |
Andreas Pantelopoulos | cd33959 | 2018-02-23 14:18:00 -0800 | [diff] [blame] | 136 | * @param pwId The id of the pseudowire. |
Andreas Pantelopoulos | 27532cd | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 137 | * @return SUCCESS if operation successful or a descriptive error otherwise. |
| 138 | */ |
Andreas Pantelopoulos | cd33959 | 2018-02-23 14:18:00 -0800 | [diff] [blame] | 139 | L2TunnelHandler.Result removePseudowire(Integer pwId); |
Andreas Pantelopoulos | 27532cd | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 140 | |
| 141 | /** |
Andreas Pantelopoulos | ff691b7 | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 142 | * Adds a Pseudowire to the system. |
Andreas Pantelopoulos | 27532cd | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 143 | * |
Andreas Pantelopoulos | cd33959 | 2018-02-23 14:18:00 -0800 | [diff] [blame] | 144 | * @param tunnel The pseudowire tunnel. |
Andreas Pantelopoulos | 27532cd | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 145 | * @return SUCCESS if operation is successful or a descriptive error otherwise. |
| 146 | */ |
Andreas Pantelopoulos | cd33959 | 2018-02-23 14:18:00 -0800 | [diff] [blame] | 147 | L2TunnelHandler.Result addPseudowire(L2TunnelDescription tunnel); |
Andreas Pantelopoulos | 27532cd | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 148 | |
| 149 | /** |
Andreas Pantelopoulos | ffe6974 | 2018-03-20 13:58:49 -0700 | [diff] [blame] | 150 | * Adds a set of pseudowires. |
| 151 | * |
| 152 | * |
Andreas Pantelopoulos | ff691b7 | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 153 | * @param l2TunnelDescriptions The pseudowires to add. |
| 154 | * @return SUCCESS if ALL pseudowires can be instantiated and are deployed, or a |
| 155 | * a descriptive error otherwise, without deploying any pseudowire. |
Andreas Pantelopoulos | ffe6974 | 2018-03-20 13:58:49 -0700 | [diff] [blame] | 156 | * @deprecated onos-1.12 use addPseudowire instead |
Andreas Pantelopoulos | ff691b7 | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 157 | */ |
Andreas Pantelopoulos | ffe6974 | 2018-03-20 13:58:49 -0700 | [diff] [blame] | 158 | @Deprecated |
Andreas Pantelopoulos | ff691b7 | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 159 | L2TunnelHandler.Result addPseudowiresBulk(List<DefaultL2TunnelDescription> l2TunnelDescriptions); |
| 160 | |
| 161 | /** |
sangho | 1e57565 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 162 | * Creates a policy. |
| 163 | * |
| 164 | * @param policy policy reference to create |
sangho | 71abe1b | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 165 | * @return ID_EXISTS if the same policy ID exists, |
| 166 | * POLICY_EXISTS if the same policy exists, TUNNEL_NOT_FOUND if the tunnel |
| 167 | * does not exists, UNSUPPORTED_TYPE if the policy type is not supported, |
| 168 | * SUCCESS if the policy is created successfully. |
sangho | 1e57565 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 169 | */ |
sangho | 71abe1b | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 170 | PolicyHandler.Result createPolicy(Policy policy); |
sangho | 1e57565 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 171 | |
| 172 | /** |
| 173 | * Removes a tunnel. |
| 174 | * |
| 175 | * @param tunnel tunnel reference to remove |
sangho | 71abe1b | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 176 | * @return TUNNEL_NOT_FOUND if the tunnel to remove does not exists, |
| 177 | * INTERNAL_ERROR if the tunnel creation failed internally, SUCCESS |
| 178 | * if the tunnel is created successfully. |
sangho | 1e57565 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 179 | */ |
sangho | 71abe1b | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 180 | TunnelHandler.Result removeTunnel(Tunnel tunnel); |
sangho | 1e57565 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 181 | |
| 182 | /** |
| 183 | * Removes a policy. |
| 184 | * |
| 185 | * @param policy policy reference to remove |
sangho | 71abe1b | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 186 | * @return POLICY_NOT_FOUND if the policy to remove does not exists, |
| 187 | * SUCCESS if it is removed successfully |
sangho | 1e57565 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 188 | */ |
sangho | 71abe1b | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 189 | PolicyHandler.Result removePolicy(Policy policy); |
Saurav Das | 59232cf | 2016-04-27 18:35:50 -0700 | [diff] [blame] | 190 | |
| 191 | /** |
| 192 | * Use current state of the network to repopulate forwarding rules. |
| 193 | * |
| 194 | */ |
| 195 | void rerouteNetwork(); |
Charles Chan | c81c45b | 2016-10-20 17:02:44 -0700 | [diff] [blame] | 196 | |
| 197 | /** |
| 198 | * Returns device-subnet mapping. |
| 199 | * |
| 200 | * @return device-subnet mapping |
| 201 | */ |
Pier Ventre | 10bd8d1 | 2016-11-26 21:05:22 -0800 | [diff] [blame] | 202 | Map<DeviceId, Set<IpPrefix>> getDeviceSubnetMap(); |
Saurav Das | c88d466 | 2017-05-15 15:34:25 -0700 | [diff] [blame] | 203 | |
| 204 | /** |
| 205 | * Returns the current ECMP shortest path graph in this controller instance. |
| 206 | * |
| 207 | * @return ECMP shortest path graph |
| 208 | */ |
| 209 | ImmutableMap<DeviceId, EcmpShortestPathGraph> getCurrentEcmpSpg(); |
| 210 | |
| 211 | /** |
Saurav Das | 7bcbe70 | 2017-06-13 15:35:54 -0700 | [diff] [blame] | 212 | * Returns the destinatiomSet-NextObjective store contents. |
Saurav Das | c88d466 | 2017-05-15 15:34:25 -0700 | [diff] [blame] | 213 | * |
Saurav Das | 7bcbe70 | 2017-06-13 15:35:54 -0700 | [diff] [blame] | 214 | * @return current contents of the destinationSetNextObjectiveStore |
Saurav Das | c88d466 | 2017-05-15 15:34:25 -0700 | [diff] [blame] | 215 | */ |
Saurav Das | 7bcbe70 | 2017-06-13 15:35:54 -0700 | [diff] [blame] | 216 | ImmutableMap<DestinationSetNextObjectiveStoreKey, NextNeighbors> getDestinationSet(); |
Saurav Das | ceccf24 | 2017-08-03 18:30:35 -0700 | [diff] [blame] | 217 | |
| 218 | /** |
| 219 | * Triggers the verification of all ECMP groups in the specified device. |
| 220 | * Adjusts the group buckets if verification finds that there are more or less |
| 221 | * buckets than what should be there. |
| 222 | * |
| 223 | * @param id the device identifier |
| 224 | */ |
| 225 | void verifyGroups(DeviceId id); |
Saurav Das | c568c34 | 2018-01-25 09:49:01 -0800 | [diff] [blame] | 226 | |
| 227 | /** |
| 228 | * Returns the internal link state as seen by this instance of the |
| 229 | * controller. |
| 230 | * |
| 231 | * @return the internal link state |
| 232 | */ |
| 233 | ImmutableMap<Link, Boolean> getSeenLinks(); |
| 234 | |
| 235 | /** |
| 236 | * Returns the ports administratively disabled by the controller. |
| 237 | * |
| 238 | * @return a map of devices and port numbers for administratively disabled |
| 239 | * ports. Does not include ports manually disabled by the operator. |
| 240 | */ |
| 241 | ImmutableMap<DeviceId, Set<PortNumber>> getDownedPortState(); |
Pier Luigi | b29144d | 2018-01-15 18:06:43 +0100 | [diff] [blame] | 242 | |
Pier | 3e79375 | 2018-04-19 16:47:06 +0200 | [diff] [blame] | 243 | /** |
Pier Luigi | b29144d | 2018-01-15 18:06:43 +0100 | [diff] [blame] | 244 | * Returns the associated next ids to the mcast groups or to the single |
| 245 | * group if mcastIp is present. |
| 246 | * |
| 247 | * @param mcastIp the group ip |
| 248 | * @return the mapping mcastIp-device to next id |
| 249 | */ |
| 250 | Map<McastStoreKey, Integer> getMcastNextIds(IpAddress mcastIp); |
| 251 | |
| 252 | /** |
| 253 | * Returns the associated roles to the mcast groups or to the single |
| 254 | * group if mcastIp is present. |
| 255 | * |
| 256 | * @param mcastIp the group ip |
| 257 | * @return the mapping mcastIp-device to mcast role |
Pier | b1fe738 | 2018-04-17 17:25:22 +0200 | [diff] [blame] | 258 | * |
| 259 | * @deprecated in 1.12 ("Magpie") release. |
Pier Luigi | b29144d | 2018-01-15 18:06:43 +0100 | [diff] [blame] | 260 | */ |
Pier | b1fe738 | 2018-04-17 17:25:22 +0200 | [diff] [blame] | 261 | @Deprecated |
Pier Luigi | 96fe077 | 2018-02-28 12:10:50 +0100 | [diff] [blame] | 262 | Map<McastStoreKey, McastRole> getMcastRoles(IpAddress mcastIp); |
Pier Luigi | b29144d | 2018-01-15 18:06:43 +0100 | [diff] [blame] | 263 | |
| 264 | /** |
Pier | 3e79375 | 2018-04-19 16:47:06 +0200 | [diff] [blame] | 265 | * Returns the associated roles to the mcast groups. |
| 266 | * |
| 267 | * @param mcastIp the group ip |
| 268 | * @param sourcecp the source connect point |
| 269 | * @return the mapping mcastIp-device to mcast role |
| 270 | */ |
| 271 | Map<McastRoleStoreKey, McastRole> getMcastRoles(IpAddress mcastIp, |
| 272 | ConnectPoint sourcecp); |
| 273 | |
| 274 | /** |
Pier Luigi | b29144d | 2018-01-15 18:06:43 +0100 | [diff] [blame] | 275 | * Returns the associated paths to the mcast group. |
| 276 | * |
| 277 | * @param mcastIp the group ip |
| 278 | * @return the mapping egress point to mcast path |
Pier | b1fe738 | 2018-04-17 17:25:22 +0200 | [diff] [blame] | 279 | * |
| 280 | * @deprecated in 1.12 ("Magpie") release. |
Pier Luigi | b29144d | 2018-01-15 18:06:43 +0100 | [diff] [blame] | 281 | */ |
Pier | b1fe738 | 2018-04-17 17:25:22 +0200 | [diff] [blame] | 282 | @Deprecated |
Pier Luigi | b29144d | 2018-01-15 18:06:43 +0100 | [diff] [blame] | 283 | Map<ConnectPoint, List<ConnectPoint>> getMcastPaths(IpAddress mcastIp); |
| 284 | |
Pier | b1fe738 | 2018-04-17 17:25:22 +0200 | [diff] [blame] | 285 | /** |
| 286 | * Returns the associated trees to the mcast group. |
| 287 | * |
| 288 | * @param mcastIp the group ip |
| 289 | * @param sourcecp the source connect point |
| 290 | * @return the mapping egress point to mcast path |
| 291 | */ |
| 292 | Multimap<ConnectPoint, List<ConnectPoint>> getMcastTrees(IpAddress mcastIp, |
| 293 | ConnectPoint sourcecp); |
| 294 | |
Pier | 96f63cb | 2018-04-17 16:29:56 +0200 | [diff] [blame] | 295 | /** |
| 296 | * Return the leaders of the mcast groups. |
| 297 | * |
| 298 | * @param mcastIp the group ip |
| 299 | * @return the mapping group-node |
| 300 | */ |
| 301 | Map<IpAddress, NodeId> getMcastLeaders(IpAddress mcastIp); |
Charles Chan | 8bc75ee | 2018-04-17 18:56:53 -0700 | [diff] [blame] | 302 | |
| 303 | /** |
| 304 | * Returns shouldProgram map. |
| 305 | * |
| 306 | * @return shouldProgram map |
| 307 | */ |
| 308 | Map<Set<DeviceId>, NodeId> getShouldProgram(); |
| 309 | |
| 310 | /** |
| 311 | * Returns shouldProgram local cache. |
| 312 | * |
| 313 | * @return shouldProgram local cache |
| 314 | */ |
| 315 | Map<DeviceId, Boolean> getShouldProgramCache(); |
Charles Chan | c7b3c45 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 316 | |
| 317 | /** |
| 318 | * Gets application id. |
| 319 | * |
| 320 | * @return application id |
| 321 | */ |
| 322 | default ApplicationId appId() { |
| 323 | throw new NotImplementedException("appId not implemented"); |
| 324 | } |
| 325 | |
| 326 | /** |
| 327 | * Returns internal VLAN for untagged hosts on given connect point. |
| 328 | * <p> |
| 329 | * The internal VLAN is either vlan-untagged for an access port, |
| 330 | * or vlan-native for a trunk port. |
| 331 | * |
| 332 | * @param connectPoint connect point |
| 333 | * @return internal VLAN or null if both vlan-untagged and vlan-native are undefined |
| 334 | */ |
| 335 | @Beta |
| 336 | default VlanId getInternalVlanId(ConnectPoint connectPoint) { |
| 337 | throw new NotImplementedException("getInternalVlanId not implemented"); |
| 338 | } |
| 339 | |
| 340 | |
| 341 | /** |
| 342 | * Returns optional pair device ID of given device. |
| 343 | * |
| 344 | * @param deviceId device ID |
| 345 | * @return optional pair device ID. Might be empty if pair device is not configured |
| 346 | */ |
| 347 | @Beta |
| 348 | default Optional<DeviceId> getPairDeviceId(DeviceId deviceId) { |
| 349 | throw new NotImplementedException("getPairDeviceId not implemented"); |
| 350 | } |
| 351 | |
| 352 | |
| 353 | /** |
| 354 | * Returns optional pair device local port of given device. |
| 355 | * |
| 356 | * @param deviceId device ID |
| 357 | * @return optional pair device ID. Might be empty if pair device is not configured |
| 358 | */ |
| 359 | @Beta |
| 360 | default Optional<PortNumber> getPairLocalPort(DeviceId deviceId) { |
| 361 | throw new NotImplementedException("getPairLocalPort not implemented"); |
| 362 | } |
sangho | 1e57565 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 363 | } |