sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.provider.of.group.impl; |
| 17 | |
| 18 | import com.google.common.collect.Lists; |
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 19 | |
Ray Milkey | 84d5a29 | 2016-02-22 14:04:01 -0800 | [diff] [blame] | 20 | import org.onlab.packet.EthType; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 21 | import org.onlab.packet.Ip4Address; |
| 22 | import org.onlab.packet.MacAddress; |
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 23 | import org.onlab.packet.MplsLabel; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 24 | import org.onlab.packet.VlanId; |
| 25 | import org.onosproject.core.DefaultGroupId; |
| 26 | import org.onosproject.core.GroupId; |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 27 | import org.onosproject.net.DeviceId; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 28 | import org.onosproject.net.PortNumber; |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 29 | import org.onosproject.net.driver.DefaultDriverData; |
| 30 | import org.onosproject.net.driver.DefaultDriverHandler; |
| 31 | import org.onosproject.net.driver.Driver; |
| 32 | import org.onosproject.net.driver.DriverHandler; |
| 33 | import org.onosproject.net.driver.DriverService; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 34 | import org.onosproject.net.flow.DefaultTrafficTreatment; |
| 35 | import org.onosproject.net.flow.TrafficTreatment; |
| 36 | import org.onosproject.net.group.DefaultGroupBucket; |
| 37 | import org.onosproject.net.group.GroupBucket; |
| 38 | import org.onosproject.net.group.GroupBuckets; |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 39 | import org.onosproject.openflow.controller.Dpid; |
| 40 | import org.onosproject.openflow.controller.ExtensionTreatmentInterpreter; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 41 | import org.projectfloodlight.openflow.protocol.OFBucket; |
| 42 | import org.projectfloodlight.openflow.protocol.OFGroupType; |
| 43 | import org.projectfloodlight.openflow.protocol.action.OFAction; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 44 | import org.projectfloodlight.openflow.protocol.action.OFActionCopyTtlIn; |
| 45 | import org.projectfloodlight.openflow.protocol.action.OFActionCopyTtlOut; |
| 46 | import org.projectfloodlight.openflow.protocol.action.OFActionDecMplsTtl; |
| 47 | import org.projectfloodlight.openflow.protocol.action.OFActionDecNwTtl; |
| 48 | import org.projectfloodlight.openflow.protocol.action.OFActionExperimenter; |
Saurav Das | 8832990 | 2015-05-27 23:22:32 -0700 | [diff] [blame] | 49 | import org.projectfloodlight.openflow.protocol.action.OFActionGroup; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 50 | import org.projectfloodlight.openflow.protocol.action.OFActionOutput; |
| 51 | import org.projectfloodlight.openflow.protocol.action.OFActionPopMpls; |
| 52 | import org.projectfloodlight.openflow.protocol.action.OFActionPushMpls; |
| 53 | import org.projectfloodlight.openflow.protocol.action.OFActionSetDlDst; |
| 54 | import org.projectfloodlight.openflow.protocol.action.OFActionSetDlSrc; |
| 55 | import org.projectfloodlight.openflow.protocol.action.OFActionSetField; |
| 56 | import org.projectfloodlight.openflow.protocol.action.OFActionSetNwDst; |
| 57 | import org.projectfloodlight.openflow.protocol.action.OFActionSetNwSrc; |
| 58 | import org.projectfloodlight.openflow.protocol.action.OFActionSetVlanPcp; |
| 59 | import org.projectfloodlight.openflow.protocol.action.OFActionSetVlanVid; |
| 60 | import org.projectfloodlight.openflow.protocol.oxm.OFOxm; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 61 | import org.projectfloodlight.openflow.types.IPv4Address; |
| 62 | import org.projectfloodlight.openflow.types.OFVlanVidMatch; |
| 63 | import org.projectfloodlight.openflow.types.U32; |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 64 | import org.projectfloodlight.openflow.types.U64; |
Saurav Das | 73a7dd4 | 2015-08-19 22:20:31 -0700 | [diff] [blame] | 65 | import org.projectfloodlight.openflow.types.U8; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 66 | import org.projectfloodlight.openflow.types.VlanPcp; |
| 67 | import org.slf4j.Logger; |
| 68 | |
| 69 | import java.util.List; |
| 70 | |
| 71 | import static org.slf4j.LoggerFactory.getLogger; |
| 72 | |
| 73 | /* |
| 74 | * Builder for GroupBucketEntry. |
| 75 | */ |
| 76 | public class GroupBucketEntryBuilder { |
| 77 | |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 78 | private Dpid dpid; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 79 | private List<OFBucket> ofBuckets; |
| 80 | private OFGroupType type; |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 81 | private DriverService driverService; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 82 | |
| 83 | private final Logger log = getLogger(getClass()); |
| 84 | |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 85 | |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 86 | /** |
| 87 | * Creates a builder. |
| 88 | * |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 89 | * @param dpid dpid |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 90 | * @param ofBuckets list of OFBucket |
| 91 | * @param type Group type |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 92 | * @param driverService driver service |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 93 | */ |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 94 | public GroupBucketEntryBuilder(Dpid dpid, List<OFBucket> ofBuckets, OFGroupType type, |
| 95 | DriverService driverService) { |
| 96 | this.dpid = dpid; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 97 | this.ofBuckets = ofBuckets; |
| 98 | this.type = type; |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 99 | this.driverService = driverService; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 100 | } |
| 101 | |
| 102 | /** |
| 103 | * Builds a GroupBuckets. |
| 104 | * |
Jonathan Hart | 8ef6d3b | 2015-03-08 21:21:27 -0700 | [diff] [blame] | 105 | * @return GroupBuckets object, a list of GroupBuckets |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 106 | */ |
| 107 | public GroupBuckets build() { |
| 108 | List<GroupBucket> bucketList = Lists.newArrayList(); |
| 109 | |
| 110 | for (OFBucket bucket: ofBuckets) { |
| 111 | TrafficTreatment treatment = buildTreatment(bucket.getActions()); |
| 112 | // TODO: Use GroupBucketEntry |
| 113 | GroupBucket groupBucket = null; |
| 114 | switch (type) { |
| 115 | case INDIRECT: |
| 116 | groupBucket = |
| 117 | DefaultGroupBucket.createIndirectGroupBucket(treatment); |
| 118 | break; |
| 119 | case SELECT: |
| 120 | groupBucket = |
| 121 | DefaultGroupBucket.createSelectGroupBucket(treatment); |
| 122 | break; |
| 123 | case FF: |
| 124 | PortNumber port = |
| 125 | PortNumber.portNumber(bucket.getWatchPort().getPortNumber()); |
| 126 | GroupId groupId = |
| 127 | new DefaultGroupId(bucket.getWatchGroup().getGroupNumber()); |
| 128 | groupBucket = |
| 129 | DefaultGroupBucket.createFailoverGroupBucket(treatment, |
| 130 | port, groupId); |
| 131 | break; |
Charles Chan | c42e84e | 2015-10-20 16:24:19 -0700 | [diff] [blame] | 132 | case ALL: |
| 133 | groupBucket = |
| 134 | DefaultGroupBucket.createAllGroupBucket(treatment); |
| 135 | break; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 136 | default: |
| 137 | log.error("Unsupported Group type : {}", type); |
| 138 | } |
| 139 | if (groupBucket != null) { |
| 140 | bucketList.add(groupBucket); |
| 141 | } |
| 142 | } |
| 143 | return new GroupBuckets(bucketList); |
| 144 | } |
| 145 | |
| 146 | |
| 147 | private TrafficTreatment buildTreatment(List<OFAction> actions) { |
| 148 | TrafficTreatment.Builder builder = DefaultTrafficTreatment.builder(); |
| 149 | // If this is a drop rule |
| 150 | if (actions.size() == 0) { |
| 151 | builder.drop(); |
| 152 | return builder.build(); |
| 153 | } |
| 154 | for (OFAction act : actions) { |
| 155 | switch (act.getType()) { |
| 156 | case OUTPUT: |
| 157 | OFActionOutput out = (OFActionOutput) act; |
| 158 | builder.setOutput( |
| 159 | PortNumber.portNumber(out.getPort().getPortNumber())); |
| 160 | break; |
| 161 | case SET_VLAN_VID: |
| 162 | OFActionSetVlanVid vlan = (OFActionSetVlanVid) act; |
| 163 | builder.setVlanId(VlanId.vlanId(vlan.getVlanVid().getVlan())); |
| 164 | break; |
| 165 | case SET_VLAN_PCP: |
| 166 | OFActionSetVlanPcp pcp = (OFActionSetVlanPcp) act; |
| 167 | builder.setVlanPcp(pcp.getVlanPcp().getValue()); |
| 168 | break; |
Jonathan Hart | e106e4b | 2015-03-09 16:44:56 -0700 | [diff] [blame] | 169 | case POP_VLAN: |
| 170 | builder.popVlan(); |
| 171 | break; |
| 172 | case PUSH_VLAN: |
| 173 | builder.pushVlan(); |
| 174 | break; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 175 | case SET_DL_DST: |
| 176 | OFActionSetDlDst dldst = (OFActionSetDlDst) act; |
| 177 | builder.setEthDst( |
| 178 | MacAddress.valueOf(dldst.getDlAddr().getLong())); |
| 179 | break; |
| 180 | case SET_DL_SRC: |
| 181 | OFActionSetDlSrc dlsrc = (OFActionSetDlSrc) act; |
| 182 | builder.setEthSrc( |
| 183 | MacAddress.valueOf(dlsrc.getDlAddr().getLong())); |
| 184 | |
| 185 | break; |
| 186 | case SET_NW_DST: |
| 187 | OFActionSetNwDst nwdst = (OFActionSetNwDst) act; |
| 188 | IPv4Address di = nwdst.getNwAddr(); |
| 189 | builder.setIpDst(Ip4Address.valueOf(di.getInt())); |
| 190 | break; |
| 191 | case SET_NW_SRC: |
| 192 | OFActionSetNwSrc nwsrc = (OFActionSetNwSrc) act; |
| 193 | IPv4Address si = nwsrc.getNwAddr(); |
| 194 | builder.setIpSrc(Ip4Address.valueOf(si.getInt())); |
| 195 | break; |
| 196 | case EXPERIMENTER: |
| 197 | OFActionExperimenter exp = (OFActionExperimenter) act; |
Sho SHIMIZU | cc137a9 | 2016-03-11 15:10:54 -0800 | [diff] [blame^] | 198 | log.warn("Unsupported OFActionExperimenter {}", exp.getExperimenter()); |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 199 | break; |
| 200 | case SET_FIELD: |
| 201 | OFActionSetField setField = (OFActionSetField) act; |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 202 | handleSetField(builder, setField); |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 203 | break; |
| 204 | case POP_MPLS: |
| 205 | OFActionPopMpls popMpls = (OFActionPopMpls) act; |
Ray Milkey | 84d5a29 | 2016-02-22 14:04:01 -0800 | [diff] [blame] | 206 | builder.popMpls(new EthType(popMpls.getEthertype().getValue())); |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 207 | break; |
| 208 | case PUSH_MPLS: |
| 209 | OFActionPushMpls pushMpls = (OFActionPushMpls) act; |
| 210 | builder.pushMpls(); |
| 211 | break; |
| 212 | case COPY_TTL_IN: |
| 213 | OFActionCopyTtlIn copyTtlIn = (OFActionCopyTtlIn) act; |
| 214 | builder.copyTtlIn(); |
| 215 | break; |
| 216 | case COPY_TTL_OUT: |
| 217 | OFActionCopyTtlOut copyTtlOut = (OFActionCopyTtlOut) act; |
| 218 | builder.copyTtlOut(); |
| 219 | break; |
| 220 | case DEC_MPLS_TTL: |
| 221 | OFActionDecMplsTtl decMplsTtl = (OFActionDecMplsTtl) act; |
| 222 | builder.decMplsTtl(); |
| 223 | break; |
| 224 | case DEC_NW_TTL: |
| 225 | OFActionDecNwTtl decNwTtl = (OFActionDecNwTtl) act; |
| 226 | builder.decNwTtl(); |
| 227 | break; |
Saurav Das | 8832990 | 2015-05-27 23:22:32 -0700 | [diff] [blame] | 228 | case GROUP: |
| 229 | OFActionGroup grp = (OFActionGroup) act; |
| 230 | builder.group(new DefaultGroupId(grp.getGroup().getGroupNumber())); |
| 231 | break; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 232 | case SET_TP_DST: |
| 233 | case SET_TP_SRC: |
| 234 | case POP_PBB: |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 235 | case PUSH_PBB: |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 236 | case SET_MPLS_LABEL: |
| 237 | case SET_MPLS_TC: |
| 238 | case SET_MPLS_TTL: |
| 239 | case SET_NW_ECN: |
| 240 | case SET_NW_TOS: |
| 241 | case SET_NW_TTL: |
| 242 | case SET_QUEUE: |
| 243 | case STRIP_VLAN: |
| 244 | case ENQUEUE: |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 245 | default: |
| 246 | log.warn("Action type {} not yet implemented.", act.getType()); |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | return builder.build(); |
| 251 | } |
| 252 | |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 253 | private void handleSetField(TrafficTreatment.Builder builder, OFActionSetField action) { |
| 254 | OFOxm<?> oxm = action.getField(); |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 255 | switch (oxm.getMatchField().id) { |
| 256 | case VLAN_PCP: |
| 257 | @SuppressWarnings("unchecked") |
| 258 | OFOxm<VlanPcp> vlanpcp = (OFOxm<VlanPcp>) oxm; |
| 259 | builder.setVlanPcp(vlanpcp.getValue().getValue()); |
| 260 | break; |
| 261 | case VLAN_VID: |
| 262 | @SuppressWarnings("unchecked") |
| 263 | OFOxm<OFVlanVidMatch> vlanvid = (OFOxm<OFVlanVidMatch>) oxm; |
| 264 | builder.setVlanId(VlanId.vlanId(vlanvid.getValue().getVlan())); |
| 265 | break; |
| 266 | case ETH_DST: |
| 267 | @SuppressWarnings("unchecked") |
| 268 | OFOxm<org.projectfloodlight.openflow.types.MacAddress> ethdst = |
| 269 | (OFOxm<org.projectfloodlight.openflow.types.MacAddress>) oxm; |
| 270 | builder.setEthDst(MacAddress.valueOf(ethdst.getValue().getLong())); |
| 271 | break; |
| 272 | case ETH_SRC: |
| 273 | @SuppressWarnings("unchecked") |
| 274 | OFOxm<org.projectfloodlight.openflow.types.MacAddress> ethsrc = |
| 275 | (OFOxm<org.projectfloodlight.openflow.types.MacAddress>) oxm; |
| 276 | builder.setEthSrc(MacAddress.valueOf(ethsrc.getValue().getLong())); |
| 277 | break; |
| 278 | case IPV4_DST: |
| 279 | @SuppressWarnings("unchecked") |
| 280 | OFOxm<IPv4Address> ip4dst = (OFOxm<IPv4Address>) oxm; |
| 281 | builder.setIpDst(Ip4Address.valueOf(ip4dst.getValue().getInt())); |
| 282 | break; |
| 283 | case IPV4_SRC: |
| 284 | @SuppressWarnings("unchecked") |
| 285 | OFOxm<IPv4Address> ip4src = (OFOxm<IPv4Address>) oxm; |
| 286 | builder.setIpSrc(Ip4Address.valueOf(ip4src.getValue().getInt())); |
| 287 | break; |
| 288 | case MPLS_LABEL: |
| 289 | @SuppressWarnings("unchecked") |
| 290 | OFOxm<U32> labelId = (OFOxm<U32>) oxm; |
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 291 | builder.setMpls(MplsLabel.mplsLabel((int) labelId.getValue().getValue())); |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 292 | break; |
Saurav Das | 73a7dd4 | 2015-08-19 22:20:31 -0700 | [diff] [blame] | 293 | case MPLS_BOS: |
| 294 | @SuppressWarnings("unchecked") |
| 295 | OFOxm<U8> mplsBos = (OFOxm<U8>) oxm; |
| 296 | builder.setMplsBos(mplsBos.getValue() == U8.ZERO ? false : true); |
| 297 | break; |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 298 | case TUNNEL_ID: |
| 299 | @SuppressWarnings("unchecked") |
| 300 | OFOxm<U64> tunnelId = (OFOxm<U64>) oxm; |
| 301 | builder.setTunnelId(tunnelId.getValue().getValue()); |
| 302 | break; |
| 303 | case TUNNEL_IPV4_DST: |
| 304 | DriverHandler driver = getDriver(dpid); |
| 305 | ExtensionTreatmentInterpreter interpreter = driver.behaviour(ExtensionTreatmentInterpreter.class); |
| 306 | if (interpreter != null) { |
| 307 | builder.extension(interpreter.mapAction(action), DeviceId.deviceId(Dpid.uri(dpid))); |
| 308 | } |
| 309 | break; |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 310 | case ARP_OP: |
| 311 | case ARP_SHA: |
| 312 | case ARP_SPA: |
| 313 | case ARP_THA: |
| 314 | case ARP_TPA: |
| 315 | case BSN_EGR_PORT_GROUP_ID: |
| 316 | case BSN_GLOBAL_VRF_ALLOWED: |
| 317 | case BSN_IN_PORTS_128: |
| 318 | case BSN_L3_DST_CLASS_ID: |
| 319 | case BSN_L3_INTERFACE_CLASS_ID: |
| 320 | case BSN_L3_SRC_CLASS_ID: |
| 321 | case BSN_LAG_ID: |
| 322 | case BSN_TCP_FLAGS: |
| 323 | case BSN_UDF0: |
| 324 | case BSN_UDF1: |
| 325 | case BSN_UDF2: |
| 326 | case BSN_UDF3: |
| 327 | case BSN_UDF4: |
| 328 | case BSN_UDF5: |
| 329 | case BSN_UDF6: |
| 330 | case BSN_UDF7: |
| 331 | case BSN_VLAN_XLATE_PORT_GROUP_ID: |
| 332 | case BSN_VRF: |
| 333 | case ETH_TYPE: |
| 334 | case ICMPV4_CODE: |
| 335 | case ICMPV4_TYPE: |
| 336 | case ICMPV6_CODE: |
| 337 | case ICMPV6_TYPE: |
| 338 | case IN_PHY_PORT: |
| 339 | case IN_PORT: |
| 340 | case IPV6_DST: |
| 341 | case IPV6_FLABEL: |
| 342 | case IPV6_ND_SLL: |
| 343 | case IPV6_ND_TARGET: |
| 344 | case IPV6_ND_TLL: |
| 345 | case IPV6_SRC: |
| 346 | case IP_DSCP: |
| 347 | case IP_ECN: |
| 348 | case IP_PROTO: |
| 349 | case METADATA: |
| 350 | case MPLS_TC: |
| 351 | case OCH_SIGID: |
| 352 | case OCH_SIGID_BASIC: |
| 353 | case OCH_SIGTYPE: |
| 354 | case OCH_SIGTYPE_BASIC: |
| 355 | case SCTP_DST: |
| 356 | case SCTP_SRC: |
| 357 | case TCP_DST: |
| 358 | case TCP_SRC: |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 359 | case UDP_DST: |
| 360 | case UDP_SRC: |
| 361 | default: |
| 362 | log.warn("Set field type {} not yet implemented.", oxm.getMatchField().id); |
| 363 | break; |
| 364 | } |
| 365 | } |
Hyunsun Moon | a834c18 | 2015-12-16 03:01:56 -0800 | [diff] [blame] | 366 | |
| 367 | private DriverHandler getDriver(Dpid dpid) { |
| 368 | DeviceId deviceId = DeviceId.deviceId(Dpid.uri(dpid)); |
| 369 | Driver driver = driverService.getDriver(deviceId); |
| 370 | DriverHandler handler = new DefaultDriverHandler(new DefaultDriverData(driver, deviceId)); |
| 371 | return handler; |
| 372 | } |
sangho | 5afd02a | 2015-02-03 20:07:35 -0800 | [diff] [blame] | 373 | } |