use of org.projectfloodlight.openflow.protocol.match.Match in project open-kilda by telstra.
the class SwitchManager method removeTransitIslVxlanRule.
@Override
public long removeTransitIslVxlanRule(DatapathId dpid, int port) throws SwitchOperationException {
IOFSwitch sw = lookupSwitch(dpid);
OFFactory ofFactory = sw.getOFFactory();
OFFlowDelete.Builder builder = ofFactory.buildFlowDelete();
long cookie = Cookie.encodeIslVxlanTransit(port);
builder.setCookie(U64.of(cookie));
builder.setCookieMask(U64.NO_MASK);
Match match = buildTransitIslVxlanRuleMatch(port, ofFactory);
builder.setMatch(match);
builder.setPriority(ISL_TRANSIT_VXLAN_RULE_PRIORITY_MULTITABLE);
removeFlowByOfFlowDelete(dpid, INPUT_TABLE_ID, builder.build());
return cookie;
}
use of org.projectfloodlight.openflow.protocol.match.Match 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.match.Match in project open-kilda by telstra.
the class SwitchManager method removeEgressIslVxlanRule.
@Override
public long removeEgressIslVxlanRule(DatapathId dpid, int port) throws SwitchOperationException {
IOFSwitch sw = lookupSwitch(dpid);
OFFactory ofFactory = sw.getOFFactory();
OFFlowDelete.Builder builder = ofFactory.buildFlowDelete();
long cookie = Cookie.encodeIslVxlanEgress(port);
builder.setCookie(U64.of(cookie));
builder.setCookieMask(U64.NO_MASK);
Match match = buildEgressIslVxlanRuleMatch(dpid, port, ofFactory);
builder.setMatch(match);
builder.setPriority(ISL_EGRESS_VXLAN_RULE_PRIORITY_MULTITABLE);
removeFlowByOfFlowDelete(dpid, INPUT_TABLE_ID, builder.build());
return cookie;
}
use of org.projectfloodlight.openflow.protocol.match.Match 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();
}
use of org.projectfloodlight.openflow.protocol.match.Match in project open-kilda by telstra.
the class SwitchManager method buildEgressIslVlanRule.
private OFFlowMod buildEgressIslVlanRule(OFFactory ofFactory, int port) {
Match match = buildInPortMatch(port, ofFactory);
OFInstructionGotoTable goToTable = ofFactory.instructions().gotoTable(TableId.of(EGRESS_TABLE_ID));
return prepareFlowModBuilder(ofFactory, Cookie.encodeIslVlanEgress(port), ISL_EGRESS_VLAN_RULE_PRIORITY_MULTITABLE, INPUT_TABLE_ID).setMatch(match).setInstructions(ImmutableList.of(goToTable)).build();
}
Aggregations