blob: 6021bd8a6aa92829203bbccda92337db02f6d4e7 [file] [log] [blame]
Thomas Vachuska781d18b2014-10-27 10:31:25 -07001/*
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07002 * Copyright 2014 Open Networking Laboratory
Thomas Vachuska781d18b2014-10-27 10:31:25 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * 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
Thomas Vachuska781d18b2014-10-27 10:31:25 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * 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.
Thomas Vachuska781d18b2014-10-27 10:31:25 -070015 */
alshabib452234e2014-11-25 00:03:49 -050016package org.onlab.onos.openflow.drivers;
tom7ef8ff92014-09-17 13:08:06 -070017
tom9c94c5b2014-09-17 13:14:42 -070018import org.onlab.onos.openflow.controller.Dpid;
19import org.onlab.onos.openflow.controller.driver.AbstractOpenFlowSwitch;
tom7ef8ff92014-09-17 13:08:06 -070020import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
21import org.projectfloodlight.openflow.protocol.OFMessage;
22import org.projectfloodlight.openflow.protocol.OFPortDesc;
23
alshabib452234e2014-11-25 00:03:49 -050024import java.util.Collections;
25import java.util.List;
26
tom7ef8ff92014-09-17 13:08:06 -070027/**
28 * OFDescriptionStatistics Vendor (Manufacturer Desc.): Nicira, Inc. Make
29 * (Hardware Desc.) : Open vSwitch Model (Datapath Desc.) : None Software :
30 * 1.11.90 (or whatever version + build) Serial : None
31 */
32public class OFSwitchImplOVS10 extends AbstractOpenFlowSwitch {
33
34 public OFSwitchImplOVS10(Dpid dpid, OFDescStatsReply desc) {
35 super(dpid);
36 setSwitchDescription(desc);
37
38 }
39
40 /* (non-Javadoc)
41 * @see java.lang.Object#toString()
42 */
43 @Override
44 public String toString() {
45 return "OFSwitchImplOVS10 [" + ((channel != null)
46 ? channel.getRemoteAddress() : "?")
47 + " DPID[" + ((getStringId() != null) ? getStringId() : "?") + "]]";
48 }
49
50 @Override
51 public Boolean supportNxRole() {
52 return true;
53 }
54
55 @Override
56 public void startDriverHandshake() {}
57
58 @Override
59 public boolean isDriverHandshakeComplete() {
60 return true;
61 }
62
63 @Override
64 public void processDriverHandshakeMessage(OFMessage m) {}
65
66 @Override
67 public void write(OFMessage msg) {
68 channel.write(Collections.singletonList(msg));
69 }
70
71 @Override
72 public void write(List<OFMessage> msgs) {
73 channel.write(msgs);
74 }
75
76 @Override
77 public List<OFPortDesc> getPorts() {
78 return Collections.unmodifiableList(features.getPorts());
79 }
80
81
82}