2 * Copyright 2014-2015 Open Networking Laboratory
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.onosproject.provider.of.flow.impl;
18 import com.google.common.collect.Lists;
19 import org.onlab.packet.Ip4Address;
20 import org.onlab.packet.Ip4Prefix;
21 import org.onlab.packet.Ip6Address;
22 import org.onlab.packet.Ip6Prefix;
23 import org.onlab.packet.MacAddress;
24 import org.onlab.packet.MplsLabel;
25 import org.onlab.packet.TpPort;
26 import org.onlab.packet.VlanId;
27 import org.onosproject.core.DefaultGroupId;
28 import org.onosproject.net.DeviceId;
29 import org.onosproject.net.Lambda;
30 import org.onosproject.net.PortNumber;
31 import org.onosproject.net.driver.DefaultDriverData;
32 import org.onosproject.net.driver.DefaultDriverHandler;
33 import org.onosproject.net.driver.Driver;
34 import org.onosproject.net.driver.DriverHandler;
35 import org.onosproject.net.driver.DriverService;
36 import org.onosproject.net.flow.DefaultFlowEntry;
37 import org.onosproject.net.flow.DefaultFlowRule;
38 import org.onosproject.net.flow.DefaultTrafficSelector;
39 import org.onosproject.net.flow.DefaultTrafficTreatment;
40 import org.onosproject.net.flow.FlowEntry;
41 import org.onosproject.net.flow.FlowEntry.FlowEntryState;
42 import org.onosproject.net.flow.FlowRule;
43 import org.onosproject.net.flow.TrafficSelector;
44 import org.onosproject.net.flow.TrafficTreatment;
45 import org.onosproject.net.flow.instructions.Instructions;
46 import org.onosproject.openflow.controller.Dpid;
47 import org.onosproject.openflow.controller.ExtensionInterpreter;
48 import org.projectfloodlight.openflow.protocol.OFFlowMod;
49 import org.projectfloodlight.openflow.protocol.OFFlowRemoved;
50 import org.projectfloodlight.openflow.protocol.OFFlowStatsEntry;
51 import org.projectfloodlight.openflow.protocol.action.OFAction;
52 import org.projectfloodlight.openflow.protocol.action.OFActionCircuit;
53 import org.projectfloodlight.openflow.protocol.action.OFActionEnqueue;
54 import org.projectfloodlight.openflow.protocol.action.OFActionExperimenter;
55 import org.projectfloodlight.openflow.protocol.action.OFActionGroup;
56 import org.projectfloodlight.openflow.protocol.action.OFActionOutput;
57 import org.projectfloodlight.openflow.protocol.action.OFActionPopMpls;
58 import org.projectfloodlight.openflow.protocol.action.OFActionSetDlDst;
59 import org.projectfloodlight.openflow.protocol.action.OFActionSetDlSrc;
60 import org.projectfloodlight.openflow.protocol.action.OFActionSetField;
61 import org.projectfloodlight.openflow.protocol.action.OFActionSetNwDst;
62 import org.projectfloodlight.openflow.protocol.action.OFActionSetNwSrc;
63 import org.projectfloodlight.openflow.protocol.action.OFActionSetQueue;
64 import org.projectfloodlight.openflow.protocol.action.OFActionSetVlanPcp;
65 import org.projectfloodlight.openflow.protocol.action.OFActionSetVlanVid;
66 import org.projectfloodlight.openflow.protocol.instruction.OFInstruction;
67 import org.projectfloodlight.openflow.protocol.instruction.OFInstructionApplyActions;
68 import org.projectfloodlight.openflow.protocol.instruction.OFInstructionGotoTable;
69 import org.projectfloodlight.openflow.protocol.instruction.OFInstructionWriteActions;
70 import org.projectfloodlight.openflow.protocol.instruction.OFInstructionWriteMetadata;
71 import org.projectfloodlight.openflow.protocol.match.Match;
72 import org.projectfloodlight.openflow.protocol.match.MatchField;
73 import org.projectfloodlight.openflow.protocol.oxm.OFOxm;
74 import org.projectfloodlight.openflow.protocol.oxm.OFOxmOchSigidBasic;
75 import org.projectfloodlight.openflow.protocol.ver13.OFFactoryVer13;
76 import org.projectfloodlight.openflow.types.CircuitSignalID;
77 import org.projectfloodlight.openflow.types.IPv4Address;
78 import org.projectfloodlight.openflow.types.IPv6Address;
79 import org.projectfloodlight.openflow.types.Masked;
80 import org.projectfloodlight.openflow.types.OFVlanVidMatch;
81 import org.projectfloodlight.openflow.types.TransportPort;
82 import org.projectfloodlight.openflow.types.U32;
83 import org.projectfloodlight.openflow.types.U64;
84 import org.projectfloodlight.openflow.types.U8;
85 import org.projectfloodlight.openflow.types.VlanPcp;
86 import org.slf4j.Logger;
88 import java.util.List;
90 import static org.onosproject.net.flow.criteria.Criteria.matchLambda;
91 import static org.onosproject.net.flow.criteria.Criteria.matchOchSignalType;
92 import static org.onosproject.provider.of.flow.impl.OpenFlowValueMapper.lookupChannelSpacing;
93 import static org.onosproject.provider.of.flow.impl.OpenFlowValueMapper.lookupGridType;
94 import static org.onosproject.provider.of.flow.impl.OpenFlowValueMapper.lookupOchSignalType;
95 import static org.slf4j.LoggerFactory.getLogger;
97 public class FlowEntryBuilder {
98 private final Logger log = getLogger(getClass());
100 private final OFFlowStatsEntry stat;
101 private final OFFlowRemoved removed;
102 private final OFFlowMod flowMod;
104 private final Match match;
106 // All actions are contained in an OFInstruction. For OF1.0
107 // the instruction type is apply instruction (immediate set in ONOS speak)
108 private final List<OFInstruction> instructions;
110 private final Dpid dpid;
112 public enum FlowType { STAT, REMOVED, MOD }
114 private final FlowType type;
116 private final DriverService driverService;
118 public FlowEntryBuilder(Dpid dpid, OFFlowStatsEntry entry, DriverService driverService) {
120 this.match = entry.getMatch();
121 this.instructions = getInstructions(entry);
125 this.type = FlowType.STAT;
126 this.driverService = driverService;
129 public FlowEntryBuilder(Dpid dpid, OFFlowRemoved removed, DriverService driverService) {
130 this.match = removed.getMatch();
131 this.removed = removed;
134 this.instructions = null;
137 this.type = FlowType.REMOVED;
138 this.driverService = driverService;
141 public FlowEntryBuilder(Dpid dpid, OFFlowMod fm, DriverService driverService) {
142 this.match = fm.getMatch();
144 this.instructions = getInstructions(fm);
145 this.type = FlowType.MOD;
149 this.driverService = driverService;
152 public FlowEntry build(FlowEntryState... state) {
156 rule = DefaultFlowRule.builder()
157 .forDevice(DeviceId.deviceId(Dpid.uri(dpid)))
158 .withSelector(buildSelector())
159 .withTreatment(buildTreatment())
160 .withPriority(stat.getPriority())
161 .makeTemporary(stat.getIdleTimeout())
162 .withCookie(stat.getCookie().getValue())
163 .forTable(stat.getTableId().getValue())
166 return new DefaultFlowEntry(rule, FlowEntryState.ADDED,
167 stat.getDurationSec(), stat.getPacketCount().getValue(),
168 stat.getByteCount().getValue());
170 rule = DefaultFlowRule.builder()
171 .forDevice(DeviceId.deviceId(Dpid.uri(dpid)))
172 .withSelector(buildSelector())
173 .withPriority(removed.getPriority())
174 .makeTemporary(removed.getIdleTimeout())
175 .withCookie(removed.getCookie().getValue())
176 .forTable(removed.getTableId().getValue())
179 return new DefaultFlowEntry(rule, FlowEntryState.REMOVED, removed.getDurationSec(),
180 removed.getPacketCount().getValue(), removed.getByteCount().getValue());
182 FlowEntryState flowState = state.length > 0 ? state[0] : FlowEntryState.FAILED;
183 rule = DefaultFlowRule.builder()
184 .forDevice(DeviceId.deviceId(Dpid.uri(dpid)))
185 .withSelector(buildSelector())
186 .withTreatment(buildTreatment())
187 .withPriority(flowMod.getPriority())
188 .makeTemporary(flowMod.getIdleTimeout())
189 .withCookie(flowMod.getCookie().getValue())
190 .forTable(flowMod.getTableId().getValue())
193 return new DefaultFlowEntry(rule, flowState, 0, 0, 0);
195 log.error("Unknown flow type : {}", this.type);
201 private List<OFInstruction> getInstructions(OFFlowMod entry) {
202 switch (entry.getVersion()) {
204 return Lists.newArrayList(OFFactoryVer13.INSTANCE.instructions()
206 entry.getActions()));
210 return entry.getInstructions();
212 log.warn("Unknown OF version {}", entry.getVersion());
214 return Lists.newLinkedList();
217 private List<OFInstruction> getInstructions(OFFlowStatsEntry entry) {
218 switch (entry.getVersion()) {
220 return Lists.newArrayList(
221 OFFactoryVer13.INSTANCE.instructions().applyActions(entry.getActions()));
225 return entry.getInstructions();
227 log.warn("Unknown OF version {}", entry.getVersion());
229 return Lists.newLinkedList();
232 private TrafficTreatment buildTreatment() {
233 TrafficTreatment.Builder builder = DefaultTrafficTreatment.builder();
234 for (OFInstruction in : instructions) {
235 switch (in.getType()) {
237 builder.transition(((int) ((OFInstructionGotoTable) in)
238 .getTableId().getValue()));
241 OFInstructionWriteMetadata m = (OFInstructionWriteMetadata) in;
242 builder.writeMetadata(m.getMetadata().getValue(),
243 m.getMetadataMask().getValue());
247 buildActions(((OFInstructionWriteActions) in).getActions(),
252 buildActions(((OFInstructionApplyActions) in).getActions(),
256 builder.wipeDeferred();
263 log.warn("Unknown instructions type {}", in.getType());
267 return builder.build();
270 private TrafficTreatment.Builder buildActions(List<OFAction> actions,
271 TrafficTreatment.Builder builder) {
272 for (OFAction act : actions) {
273 switch (act.getType()) {
275 OFActionOutput out = (OFActionOutput) act;
277 PortNumber.portNumber(out.getPort().getPortNumber()));
280 OFActionSetVlanVid vlan = (OFActionSetVlanVid) act;
281 builder.setVlanId(VlanId.vlanId(vlan.getVlanVid().getVlan()));
284 OFActionSetVlanPcp pcp = (OFActionSetVlanPcp) act;
285 builder.setVlanPcp(pcp.getVlanPcp().getValue());
288 OFActionSetDlDst dldst = (OFActionSetDlDst) act;
290 MacAddress.valueOf(dldst.getDlAddr().getLong()));
293 OFActionSetDlSrc dlsrc = (OFActionSetDlSrc) act;
295 MacAddress.valueOf(dlsrc.getDlAddr().getLong()));
299 OFActionSetNwDst nwdst = (OFActionSetNwDst) act;
300 IPv4Address di = nwdst.getNwAddr();
301 builder.setIpDst(Ip4Address.valueOf(di.getInt()));
304 OFActionSetNwSrc nwsrc = (OFActionSetNwSrc) act;
305 IPv4Address si = nwsrc.getNwAddr();
306 builder.setIpSrc(Ip4Address.valueOf(si.getInt()));
309 OFActionExperimenter exp = (OFActionExperimenter) act;
310 if (exp.getExperimenter() == 0x80005A06 ||
311 exp.getExperimenter() == 0x748771) {
312 OFActionCircuit ct = (OFActionCircuit) exp;
313 short lambda = ((OFOxmOchSigidBasic) ct.getField()).getValue().getChannelNumber();
314 builder.add(Instructions.modL0Lambda(Lambda.indexedLambda(lambda)));
316 log.warn("Unsupported OFActionExperimenter {}", exp.getExperimenter());
320 OFActionSetField setField = (OFActionSetField) act;
321 handleSetField(builder, setField);
324 OFActionPopMpls popMpls = (OFActionPopMpls) act;
325 builder.popMpls((short) popMpls.getEthertype().getValue());
334 builder.copyTtlOut();
337 builder.decMplsTtl();
343 OFActionGroup group = (OFActionGroup) act;
344 builder.group(new DefaultGroupId(group.getGroup().getGroupNumber()));
347 OFActionSetQueue setQueue = (OFActionSetQueue) act;
348 builder.setQueue(setQueue.getQueueId());
351 OFActionEnqueue enqueue = (OFActionEnqueue) act;
352 builder.setQueue(enqueue.getQueueId(), PortNumber.portNumber(enqueue.getPort().getPortNumber()));
373 log.warn("Action type {} not yet implemented.", act.getType());
380 private void handleSetField(TrafficTreatment.Builder builder, OFActionSetField action) {
381 OFOxm<?> oxm = action.getField();
382 switch (oxm.getMatchField().id) {
384 @SuppressWarnings("unchecked")
385 OFOxm<VlanPcp> vlanpcp = (OFOxm<VlanPcp>) oxm;
386 builder.setVlanPcp(vlanpcp.getValue().getValue());
389 @SuppressWarnings("unchecked")
390 OFOxm<OFVlanVidMatch> vlanvid = (OFOxm<OFVlanVidMatch>) oxm;
391 builder.setVlanId(VlanId.vlanId(vlanvid.getValue().getVlan()));
394 @SuppressWarnings("unchecked")
395 OFOxm<org.projectfloodlight.openflow.types.MacAddress> ethdst =
396 (OFOxm<org.projectfloodlight.openflow.types.MacAddress>) oxm;
397 builder.setEthDst(MacAddress.valueOf(ethdst.getValue().getLong()));
400 @SuppressWarnings("unchecked")
401 OFOxm<org.projectfloodlight.openflow.types.MacAddress> ethsrc =
402 (OFOxm<org.projectfloodlight.openflow.types.MacAddress>) oxm;
403 builder.setEthSrc(MacAddress.valueOf(ethsrc.getValue().getLong()));
406 @SuppressWarnings("unchecked")
407 OFOxm<IPv4Address> ip4dst = (OFOxm<IPv4Address>) oxm;
408 builder.setIpDst(Ip4Address.valueOf(ip4dst.getValue().getInt()));
411 @SuppressWarnings("unchecked")
412 OFOxm<IPv4Address> ip4src = (OFOxm<IPv4Address>) oxm;
413 builder.setIpSrc(Ip4Address.valueOf(ip4src.getValue().getInt()));
416 @SuppressWarnings("unchecked")
417 OFOxm<U32> labelId = (OFOxm<U32>) oxm;
418 builder.setMpls(MplsLabel.mplsLabel((int) labelId.getValue().getValue()));
421 @SuppressWarnings("unchecked")
422 OFOxm<U8> mplsBos = (OFOxm<U8>) oxm;
423 builder.setMplsBos(mplsBos.getValue() == U8.ZERO ? false : true);
426 @SuppressWarnings("unchecked")
427 OFOxm<U64> tunnelId = (OFOxm<U64>) oxm;
428 builder.setTunnelId(tunnelId.getValue().getValue());
431 @SuppressWarnings("unchecked")
432 OFOxm<TransportPort> tcpdst = (OFOxm<TransportPort>) oxm;
433 builder.setTcpDst(TpPort.tpPort(tcpdst.getValue().getPort()));
436 @SuppressWarnings("unchecked")
437 OFOxm<TransportPort> tcpsrc = (OFOxm<TransportPort>) oxm;
438 builder.setTcpSrc(TpPort.tpPort(tcpsrc.getValue().getPort()));
441 @SuppressWarnings("unchecked")
442 OFOxm<TransportPort> udpdst = (OFOxm<TransportPort>) oxm;
443 builder.setUdpDst(TpPort.tpPort(udpdst.getValue().getPort()));
446 @SuppressWarnings("unchecked")
447 OFOxm<TransportPort> udpsrc = (OFOxm<TransportPort>) oxm;
448 builder.setUdpSrc(TpPort.tpPort(udpsrc.getValue().getPort()));
450 case TUNNEL_IPV4_DST:
451 DriverHandler driver = getDriver(dpid);
452 ExtensionInterpreter interpreter = driver.behaviour(ExtensionInterpreter.class);
453 if (interpreter != null) {
454 builder.extension(interpreter.mapAction(action), DeviceId.deviceId(Dpid.uri(dpid)));
462 case BSN_EGR_PORT_GROUP_ID:
463 case BSN_GLOBAL_VRF_ALLOWED:
464 case BSN_IN_PORTS_128:
465 case BSN_L3_DST_CLASS_ID:
466 case BSN_L3_INTERFACE_CLASS_ID:
467 case BSN_L3_SRC_CLASS_ID:
478 case BSN_VLAN_XLATE_PORT_GROUP_ID:
499 case OCH_SIGID_BASIC:
501 case OCH_SIGTYPE_BASIC:
505 log.warn("Set field type {} not yet implemented.", oxm.getMatchField().id);
510 // CHECKSTYLE IGNORE MethodLength FOR NEXT 1 LINES
511 private TrafficSelector buildSelector() {
514 Ip6Address ip6Address;
517 TrafficSelector.Builder builder = DefaultTrafficSelector.builder();
518 for (MatchField<?> field : match.getMatchFields()) {
521 builder.matchInPort(PortNumber
522 .portNumber(match.get(MatchField.IN_PORT).getPortNumber()));
525 builder.matchInPhyPort(PortNumber
526 .portNumber(match.get(MatchField.IN_PHY_PORT).getPortNumber()));
530 match.get(MatchField.METADATA).getValue().getValue();
531 builder.matchMetadata(metadata);
534 mac = MacAddress.valueOf(match.get(MatchField.ETH_DST).getLong());
535 builder.matchEthDst(mac);
538 mac = MacAddress.valueOf(match.get(MatchField.ETH_SRC).getLong());
539 builder.matchEthSrc(mac);
542 int ethType = match.get(MatchField.ETH_TYPE).getValue();
543 builder.matchEthType((short) ethType);
546 VlanId vlanId = null;
547 if (match.isPartiallyMasked(MatchField.VLAN_VID)) {
548 Masked<OFVlanVidMatch> masked = match.getMasked(MatchField.VLAN_VID);
549 if (masked.getValue().equals(OFVlanVidMatch.PRESENT)
550 && masked.getMask().equals(OFVlanVidMatch.PRESENT)) {
554 if (!match.get(MatchField.VLAN_VID).isPresentBitSet()) {
555 vlanId = VlanId.NONE;
557 vlanId = VlanId.vlanId(match.get(MatchField.VLAN_VID).getVlan());
560 if (vlanId != null) {
561 builder.matchVlanId(vlanId);
565 byte vlanPcp = match.get(MatchField.VLAN_PCP).getValue();
566 builder.matchVlanPcp(vlanPcp);
569 byte ipDscp = match.get(MatchField.IP_DSCP).getDscpValue();
570 builder.matchIPDscp(ipDscp);
573 byte ipEcn = match.get(MatchField.IP_ECN).getEcnValue();
574 builder.matchIPEcn(ipEcn);
577 short proto = match.get(MatchField.IP_PROTO).getIpProtocolNumber();
578 builder.matchIPProtocol((byte) proto);
581 if (match.isPartiallyMasked(MatchField.IPV4_SRC)) {
582 Masked<IPv4Address> maskedIp = match.getMasked(MatchField.IPV4_SRC);
583 ip4Prefix = Ip4Prefix.valueOf(
584 maskedIp.getValue().getInt(),
585 maskedIp.getMask().asCidrMaskLength());
587 ip4Prefix = Ip4Prefix.valueOf(
588 match.get(MatchField.IPV4_SRC).getInt(),
589 Ip4Prefix.MAX_MASK_LENGTH);
591 builder.matchIPSrc(ip4Prefix);
594 if (match.isPartiallyMasked(MatchField.IPV4_DST)) {
595 Masked<IPv4Address> maskedIp = match.getMasked(MatchField.IPV4_DST);
596 ip4Prefix = Ip4Prefix.valueOf(
597 maskedIp.getValue().getInt(),
598 maskedIp.getMask().asCidrMaskLength());
600 ip4Prefix = Ip4Prefix.valueOf(
601 match.get(MatchField.IPV4_DST).getInt(),
602 Ip4Prefix.MAX_MASK_LENGTH);
604 builder.matchIPDst(ip4Prefix);
607 builder.matchTcpSrc(TpPort.tpPort(match.get(MatchField.TCP_SRC).getPort()));
610 builder.matchTcpDst(TpPort.tpPort(match.get(MatchField.TCP_DST).getPort()));
613 builder.matchUdpSrc(TpPort.tpPort(match.get(MatchField.UDP_SRC).getPort()));
616 builder.matchUdpDst(TpPort.tpPort(match.get(MatchField.UDP_DST).getPort()));
619 builder.matchMplsLabel(MplsLabel.mplsLabel((int) match.get(MatchField.MPLS_LABEL)
623 builder.matchMplsBos(match.get(MatchField.MPLS_BOS).getValue());
626 builder.matchSctpSrc(TpPort.tpPort(match.get(MatchField.SCTP_SRC).getPort()));
629 builder.matchSctpDst(TpPort.tpPort(match.get(MatchField.SCTP_DST).getPort()));
632 byte icmpType = (byte) match.get(MatchField.ICMPV4_TYPE).getType();
633 builder.matchIcmpType(icmpType);
636 byte icmpCode = (byte) match.get(MatchField.ICMPV4_CODE).getCode();
637 builder.matchIcmpCode(icmpCode);
640 if (match.isPartiallyMasked(MatchField.IPV6_SRC)) {
641 Masked<IPv6Address> maskedIp = match.getMasked(MatchField.IPV6_SRC);
642 ip6Prefix = Ip6Prefix.valueOf(
643 maskedIp.getValue().getBytes(),
644 maskedIp.getMask().asCidrMaskLength());
646 ip6Prefix = Ip6Prefix.valueOf(
647 match.get(MatchField.IPV6_SRC).getBytes(),
648 Ip6Prefix.MAX_MASK_LENGTH);
650 builder.matchIPv6Src(ip6Prefix);
653 if (match.isPartiallyMasked(MatchField.IPV6_DST)) {
654 Masked<IPv6Address> maskedIp = match.getMasked(MatchField.IPV6_DST);
655 ip6Prefix = Ip6Prefix.valueOf(
656 maskedIp.getValue().getBytes(),
657 maskedIp.getMask().asCidrMaskLength());
659 ip6Prefix = Ip6Prefix.valueOf(
660 match.get(MatchField.IPV6_DST).getBytes(),
661 Ip6Prefix.MAX_MASK_LENGTH);
663 builder.matchIPv6Dst(ip6Prefix);
667 match.get(MatchField.IPV6_FLABEL).getIPv6FlowLabelValue();
668 builder.matchIPv6FlowLabel(flowLabel);
671 byte icmpv6type = (byte) match.get(MatchField.ICMPV6_TYPE).getValue();
672 builder.matchIcmpv6Type(icmpv6type);
675 byte icmpv6code = (byte) match.get(MatchField.ICMPV6_CODE).getValue();
676 builder.matchIcmpv6Code(icmpv6code);
680 Ip6Address.valueOf(match.get(MatchField.IPV6_ND_TARGET).getBytes());
681 builder.matchIPv6NDTargetAddress(ip6Address);
684 mac = MacAddress.valueOf(match.get(MatchField.IPV6_ND_SLL).getLong());
685 builder.matchIPv6NDSourceLinkLayerAddress(mac);
688 mac = MacAddress.valueOf(match.get(MatchField.IPV6_ND_TLL).getLong());
689 builder.matchIPv6NDTargetLinkLayerAddress(mac);
692 builder.matchIPv6ExthdrFlags((short) match.get(MatchField.IPV6_EXTHDR)
696 CircuitSignalID sigId = match.get(MatchField.OCH_SIGID);
697 builder.add(matchLambda(Lambda.ochSignal(
698 lookupGridType(sigId.getGridType()), lookupChannelSpacing(sigId.getChannelSpacing()),
699 sigId.getChannelNumber(), sigId.getSpectralWidth())
703 U8 sigType = match.get(MatchField.OCH_SIGTYPE);
704 builder.add(matchOchSignalType(lookupOchSignalType((byte) sigType.getValue())));
707 long tunnelId = match.get(MatchField.TUNNEL_ID).getValue();
708 builder.matchTunnelId(tunnelId);
711 mac = MacAddress.valueOf(match.get(MatchField.ARP_THA).getLong());
712 builder.matchArpTha(mac);
720 log.warn("Match type {} not yet implemented.", field.id);
723 return builder.build();
726 private DriverHandler getDriver(Dpid dpid) {
727 DeviceId deviceId = DeviceId.deviceId(Dpid.uri(dpid));
728 Driver driver = driverService.getDriver(deviceId);
729 DriverHandler handler = new DefaultDriverHandler(new DefaultDriverData(driver, deviceId));