/** * 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(); } }
/** * Generic setter for frame/packet/message's header field against which to match * * @param field the fields parameters as MAtchField object */ public void setField(MatchField field) { if (field.isValid()) { fields.put(field.getType(), field); matches |= field.getType().getIndex(); } }