blob: a325b95e136530748076632b70189113dba9bd75 [file] [log] [blame]
Thomas Vachuska05453c92015-09-09 14:40:49 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Thomas Vachuska05453c92015-09-09 14:40:49 -07003 *
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 Milkey957390e2016-02-09 10:02:46 -080016package org.onosproject.provider.lldpcommon;
Thomas Vachuska05453c92015-09-09 14:40:49 -070017
18import org.onosproject.mastership.MastershipService;
Thomas Vachuskae4ebac92015-09-10 11:39:05 -070019import org.onosproject.net.LinkKey;
Ayaka Koshibe3ddb7b22015-12-10 17:32:59 -080020import org.onosproject.net.device.DeviceService;
Thomas Vachuska05453c92015-09-09 14:40:49 -070021import org.onosproject.net.link.LinkProviderService;
22import org.onosproject.net.packet.PacketService;
23
24/**
25 * Shared context for use by link discovery.
26 */
Ray Milkey957390e2016-02-09 10:02:46 -080027public interface LinkDiscoveryContext {
Thomas Vachuska05453c92015-09-09 14:40:49 -070028
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 Koshibe3ddb7b22015-12-10 17:32:59 -080051 * Returns the DeviceService reference.
52 *
53 * @return the device service interface
54 */
55 DeviceService deviceService();
56
57 /**
Thomas Vachuska05453c92015-09-09 14:40:49 -070058 * Returns the probe rate in millis.
59 *
60 * @return probe rate
61 */
62 long probeRate();
63
64 /**
Thomas Vachuska05453c92015-09-09 14:40:49 -070065 * Indicates whether to emit BDDP.
66 *
67 * @return true to emit BDDP
68 */
Jonathan Hartb35540a2015-11-17 09:30:56 -080069 boolean useBddp();
Thomas Vachuskae4ebac92015-09-10 11:39:05 -070070
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 Koshibe12c8c082015-12-08 12:48:46 -080077
78 /**
79 * Returns the cluster-wide unique identifier.
80 *
81 * @return the cluster identifier
82 */
83 String fingerprint();
Samuel Jero31e16f52018-09-21 10:34:28 -040084
85 /**
86 * Returns the cluster-wide MAC secret used to secure LLDP packets.
87 *
88 * @return the secret
89 */
90 String lldpSecret();
91
92 /**
93 * Returns the maximum delay in milliseconds between sending an LLDP packet and receiving it elsewhere.
94 *
95 * @return delay in ms
96 */
97 long maxDiscoveryDelay();
Thomas Vachuska05453c92015-09-09 14:40:49 -070098}