@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; }
private static OutputActionCase _toAction(final Output sourceAction) { return new OutputActionCaseBuilder() .setOutputAction( new OutputActionBuilder().setOutputNodeConnector(MDFlowMapping.toUri(sourceAction.getPort())).build() ).build(); }
NodeConnector outputPort = out.getPort(); if (!switchManager.getNodeConnectors(node).contains(outputPort)) { String msg = String.format("Output port %s is not present on this container", outputPort);
return new Status(StatusCode.NOTALLOWED, "SNMPHandler.sendBySNMP(): flow's action is not to set OUTPUT port!"); NodeConnector oport = ((Output)action).getPort();
outPorts.append(" "); actions.append(action.getType().toString()).append(" = ").append(ao.getPort().getNodeConnectorIdAsString()).append("<br>"); } else if (action instanceof SetVlanId) { SetVlanId av = (SetVlanId) action;
private boolean doesFlowContainNodeConnector(Flow flow, NodeConnector nc) { if (nc == null) { return false; } Match match = flow.getMatch(); if (match.isPresent(MatchType.IN_PORT)) { NodeConnector matchPort = (NodeConnector) match.getField(MatchType.IN_PORT).getValue(); if (matchPort.equals(nc)) { return true; } } List<Action> actionsList = flow.getActions(); if (actionsList != null) { for (Action action : actionsList) { if (action instanceof Output) { NodeConnector actionPort = ((Output) action).getPort(); if (actionPort.equals(nc)) { return true; } } } } return false; }
/** * 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(); if (!containerOwnsNodeConnector(container, outPort)) { return false;
OFActionOutput ofAction = new OFActionOutput(); ofAction.setMaxLength((short) 0xffff); ofAction.setPort(PortConverter.toOFPort(a.getPort())); actionsList.add(ofAction); actionsLength += OFActionOutput.MINIMUM_LENGTH;