/** * Generic setter for frame/packet/message's header fields against which to match * Note: For MAC addresses, please pass the cloned value to this function * * @param type packet's header field type * @param value field's value to assign to the match */ public void setField(MatchType type, Object value) { MatchField field = new MatchField(type, value); if (field.isValid()) { fields.put(type, field); matches |= type.getIndex(); } }
/** * Generic setter for frame/packet/message's header fields against which to match * Note: For MAC addresses, please pass the cloned value to this function * * @param type packet's header field type * @param value field's value to assign to the match * @param mask field's bitmask to apply to the match (has to be of the same class type of value) */ public void setField(MatchType type, Object value, Object mask) { MatchField field = new MatchField(type, value, mask); if (field.isValid()) { fields.put(type, field); matches |= type.getIndex(); } }
match.setField(new MatchField(MatchType.IN_PORT, incoming_connector)); match.setField(new MatchField(MatchType.DL_DST, dstMAC.clone())); installFlow(match, actions, incoming_node, (short) 1);
salMatch.setField(new MatchField(MatchType.IN_PORT, NodeConnectorCreator.createNodeConnector( ofMatch.getInputPort(), node))); .isZeroMAC(ofMatch.getDataLayerSource())) { byte srcMac[] = ofMatch.getDataLayerSource(); salMatch.setField(new MatchField(MatchType.DL_SRC, srcMac.clone())); .getDataLayerDestination())) { byte dstMac[] = ofMatch.getDataLayerDestination(); salMatch.setField(new MatchField(MatchType.DL_DST, dstMac.clone())); salMatch.setField(new MatchField(MatchType.DL_TYPE, ofMatch.getDataLayerType())); salMatch.setField(new MatchField(MatchType.DL_VLAN, vlan)); salMatch.setField(new MatchField(MatchType.IN_PORT, NodeConnectorCreator.createOFNodeConnector( v6Match.getInputPort(), node))); .isZeroMAC(ofMatch.getDataLayerSource())) { byte srcMac[] = v6Match.getDataLayerSource(); salMatch.setField(new MatchField(MatchType.DL_SRC, srcMac.clone()));
.getSubnetMaskLength(otherMask); if (thisMaskLen < otherMaskLen) { intersection.setField(new MatchField(type, NetUtils.getSubnetPrefix(otherAddress, otherMaskLen), otherMask)); } else { intersection.setField(new MatchField(type, NetUtils.getSubnetPrefix(thisAddress, thisMaskLen), thisMask));