use of org.projectfloodlight.openflow.protocol.instruction.OFInstructionGotoTable in project open-kilda by telstra.
the class SwitchManager method buildLldpInputCustomerFlow.
@Override
public OFFlowMod buildLldpInputCustomerFlow(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.LLDP).build();
RoutingMetadata metadata = buildMetadata(RoutingMetadata.builder().lldpFlag(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.encodeLldpInputCustomer(port), LLDP_INPUT_CUSTOMER_PRIORITY, INPUT_TABLE_ID).setMatch(match).setInstructions(ImmutableList.of(goToTable, writeMetadata)).build();
}
use of org.projectfloodlight.openflow.protocol.instruction.OFInstructionGotoTable in project open-kilda by telstra.
the class SwitchManager method removeArpInputCustomerFlow.
@Override
public Long removeArpInputCustomerFlow(DatapathId dpid, int port) throws SwitchOperationException {
long cookie = Cookie.encodeArpInputCustomer(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.setMatch(buildInPortMatch(port, ofFactory));
builder.setInstructions(ImmutableList.of(goToTable));
builder.setPriority(ARP_INPUT_CUSTOMER_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 removeIntermediateIngressRule.
@Override
public long removeIntermediateIngressRule(DatapathId dpid, int port) throws SwitchOperationException {
IOFSwitch sw = lookupSwitch(dpid);
OFFactory ofFactory = sw.getOFFactory();
OFFlowDelete.Builder builder = ofFactory.buildFlowDelete();
long cookie = Cookie.encodeIngressRulePassThrough(port);
builder.setCookie(U64.of(cookie));
builder.setCookieMask(U64.NO_MASK);
Match match = buildInPortMatch(port, ofFactory);
builder.setMatch(match);
OFInstructionGotoTable goToTable = ofFactory.instructions().gotoTable(TableId.of(PRE_INGRESS_TABLE_ID));
builder.setInstructions(ImmutableList.of(goToTable));
builder.setPriority(INGRESS_CUSTOMER_PORT_RULE_PRIORITY_MULTITABLE);
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 removeLldpInputCustomerFlow.
@Override
public long removeLldpInputCustomerFlow(DatapathId dpid, int port) throws SwitchOperationException {
long cookie = Cookie.encodeLldpInputCustomer(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.setMatch(buildInPortMatch(port, ofFactory));
builder.setInstructions(ImmutableList.of(goToTable));
builder.setPriority(LLDP_INPUT_CUSTOMER_PRIORITY);
removeFlowByOfFlowDelete(dpid, INPUT_TABLE_ID, builder.build());
return cookie;
}
Aggregations