sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 0947d7e | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
sangho | 27462c6 | 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 | |
Pier | 71c5577 | 2018-04-17 17:25:22 +0200 | [diff] [blame] | 18 | import com.google.common.collect.Multimap; |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 19 | import org.apache.commons.lang3.NotImplementedException; |
Pier Luigi | 0f9635b | 2018-01-15 18:06:43 +0100 | [diff] [blame] | 20 | import org.onlab.packet.IpAddress; |
Pier Ventre | b6a7f34 | 2016-11-26 21:05:22 -0800 | [diff] [blame] | 21 | import org.onlab.packet.IpPrefix; |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 22 | import org.onlab.packet.VlanId; |
Pier | db27b8d | 2018-04-17 16:29:56 +0200 | [diff] [blame] | 23 | import org.onosproject.cluster.NodeId; |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 24 | import org.onosproject.core.ApplicationId; |
Pier Luigi | 0f9635b | 2018-01-15 18:06:43 +0100 | [diff] [blame] | 25 | import org.onosproject.net.ConnectPoint; |
Charles Chan | d7844e5 | 2016-10-20 17:02:44 -0700 | [diff] [blame] | 26 | import org.onosproject.net.DeviceId; |
Saurav Das | 6430f41 | 2018-01-25 09:49:01 -0800 | [diff] [blame] | 27 | import org.onosproject.net.Link; |
| 28 | import org.onosproject.net.PortNumber; |
Charles Chan | 0b1dd7e | 2018-08-19 19:21:46 -0700 | [diff] [blame] | 29 | import org.onosproject.net.flowobjective.NextObjective; |
Saurav Das | 261c300 | 2017-06-13 15:35:54 -0700 | [diff] [blame] | 30 | import org.onosproject.segmentrouting.grouphandler.NextNeighbors; |
Harshada Chaundkar | 9204f31 | 2019-07-02 16:01:24 +0000 | [diff] [blame] | 31 | import org.onosproject.segmentrouting.mcast.McastFilteringObjStoreKey; |
Pier Luigi | 69f774d | 2018-02-28 12:10:50 +0100 | [diff] [blame] | 32 | import org.onosproject.segmentrouting.mcast.McastRole; |
Pier | e99511d | 2018-04-19 16:47:06 +0200 | [diff] [blame] | 33 | import org.onosproject.segmentrouting.mcast.McastRoleStoreKey; |
Andreas Pantelopoulos | fc4bc2a | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 34 | import org.onosproject.segmentrouting.pwaas.DefaultL2TunnelDescription; |
Andreas Pantelopoulos | 4c7de13 | 2018-02-22 12:32:42 -0800 | [diff] [blame] | 35 | import org.onosproject.segmentrouting.pwaas.L2Tunnel; |
Andreas Pantelopoulos | 5e7be3d | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 36 | import org.onosproject.segmentrouting.pwaas.L2TunnelHandler; |
Andreas Pantelopoulos | 4c7de13 | 2018-02-22 12:32:42 -0800 | [diff] [blame] | 37 | import org.onosproject.segmentrouting.pwaas.L2TunnelPolicy; |
Andreas Pantelopoulos | cdbb22c | 2018-02-23 14:18:00 -0800 | [diff] [blame] | 38 | import org.onosproject.segmentrouting.pwaas.L2TunnelDescription; |
Saurav Das | 261c300 | 2017-06-13 15:35:54 -0700 | [diff] [blame] | 39 | import org.onosproject.segmentrouting.storekey.DestinationSetNextObjectiveStoreKey; |
Saurav Das | 62ae679 | 2017-05-15 15:34:25 -0700 | [diff] [blame] | 40 | |
| 41 | import com.google.common.collect.ImmutableMap; |
Pier | e99511d | 2018-04-19 16:47:06 +0200 | [diff] [blame] | 42 | import org.onosproject.segmentrouting.mcast.McastStoreKey; |
Charles Chan | 0b1dd7e | 2018-08-19 19:21:46 -0700 | [diff] [blame] | 43 | import org.onosproject.segmentrouting.storekey.PortNextObjectiveStoreKey; |
| 44 | import org.onosproject.segmentrouting.storekey.VlanNextObjectiveStoreKey; |
Ruchi Sahota | 71bcb4e | 2019-01-28 01:08:18 +0000 | [diff] [blame] | 45 | import org.onosproject.segmentrouting.storekey.MacVlanNextObjectiveStoreKey; |
Charles Chan | d7844e5 | 2016-10-20 17:02:44 -0700 | [diff] [blame] | 46 | |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 47 | import java.util.List; |
Charles Chan | d7844e5 | 2016-10-20 17:02:44 -0700 | [diff] [blame] | 48 | import java.util.Map; |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 49 | import java.util.Optional; |
Charles Chan | d7844e5 | 2016-10-20 17:02:44 -0700 | [diff] [blame] | 50 | import java.util.Set; |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 51 | |
| 52 | /** |
| 53 | * Segment Routing Service for REST API. |
| 54 | */ |
| 55 | public interface SegmentRoutingService { |
Charles Chan | 82ab193 | 2016-01-30 23:22:37 -0800 | [diff] [blame] | 56 | /** |
Charles Chan | 868c957 | 2018-06-15 18:54:18 -0700 | [diff] [blame] | 57 | * VLAN cross-connect ACL priority. |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 58 | * |
| 59 | * @deprecated in ONOS 1.12. Replaced by {@link org.onosproject.segmentrouting.xconnect.api.XconnectService} |
Charles Chan | 868c957 | 2018-06-15 18:54:18 -0700 | [diff] [blame] | 60 | */ |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 61 | @Deprecated |
Charles Chan | 868c957 | 2018-06-15 18:54:18 -0700 | [diff] [blame] | 62 | int XCONNECT_ACL_PRIORITY = 60000; |
| 63 | |
| 64 | /** |
| 65 | * VLAN cross-connect Bridging priority. |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 66 | * |
| 67 | * @deprecated in ONOS 1.12. Replaced by {@link org.onosproject.segmentrouting.xconnect.api.XconnectService} |
Charles Chan | 82ab193 | 2016-01-30 23:22:37 -0800 | [diff] [blame] | 68 | */ |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 69 | @Deprecated |
Charles Chan | 82ab193 | 2016-01-30 23:22:37 -0800 | [diff] [blame] | 70 | int XCONNECT_PRIORITY = 1000; |
| 71 | |
| 72 | /** |
| 73 | * Default flow priority. |
| 74 | */ |
| 75 | int DEFAULT_PRIORITY = 100; |
| 76 | |
| 77 | /** |
| 78 | * Minimum IP priority. |
| 79 | * |
Charles Chan | d86904c | 2016-02-18 10:43:46 -0800 | [diff] [blame] | 80 | * Should < 0 such that priority of /0 will not conflict with lowest |
Charles Chan | 82ab193 | 2016-01-30 23:22:37 -0800 | [diff] [blame] | 81 | * priority default entries. |
| 82 | */ |
| 83 | int MIN_IP_PRIORITY = 10; |
| 84 | |
| 85 | /** |
| 86 | * Subnet flooding flow priority. |
| 87 | */ |
| 88 | int FLOOD_PRIORITY = 5; |
| 89 | |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 90 | /** |
| 91 | * Returns all tunnels. |
| 92 | * |
| 93 | * @return list of tunnels |
| 94 | */ |
| 95 | List<Tunnel> getTunnels(); |
| 96 | |
| 97 | /** |
| 98 | * Creates a tunnel. |
| 99 | * |
| 100 | * @param tunnel tunnel reference to create |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 101 | * @return WRONG_PATH if the tunnel path is wrong, ID_EXISTS if the tunnel ID |
| 102 | * exists already, TUNNEL_EXISTS if the same tunnel exists, INTERNAL_ERROR |
| 103 | * if the tunnel creation failed internally, SUCCESS if the tunnel is created |
| 104 | * successfully |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 105 | */ |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 106 | TunnelHandler.Result createTunnel(Tunnel tunnel); |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 107 | |
| 108 | /** |
| 109 | * Returns all policies. |
| 110 | * |
| 111 | * @return list of policy |
| 112 | */ |
| 113 | List<Policy> getPolicies(); |
| 114 | |
| 115 | /** |
Andreas Pantelopoulos | fc4bc2a | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 116 | * Returns the l2 tunnel descriptions. |
| 117 | * |
Andreas Pantelopoulos | d988c1a | 2018-03-15 16:56:09 -0700 | [diff] [blame] | 118 | * @param pending if true fetch pending pseudowires, else fetch installed |
Andreas Pantelopoulos | fc4bc2a | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 119 | * @return set of l2 tunnel descriptions. |
| 120 | */ |
Andreas Pantelopoulos | d988c1a | 2018-03-15 16:56:09 -0700 | [diff] [blame] | 121 | Set<L2TunnelDescription> getL2TunnelDescriptions(boolean pending); |
Andreas Pantelopoulos | fc4bc2a | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 122 | |
| 123 | /** |
Andreas Pantelopoulos | 5e7be3d | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 124 | * Returns all l2 tunnels of pseudowires. |
| 125 | * |
| 126 | * @return list of l2 tunnels |
| 127 | */ |
Andreas Pantelopoulos | 4c7de13 | 2018-02-22 12:32:42 -0800 | [diff] [blame] | 128 | List<L2Tunnel> getL2Tunnels(); |
Andreas Pantelopoulos | 5e7be3d | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 129 | |
| 130 | /** |
| 131 | * Returns all l2 policie of pseudowires. |
| 132 | * |
| 133 | * @return list of l2 policies. |
| 134 | */ |
Andreas Pantelopoulos | 4c7de13 | 2018-02-22 12:32:42 -0800 | [diff] [blame] | 135 | List<L2TunnelPolicy> getL2Policies(); |
Andreas Pantelopoulos | 5e7be3d | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 136 | |
| 137 | /** |
Andreas Pantelopoulos | fc4bc2a | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 138 | * Removes pseudowire. |
Andreas Pantelopoulos | 5e7be3d | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 139 | * |
Andreas Pantelopoulos | cdbb22c | 2018-02-23 14:18:00 -0800 | [diff] [blame] | 140 | * @param pwId The id of the pseudowire. |
Andreas Pantelopoulos | 5e7be3d | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 141 | * @return SUCCESS if operation successful or a descriptive error otherwise. |
| 142 | */ |
Andreas Pantelopoulos | cdbb22c | 2018-02-23 14:18:00 -0800 | [diff] [blame] | 143 | L2TunnelHandler.Result removePseudowire(Integer pwId); |
Andreas Pantelopoulos | 5e7be3d | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 144 | |
| 145 | /** |
Andreas Pantelopoulos | fc4bc2a | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 146 | * Adds a Pseudowire to the system. |
Andreas Pantelopoulos | 5e7be3d | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 147 | * |
Andreas Pantelopoulos | cdbb22c | 2018-02-23 14:18:00 -0800 | [diff] [blame] | 148 | * @param tunnel The pseudowire tunnel. |
Andreas Pantelopoulos | 5e7be3d | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 149 | * @return SUCCESS if operation is successful or a descriptive error otherwise. |
| 150 | */ |
Andreas Pantelopoulos | cdbb22c | 2018-02-23 14:18:00 -0800 | [diff] [blame] | 151 | L2TunnelHandler.Result addPseudowire(L2TunnelDescription tunnel); |
Andreas Pantelopoulos | 5e7be3d | 2017-10-23 12:18:25 -0700 | [diff] [blame] | 152 | |
| 153 | /** |
Andreas Pantelopoulos | 9685125 | 2018-03-20 13:58:49 -0700 | [diff] [blame] | 154 | * Adds a set of pseudowires. |
| 155 | * |
| 156 | * |
Andreas Pantelopoulos | fc4bc2a | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 157 | * @param l2TunnelDescriptions The pseudowires to add. |
| 158 | * @return SUCCESS if ALL pseudowires can be instantiated and are deployed, or a |
| 159 | * a descriptive error otherwise, without deploying any pseudowire. |
Andreas Pantelopoulos | 9685125 | 2018-03-20 13:58:49 -0700 | [diff] [blame] | 160 | * @deprecated onos-1.12 use addPseudowire instead |
Andreas Pantelopoulos | fc4bc2a | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 161 | */ |
Andreas Pantelopoulos | 9685125 | 2018-03-20 13:58:49 -0700 | [diff] [blame] | 162 | @Deprecated |
Andreas Pantelopoulos | fc4bc2a | 2018-03-12 16:30:20 -0700 | [diff] [blame] | 163 | L2TunnelHandler.Result addPseudowiresBulk(List<DefaultL2TunnelDescription> l2TunnelDescriptions); |
| 164 | |
| 165 | /** |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 166 | * Creates a policy. |
| 167 | * |
| 168 | * @param policy policy reference to create |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 169 | * @return ID_EXISTS if the same policy ID exists, |
| 170 | * POLICY_EXISTS if the same policy exists, TUNNEL_NOT_FOUND if the tunnel |
| 171 | * does not exists, UNSUPPORTED_TYPE if the policy type is not supported, |
| 172 | * SUCCESS if the policy is created successfully. |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 173 | */ |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 174 | PolicyHandler.Result createPolicy(Policy policy); |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 175 | |
| 176 | /** |
| 177 | * Removes a tunnel. |
| 178 | * |
| 179 | * @param tunnel tunnel reference to remove |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 180 | * @return TUNNEL_NOT_FOUND if the tunnel to remove does not exists, |
| 181 | * INTERNAL_ERROR if the tunnel creation failed internally, SUCCESS |
| 182 | * if the tunnel is created successfully. |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 183 | */ |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 184 | TunnelHandler.Result removeTunnel(Tunnel tunnel); |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 185 | |
| 186 | /** |
| 187 | * Removes a policy. |
| 188 | * |
| 189 | * @param policy policy reference to remove |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 190 | * @return POLICY_NOT_FOUND if the policy to remove does not exists, |
| 191 | * SUCCESS if it is removed successfully |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 192 | */ |
sangho | bd812f8 | 2015-06-29 14:58:47 -0700 | [diff] [blame] | 193 | PolicyHandler.Result removePolicy(Policy policy); |
Saurav Das | 07c7460 | 2016-04-27 18:35:50 -0700 | [diff] [blame] | 194 | |
| 195 | /** |
| 196 | * Use current state of the network to repopulate forwarding rules. |
| 197 | * |
| 198 | */ |
| 199 | void rerouteNetwork(); |
Charles Chan | d7844e5 | 2016-10-20 17:02:44 -0700 | [diff] [blame] | 200 | |
| 201 | /** |
| 202 | * Returns device-subnet mapping. |
| 203 | * |
| 204 | * @return device-subnet mapping |
| 205 | */ |
Pier Ventre | b6a7f34 | 2016-11-26 21:05:22 -0800 | [diff] [blame] | 206 | Map<DeviceId, Set<IpPrefix>> getDeviceSubnetMap(); |
Saurav Das | 62ae679 | 2017-05-15 15:34:25 -0700 | [diff] [blame] | 207 | |
| 208 | /** |
| 209 | * Returns the current ECMP shortest path graph in this controller instance. |
| 210 | * |
| 211 | * @return ECMP shortest path graph |
| 212 | */ |
| 213 | ImmutableMap<DeviceId, EcmpShortestPathGraph> getCurrentEcmpSpg(); |
| 214 | |
| 215 | /** |
Saurav Das | 261c300 | 2017-06-13 15:35:54 -0700 | [diff] [blame] | 216 | * Returns the destinatiomSet-NextObjective store contents. |
Saurav Das | 62ae679 | 2017-05-15 15:34:25 -0700 | [diff] [blame] | 217 | * |
Charles Chan | 0b1dd7e | 2018-08-19 19:21:46 -0700 | [diff] [blame] | 218 | * @return current contents of the dstNextObjStore |
Saurav Das | 62ae679 | 2017-05-15 15:34:25 -0700 | [diff] [blame] | 219 | */ |
Charles Chan | 0b1dd7e | 2018-08-19 19:21:46 -0700 | [diff] [blame] | 220 | ImmutableMap<DestinationSetNextObjectiveStoreKey, NextNeighbors> getDstNextObjStore(); |
| 221 | |
| 222 | /** |
| 223 | * Returns the VLAN next objective store. |
| 224 | * |
| 225 | * @return current contents of the vlanNextObjStore |
| 226 | */ |
| 227 | ImmutableMap<VlanNextObjectiveStoreKey, Integer> getVlanNextObjStore(); |
| 228 | |
| 229 | /** |
Ruchi Sahota | 71bcb4e | 2019-01-28 01:08:18 +0000 | [diff] [blame] | 230 | * Returns the Mac Vlan next objective store. |
| 231 | * |
| 232 | * @return current contents of the macVlanNextObjStore |
| 233 | */ |
| 234 | ImmutableMap<MacVlanNextObjectiveStoreKey, Integer> getMacVlanNextObjStore(); |
| 235 | |
| 236 | /** |
Charles Chan | 0b1dd7e | 2018-08-19 19:21:46 -0700 | [diff] [blame] | 237 | * Returns the port next objective store. |
| 238 | * |
| 239 | * @return current contents of the portNextObjStore |
| 240 | */ |
| 241 | ImmutableMap<PortNextObjectiveStoreKey, Integer> getPortNextObjStore(); |
| 242 | |
| 243 | /** |
| 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 PW init next objective store. |
| 254 | * |
| 255 | * @return current contents of the l2InitiationNextObjStore |
| 256 | */ |
| 257 | ImmutableMap<String, NextObjective> getPwInitNext(); |
| 258 | |
| 259 | /** |
| 260 | * Returns the PW termination next objective store. |
| 261 | * |
| 262 | * @return current contents of the l2TerminationNextObjStore |
| 263 | */ |
| 264 | ImmutableMap<String, NextObjective> getPwTermNext(); |
| 265 | |
| 266 | /** |
| 267 | * Removes all entries in dst/vlan/port/mcast NextObjectiveStore that are associated with the given nextId. |
| 268 | * |
| 269 | * @param nextId nextId |
| 270 | */ |
| 271 | void invalidateNextObj(int nextId); |
Saurav Das | fbe7457 | 2017-08-03 18:30:35 -0700 | [diff] [blame] | 272 | |
| 273 | /** |
| 274 | * Triggers the verification of all ECMP groups in the specified device. |
| 275 | * Adjusts the group buckets if verification finds that there are more or less |
| 276 | * buckets than what should be there. |
| 277 | * |
| 278 | * @param id the device identifier |
| 279 | */ |
| 280 | void verifyGroups(DeviceId id); |
Saurav Das | 6430f41 | 2018-01-25 09:49:01 -0800 | [diff] [blame] | 281 | |
| 282 | /** |
| 283 | * Returns the internal link state as seen by this instance of the |
| 284 | * controller. |
| 285 | * |
| 286 | * @return the internal link state |
| 287 | */ |
| 288 | ImmutableMap<Link, Boolean> getSeenLinks(); |
| 289 | |
| 290 | /** |
| 291 | * Returns the ports administratively disabled by the controller. |
| 292 | * |
| 293 | * @return a map of devices and port numbers for administratively disabled |
| 294 | * ports. Does not include ports manually disabled by the operator. |
| 295 | */ |
| 296 | ImmutableMap<DeviceId, Set<PortNumber>> getDownedPortState(); |
Pier Luigi | 0f9635b | 2018-01-15 18:06:43 +0100 | [diff] [blame] | 297 | |
Pier | e99511d | 2018-04-19 16:47:06 +0200 | [diff] [blame] | 298 | /** |
Pier | e99511d | 2018-04-19 16:47:06 +0200 | [diff] [blame] | 299 | * Returns the associated roles to the mcast groups. |
| 300 | * |
| 301 | * @param mcastIp the group ip |
| 302 | * @param sourcecp the source connect point |
| 303 | * @return the mapping mcastIp-device to mcast role |
| 304 | */ |
| 305 | Map<McastRoleStoreKey, McastRole> getMcastRoles(IpAddress mcastIp, |
| 306 | ConnectPoint sourcecp); |
| 307 | |
| 308 | /** |
Pier | 71c5577 | 2018-04-17 17:25:22 +0200 | [diff] [blame] | 309 | * Returns the associated trees to the mcast group. |
| 310 | * |
| 311 | * @param mcastIp the group ip |
| 312 | * @param sourcecp the source connect point |
| 313 | * @return the mapping egress point to mcast path |
| 314 | */ |
| 315 | Multimap<ConnectPoint, List<ConnectPoint>> getMcastTrees(IpAddress mcastIp, |
| 316 | ConnectPoint sourcecp); |
| 317 | |
Pier | db27b8d | 2018-04-17 16:29:56 +0200 | [diff] [blame] | 318 | /** |
| 319 | * Return the leaders of the mcast groups. |
| 320 | * |
| 321 | * @param mcastIp the group ip |
| 322 | * @return the mapping group-node |
| 323 | */ |
| 324 | Map<IpAddress, NodeId> getMcastLeaders(IpAddress mcastIp); |
Charles Chan | b13e070 | 2018-04-17 18:56:53 -0700 | [diff] [blame] | 325 | |
| 326 | /** |
| 327 | * Returns shouldProgram map. |
| 328 | * |
| 329 | * @return shouldProgram map |
| 330 | */ |
| 331 | Map<Set<DeviceId>, NodeId> getShouldProgram(); |
| 332 | |
| 333 | /** |
| 334 | * Returns shouldProgram local cache. |
| 335 | * |
| 336 | * @return shouldProgram local cache |
| 337 | */ |
| 338 | Map<DeviceId, Boolean> getShouldProgramCache(); |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 339 | |
| 340 | /** |
jayakumarthazhath | 66c9ec1 | 2018-10-01 00:51:54 +0530 | [diff] [blame] | 341 | * Returns whether instance should program device or not. |
| 342 | * |
| 343 | * @param deviceId . |
| 344 | * @return boolean status saying instance should program device or not. |
| 345 | */ |
| 346 | boolean shouldProgram(DeviceId deviceId); |
| 347 | |
| 348 | /** |
Harshada Chaundkar | 9204f31 | 2019-07-02 16:01:24 +0000 | [diff] [blame] | 349 | * Returns the mcast filtering obj. |
| 350 | * |
| 351 | * @return the mapping group-node |
| 352 | */ |
| 353 | Map<DeviceId, List<McastFilteringObjStoreKey>> getMcastFilters(); |
| 354 | |
| 355 | /** |
Charles Chan | 12a8a84 | 2020-02-14 13:23:57 -0800 | [diff] [blame] | 356 | * Determines if routing in the network has been stable in the last |
| 357 | * STABILITY_THRESHOLD seconds, by comparing the current time to the last |
| 358 | * routing change timestamp. |
| 359 | * |
| 360 | * @return true if stable |
| 361 | */ |
| 362 | boolean isRoutingStable(); |
| 363 | |
| 364 | /** |
| 365 | * Invoke hostHandler.init() for given device. |
| 366 | * |
| 367 | * @param deviceId device ID |
| 368 | */ |
| 369 | void initHost(DeviceId deviceId); |
| 370 | |
| 371 | /** |
| 372 | * Invoke routeHandler.init() for given device. |
| 373 | * |
| 374 | * @param deviceId device ID |
| 375 | */ |
| 376 | void initRoute(DeviceId deviceId); |
| 377 | |
| 378 | /** |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 379 | * Gets application id. |
| 380 | * |
| 381 | * @return application id |
| 382 | */ |
| 383 | default ApplicationId appId() { |
| 384 | throw new NotImplementedException("appId not implemented"); |
| 385 | } |
| 386 | |
| 387 | /** |
| 388 | * Returns internal VLAN for untagged hosts on given connect point. |
| 389 | * <p> |
| 390 | * The internal VLAN is either vlan-untagged for an access port, |
| 391 | * or vlan-native for a trunk port. |
| 392 | * |
| 393 | * @param connectPoint connect point |
| 394 | * @return internal VLAN or null if both vlan-untagged and vlan-native are undefined |
| 395 | */ |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 396 | default VlanId getInternalVlanId(ConnectPoint connectPoint) { |
| 397 | throw new NotImplementedException("getInternalVlanId not implemented"); |
| 398 | } |
| 399 | |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 400 | /** |
| 401 | * Returns optional pair device ID of given device. |
| 402 | * |
| 403 | * @param deviceId device ID |
| 404 | * @return optional pair device ID. Might be empty if pair device is not configured |
| 405 | */ |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 406 | default Optional<DeviceId> getPairDeviceId(DeviceId deviceId) { |
| 407 | throw new NotImplementedException("getPairDeviceId not implemented"); |
| 408 | } |
| 409 | |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 410 | /** |
| 411 | * Returns optional pair device local port of given device. |
| 412 | * |
| 413 | * @param deviceId device ID |
| 414 | * @return optional pair device ID. Might be empty if pair device is not configured |
| 415 | */ |
Charles Chan | 8d31633 | 2018-06-19 20:31:57 -0700 | [diff] [blame] | 416 | default Optional<PortNumber> getPairLocalPort(DeviceId deviceId) { |
| 417 | throw new NotImplementedException("getPairLocalPort not implemented"); |
| 418 | } |
Harshada Chaundkar | 9204f31 | 2019-07-02 16:01:24 +0000 | [diff] [blame] | 419 | |
Charles Chan | 12a8a84 | 2020-02-14 13:23:57 -0800 | [diff] [blame] | 420 | /** |
| 421 | * Returns a set of infrastructure ports on the given device. |
| 422 | * |
| 423 | * @param deviceId device ID |
| 424 | * @return a set of ports that does not have interface configuration |
| 425 | */ |
| 426 | default Set<PortNumber> getInfraPorts(DeviceId deviceId) { |
| 427 | throw new NotImplementedException("getInfraPorts not implemented"); |
| 428 | } |
| 429 | |
| 430 | /** |
| 431 | * Returns a set of edge ports on the given device. |
| 432 | * |
| 433 | * @param deviceId device ID |
| 434 | * @return a set of ports that has interface configuration |
| 435 | */ |
| 436 | default Set<PortNumber> getEdgePorts(DeviceId deviceId) { |
| 437 | throw new NotImplementedException("getEdgePorts not implemented"); |
| 438 | } |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 439 | } |