private OFAction buildL2Modification(Instruction i) { L2ModificationInstruction l2m = (L2ModificationInstruction) i; ModEtherInstruction eth; switch (l2m.subtype()) { case ETH_DST: eth = (ModEtherInstruction) l2m; return factory().actions().setDlDst(MacAddress.of(eth.mac().toLong())); case ETH_SRC: eth = (ModEtherInstruction) l2m; return factory().actions().setDlSrc(MacAddress.of(eth.mac().toLong())); case VLAN_ID: ModVlanIdInstruction vlanId = (ModVlanIdInstruction) l2m; return factory().actions().setVlanVid(VlanVid.ofVlan(vlanId.vlanId().toShort())); case VLAN_PCP: ModVlanPcpInstruction vlanPcp = (ModVlanPcpInstruction) l2m; return factory().actions().setVlanPcp(VlanPcp.of(vlanPcp.vlanPcp())); case VLAN_POP: return factory().actions().stripVlan(); case VLAN_PUSH: return null; default: log.warn("Unimplemented action type {}.", l2m.subtype()); break; } return null; }
case ETH_DST: eth = (L2ModificationInstruction.ModEtherInstruction) l2m; oxm = factory.oxms().ethDst(MacAddress.of(eth.mac().toLong())); break; case ETH_SRC: eth = (L2ModificationInstruction.ModEtherInstruction) l2m; oxm = factory.oxms().ethSrc(MacAddress.of(eth.mac().toLong())); break; case VLAN_ID:
ethCriterion = (EthCriterion) c; mBuilder.setExact(MatchField.ETH_DST, MacAddress.of(ethCriterion.mac().toLong())); break; case ETH_DST_MASKED: ethCriterion = (EthCriterion) c; mBuilder.setMasked(MatchField.ETH_DST, MacAddress.of(ethCriterion.mac().toLong()), MacAddress.of(ethCriterion.mask().toLong())); break; case ETH_SRC: ethCriterion = (EthCriterion) c; mBuilder.setExact(MatchField.ETH_SRC, MacAddress.of(ethCriterion.mac().toLong())); break; case ETH_SRC_MASKED: ethCriterion = (EthCriterion) c; mBuilder.setMasked(MatchField.ETH_SRC, MacAddress.of(ethCriterion.mac().toLong()), MacAddress.of(ethCriterion.mask().toLong())); break; case ETH_TYPE: (IPv6NDLinkLayerAddressCriterion) c; mBuilder.setExact(MatchField.IPV6_ND_SLL, MacAddress.of(llAddressCriterion.mac().toLong())); break; case IPV6_ND_TLL:
case ARP_SHA: ModArpEthInstruction ei = (ModArpEthInstruction) i; oxm = factory().oxms().arpSha(MacAddress.of(ei.mac().toLong())); break; case ARP_OP: