Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -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 | */ |
Ray Milkey | 957390e | 2016-02-09 10:02:46 -0800 | [diff] [blame] | 16 | package org.onosproject.provider.lldpcommon; |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 17 | |
| 18 | import org.onosproject.mastership.MastershipService; |
Thomas Vachuska | e4ebac9 | 2015-09-10 11:39:05 -0700 | [diff] [blame] | 19 | import org.onosproject.net.LinkKey; |
Ayaka Koshibe | 3ddb7b2 | 2015-12-10 17:32:59 -0800 | [diff] [blame] | 20 | import org.onosproject.net.device.DeviceService; |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 21 | import org.onosproject.net.link.LinkProviderService; |
| 22 | import org.onosproject.net.packet.PacketService; |
| 23 | |
| 24 | /** |
| 25 | * Shared context for use by link discovery. |
| 26 | */ |
Ray Milkey | 957390e | 2016-02-09 10:02:46 -0800 | [diff] [blame] | 27 | public interface LinkDiscoveryContext { |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 28 | |
| 29 | /** |
| 30 | * Returns the shared mastership service reference. |
| 31 | * |
| 32 | * @return mastership service |
| 33 | */ |
| 34 | MastershipService mastershipService(); |
| 35 | |
| 36 | /** |
| 37 | * Returns the shared link provider service reference. |
| 38 | * |
| 39 | * @return link provider service |
| 40 | */ |
| 41 | LinkProviderService providerService(); |
| 42 | |
| 43 | /** |
| 44 | * Returns the shared packet service reference. |
| 45 | * |
| 46 | * @return packet service |
| 47 | */ |
| 48 | PacketService packetService(); |
| 49 | |
| 50 | /** |
Ayaka Koshibe | 3ddb7b2 | 2015-12-10 17:32:59 -0800 | [diff] [blame] | 51 | * Returns the DeviceService reference. |
| 52 | * |
| 53 | * @return the device service interface |
| 54 | */ |
| 55 | DeviceService deviceService(); |
| 56 | |
| 57 | /** |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 58 | * Returns the probe rate in millis. |
| 59 | * |
| 60 | * @return probe rate |
| 61 | */ |
| 62 | long probeRate(); |
| 63 | |
| 64 | /** |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 65 | * Indicates whether to emit BDDP. |
| 66 | * |
| 67 | * @return true to emit BDDP |
| 68 | */ |
Jonathan Hart | b35540a | 2015-11-17 09:30:56 -0800 | [diff] [blame] | 69 | boolean useBddp(); |
Thomas Vachuska | e4ebac9 | 2015-09-10 11:39:05 -0700 | [diff] [blame] | 70 | |
| 71 | /** |
| 72 | * Touches the link identified by the given key to indicate that it's active. |
| 73 | * |
| 74 | * @param key link key |
| 75 | */ |
| 76 | void touchLink(LinkKey key); |
Ayaka Koshibe | 12c8c08 | 2015-12-08 12:48:46 -0800 | [diff] [blame] | 77 | |
| 78 | /** |
DongRyeol Cha | ce65cc0 | 2018-07-23 15:02:28 +0900 | [diff] [blame] | 79 | * Set the TTL to the link identified by the given key to indicate that it's active. |
| 80 | * |
| 81 | * @param key link key |
| 82 | * @param ttl ttl value(seconds) |
| 83 | */ |
| 84 | void setTtl(LinkKey key, short ttl); |
| 85 | |
| 86 | /** |
Ayaka Koshibe | 12c8c08 | 2015-12-08 12:48:46 -0800 | [diff] [blame] | 87 | * Returns the cluster-wide unique identifier. |
| 88 | * |
| 89 | * @return the cluster identifier |
| 90 | */ |
| 91 | String fingerprint(); |
Samuel Jero | 31e16f5 | 2018-09-21 10:34:28 -0400 | [diff] [blame] | 92 | |
| 93 | /** |
| 94 | * Returns the cluster-wide MAC secret used to secure LLDP packets. |
| 95 | * |
| 96 | * @return the secret |
| 97 | */ |
| 98 | String lldpSecret(); |
| 99 | |
| 100 | /** |
| 101 | * Returns the maximum delay in milliseconds between sending an LLDP packet and receiving it elsewhere. |
| 102 | * |
| 103 | * @return delay in ms |
| 104 | */ |
| 105 | long maxDiscoveryDelay(); |
Thomas Vachuska | 05453c9 | 2015-09-09 14:40:49 -0700 | [diff] [blame] | 106 | } |