Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2014-present Open Networking Foundation |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -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 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.host; |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 17 | |
Charles Chan | ff79dd9 | 2018-06-01 16:33:48 -0700 | [diff] [blame] | 18 | import org.apache.commons.lang3.NotImplementedException; |
samanwita pal | c40e5ed | 2015-09-24 11:01:51 -0700 | [diff] [blame] | 19 | import org.onlab.packet.IpAddress; |
Charles Chan | 35a3232 | 2017-08-14 11:42:11 -0700 | [diff] [blame] | 20 | import org.onlab.packet.MacAddress; |
Charles Chan | 4793375 | 2017-11-30 15:37:50 -0800 | [diff] [blame] | 21 | import org.onosproject.net.ConnectPoint; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 22 | import org.onosproject.net.HostId; |
Charles Chan | 888e20a | 2017-05-01 15:44:23 -0700 | [diff] [blame] | 23 | import org.onosproject.net.HostLocation; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 24 | import org.onosproject.net.provider.ProviderService; |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * Means of conveying host information to the core. |
| 28 | */ |
tom | d735672 | 2014-08-26 01:07:39 -0700 | [diff] [blame] | 29 | public interface HostProviderService extends ProviderService<HostProvider> { |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 30 | |
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 31 | /** |
| 32 | * Notifies the core when a host has been detected on a network along with |
Kedar Gupta | 47bd480 | 2015-07-15 09:43:26 -0700 | [diff] [blame] | 33 | * information that identifies the host location. |
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 34 | * |
tom | 7869ad9 | 2014-09-09 14:32:08 -0700 | [diff] [blame] | 35 | * @param hostId id of the host that been detected |
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 36 | * @param hostDescription description of host and its location |
Brian O'Connor | f107bd7 | 2015-09-21 15:31:03 -0700 | [diff] [blame] | 37 | * @param replaceIps replace IP set if true, merge IP set otherwise |
| 38 | */ |
| 39 | void hostDetected(HostId hostId, HostDescription hostDescription, boolean replaceIps); |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 40 | |
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 41 | /** |
| 42 | * Notifies the core when a host is no longer detected on a network. |
| 43 | * |
tom | 7869ad9 | 2014-09-09 14:32:08 -0700 | [diff] [blame] | 44 | * @param hostId id of the host that vanished |
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 45 | */ |
tom | 7869ad9 | 2014-09-09 14:32:08 -0700 | [diff] [blame] | 46 | void hostVanished(HostId hostId); |
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 47 | |
samanwita pal | c40e5ed | 2015-09-24 11:01:51 -0700 | [diff] [blame] | 48 | /** |
Brian O'Connor | 5251562 | 2015-10-09 17:03:44 -0700 | [diff] [blame] | 49 | * Notifies the core when an IP is no longer associated with a host. |
samanwita pal | c40e5ed | 2015-09-24 11:01:51 -0700 | [diff] [blame] | 50 | * |
Brian O'Connor | 5251562 | 2015-10-09 17:03:44 -0700 | [diff] [blame] | 51 | * @param hostId id of the host |
| 52 | * @param ipAddress ip address of host that vanished |
samanwita pal | c40e5ed | 2015-09-24 11:01:51 -0700 | [diff] [blame] | 53 | */ |
| 54 | void removeIpFromHost(HostId hostId, IpAddress ipAddress); |
| 55 | |
Charles Chan | 888e20a | 2017-05-01 15:44:23 -0700 | [diff] [blame] | 56 | /** |
Charles Chan | ff79dd9 | 2018-06-01 16:33:48 -0700 | [diff] [blame] | 57 | * Notifies the core when a location is associated with a host. |
| 58 | * |
| 59 | * @param hostId id of the host |
| 60 | * @param location location of host that gets discovered |
| 61 | */ |
| 62 | default void addLocationToHost(HostId hostId, HostLocation location) { |
| 63 | throw new NotImplementedException("addLocationToHost is not implemented"); |
| 64 | } |
| 65 | |
| 66 | /** |
Charles Chan | 888e20a | 2017-05-01 15:44:23 -0700 | [diff] [blame] | 67 | * Notifies the core when a location is no longer associated with a host. |
| 68 | * |
| 69 | * @param hostId id of the host |
| 70 | * @param location location of host that vanished |
| 71 | */ |
| 72 | void removeLocationFromHost(HostId hostId, HostLocation location); |
Charles Chan | 35a3232 | 2017-08-14 11:42:11 -0700 | [diff] [blame] | 73 | |
| 74 | /** |
| 75 | * Notifies HostProviderService the beginning of pending host location verification and |
| 76 | * retrieves the unique MAC address for the probe. |
| 77 | * |
| 78 | * @param hostId ID of the host |
Charles Chan | 4793375 | 2017-11-30 15:37:50 -0800 | [diff] [blame] | 79 | * @param connectPoint the connect point that is under verification |
| 80 | * @param probeMode probe mode |
Charles Chan | 35a3232 | 2017-08-14 11:42:11 -0700 | [diff] [blame] | 81 | * @return probeMac, the source MAC address ONOS uses to probe the host |
Charles Chan | ff79dd9 | 2018-06-01 16:33:48 -0700 | [diff] [blame] | 82 | * @deprecated in ONOS 1.12, replaced by {@link HostProbingProviderService} |
Charles Chan | 35a3232 | 2017-08-14 11:42:11 -0700 | [diff] [blame] | 83 | */ |
Charles Chan | ff79dd9 | 2018-06-01 16:33:48 -0700 | [diff] [blame] | 84 | @Deprecated |
Charles Chan | 4793375 | 2017-11-30 15:37:50 -0800 | [diff] [blame] | 85 | default MacAddress addPendingHostLocation(HostId hostId, ConnectPoint connectPoint, ProbeMode probeMode) { |
Charles Chan | 35a3232 | 2017-08-14 11:42:11 -0700 | [diff] [blame] | 86 | return MacAddress.NONE; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Notifies HostProviderService the end of pending host location verification. |
| 91 | * |
| 92 | * @param probeMac the source MAC address ONOS uses to probe the host |
Charles Chan | ff79dd9 | 2018-06-01 16:33:48 -0700 | [diff] [blame] | 93 | * @deprecated in ONOS 1.12, replaced by {@link HostProbingProviderService} |
Charles Chan | 35a3232 | 2017-08-14 11:42:11 -0700 | [diff] [blame] | 94 | */ |
Charles Chan | ff79dd9 | 2018-06-01 16:33:48 -0700 | [diff] [blame] | 95 | @Deprecated |
Charles Chan | 35a3232 | 2017-08-14 11:42:11 -0700 | [diff] [blame] | 96 | default void removePendingHostLocation(MacAddress probeMac) {} |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 97 | } |