private void readVlanTci(ByteBuffer data, int nxmLen, boolean hasMask) { short vlan_mask = 0xfff; if (hasMask) { if ((nxmLen != 2 * 2) || (data.remaining() < 2 * 2)) return; else { short vlan = data.getShort(); vlan &= vlan_mask; super.setDataLayerVirtualLan(vlan); this.dataLayerVirtualLanMask = data.getShort(); this.dlVlanState = MatchFieldState.MATCH_FIELD_WITH_MASK; this.match_len += 8; this.wildcards ^= (1 << 20); } } else { if ((nxmLen != 2) || (data.remaining() < 2)) return; else { short vlan = data.getShort(); vlan &= vlan_mask; super.setDataLayerVirtualLan(vlan); this.dlVlanState = MatchFieldState.MATCH_FIELD_ONLY; this.match_len += 6; } } this.wildcards ^= (1 << 1); // Sync with 0F 1.0 Match }
super.setDataLayerVirtualLan(getVlanID(firstByte, secondByte)); this.wildcards ^= (1 << 1); // Sync with 0F 1.0 Match } else { super.setDataLayerVirtualLanPriorityCodePoint(getVlanPCP(firstByte)); super.setDataLayerVirtualLan(getVlanID(firstByte, secondByte)); this.wildcards ^= (1 << 20);
this.setDataLayerVirtualLan((short) 0xffff); this.setDataLayerVirtualLanPriorityCodePoint((byte) 0); } else { this.setDataLayerVirtualLan((short) (0xfff & scratch)); this.setDataLayerVirtualLanPriorityCodePoint((byte) ((0xe000 & scratch) >> 13)); this.dataLayerType = packetDataBB.getShort();
/** * Rewrites the given match according to the current instance. * * @param match * the OpenFlow match */ public void rewriteMatch(final OFMatch match) { final OVXLinkField linkField = OpenVirteXController.getInstance() .getOvxLinkField(); if (linkField == OVXLinkField.MAC_ADDRESS) { match.setDataLayerSource(this.getSrcMac().toBytes()); match.setDataLayerDestination(this.getDstMac().toBytes()); } else if (linkField == OVXLinkField.VLAN) { match.setDataLayerVirtualLan(this.getVlan()); } }
ofMatch.setDataLayerVirtualLan(vlan); wildcards &= ~OFMatch.OFPFW_DL_VLAN; } else {