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