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; }
@SuppressWarnings("unchecked") OFOxm<VlanPcp> vlanpcp = (OFOxm<VlanPcp>) oxm; builder.setVlanPcp(vlanpcp.getValue().getValue()); break; case VLAN_VID:
L2ModificationInstruction.ModVlanPcpInstruction vlanPcp = (L2ModificationInstruction.ModVlanPcpInstruction) l2m; oxm = factory.oxms().vlanPcp(VlanPcp.of(vlanPcp.vlanPcp())); break; case VLAN_POP:
case SET_VLAN_PCP: OFActionSetVlanPcp pcp = (OFActionSetVlanPcp) act; builder.setVlanPcp(pcp.getVlanPcp().getValue()); break; case SET_DL_DST:
case VLAN_PCP: ModVlanPcpInstruction vlanPcp = (ModVlanPcpInstruction) l2m; oxm = factory().oxms().vlanPcp(VlanPcp.of(vlanPcp.vlanPcp())); break; case MPLS_PUSH:
byte vlanPcp = match.get(MatchField.VLAN_PCP).getValue(); builder.matchVlanPcp(vlanPcp); break;
case VLAN_PCP: VlanPcpCriterion vpcp = (VlanPcpCriterion) c; mBuilder.setExact(MatchField.VLAN_PCP, VlanPcp.of(vpcp.priority())); break; case IP_DSCP: