/** * Construct a new action instance which represents OF 1.3 PUSH_VLAN. * * @param tag An {@link EtherTypes} instance. */ public PushVlan(EtherTypes tag) { this(tag.intValue()); }
/** * Construct a new action instance which represents OF 1.3 PUSH_VLAN. * * @param tag An ethernet type of a new VLAN tag. */ public PushVlan(int tag) { type = ActionType.PUSH_VLAN; this.tag = tag; if (tag != EtherTypes.VLANTAGGED.intValue() && tag != EtherTypes.QINQ.intValue()) { // pass a value which will tell fail and tell something about the // original wrong value checkValue(ActionType.SET_DL_TYPE, 0xBAD << 16 | tag); } }
public static int getEtherTypeNumberInt(String name) { if (name.matches(regexNumberString)) { return Integer.valueOf(name); } for (EtherTypes type : EtherTypes.values()) { if (type.description.equalsIgnoreCase(name)) { return type.intValue(); } } return 0; }
public SetDlType(EtherTypes dlType) { type = ActionType.SET_DL_TYPE; this.dlType = dlType.intValue(); checkValue(this.dlType); }
private void runChecks() { checkValue(ActionType.SET_DL_TYPE, tag); checkValue(ActionType.SET_VLAN_PCP, pcp); checkValue(ActionType.SET_VLAN_CFI, cfi); checkValue(ActionType.SET_VLAN_ID, vlanId); checkValue(tci); // Run action specific check which cannot be run by parent if (tag != EtherTypes.VLANTAGGED.intValue() && tag != EtherTypes.QINQ.intValue() && tag != EtherTypes.OLDQINQ.intValue() && tag != EtherTypes.CISCOQINQ.intValue()) { // pass a value which will tell fail and tell something about the // original wrong value checkValue(ActionType.SET_DL_TYPE, 0xBAD << 16 | tag); } }
public PushVlan(EtherTypes tag, int pcp, int cfi, int vlanId) { type = ActionType.PUSH_VLAN; this.tag = tag.intValue(); this.cfi = cfi; this.pcp = pcp; this.vlanId = vlanId; this.tci = createTci(); this.header = createHeader(); runChecks(); }
if (((SetDlType) action).getDlType() == EtherTypes.IPv6.intValue()) { return true;
allowARP.setPriority("1"); allowARP.setNode(node); allowARP.setEtherType("0x" + Integer.toHexString(EtherTypes.ARP.intValue()) .toUpperCase()); allowARP.setActions(puntAction); allowLLDP.setPriority("1"); allowLLDP.setNode(node); allowLLDP.setEtherType("0x" + Integer.toHexString(EtherTypes.LLDP.intValue()) .toUpperCase()); allowLLDP.setActions(puntAction);