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