blob: c39138eb507c27b4de3723e5e263df3753be1ae1 [file] [log] [blame]
CNluciusa66c3972015-09-06 20:31:29 +08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
CNluciusa66c3972015-09-06 20:31:29 +08003 *
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 */
16package org.onosproject.net.behaviour;
17
18import java.util.Collection;
19import java.util.List;
20import java.util.Set;
21
22import org.onosproject.net.PortNumber;
23import org.onosproject.net.device.PortDescription;
24import org.onosproject.net.driver.HandlerBehaviour;
25
26/**
27 * Behaviour for handling various drivers for bridge configurations.
28 */
29public interface BridgeConfig extends HandlerBehaviour {
30
31 /**
32 * Add a bridge.
33 *
Hyunsun Moon1251e192016-06-07 16:57:05 -070034 * @deprecated version 1.7.0 - Hummingbird
CNluciusa66c3972015-09-06 20:31:29 +080035 * @param bridgeName bridge name
36 */
Hyunsun Moon1251e192016-06-07 16:57:05 -070037 @Deprecated
CNluciusa66c3972015-09-06 20:31:29 +080038 void addBridge(BridgeName bridgeName);
39
40 /**
lishuai6c56f5e2015-11-17 16:38:19 +080041 * Adds a bridge with given bridge name, dpid and exPortName.
42 *
Hyunsun Moon1251e192016-06-07 16:57:05 -070043 * @deprecated version 1.7.0 - Hummingbird
lishuai6c56f5e2015-11-17 16:38:19 +080044 * @param bridgeName bridge name
45 * @param dpid dpid
46 * @param exPortName external port name
47 */
Hyunsun Moon1251e192016-06-07 16:57:05 -070048 @Deprecated
lishuai6c56f5e2015-11-17 16:38:19 +080049 void addBridge(BridgeName bridgeName, String dpid, String exPortName);
50
51 /**
Hyunsun Moonaab8c672015-10-27 19:42:12 -070052 * Adds a bridge with given bridge name and dpid, and sets the controller
53 * of the bridge with given controllers.
54 *
Hyunsun Moon1251e192016-06-07 16:57:05 -070055 * @deprecated version 1.7.0 - Hummingbird
Hyunsun Moonaab8c672015-10-27 19:42:12 -070056 * @param bridgeName bridge name
57 * @param dpid dpid
58 * @param controllers list of controller
59 * @return true if succeeds, fail otherwise
60 */
Hyunsun Moon1251e192016-06-07 16:57:05 -070061 @Deprecated
Hyunsun Moonaab8c672015-10-27 19:42:12 -070062 boolean addBridge(BridgeName bridgeName, String dpid, List<ControllerInfo> controllers);
63
64 /**
Hyunsun Moon1251e192016-06-07 16:57:05 -070065 * Adds a bridge with a given description.
66 *
67 * @param bridgeDescription bridge description
68 * @return true if succeeds, or false
69 */
70 boolean addBridge(BridgeDescription bridgeDescription);
71
72 /**
CNluciusa66c3972015-09-06 20:31:29 +080073 * Remove a bridge.
74 *
75 * @param bridgeName bridge name
76 */
77 void deleteBridge(BridgeName bridgeName);
78
79 /**
80 * Remove a bridge.
81 *
82 * @return bridge collection
83 */
84 Collection<BridgeDescription> getBridges();
85
86 /**
Hyunsun Moon52b93362016-01-19 11:53:57 -080087 * Adds a port to a given bridge.
88 *
89 * @param bridgeName bridge name
90 * @param portName port name
91 */
92 void addPort(BridgeName bridgeName, String portName);
93
94 /**
Andrea Campanella65ece152016-01-21 13:33:43 -080095 * Removes a port from a given bridge.
96 *
97 * @param bridgeName bridge name
98 * @param portName port name
99 */
100 void deletePort(BridgeName bridgeName, String portName);
101
102 /**
CNluciusa66c3972015-09-06 20:31:29 +0800103 * Delete a logical/virtual port.
104 *
105 * @return collection of port
106 */
107 Collection<PortDescription> getPorts();
108
109 /**
110 * Get a collection of port.
111 *
112 * @return portNumbers set of PortNumber
113 */
114 Set<PortNumber> getPortNumbers();
115
116 /**
117 * Get logical/virtual ports by ifaceIds.
118 *
119 * @param ifaceIds the ifaceid that needed
120 * @return list of PortNumber
121 */
122 List<PortNumber> getLocalPorts(Iterable<String> ifaceIds);
123}