/** * 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; }
@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; }
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;
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());
if (this.actions != null) { for (Action action : actions) { switch (action.getType()) { case SET_NW_SRC: if (((SetNwSrc) action).getAddress() instanceof Inet6Address) {
Action target = null; for (Action action : newFlowEntry.getFlow().getActions()) { if (action.getType() == ActionType.OUTPUT) { target = action; break;
actions.append(action.getType().toString()).append(" = ").append(ao.getPort().getNodeConnectorIdAsString()).append("<br>"); } else if (action instanceof SetVlanId) { SetVlanId av = (SetVlanId) action; String outVlanId = String.valueOf(av.getVlanId()); actions.append(action.getType().toString()).append(" = ").append(outVlanId).append("<br>"); } else if (action instanceof SetDlSrc) { SetDlSrc ads = (SetDlSrc) action; actions.append(action.getType().toString()).append(" = ").append(HexEncode.bytesToHexStringFormat(ads.getDlAddress())).append("<br>"); } else if (action instanceof SetDlDst) { SetDlDst add = (SetDlDst) action; actions.append(action.getType().toString()).append(" = ").append(HexEncode.bytesToHexStringFormat(add.getDlAddress())).append("<br>"); } else if (action instanceof SetNwSrc) { SetNwSrc ans = (SetNwSrc) action; actions.append(action.getType().toString()).append(" = ").append(ans.getAddressAsString()).append("<br>"); } else if (action instanceof SetNwDst) { SetNwDst and = (SetNwDst) action; actions.append(action.getType().toString()).append(" = ").append(and.getAddressAsString()).append("<br>"); } else if (action instanceof SetNwTos) { SetNwTos ant = (SetNwTos) action; actions.append(action.getType().toString()).append(" = ").append(ant.getNwTos()).append("<br>"); } else if (action instanceof SetTpSrc) { SetTpSrc ads = (SetTpSrc) action; actions.append(action.getType().toString()).append(" = ").append(ads.getPort()).append("<br>"); } else if (action instanceof SetTpDst) { SetTpDst atd = (SetTpDst) action; actions.append(action.getType().toString()).append(" = ").append(atd.getPort()).append("<br>"); } else if (action instanceof SetVlanPcp) { SetVlanPcp avp = (SetVlanPcp) action; actions.append(action.getType().toString()).append(" = ").append(avp.getPcp()).append("<br>");
return new Status(StatusCode.NOTALLOWED, "SNMPHandler.sendBySNMP(): flow.getActions() > 1"); if(action.getType() != ActionType.OUTPUT){ logger.debug("ERROR: sendBySNMP(): flow's action is not to set OUTPUT port!"); return new Status(StatusCode.NOTALLOWED, "SNMPHandler.sendBySNMP(): flow's action is not to set OUTPUT port!");
switch (action.getType()) { case SET_VLAN_ID: actionMatch.setField(MatchType.DL_VLAN,
/** * Check whether the ports in the flow match and flow actions for * the specified node belong to the container * * @param container * @param node * @param flow * @return */ private boolean flowPortsBelongToContainer(String container, Node node, Flow flow) { Match m = flow.getMatch(); if (m.isPresent(MatchType.IN_PORT)) { NodeConnector inPort = (NodeConnector) m.getField(MatchType.IN_PORT).getValue(); // If the incoming port is specified, check if it belongs to if (!containerOwnsNodeConnector(container, inPort)) { return false; } } // If an outgoing port is specified, it must belong to this container for (Action action : flow.getActions()) { if (action.getType() == ActionType.OUTPUT) { NodeConnector outPort = ((Output) action).getPort(); if (!containerOwnsNodeConnector(container, outPort)) { return false; } } } return true; }
if (action.getType() == ActionType.OUTPUT) { NodeConnector outPort = (NodeConnector) ((Output) action) .getPort();