@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } SetTpSrc other = (SetTpSrc) obj; if (port != other.port) { return false; } return true; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + vlanId; return result; }
/** * Adds the specified action to the list of action of this flow * * @param action * @return false if the passed action is null or not valid or if it fails to * add it */ public boolean addAction(Action action) { if (action == null || !action.isValid()) { return false; } return actions.add(action); }
/** * remove ALL actions of type actionType from the list of actions of this * flow * * @param actionType * @return false if an action of that type is present and it fails to remove * it */ public boolean removeAction(ActionType actionType) { Iterator<Action> actionIter = this.getActions().iterator(); while (actionIter.hasNext()) { Action action = actionIter.next(); if (action.getType() == actionType) { if (!this.removeAction(action)) { return false; } } } return true; }
/** * Checks if the passed value is in the valid range for this action * * @param value * @return boolean */ protected void checkValue(int value) { if (type.isValidTarget(value) == false) { isValid = false; throwValueException(value); } }
@Override public NodeConnector getOutputPort(Node node, String flowName) { for (FlowEntryInstall index : this.nodeFlows.get(node)) { FlowEntryInstall flow = this.installedSwView.get(index); if (flow.getFlowName().equals(flowName)) { for (Action action : flow.getOriginal().getFlow().getActions()) { if (action.getType() == ActionType.OUTPUT) { return ((Output) action).getPort(); } } } } return null; }
/** * Checks if the passed value is in the valid range for the passed action * type This method is used for complex Action types which are * * @param value * @return boolean */ protected void checkValue(ActionType type, int value) { if (type.isValidTarget(value) == false) { isValid = false; throwValueException(value); } }
log.trace("{}", flow1.getActions().get(i)); if(action1.getType() != ActionType.OUTPUT){ log.warn("flow's action is not to set OUTPUT port!"); return false; log.trace("{}", flow1.getActions().get(i)); if(action2.getType() != ActionType.OUTPUT){ log.warn("flow's action is not to set OUTPUT port!"); return false;
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + cfi; return result; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } SetNwTos other = (SetNwTos) obj; if (tos != other.tos) { return false; } return true; }
/** * Set the actions list for this flow If a list is already present, it will * be replaced with the passed one. During addition, only the valid actions * will be added It is a no op if the passed actions is null An empty * actions is a vlaid input * * @param actions */ public void setActions(List<Action> actions) { if (actions == null) { return; } this.actions = new ArrayList<Action>(actions.size()); for (Action action : actions) { if (action.isValid()) { this.actions.add(action); } } }
actionsList = new ArrayList<OFAction>(); for (Action action : flow.getActions()) { if (action.getType() == ActionType.OUTPUT) { Output a = (Output) action; OFActionOutput ofAction = new OFActionOutput(); if (action.getType() == ActionType.ENQUEUE) { Enqueue a = (Enqueue) action; OFActionEnqueue ofAction = new OFActionEnqueue(); if (action.getType() == ActionType.DROP) { continue; if (action.getType() == ActionType.LOOPBACK) { OFActionOutput ofAction = new OFActionOutput(); ofAction.setPort(OFPort.OFPP_IN_PORT.getValue()); if (action.getType() == ActionType.FLOOD) { OFActionOutput ofAction = new OFActionOutput(); ofAction.setPort(OFPort.OFPP_FLOOD.getValue()); if (action.getType() == ActionType.FLOOD_ALL) { OFActionOutput ofAction = new OFActionOutput(); ofAction.setPort(OFPort.OFPP_ALL.getValue()); if (action.getType() == ActionType.CONTROLLER) { OFActionOutput ofAction = new OFActionOutput(); ofAction.setPort(OFPort.OFPP_CONTROLLER.getValue());
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + port; return result; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } SetTpDst other = (SetTpDst) obj; if (port != other.port) { return false; } return true; }
if (this.actions != null) { for (Action action : actions) { switch (action.getType()) { case SET_NW_SRC: if (((SetNwSrc) action).getAddress() instanceof Inet6Address) {
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + dlType; return result; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } SetDlType other = (SetDlType) obj; if (dlType != other.dlType) { return false; } return true; }
Action target = null; for (Action action : newFlowEntry.getFlow().getActions()) { if (action.getType() == ActionType.OUTPUT) { target = action; break;
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + pcp; return result; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } SetVlanPcp other = (SetVlanPcp) obj; if (pcp != other.pcp) { return false; } return true; }