Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 1 | /** |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 2 | * Copyright 2011, Big Switch Networks, Inc. |
| 3 | * Originally created by David Erickson, Stanford University |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 6 | * not use this file except in compliance with the License. You may obtain |
| 7 | * a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | * License for the specific language governing permissions and limitations |
| 15 | * under the License. |
| 16 | **/ |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 17 | |
| 18 | package net.floodlightcontroller.core.web; |
| 19 | |
Srikanth Vavilapalli | b725851 | 2014-09-29 13:24:11 -0700 | [diff] [blame] | 20 | import java.util.ArrayList; |
Srikanth Vavilapalli | a0e6d58 | 2014-09-28 22:42:34 -0700 | [diff] [blame] | 21 | import java.util.List; |
| 22 | import java.util.concurrent.Future; |
| 23 | import java.util.concurrent.TimeUnit; |
| 24 | |
| 25 | import net.floodlightcontroller.core.IFloodlightProviderService; |
| 26 | import net.floodlightcontroller.core.IOFSwitch; |
| 27 | import net.floodlightcontroller.core.annotations.LogMessageDoc; |
Srikanth Vavilapalli | 8a661e7 | 2014-10-27 15:40:22 -0700 | [diff] [blame] | 28 | import net.onrc.onos.core.drivermanager.OFSwitchImplSpringOpenTTP; |
Srikanth Vavilapalli | a0e6d58 | 2014-09-28 22:42:34 -0700 | [diff] [blame] | 29 | |
| 30 | import org.projectfloodlight.openflow.protocol.OFFeaturesReply; |
Fahad Naeem Khan | d89448d | 2014-10-06 18:40:45 -0700 | [diff] [blame] | 31 | import org.projectfloodlight.openflow.protocol.OFFlowStatsEntry; |
Srikanth Vavilapalli | 8a661e7 | 2014-10-27 15:40:22 -0700 | [diff] [blame] | 32 | import org.projectfloodlight.openflow.protocol.OFFlowStatsReply; |
Fahad Naeem Khan | 9ae7fa1 | 2014-10-03 14:30:55 -0700 | [diff] [blame] | 33 | import org.projectfloodlight.openflow.protocol.OFGroupDescStatsEntry; |
| 34 | import org.projectfloodlight.openflow.protocol.OFGroupDescStatsReply; |
Fahad Naeem Khan | 8a8daf2 | 2014-10-06 14:07:43 -0700 | [diff] [blame] | 35 | import org.projectfloodlight.openflow.protocol.OFGroupStatsEntry; |
| 36 | import org.projectfloodlight.openflow.protocol.OFGroupStatsReply; |
Srikanth Vavilapalli | a0e6d58 | 2014-09-28 22:42:34 -0700 | [diff] [blame] | 37 | import org.projectfloodlight.openflow.protocol.OFMatchV3; |
| 38 | import org.projectfloodlight.openflow.protocol.OFOxmList; |
Srikanth Vavilapalli | b725851 | 2014-09-29 13:24:11 -0700 | [diff] [blame] | 39 | import org.projectfloodlight.openflow.protocol.OFPortStatsEntry; |
| 40 | import org.projectfloodlight.openflow.protocol.OFPortStatsReply; |
Srikanth Vavilapalli | a0e6d58 | 2014-09-28 22:42:34 -0700 | [diff] [blame] | 41 | import org.projectfloodlight.openflow.protocol.OFStatsReply; |
| 42 | import org.projectfloodlight.openflow.protocol.OFStatsRequest; |
| 43 | import org.projectfloodlight.openflow.protocol.OFStatsType; |
| 44 | import org.projectfloodlight.openflow.types.OFPort; |
| 45 | import org.projectfloodlight.openflow.types.TableId; |
| 46 | import org.projectfloodlight.openflow.util.HexString; |
| 47 | import org.restlet.resource.ResourceException; |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 48 | import org.restlet.resource.ServerResource; |
Srikanth Vavilapalli | a0e6d58 | 2014-09-28 22:42:34 -0700 | [diff] [blame] | 49 | import org.slf4j.Logger; |
| 50 | import org.slf4j.LoggerFactory; |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 51 | |
| 52 | /** |
| 53 | * Base class for server resources related to switches |
Fahad Naeem Khan | 9ae7fa1 | 2014-10-03 14:30:55 -0700 | [diff] [blame] | 54 | * |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 55 | * @author readams |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 56 | */ |
Ray Milkey | ff73514 | 2014-05-22 19:06:02 -0700 | [diff] [blame] | 57 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 58 | public class SwitchResourceBase extends ServerResource { |
Srikanth Vavilapalli | a0e6d58 | 2014-09-28 22:42:34 -0700 | [diff] [blame] | 59 | protected final static Logger log = LoggerFactory.getLogger(SwitchResourceBase.class); |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 60 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 61 | public enum REQUESTTYPE { |
| 62 | OFSTATS, |
| 63 | OFFEATURES |
| 64 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 65 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 66 | @Override |
| 67 | protected void doInit() throws ResourceException { |
| 68 | super.doInit(); |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 69 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 70 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 71 | |
| 72 | @LogMessageDoc(level = "ERROR", |
| 73 | message = "Failure retrieving statistics from switch {switch}", |
| 74 | explanation = "An error occurred while retrieving statistics" + |
| 75 | "from the switch", |
Fahad Naeem Khan | 9ae7fa1 | 2014-10-03 14:30:55 -0700 | [diff] [blame] | 76 | recommendation = LogMessageDoc.CHECK_SWITCH + " " + |
| 77 | LogMessageDoc.GENERIC_ACTION) |
| 78 | |
| 79 | protected List<?> getSwitchStatistics(long switchId, |
Srikanth Vavilapalli | f25c7b0 | 2014-10-01 14:30:43 -0700 | [diff] [blame] | 80 | OFStatsType statType) { |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 81 | IFloodlightProviderService floodlightProvider = |
| 82 | (IFloodlightProviderService) getContext().getAttributes(). |
Fahad Naeem Khan | 9ae7fa1 | 2014-10-03 14:30:55 -0700 | [diff] [blame] | 83 | get(IFloodlightProviderService.class.getCanonicalName()); |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 84 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 85 | IOFSwitch sw = floodlightProvider.getSwitches().get(switchId); |
Srikanth Vavilapalli | a0e6d58 | 2014-09-28 22:42:34 -0700 | [diff] [blame] | 86 | Future<List<OFStatsReply>> future; |
| 87 | List<OFStatsReply> values = null; |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 88 | if (sw != null) { |
Srikanth Vavilapalli | f25c7b0 | 2014-10-01 14:30:43 -0700 | [diff] [blame] | 89 | OFStatsRequest<?> req = null; |
Srikanth Vavilapalli | a0e6d58 | 2014-09-28 22:42:34 -0700 | [diff] [blame] | 90 | if (statType == OFStatsType.FLOW) { |
Srikanth Vavilapalli | f25c7b0 | 2014-10-01 14:30:43 -0700 | [diff] [blame] | 91 | log.debug("Switch Flow Stats req sent for switch {}", |
| 92 | sw.getStringId()); |
Srikanth Vavilapalli | a0e6d58 | 2014-09-28 22:42:34 -0700 | [diff] [blame] | 93 | OFMatchV3 match = sw.getFactory().buildMatchV3() |
Srikanth Vavilapalli | f25c7b0 | 2014-10-01 14:30:43 -0700 | [diff] [blame] | 94 | .setOxmList(OFOxmList.EMPTY).build(); |
| 95 | req = sw.getFactory() |
| 96 | .buildFlowStatsRequest() |
| 97 | .setMatch(match) |
| 98 | .setOutPort(OFPort.ANY) |
| 99 | .setTableId(TableId.ALL) |
| 100 | .setXid(sw.getNextTransactionId()).build(); |
Fahad Naeem Khan | d89448d | 2014-10-06 18:40:45 -0700 | [diff] [blame] | 101 | List<OFFlowStatsEntryMod> flowStats = new ArrayList<OFFlowStatsEntryMod>(); |
| 102 | try { |
| 103 | future = sw.getStatistics(req); |
| 104 | values = future.get(10, TimeUnit.SECONDS); |
Fahad Naeem Khan | d89448d | 2014-10-06 18:40:45 -0700 | [diff] [blame] | 105 | for (OFFlowStatsEntry entry : ((OFFlowStatsReply)values.get(0)).getEntries()) { |
| 106 | OFFlowStatsEntryMod entryMod = new OFFlowStatsEntryMod(entry); |
| 107 | flowStats.add(entryMod); |
| 108 | } |
| 109 | log.debug("Switch flow Stats Entries from switch {} are {}", |
| 110 | sw.getStringId(), flowStats); |
| 111 | } catch (Exception e) { |
| 112 | log.error("Failure retrieving statistics from switch " + sw, e); |
| 113 | } |
| 114 | return flowStats; |
Srikanth Vavilapalli | 8a661e7 | 2014-10-27 15:40:22 -0700 | [diff] [blame] | 115 | } |
Fahad Naeem Khan | 9ae7fa1 | 2014-10-03 14:30:55 -0700 | [diff] [blame] | 116 | else if (statType == OFStatsType.PORT){ |
| 117 | log.debug("Switch Port Stats: req sent for all " |
| 118 | + "ports in switch {}", sw.getStringId()); |
| 119 | List<OFPortStatsEntryMod> portStats = null; |
| 120 | req = sw.getFactory() |
| 121 | .buildPortStatsRequest() |
| 122 | .setPortNo(OFPort.ANY).setXid |
| 123 | (sw.getNextTransactionId()).build(); |
| 124 | try { |
| 125 | future = sw.getStatistics(req); |
| 126 | values = future.get(10, TimeUnit.SECONDS); |
| 127 | portStats = new ArrayList<OFPortStatsEntryMod>(); |
| 128 | for (OFPortStatsEntry entry : ((OFPortStatsReply)values.get(0)).getEntries()) { |
| 129 | OFPortStatsEntryMod entryMod = new OFPortStatsEntryMod(entry); |
| 130 | portStats.add(entryMod); |
| 131 | } |
| 132 | log.debug("Switch Port Stats Entries from switch {} are {}", |
| 133 | sw.getStringId(), portStats); |
| 134 | } catch (Exception e) { |
| 135 | log.error("Failure retrieving statistics from switch " + sw, e); |
| 136 | } |
| 137 | return portStats; |
| 138 | } |
| 139 | else if (statType == OFStatsType.GROUP){ |
| 140 | log.debug("Switch Group Stats: req sent for all " |
| 141 | + "ports in switch {}", sw.getStringId()); |
| 142 | req = sw.getFactory().buildGroupStatsRequest().setXid |
| 143 | (sw.getNextTransactionId()).build(); |
Fahad Naeem Khan | 8a8daf2 | 2014-10-06 14:07:43 -0700 | [diff] [blame] | 144 | List<OFGroupStatsEntryMod> groupStats = new ArrayList<OFGroupStatsEntryMod>(); |
| 145 | try { |
| 146 | future = sw.getStatistics(req); |
| 147 | values = future.get(10, TimeUnit.SECONDS); |
| 148 | for (OFGroupStatsEntry entry : ((OFGroupStatsReply)values.get(0)).getEntries()) { |
| 149 | OFGroupStatsEntryMod entryMod = new OFGroupStatsEntryMod(entry); |
| 150 | groupStats.add(entryMod); |
| 151 | } |
| 152 | log.debug("Switch Group Stats Entries from switch {} are {}", |
| 153 | sw.getStringId(), groupStats); |
| 154 | } catch (Exception e) { |
| 155 | log.error("Failure retrieving statistics from switch " + sw, e); |
| 156 | } |
| 157 | return groupStats; |
Fahad Naeem Khan | 9ae7fa1 | 2014-10-03 14:30:55 -0700 | [diff] [blame] | 158 | } |
| 159 | else if (statType == OFStatsType.GROUP_DESC){ |
| 160 | log.debug("Switch Group Desc Stats: req sent for all " |
| 161 | + "ports in switch {}", sw.getStringId()); |
| 162 | List<OFGroupDescStatsEntryMod> GroupDescStats= new ArrayList<OFGroupDescStatsEntryMod>(); |
| 163 | req = sw.getFactory().buildGroupDescStatsRequest().setXid |
| 164 | (sw.getNextTransactionId()).build(); |
| 165 | try { |
| 166 | future = sw.getStatistics(req); |
| 167 | values = future.get(10, TimeUnit.SECONDS); |
| 168 | for (OFGroupDescStatsEntry entry : ((OFGroupDescStatsReply)values.get(0)).getEntries()) { |
| 169 | OFGroupDescStatsEntryMod entryMod = new OFGroupDescStatsEntryMod(entry); |
| 170 | GroupDescStats.add(entryMod); |
| 171 | } |
| 172 | log.debug("Switch Group_Desc Stats Entries from switch {} are {}", |
| 173 | sw.getStringId(), GroupDescStats); |
| 174 | } catch (Exception e) { |
| 175 | log.error("Failure retrieving statistics from switch " + sw, e); |
| 176 | } |
| 177 | return GroupDescStats; |
| 178 | } |
| 179 | /*else if (statType == OFStatisticsType.AGGREGATE) { |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 180 | OFAggregateStatisticsRequest specificReq = new OFAggregateStatisticsRequest(); |
| 181 | OFMatch match = new OFMatch(); |
| 182 | match.setWildcards(0xffffffff); |
| 183 | specificReq.setMatch(match); |
| 184 | specificReq.setOutPort(OFPort.OFPP_NONE.getValue()); |
| 185 | specificReq.setTableId((byte) 0xff); |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 186 | req.setStatistics(Collections.singletonList((OFStatistics) specificReq)); |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 187 | requestLength += specificReq.getLength(); |
Fahad Naeem Khan | 9ae7fa1 | 2014-10-03 14:30:55 -0700 | [diff] [blame] | 188 | } /*else if (statType == OFStatisticsType.QUEUE) { |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 189 | OFQueueStatisticsRequest specificReq = new OFQueueStatisticsRequest(); |
Ray Milkey | ff73514 | 2014-05-22 19:06:02 -0700 | [diff] [blame] | 190 | specificReq.setPortNumber(OFPort.OFPP_ALL.getValue()); |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 191 | // LOOK! openflowj does not define OFPQ_ALL! pulled this from openflow.h |
| 192 | // note that I haven't seen this work yet though... |
| 193 | specificReq.setQueueId(0xffffffff); |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 194 | req.setStatistics(Collections.singletonList((OFStatistics) specificReq)); |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 195 | requestLength += specificReq.getLength(); |
Fahad Naeem Khan | 9ae7fa1 | 2014-10-03 14:30:55 -0700 | [diff] [blame] | 196 | } else if (statType == OFStatisticsType.DESC || |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 197 | statType == OFStatisticsType.TABLE) { |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 198 | // pass - nothing todo besides set the type above |
Fahad Naeem Khan | 9ae7fa1 | 2014-10-03 14:30:55 -0700 | [diff] [blame] | 199 | }*/ |
Brian O'Connor | c67f9fa | 2014-08-07 18:17:46 -0700 | [diff] [blame] | 200 | // XXX S fix when we fix stats |
Jonathan Hart | c78b8f6 | 2014-08-07 22:31:09 -0700 | [diff] [blame] | 201 | try { |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 202 | future = sw.getStatistics(req); |
| 203 | values = future.get(10, TimeUnit.SECONDS); |
| 204 | } catch (Exception e) { |
| 205 | log.error("Failure retrieving statistics from switch " + sw, e); |
Jonathan Hart | c78b8f6 | 2014-08-07 22:31:09 -0700 | [diff] [blame] | 206 | } |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 207 | } |
| 208 | return values; |
| 209 | } |
| 210 | |
Srikanth Vavilapalli | b725851 | 2014-09-29 13:24:11 -0700 | [diff] [blame] | 211 | protected Object getSwitchStatistics(String switchId, OFStatsType statType) { |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 212 | return getSwitchStatistics(HexString.toLong(switchId), statType); |
| 213 | } |
Fahad Naeem Khan | d563af6 | 2014-10-08 17:37:25 -0700 | [diff] [blame] | 214 | //TODO: Java doc |
| 215 | protected List<?> getSwitchStatisticsForTable(long switchId, |
| 216 | OFStatsType statType, String tableType) { |
| 217 | IFloodlightProviderService floodlightProvider = |
| 218 | (IFloodlightProviderService) getContext().getAttributes(). |
| 219 | get(IFloodlightProviderService.class.getCanonicalName()); |
| 220 | IOFSwitch sw = floodlightProvider.getSwitches().get(switchId); |
| 221 | Future<List<OFStatsReply>> future; |
| 222 | List<OFStatsReply> values = null; |
| 223 | //getting tableId from CPqD driver |
| 224 | TableId tableId; |
| 225 | if (sw != null) { |
Srikanth Vavilapalli | 8a661e7 | 2014-10-27 15:40:22 -0700 | [diff] [blame] | 226 | if ((tableId = ((OFSwitchImplSpringOpenTTP) sw).getTableId(tableType)) == null) { |
Fahad Naeem Khan | d563af6 | 2014-10-08 17:37:25 -0700 | [diff] [blame] | 227 | log.error("Invalid tableType {} " + tableType); |
| 228 | return null; |
| 229 | } |
| 230 | OFStatsRequest<?> req = null; |
| 231 | if (statType == OFStatsType.FLOW) { |
| 232 | log.debug("Switch Flow Stats req for table {} sent to switch {}", |
| 233 | tableType,sw.getStringId()); |
| 234 | OFMatchV3 match = sw.getFactory().buildMatchV3() |
| 235 | .setOxmList(OFOxmList.EMPTY).build(); |
| 236 | req = sw.getFactory() |
| 237 | .buildFlowStatsRequest() |
| 238 | .setMatch(match) |
| 239 | .setOutPort(OFPort.ANY) |
| 240 | .setTableId(tableId) |
| 241 | .setXid(sw.getNextTransactionId()).build(); |
| 242 | List<OFFlowStatsEntryMod> flowStats = new ArrayList<OFFlowStatsEntryMod>(); |
| 243 | try { |
| 244 | future = sw.getStatistics(req); |
| 245 | values = future.get(10, TimeUnit.SECONDS); |
| 246 | for (OFFlowStatsEntry entry : ((OFFlowStatsReply)values.get(0)).getEntries()) { |
| 247 | OFFlowStatsEntryMod entryMod = new OFFlowStatsEntryMod(entry); |
| 248 | flowStats.add(entryMod); |
| 249 | } |
| 250 | log.debug("Switch flow Stats Entries for table {} from switch {} are {}", |
| 251 | tableType, sw.getStringId(), flowStats); |
| 252 | } catch (Exception e) { |
| 253 | log.error("Failure retrieving per table statistics from switch " + sw, e); |
| 254 | } |
| 255 | return flowStats; |
Srikanth Vavilapalli | 8a661e7 | 2014-10-27 15:40:22 -0700 | [diff] [blame] | 256 | } |
Fahad Naeem Khan | d563af6 | 2014-10-08 17:37:25 -0700 | [diff] [blame] | 257 | } |
| 258 | //should never get to this point |
| 259 | log.error("Failure retrieving {} table statistics from switch {}",tableType, sw); |
| 260 | return null; |
| 261 | } |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 262 | |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 263 | protected OFFeaturesReply getSwitchFeaturesReply(long switchId) { |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 264 | IFloodlightProviderService floodlightProvider = |
| 265 | (IFloodlightProviderService) getContext().getAttributes(). |
Fahad Naeem Khan | 9ae7fa1 | 2014-10-03 14:30:55 -0700 | [diff] [blame] | 266 | get(IFloodlightProviderService.class.getCanonicalName()); |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 267 | |
| 268 | IOFSwitch sw = floodlightProvider.getSwitches().get(switchId); |
Fahad Naeem Khan | 9ae7fa1 | 2014-10-03 14:30:55 -0700 | [diff] [blame] | 269 | //uture<OFFeaturesReply> future; |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 270 | OFFeaturesReply featuresReply = null; |
| 271 | if (sw != null) { |
Srikanth Vavilapalli | f25c7b0 | 2014-10-01 14:30:43 -0700 | [diff] [blame] | 272 | // XXX S fix when we fix stats |
Jonathan Hart | c78b8f6 | 2014-08-07 22:31:09 -0700 | [diff] [blame] | 273 | try { |
Fahad Naeem Khan | 9ae7fa1 | 2014-10-03 14:30:55 -0700 | [diff] [blame] | 274 | //future = sw.getFeaturesReplyFromSwitch(); |
| 275 | //featuresReply = future.get(10, TimeUnit.SECONDS); |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 276 | } catch (Exception e) { |
| 277 | log.error("Failure getting features reply from switch" + sw, e); |
Jonathan Hart | c78b8f6 | 2014-08-07 22:31:09 -0700 | [diff] [blame] | 278 | } |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 279 | } |
| 280 | |
| 281 | return featuresReply; |
| 282 | } |
| 283 | |
| 284 | protected OFFeaturesReply getSwitchFeaturesReply(String switchId) { |
| 285 | return getSwitchFeaturesReply(HexString.toLong(switchId)); |
Srikanth Vavilapalli | a0e6d58 | 2014-09-28 22:42:34 -0700 | [diff] [blame] | 286 | } |
Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 287 | |
| 288 | } |