Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
tom | 9c94c5b | 2014-09-17 13:14:42 -0700 | [diff] [blame] | 19 | package org.onlab.onos.openflow.drivers.impl; |
tom | 7ef8ff9 | 2014-09-17 13:08:06 -0700 | [diff] [blame] | 20 | |
| 21 | import java.util.Collections; |
| 22 | import java.util.List; |
| 23 | |
tom | 9c94c5b | 2014-09-17 13:14:42 -0700 | [diff] [blame] | 24 | import org.onlab.onos.openflow.controller.Dpid; |
| 25 | import org.onlab.onos.openflow.controller.driver.AbstractOpenFlowSwitch; |
tom | 7ef8ff9 | 2014-09-17 13:08:06 -0700 | [diff] [blame] | 26 | import org.projectfloodlight.openflow.protocol.OFDescStatsReply; |
| 27 | import org.projectfloodlight.openflow.protocol.OFMessage; |
| 28 | import org.projectfloodlight.openflow.protocol.OFPortDesc; |
| 29 | |
| 30 | /** |
| 31 | * OFDescriptionStatistics Vendor (Manufacturer Desc.): Nicira, Inc. Make |
| 32 | * (Hardware Desc.) : Open vSwitch Model (Datapath Desc.) : None Software : |
| 33 | * 1.11.90 (or whatever version + build) Serial : None |
| 34 | */ |
| 35 | public class OFSwitchImplOVS10 extends AbstractOpenFlowSwitch { |
| 36 | |
| 37 | public OFSwitchImplOVS10(Dpid dpid, OFDescStatsReply desc) { |
| 38 | super(dpid); |
| 39 | setSwitchDescription(desc); |
| 40 | |
| 41 | } |
| 42 | |
| 43 | /* (non-Javadoc) |
| 44 | * @see java.lang.Object#toString() |
| 45 | */ |
| 46 | @Override |
| 47 | public String toString() { |
| 48 | return "OFSwitchImplOVS10 [" + ((channel != null) |
| 49 | ? channel.getRemoteAddress() : "?") |
| 50 | + " DPID[" + ((getStringId() != null) ? getStringId() : "?") + "]]"; |
| 51 | } |
| 52 | |
| 53 | @Override |
| 54 | public Boolean supportNxRole() { |
| 55 | return true; |
| 56 | } |
| 57 | |
| 58 | @Override |
| 59 | public void startDriverHandshake() {} |
| 60 | |
| 61 | @Override |
| 62 | public boolean isDriverHandshakeComplete() { |
| 63 | return true; |
| 64 | } |
| 65 | |
| 66 | @Override |
| 67 | public void processDriverHandshakeMessage(OFMessage m) {} |
| 68 | |
| 69 | @Override |
| 70 | public void write(OFMessage msg) { |
| 71 | channel.write(Collections.singletonList(msg)); |
| 72 | } |
| 73 | |
| 74 | @Override |
| 75 | public void write(List<OFMessage> msgs) { |
| 76 | channel.write(msgs); |
| 77 | } |
| 78 | |
| 79 | @Override |
| 80 | public List<OFPortDesc> getPorts() { |
| 81 | return Collections.unmodifiableList(features.getPorts()); |
| 82 | } |
| 83 | |
| 84 | |
| 85 | } |