blob: 0efd6fa1a829d703dc3360ec4f52cf44c6d11b97 [file] [log] [blame]
Ray Milkey7f9e0202015-11-04 17:14:09 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Ray Milkey7f9e0202015-11-04 17:14:09 -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.openflow;
17
18import java.util.List;
19
20import org.jboss.netty.channel.Channel;
21import org.onosproject.net.Device;
22import org.onosproject.net.driver.DriverData;
23import org.onosproject.net.driver.DriverHandler;
24import org.onosproject.openflow.controller.Dpid;
Jian Li152b8852015-12-07 14:47:25 -080025import org.onosproject.openflow.controller.OpenFlowEventListener;
Ray Milkey7f9e0202015-11-04 17:14:09 -080026import org.onosproject.openflow.controller.RoleState;
27import org.onosproject.openflow.controller.driver.OpenFlowAgent;
28import org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver;
29import org.onosproject.openflow.controller.driver.RoleHandler;
30import org.onosproject.openflow.controller.driver.SwitchStateException;
31import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
32import org.projectfloodlight.openflow.protocol.OFErrorMsg;
33import org.projectfloodlight.openflow.protocol.OFFactories;
34import org.projectfloodlight.openflow.protocol.OFFactory;
35import org.projectfloodlight.openflow.protocol.OFFeaturesReply;
36import org.projectfloodlight.openflow.protocol.OFMessage;
37import org.projectfloodlight.openflow.protocol.OFPortDesc;
38import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply;
39import org.projectfloodlight.openflow.protocol.OFVersion;
40
41/**
42 * Testing adapter for the OpenFlow switch driver class.
43 */
44public class OpenflowSwitchDriverAdapter implements OpenFlowSwitchDriver {
Ray Milkeyca20bb52015-11-10 13:59:16 -080045
46 RoleState role = RoleState.MASTER;
47
Ray Milkey7f9e0202015-11-04 17:14:09 -080048 @Override
49 public void setAgent(OpenFlowAgent agent) {
50
51 }
52
53 @Override
54 public void setRoleHandler(RoleHandler roleHandler) {
55
56 }
57
58 @Override
59 public void reassertRole() {
60
61 }
62
63 @Override
64 public boolean handleRoleError(OFErrorMsg error) {
65 return false;
66 }
67
68 @Override
69 public void handleNiciraRole(OFMessage m) throws SwitchStateException {
70
71 }
72
73 @Override
74 public void handleRole(OFMessage m) throws SwitchStateException {
75
76 }
77
78 @Override
79 public boolean connectSwitch() {
80 return false;
81 }
82
83 @Override
84 public boolean activateMasterSwitch() {
85 return false;
86 }
87
88 @Override
89 public boolean activateEqualSwitch() {
90 return false;
91 }
92
93 @Override
94 public void transitionToEqualSwitch() {
95
96 }
97
98 @Override
99 public void transitionToMasterSwitch() {
100
101 }
102
103 @Override
104 public void removeConnectedSwitch() {
105
106 }
107
108 @Override
109 public void setPortDescReply(OFPortDescStatsReply portDescReply) {
110
111 }
112
113 @Override
114 public void setPortDescReplies(List<OFPortDescStatsReply> portDescReplies) {
115
116 }
117
118 @Override
119 public void setFeaturesReply(OFFeaturesReply featuresReply) {
120
121 }
122
123 @Override
124 public void setSwitchDescription(OFDescStatsReply desc) {
125
126 }
127
128 @Override
129 public int getNextTransactionId() {
130 return 0;
131 }
132
133 @Override
134 public void setOFVersion(OFVersion ofV) {
135
136 }
137
138 @Override
139 public void setTableFull(boolean full) {
140
141 }
142
143 @Override
144 public void setChannel(Channel channel) {
145
146 }
147
148 @Override
149 public void setConnected(boolean connected) {
150
151 }
152
153 @Override
154 public void init(Dpid dpid, OFDescStatsReply desc, OFVersion ofv) {
155
156 }
157
158 @Override
159 public Boolean supportNxRole() {
160 return true;
161 }
162
163 @Override
164 public void startDriverHandshake() {
165
166 }
167
168 @Override
169 public boolean isDriverHandshakeComplete() {
170 return false;
171 }
172
173 @Override
174 public void processDriverHandshakeMessage(OFMessage m) {
175
176 }
177
178 @Override
179 public void sendRoleRequest(OFMessage message) {
180
181 }
182
183 @Override
184 public void sendHandshakeMessage(OFMessage message) {
185
186 }
187
188 @Override
189 public DriverHandler handler() {
190 return null;
191 }
192
193 @Override
194 public void setHandler(DriverHandler handler) {
195
196 }
197
198 @Override
199 public DriverData data() {
200 return null;
201 }
202
203 @Override
204 public void setData(DriverData data) {
205
206 }
207
208 @Override
209 public void sendMsg(OFMessage msg) {
210
211 }
212
213 @Override
214 public void sendMsg(List<OFMessage> msgs) {
215
216 }
217
218 @Override
219 public void handleMessage(OFMessage fromSwitch) {
220
221 }
222
223 @Override
224 public void setRole(RoleState role) {
Ray Milkeyca20bb52015-11-10 13:59:16 -0800225 this.role = role;
Ray Milkey7f9e0202015-11-04 17:14:09 -0800226 }
227
228 @Override
229 public RoleState getRole() {
Ray Milkeyca20bb52015-11-10 13:59:16 -0800230 return role;
Ray Milkey7f9e0202015-11-04 17:14:09 -0800231 }
232
233 @Override
234 public List<OFPortDesc> getPorts() {
235 return null;
236 }
237
238 @Override
239 public OFFactory factory() {
240 // return what-ever triggers requestPending = true
241 return OFFactories.getFactory(OFVersion.OF_10);
242 }
243
244 @Override
245 public String getStringId() {
246 return "100";
247 }
248
249 @Override
250 public long getId() {
251 return 0;
252 }
253
254 @Override
255 public String manufacturerDescription() {
256 return null;
257 }
258
259 @Override
260 public String datapathDescription() {
261 return null;
262 }
263
264 @Override
265 public String hardwareDescription() {
266 return null;
267 }
268
269 @Override
270 public String softwareDescription() {
271 return null;
272 }
273
274 @Override
275 public String serialNumber() {
276 return null;
277 }
278
279 @Override
280 public boolean isConnected() {
281 return false;
282 }
283
284 @Override
285 public void disconnectSwitch() {
286
287 }
288
289 @Override
290 public void returnRoleReply(RoleState requested, RoleState response) {
291
292 }
293
294 @Override
295 public Device.Type deviceType() {
296 return Device.Type.SWITCH;
297 }
298
299 @Override
300 public String channelId() {
301 return null;
302 }
Jian Li152b8852015-12-07 14:47:25 -0800303
304 @Override
305 public void addEventListener(OpenFlowEventListener listener) {
306 }
307
308 @Override
309 public void removeEventListener(OpenFlowEventListener listener) {
310 }
Ray Milkey7f9e0202015-11-04 17:14:09 -0800311}