use of org.projectfloodlight.openflow.protocol.instruction.OFInstructionGotoTable in project open-kilda by telstra.
the class IngressFlowModFactoryTest method verifyGoToTableInstruction.
// --- verify methods
protected void verifyGoToTableInstruction(OFFlowMod message) {
OFInstructionGotoTable match = null;
for (OFInstruction instruction : message.getInstructions()) {
if (instruction instanceof OFInstructionGotoTable) {
match = (OFInstructionGotoTable) instruction;
break;
}
}
if (expectPostIngressTableRedirect()) {
Assert.assertNotNull(match);
Assert.assertEquals(TableId.of(SwitchManager.POST_INGRESS_TABLE_ID), match.getTableId());
} else {
Assert.assertNull(match);
}
}
use of org.projectfloodlight.openflow.protocol.instruction.OFInstructionGotoTable in project open-kilda by telstra.
the class SwitchManager method buildEgressIslVxlanRule.
private OFFlowMod buildEgressIslVxlanRule(OFFactory ofFactory, DatapathId dpid, int port) {
Match match = buildEgressIslVxlanRuleMatch(dpid, port, ofFactory);
OFInstructionGotoTable goToTable = ofFactory.instructions().gotoTable(TableId.of(EGRESS_TABLE_ID));
return prepareFlowModBuilder(ofFactory, Cookie.encodeIslVxlanEgress(port), ISL_EGRESS_VXLAN_RULE_PRIORITY_MULTITABLE, INPUT_TABLE_ID).setMatch(match).setInstructions(ImmutableList.of(goToTable)).build();
}
use of org.projectfloodlight.openflow.protocol.instruction.OFInstructionGotoTable in project open-kilda by telstra.
the class SwitchManager method removeServer42FlowRttInputFlow.
@Override
public Long removeServer42FlowRttInputFlow(DatapathId dpid, int port) throws SwitchOperationException {
long cookie = Cookie.encodeServer42FlowRttInput(port);
IOFSwitch sw = lookupSwitch(dpid);
OFFactory ofFactory = sw.getOFFactory();
OFInstructionGotoTable goToTable = ofFactory.instructions().gotoTable(TableId.of(PRE_INGRESS_TABLE_ID));
OFFlowDelete.Builder builder = ofFactory.buildFlowDelete();
builder.setCookie(U64.of(cookie));
builder.setCookieMask(U64.NO_MASK);
builder.setInstructions(ImmutableList.of(goToTable));
builder.setPriority(SERVER_42_FLOW_RTT_INPUT_PRIORITY);
removeFlowByOfFlowDelete(dpid, INPUT_TABLE_ID, builder.build());
return cookie;
}
use of org.projectfloodlight.openflow.protocol.instruction.OFInstructionGotoTable in project open-kilda by telstra.
the class SwitchManager method buildTransitIslVxlanRule.
private OFFlowMod buildTransitIslVxlanRule(OFFactory ofFactory, int port) {
Match match = buildTransitIslVxlanRuleMatch(port, ofFactory);
OFInstructionGotoTable goToTable = ofFactory.instructions().gotoTable(TableId.of(TRANSIT_TABLE_ID));
return prepareFlowModBuilder(ofFactory, Cookie.encodeIslVxlanTransit(port), ISL_TRANSIT_VXLAN_RULE_PRIORITY_MULTITABLE, INPUT_TABLE_ID).setMatch(match).setInstructions(ImmutableList.of(goToTable)).build();
}
use of org.projectfloodlight.openflow.protocol.instruction.OFInstructionGotoTable in project open-kilda by telstra.
the class SwitchManager method buildArpInputCustomerFlow.
@Override
public OFFlowMod buildArpInputCustomerFlow(DatapathId dpid, int port) throws SwitchNotFoundException {
IOFSwitch sw = lookupSwitch(dpid);
OFFactory ofFactory = sw.getOFFactory();
Match match = ofFactory.buildMatch().setExact(MatchField.IN_PORT, OFPort.of(port)).setExact(MatchField.ETH_TYPE, EthType.ARP).build();
RoutingMetadata metadata = buildMetadata(RoutingMetadata.builder().arpFlag(true), sw);
OFInstructionWriteMetadata writeMetadata = ofFactory.instructions().buildWriteMetadata().setMetadata(metadata.getValue()).setMetadataMask(metadata.getMask()).build();
OFInstructionGotoTable goToTable = ofFactory.instructions().gotoTable(TableId.of(PRE_INGRESS_TABLE_ID));
return prepareFlowModBuilder(ofFactory, Cookie.encodeArpInputCustomer(port), ARP_INPUT_CUSTOMER_PRIORITY, INPUT_TABLE_ID).setMatch(match).setInstructions(ImmutableList.of(goToTable, writeMetadata)).build();
}
Aggregations