/** * Construct a new {@link FlowModFlags} instance. * * @return A {@link FlowModFlags} instance. */ public FlowModFlags build() { return new FlowModFlags(checkOverlap, noBytCounts, noPktCounts, resetCounts, sendFlowRem); } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_bufferId == null) ? 0 : _bufferId.hashCode()); result = prime * result + ((_containerName == null) ? 0 : _containerName.hashCode()); result = prime * result + ((_cookie == null) ? 0 : _cookie.hashCode()); result = prime * result + ((_cookieMask == null) ? 0 : _cookieMask.hashCode()); result = prime * result + ((_flags == null) ? 0 : _flags.hashCode()); result = prime * result + ((_flowName == null) ? 0 : _flowName.hashCode()); result = prime * result + ((_hardTimeout == null) ? 0 : _hardTimeout.hashCode()); result = prime * result + ((_idleTimeout == null) ? 0 : _idleTimeout.hashCode()); result = prime * result + ((_instructions == null) ? 0 : _instructions.hashCode()); result = prime * result + ((_match == null) ? 0 : _match.hashCode()); result = prime * result + ((_node == null) ? 0 : _node.hashCode()); result = prime * result + ((_outGroup == null) ? 0 : _outGroup.hashCode()); result = prime * result + ((_outPort == null) ? 0 : _outPort.hashCode()); result = prime * result + ((_priority == null) ? 0 : _priority.hashCode()); result = prime * result + ((_tableId == null) ? 0 : _tableId.hashCode()); result = prime * result + ((_barrier == null) ? 0 : _barrier.hashCode()); result = prime * result + ((_installHw == null) ? 0 : _installHw.hashCode()); result = prime * result + ((_strict == null) ? 0 : _strict.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); return result; }
return false; } else if(!_flags.equals(other._flags)) { return false;
@Override public FlowModFlags convert( org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags source, ConvertorExecutor convertorExecutor) { FlowModFlags ofFlowModFlags; if (source != null) { ofFlowModFlags = new FlowModFlags( source.isCHECKOVERLAP(), source.isNOBYTCOUNTS(), source.isNOPKTCOUNTS(), source.isRESETCOUNTS(), source.isSENDFLOWREM()); } else { ofFlowModFlags = new FlowModFlags( FlowConvertor.DEFAULT_OFPFF_CHECK_OVERLAP, FlowConvertor.DEFAULT_OFPFF_NO_BYT_COUNTS, FlowConvertor.DEFAULT_OFPFF_NO_PKT_COUNTS, FlowConvertor.DEFAULT_OFPFF_RESET_COUNTS, FlowConvertor.DEFAULT_OFPFF_FLOW_REM); } return ofFlowModFlags; } }
@Override public FlowModFlagsV10 convert( FlowModFlags source, ConvertorExecutor convertorExecutor) { FlowModFlagsV10 ofFlowModFlags; if (source != null) { ofFlowModFlags = new FlowModFlagsV10( source.isCHECKOVERLAP(), FlowConvertor.DEFAULT_OFPFF_EMERGENCY, source.isSENDFLOWREM()); } else { ofFlowModFlags = new FlowModFlagsV10( FlowConvertor.DEFAULT_OFPFF_CHECK_OVERLAP, FlowConvertor.DEFAULT_OFPFF_EMERGENCY, FlowConvertor.DEFAULT_OFPFF_FLOW_REM); } return ofFlowModFlags; } }
/** * Publish a switch-flow-removed notification only if the specified * flow entry needs to be notified by a FLOW_REMOVED. * * @param nref A reference to the node that contains this flow table. * @param ofent A {@link OfMockFlowEntry} instance that indicates a * removed flow entry. */ private void publishFlowRemoved(NodeRef nref, OfMockFlowEntry ofent) { FlowModFlags flags = ofent.getFlowModFlags(); if (flags != null && Boolean.TRUE.equals(flags.isSENDFLOWREM())) { FlowRemovedBuilder builder = new FlowRemovedBuilder(ofent.getFlowEntry()). setNode(nref); if (ofVersion == VtnOpenflowVersion.OF10) { // OF 1.0 has no table ID. builder.setTableId(null); } ofMockProvider.publish(builder.build()); } } }
return equalsWithDefault(f1.isCHECKOVERLAP(), f2.isCHECKOVERLAP(), Boolean.FALSE) && equalsWithDefault(f1.isNOBYTCOUNTS(), f2.isNOBYTCOUNTS(), Boolean.FALSE) && equalsWithDefault(f1.isNOPKTCOUNTS(), f2.isNOPKTCOUNTS(), Boolean.FALSE) && equalsWithDefault(f1.isRESETCOUNTS(), f2.isRESETCOUNTS(), Boolean.FALSE) && equalsWithDefault(f1.isSENDFLOWREM(), f2.isSENDFLOWREM(), Boolean.FALSE);
public static FlowModFlags getDefaultInstance(String defaultValue) { List<java.lang.String> properties = Lists.newArrayList("cHECKOVERLAP", "nOBYTCOUNTS", "nOPKTCOUNTS", "rESETCOUNTS", "sENDFLOWREM" ); if (!properties.contains(defaultValue)) { throw new java.lang.IllegalArgumentException("invalid default parameter"); } int i = 0; return new FlowModFlags( properties.get(i++).equals(defaultValue) ? java.lang.Boolean.TRUE : null, properties.get(i++).equals(defaultValue) ? java.lang.Boolean.TRUE : null, properties.get(i++).equals(defaultValue) ? java.lang.Boolean.TRUE : null, properties.get(i++).equals(defaultValue) ? java.lang.Boolean.TRUE : null, properties.get(i++).equals(defaultValue) ? java.lang.Boolean.TRUE : null ); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_id == null) ? 0 : _id.hashCode()); result = prime * result + ((_key == null) ? 0 : _key.hashCode()); result = prime * result + ((_node == null) ? 0 : _node.hashCode()); result = prime * result + ((_barrier == null) ? 0 : _barrier.hashCode()); result = prime * result + ((_bufferId == null) ? 0 : _bufferId.hashCode()); result = prime * result + ((_containerName == null) ? 0 : _containerName.hashCode()); result = prime * result + ((_cookieMask == null) ? 0 : _cookieMask.hashCode()); result = prime * result + ((_flags == null) ? 0 : _flags.hashCode()); result = prime * result + ((_flowName == null) ? 0 : _flowName.hashCode()); result = prime * result + ((_installHw == null) ? 0 : _installHw.hashCode()); result = prime * result + ((_instructions == null) ? 0 : _instructions.hashCode()); result = prime * result + ((_match == null) ? 0 : _match.hashCode()); result = prime * result + ((_outGroup == null) ? 0 : _outGroup.hashCode()); result = prime * result + ((_outPort == null) ? 0 : _outPort.hashCode()); result = prime * result + ((_strict == null) ? 0 : _strict.hashCode()); result = prime * result + ((_cookie == null) ? 0 : _cookie.hashCode()); result = prime * result + ((_hardTimeout == null) ? 0 : _hardTimeout.hashCode()); result = prime * result + ((_idleTimeout == null) ? 0 : _idleTimeout.hashCode()); result = prime * result + ((_priority == null) ? 0 : _priority.hashCode()); result = prime * result + ((_tableId == null) ? 0 : _tableId.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); return result; }
return false; } else if(!_flags.equals(other.getFlags())) { return false;
private static FlowBuilder internalToMDFlow(final Flow sourceFlow) { Preconditions.checkArgument(sourceFlow != null); // Instruct switch to let controller know when flow is removed. FlowModFlags flags = new FlowModFlags(false, false, false, false, true); return new FlowBuilder() .setHardTimeout(Integer.valueOf(sourceFlow.getHardTimeout())) .setIdleTimeout(Integer.valueOf(sourceFlow.getIdleTimeout())) .setCookie(new FlowCookie(BigInteger.valueOf(sourceFlow.getId()))) .setPriority(Integer.valueOf((sourceFlow.getPriority()))) .setFlags(flags) .setInstructions(MDFlowMapping.toApplyInstruction(toMDActions(sourceFlow.getActions()))) .setMatch(FromSalConversionsUtils.toMatch(sourceFlow.getMatch())); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_bufferId == null) ? 0 : _bufferId.hashCode()); result = prime * result + ((_containerName == null) ? 0 : _containerName.hashCode()); result = prime * result + ((_cookie == null) ? 0 : _cookie.hashCode()); result = prime * result + ((_cookieMask == null) ? 0 : _cookieMask.hashCode()); result = prime * result + ((_flags == null) ? 0 : _flags.hashCode()); result = prime * result + ((_flowName == null) ? 0 : _flowName.hashCode()); result = prime * result + ((_hardTimeout == null) ? 0 : _hardTimeout.hashCode()); result = prime * result + ((_idleTimeout == null) ? 0 : _idleTimeout.hashCode()); result = prime * result + ((_instructions == null) ? 0 : _instructions.hashCode()); result = prime * result + ((_match == null) ? 0 : _match.hashCode()); result = prime * result + ((_node == null) ? 0 : _node.hashCode()); result = prime * result + ((_outGroup == null) ? 0 : _outGroup.hashCode()); result = prime * result + ((_outPort == null) ? 0 : _outPort.hashCode()); result = prime * result + ((_priority == null) ? 0 : _priority.hashCode()); result = prime * result + ((_tableId == null) ? 0 : _tableId.hashCode()); result = prime * result + ((_barrier == null) ? 0 : _barrier.hashCode()); result = prime * result + ((_installHw == null) ? 0 : _installHw.hashCode()); result = prime * result + ((_strict == null) ? 0 : _strict.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); return result; }
return false; } else if(!_flags.equals(other.getFlags())) { return false;
private FlowBuilder createBaseFlowForPortMatch(NodeConnector nc) { FlowBuilder floodFlow = new FlowBuilder().setTableId(flowTableId).setFlowName("flood"); floodFlow.setId(new FlowId(Long.toString(floodFlow.hashCode()))); Match match = new MatchBuilder().setInPort(nc.getId()).build(); floodFlow.setMatch(match) // .setPriority(flowPriority) // .setBufferId(OFConstants.OFP_NO_BUFFER) // .setHardTimeout(flowHardTimeout) // .setIdleTimeout(flowIdleTimeout) // .setCookie(new FlowCookie(BigInteger.valueOf(flowCookieInc.getAndIncrement()))) .setFlags(new FlowModFlags(false, false, false, false, false)); return floodFlow; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_bufferId == null) ? 0 : _bufferId.hashCode()); result = prime * result + ((_byteCount == null) ? 0 : _byteCount.hashCode()); result = prime * result + ((_containerName == null) ? 0 : _containerName.hashCode()); result = prime * result + ((_cookie == null) ? 0 : _cookie.hashCode()); result = prime * result + ((_cookieMask == null) ? 0 : _cookieMask.hashCode()); result = prime * result + ((_duration == null) ? 0 : _duration.hashCode()); result = prime * result + ((_flags == null) ? 0 : _flags.hashCode()); result = prime * result + ((_flowId == null) ? 0 : _flowId.hashCode()); result = prime * result + ((_flowName == null) ? 0 : _flowName.hashCode()); result = prime * result + ((_hardTimeout == null) ? 0 : _hardTimeout.hashCode()); result = prime * result + ((_idleTimeout == null) ? 0 : _idleTimeout.hashCode()); result = prime * result + ((_instructions == null) ? 0 : _instructions.hashCode()); result = prime * result + ((_key == null) ? 0 : _key.hashCode()); result = prime * result + ((_match == null) ? 0 : _match.hashCode()); result = prime * result + ((_outGroup == null) ? 0 : _outGroup.hashCode()); result = prime * result + ((_outPort == null) ? 0 : _outPort.hashCode()); result = prime * result + ((_packetCount == null) ? 0 : _packetCount.hashCode()); result = prime * result + ((_priority == null) ? 0 : _priority.hashCode()); result = prime * result + ((_tableId == null) ? 0 : _tableId.hashCode()); result = prime * result + ((_barrier == null) ? 0 : _barrier.hashCode()); result = prime * result + ((_installHw == null) ? 0 : _installHw.hashCode()); result = prime * result + ((_strict == null) ? 0 : _strict.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); return result; }
return false; } else if(!_flags.equals(other.getFlags())) { return false;
private Flow createFlow(FlowId flowId, String flowName, Short tableId, int priority, Match match, Instructions instructions) { return new FlowBuilder() .setId(flowId) .setFlowName(flowName) .setTableId(tableId) .setMatch(match) .setInstructions(instructions) .setPriority(priority) .setBufferId(OFP_NO_BUFFER) .setHardTimeout(DEFAULT_HARD_TIMEOUT) .setIdleTimeout(DEFAULT_IDLE_TIMEOUT) .setFlags(new FlowModFlags(false,false,false,false,false)) .setCookie(new FlowCookie(BigInteger.valueOf(flowCookieInc.getAndIncrement()))) .build(); }
result = prime * result + ((flow.getCookie() == null) ? 0 : flow.getCookie().hashCode()); result = prime * result + ((flow.getCookieMask() == null) ? 0 : flow.getCookieMask().hashCode()); result = prime * result + ((flow.getFlags() == null) ? 0 : flow.getFlags().hashCode()); result = prime * result + ((flow.getFlowName() == null) ? 0 : flow.getFlowName().hashCode());
private Flow createArpReplyToControllerFlow(final ArpMessageAddress senderAddress, final Ipv4Address ipForRequestedMac) { checkNotNull(senderAddress); checkNotNull(ipForRequestedMac); FlowBuilder arpFlow = new FlowBuilder().setTableId(Service.CLASSIFIER.getTable()) .setFlowName(ARP_REPLY_TO_CONTROLLER_FLOW_NAME) .setPriority(ARP_REPLY_TO_CONTROLLER_FLOW_PRIORITY) .setBufferId(OFConstants.OFP_NO_BUFFER) .setIdleTimeout(0) .setHardTimeout(0) .setCookie(new FlowCookie(BigInteger.valueOf(flowCookie.incrementAndGet()))) .setFlags(new FlowModFlags(false, false, false, false, false)); EthernetMatch ethernetMatch = ArpFlowFactory.createEthernetMatch(senderAddress.getHardwareAddress()); ArpMatch arpMatch = ArpFlowFactory.createArpMatch(senderAddress, ipForRequestedMac); Match match = new MatchBuilder().setEthernetMatch(ethernetMatch).setLayer3Match(arpMatch).build(); arpFlow.setMatch(match); arpFlow.setInstructions(new InstructionsBuilder().setInstruction( ImmutableList.of(SEND_TO_CONTROLLER_INSTRUCTION)).build()); arpFlow.setId(createFlowId(ipForRequestedMac)); return arpFlow.build(); }
@Override protected AddFlowInputBuilder initialValue() { final AddFlowInputBuilder fb = new AddFlowInputBuilder(); fb.setPriority(PRIORITY); fb.setBufferId(BUFFER_ID); final FlowCookie cookie = new FlowCookie(BigInteger.TEN); fb.setCookie(cookie); fb.setCookieMask(cookie); fb.setTableId(TABLE_ID); fb.setHardTimeout(HARD_TIMEOUT); fb.setIdleTimeout(IDLE_TIMEOUT); fb.setFlags(new FlowModFlags(false, false, false, false, false)); return fb; } };