public static void addMatchInPort(MatchBuilder match, NodeConnectorId nodeConnId) { match.setInPort(nodeConnId); }
/** * Create Ingress Port Match dpidLong, inPort * * @param matchBuilder Map matchBuilder MatchBuilder Object without a match * @param ncId OpenFlow Node Connector ID: the OF Node Port * @return matchBuilder Map MatchBuilder Object with a match */ public static MatchBuilder createInPortMatch(MatchBuilder matchBuilder, NodeConnectorId ncId) { LOG.debug("createInPortMatch() Node Connector ID is {} ", ncId); matchBuilder.setInPort(ncId); return matchBuilder; }
/** * Create Ingress Port Match dpidLong, inPort * * @param matchBuilder Map matchBuilder MatchBuilder Object without a match * @param nodeConnectorId NodeConnectorId for the ingress port * @return matchBuilder Map MatchBuilder Object with a match */ public static MatchBuilder createInPortMatch(MatchBuilder matchBuilder, NodeConnectorId ncId) { logger.debug("createInPortMatch() Node Connector ID is {} ", ncId); matchBuilder.setInPort(ncId); return matchBuilder; }
/** * Create Ingress Port Match dpidLong, inPort * * @param matchBuilder Map matchBuilder MatchBuilder Object without a match * @param dpidLong Long the datapath ID of a switch/node * @param inPort Long ingress port on a switch * @return matchBuilder Map MatchBuilder Object with a match */ public static MatchBuilder createInPortMatch(MatchBuilder matchBuilder, Long dpidLong, Long inPort) { NodeConnectorId ncid = new NodeConnectorId("openflow:" + dpidLong + ":" + inPort); LOG.debug("createInPortMatch() Node Connector ID is - Type=openflow: DPID={} inPort={} ", dpidLong, inPort); matchBuilder.setInPort(ncid); return matchBuilder; }
public static void addMatchInPort(MatchBuilder match, String nodeName, int value) { match.setInPort(new NodeConnectorId(nodeName + ":" + String.valueOf(value))); }
public static void addMatchInPort(MatchBuilder match, NodeId nodeId, long inPort) { match.setInPort(new NodeConnectorId(nodeId + ":" + inPort)); }
/** * Create Ingress Port Match dpidLong, inPort * * @param matchBuilder Map matchBuilder MatchBuilder Object without a match * @param dpidLong Long the datapath ID of a switch/node * @param inPort Long ingress port on a switch * @return matchBuilder Map MatchBuilder Object with a match */ public static MatchBuilder createInPortMatch(MatchBuilder matchBuilder, Long dpidLong, Long inPort) { NodeConnectorId ncid = new NodeConnectorId("openflow:" + dpidLong + ":" + inPort); logger.debug("createInPortMatch() Node Connector ID is - Type=openflow: DPID={} inPort={} ", dpidLong, inPort); matchBuilder.setInPort(ncid); return matchBuilder; }
public static MatchBuilder createInPortLocalMatch(MatchBuilder matchBuilder, Long dpidLong, String portId) { NodeConnectorId ncid = new NodeConnectorId("openflow:" + dpidLong + ":" + portId); logger.debug("createInPortMatch() Node Connector ID is - Type=openflow: DPID={} inPort={} ", dpidLong, "LOCAL"); matchBuilder.setInPort(NodeConnectorId.getDefaultInstance(ncid.getValue())); matchBuilder.setInPort(ncid); return matchBuilder; }
public static MatchBuilder createInPortReservedMatch(MatchBuilder matchBuilder, Long dpidLong, String inPort) { NodeConnectorId ncid = new NodeConnectorId("openflow:" + dpidLong + ":" + inPort); LOG.debug("createInPortResrevedMatch() Node Connector ID is - Type=openflow: DPID={} inPort={} ", dpidLong, inPort); matchBuilder.setInPort(NodeConnectorId.getDefaultInstance(ncid.getValue())); matchBuilder.setInPort(ncid); return matchBuilder; }
/** * Create Ingress Port Match dpidLong, inPort * * @param matchBuilder Map matchBuilder MatchBuilder Object without a match * @param dpidLong Long the datapath ID of a switch/node * @param inPort Long ingress port on a switch * @return matchBuilder Map MatchBuilder Object with a match */ public static MatchBuilder createInPortMatch(MatchBuilder matchBuilder, Long dpidLong, Long inPort) { NodeConnectorId ncid = new NodeConnectorId("openflow:" + dpidLong + ":" + inPort); LOG.debug("createInPortMatch() Node Connector ID is - Type=openflow: DPID={} inPort={} ", dpidLong, inPort); matchBuilder.setInPort(NodeConnectorId.getDefaultInstance(ncid.getValue())); matchBuilder.setInPort(ncid); return matchBuilder; }
private static MatchBuilder createInphyportMatch(final NodeId nodeId) { final MatchBuilder match = new MatchBuilder(); match.setInPort(new NodeConnectorId(nodeId + ":202")); match.setInPhyPort(new NodeConnectorId(nodeId + ":10122")); return match; }
private static MatchBuilder createInphyportMatch(NodeId nodeId) { MatchBuilder match = new MatchBuilder(); match.setInPort(new NodeConnectorId(nodeId + ":202")); match.setInPhyPort(new NodeConnectorId(nodeId + ":10122")); return match; }
@Override public Optional<MatchBuilder> process(@Nonnull InPortCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) { final MatchBuilder matchBuilder = data.getMatchBuilder(); final OpenflowVersion ofVersion = OpenflowVersion.get(data.getVersion()); final BigInteger datapathId = data.getDatapathId(); final PortNumber portNumber = source.getInPort().getPortNumber(); if (portNumber != null) { matchBuilder.setInPort(InventoryDataServiceUtil.nodeConnectorIdfromDatapathPortNo(datapathId, portNumber.getValue(), ofVersion)); } return Optional.of(matchBuilder); } }
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; }
/** * Allow untagged frames enter policy domain. Packets are sent to ingress NAT table * * @param goToTable tableId for goToTable instruction * @param connectorId should be external for now * @param priority of flow in the table * @param ofWriter flow writer */ void allowFromExternalPortFlow(short goToTable, NodeConnectorId connectorId, int priority, OfWriter ofWriter) { Match match = new MatchBuilder().setInPort(connectorId).build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "allowExternal", match); FlowBuilder flowBuilder = FlowUtils.base(tableId).setId(flowid) .setPriority(priority) .setMatch(match) .setInstructions(FlowUtils.gotoTableInstructions(goToTable)); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); }
private Flow allowFromTunnel(NodeConnectorId tunPort) { MatchBuilder mb = new MatchBuilder().setInPort(tunPort); addNxRegMatch(mb, RegMatch.of(NxmNxReg1.class, 0xffffffL)); Match match = mb.build(); FlowId flowId = FlowIdUtils.newFlowId(TABLE_ID, "tunnelallow", match); FlowBuilder flow = base().setId(flowId).setMatch(match).setPriority(65000).setInstructions( instructions(applyActionIns(nxOutputRegAction(NxmNxReg7.class)))); return flow.build(); }
public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match toMatch( Match sourceMatch) { if (sourceMatch != null) { MatchBuilder targetBuilder = new MatchBuilder(); targetBuilder.setEthernetMatch(ethernetMatch(sourceMatch)); targetBuilder.setIpMatch(ipMatch(sourceMatch)); targetBuilder.setVlanMatch(vlanMatch(sourceMatch)); targetBuilder.setLayer3Match(layer3Match(sourceMatch)); targetBuilder.setLayer4Match(layer4Match(sourceMatch)); targetBuilder.setInPort(inPortMatch(sourceMatch)); return targetBuilder.build(); } return null; }
private static Flow allowFromChainTunnel(NodeConnectorId tunPort, short tableId) { MatchBuilder mb = new MatchBuilder().setInPort(tunPort); addNxRegMatch(mb, RegMatch.of(NxmNxReg1.class, 0xffffffL)); Match match = mb.build(); FlowId flowId = FlowIdUtils.newFlowId(tableId, "chainport", match); FlowBuilder flow = base(tableId).setId(flowId).setMatch(match).setPriority(65000).setInstructions( instructions(applyActionIns(nxPopNshAction(), nxOutputRegAction(NxmNxReg7.class)))); return flow.build(); }
private static Flow createChainBroadcastFlow(SfcNshHeader sfcNshHeader, NodeConnectorId tunPort, EndpointFwdCtxOrdinals epFwdCtxOrds, short tableId, OfContext ctx) { int fdId = epFwdCtxOrds.getFdId(); MatchBuilder mb = new MatchBuilder().setInPort(tunPort); addNxNsiMatch(mb, sfcNshHeader.getNshNsiFromChain()); addNxNspMatch(mb, sfcNshHeader.getNshNspFromChain()); addNxTunIdMatch(mb, fdId); org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action fdReg = nxLoadRegAction(NxmNxReg5.class, BigInteger.valueOf(fdId)); Match match = mb.build(); FlowId flowId = FlowIdUtils.newFlowId(tableId, "chainbroadcast", match); FlowBuilder flowb = base(tableId).setId(flowId) .setPriority(150) .setMatch(match) .setInstructions(instructions(applyActionIns(fdReg), gotoTableIns(ctx.getPolicyManager().getTABLEID_DESTINATION_MAPPER()))); return flowb.build(); }
private static Flow allowFromChainPort(SfcNshHeader sfcNshHeader, NodeConnectorId port, short tableId, OfContext ctx) { // Matching on last NSP/NSI that SFF leaves on but with C1=0 MatchBuilder mb = new MatchBuilder(); FlowUtils.addNxNshc1RegMatch(mb, 0L); FlowUtils.addNxNsiMatch(mb, sfcNshHeader.getNshNsiFromChain()); FlowUtils.addNxNspMatch(mb, sfcNshHeader.getNshNspFromChain()); Match match = mb.setInPort(port).build(); FlowId flowId = FlowIdUtils.newFlowId(tableId, "chainport", match); FlowBuilder flowb = base(tableId).setId(flowId).setPriority(1200).setMatch(match).setInstructions( FlowUtils.gotoTableInstructions(ctx.getPolicyManager().getTABLEID_SOURCE_MAPPER())); return flowb.build(); }