blob: 11c47e1fd7266dd011bb98459ab99d921e4b830e [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
Ray Milkey7f9e0202015-11-04 17:14:09 -080018import org.jboss.netty.channel.Channel;
19import org.onosproject.net.Device;
20import org.onosproject.net.driver.DriverData;
21import org.onosproject.net.driver.DriverHandler;
22import org.onosproject.openflow.controller.Dpid;
23import org.onosproject.openflow.controller.RoleState;
24import org.onosproject.openflow.controller.driver.OpenFlowAgent;
25import org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver;
26import org.onosproject.openflow.controller.driver.RoleHandler;
27import org.onosproject.openflow.controller.driver.SwitchStateException;
28import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
29import org.projectfloodlight.openflow.protocol.OFErrorMsg;
30import org.projectfloodlight.openflow.protocol.OFFactories;
31import org.projectfloodlight.openflow.protocol.OFFactory;
32import org.projectfloodlight.openflow.protocol.OFFeaturesReply;
33import org.projectfloodlight.openflow.protocol.OFMessage;
Jordi Ortiz91477b82016-11-29 15:22:50 +010034import org.projectfloodlight.openflow.protocol.OFMeterFeaturesStatsReply;
Ray Milkey7f9e0202015-11-04 17:14:09 -080035import org.projectfloodlight.openflow.protocol.OFPortDesc;
36import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply;
37import org.projectfloodlight.openflow.protocol.OFVersion;
38
Jian Lia78cdb22016-04-21 13:03:58 -070039import java.util.List;
40
Ray Milkey7f9e0202015-11-04 17:14:09 -080041/**
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
Jordi Ortiz91477b82016-11-29 15:22:50 +0100124 public void setMeterFeaturesReply(OFMeterFeaturesStatsReply meterFeaturesReply) {
125
126 }
127
128 @Override
Ray Milkey7f9e0202015-11-04 17:14:09 -0800129 public void setSwitchDescription(OFDescStatsReply desc) {
130
131 }
132
133 @Override
134 public int getNextTransactionId() {
135 return 0;
136 }
137
138 @Override
139 public void setOFVersion(OFVersion ofV) {
140
141 }
142
143 @Override
144 public void setTableFull(boolean full) {
145
146 }
147
148 @Override
149 public void setChannel(Channel channel) {
150
151 }
152
153 @Override
154 public void setConnected(boolean connected) {
155
156 }
157
158 @Override
159 public void init(Dpid dpid, OFDescStatsReply desc, OFVersion ofv) {
160
161 }
162
163 @Override
164 public Boolean supportNxRole() {
165 return true;
166 }
167
168 @Override
169 public void startDriverHandshake() {
170
171 }
172
173 @Override
174 public boolean isDriverHandshakeComplete() {
175 return false;
176 }
177
178 @Override
179 public void processDriverHandshakeMessage(OFMessage m) {
180
181 }
182
183 @Override
184 public void sendRoleRequest(OFMessage message) {
185
186 }
187
188 @Override
189 public void sendHandshakeMessage(OFMessage message) {
190
191 }
192
193 @Override
194 public DriverHandler handler() {
195 return null;
196 }
197
198 @Override
199 public void setHandler(DriverHandler handler) {
200
201 }
202
203 @Override
204 public DriverData data() {
205 return null;
206 }
207
208 @Override
209 public void setData(DriverData data) {
210
211 }
212
213 @Override
214 public void sendMsg(OFMessage msg) {
215
216 }
217
218 @Override
219 public void sendMsg(List<OFMessage> msgs) {
220
221 }
222
223 @Override
224 public void handleMessage(OFMessage fromSwitch) {
225
226 }
227
228 @Override
229 public void setRole(RoleState role) {
Ray Milkeyca20bb52015-11-10 13:59:16 -0800230 this.role = role;
Ray Milkey7f9e0202015-11-04 17:14:09 -0800231 }
232
233 @Override
234 public RoleState getRole() {
Ray Milkeyca20bb52015-11-10 13:59:16 -0800235 return role;
Ray Milkey7f9e0202015-11-04 17:14:09 -0800236 }
237
238 @Override
239 public List<OFPortDesc> getPorts() {
240 return null;
241 }
242
243 @Override
244 public OFFactory factory() {
245 // return what-ever triggers requestPending = true
246 return OFFactories.getFactory(OFVersion.OF_10);
247 }
248
249 @Override
250 public String getStringId() {
251 return "100";
252 }
253
254 @Override
255 public long getId() {
256 return 0;
257 }
258
259 @Override
260 public String manufacturerDescription() {
261 return null;
262 }
263
264 @Override
265 public String datapathDescription() {
266 return null;
267 }
268
269 @Override
270 public String hardwareDescription() {
271 return null;
272 }
273
274 @Override
275 public String softwareDescription() {
276 return null;
277 }
278
279 @Override
280 public String serialNumber() {
281 return null;
282 }
283
284 @Override
285 public boolean isConnected() {
286 return false;
287 }
288
289 @Override
290 public void disconnectSwitch() {
291
292 }
293
294 @Override
295 public void returnRoleReply(RoleState requested, RoleState response) {
296
297 }
298
299 @Override
300 public Device.Type deviceType() {
301 return Device.Type.SWITCH;
302 }
303
304 @Override
305 public String channelId() {
306 return null;
307 }
Ray Milkey7f9e0202015-11-04 17:14:09 -0800308}