org.opendaylight.controller.sal.action.Output.getPort()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中org.opendaylight.controller.sal.action.Output.getPort()方法的一些代码示例,展示了Output.getPort()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Output.getPort()方法的具体详情如下:
包路径:org.opendaylight.controller.sal.action.Output
类名称:Output
方法名:getPort

Output.getPort介绍

暂无

代码示例

代码示例来源:origin: org.opendaylight.controller/forwardingrulesmanager.implementation

@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;
}

代码示例来源:origin: org.opendaylight.openflowplugin.legacy/sal-compatibility

private static OutputActionCase _toAction(final Output sourceAction) {
  return new OutputActionCaseBuilder()
  .setOutputAction(
      new OutputActionBuilder().setOutputNodeConnector(MDFlowMapping.toUri(sourceAction.getPort())).build()
      ).build();
}

代码示例来源:origin: org.opendaylight.controller/forwardingrulesmanager.implementation

NodeConnector outputPort = out.getPort();
if (!switchManager.getNodeConnectors(node).contains(outputPort)) {
  String msg = String.format("Output port %s is not present on this container", outputPort);

代码示例来源:origin: org.opendaylight.snmp4sdn/snmp4sdn

return new Status(StatusCode.NOTALLOWED, "SNMPHandler.sendBySNMP(): flow's action is not to set OUTPUT port!");
NodeConnector oport = ((Output)action).getPort();

代码示例来源:origin: org.opendaylight.controller/troubleshoot.web

outPorts.append(" ");
  actions.append(action.getType().toString()).append(" = ").append(ao.getPort().getNodeConnectorIdAsString()).append("<br>");
} else if (action instanceof SetVlanId) {
  SetVlanId av = (SetVlanId) action;

代码示例来源:origin: org.opendaylight.controller/forwardingrulesmanager.implementation

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;
}

代码示例来源:origin: org.opendaylight.controller/protocol_plugins.openflow

/**
 * 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;
}

代码示例来源:origin: org.opendaylight.snmp4sdn/snmp4sdn

if (action.getType() == ActionType.OUTPUT) {
  NodeConnector outPort = (NodeConnector) ((Output) action)
      .getPort();
  if (!containerOwnsNodeConnector(container, outPort)) {
    return false;

代码示例来源:origin: org.opendaylight.controller/protocol_plugins.openflow

OFActionOutput ofAction = new OFActionOutput();
ofAction.setMaxLength((short) 0xffff);
ofAction.setPort(PortConverter.toOFPort(a.getPort()));
actionsList.add(ofAction);
actionsLength += OFActionOutput.MINIMUM_LENGTH;

相关文章