use of org.openkilda.rulemanager.action.PortOutAction in project open-kilda by telstra.
the class TransitYRuleGeneratorTest method assertTransitCommand.
private void assertTransitCommand(List<SpeakerData> commands, OfTable table, FlowTransitEncapsulation encapsulation) {
assertEquals(1, commands.size());
FlowSpeakerData flowCommandData = getCommand(FlowSpeakerData.class, commands);
assertEquals(SWITCH_1.getSwitchId(), flowCommandData.getSwitchId());
assertEquals(SWITCH_1.getOfVersion(), flowCommandData.getOfVersion().toString());
assertTrue(flowCommandData.getDependsOn().contains(SHARED_METER_UUID));
assertEquals(COOKIE, flowCommandData.getCookie());
assertEquals(table, flowCommandData.getTable());
assertEquals(Priority.Y_FLOW_PRIORITY, flowCommandData.getPriority());
Set<FieldMatch> expectedMatch;
if (encapsulation.getType().equals(FlowEncapsulationType.TRANSIT_VLAN)) {
expectedMatch = buildExpectedVlanMatch(PORT_NUMBER_1, encapsulation.getId());
} else {
expectedMatch = buildExpectedVxlanMatch(PORT_NUMBER_1, encapsulation.getId());
}
assertEqualsMatch(expectedMatch, flowCommandData.getMatch());
Instructions expectedInstructions = Instructions.builder().applyActions(Lists.newArrayList(new PortOutAction(new PortNumber(PORT_NUMBER_2)))).goToMeter(SHARED_METER_ID).build();
assertEquals(expectedInstructions, flowCommandData.getInstructions());
assertEquals(Sets.newHashSet(OfFlowFlag.RESET_COUNTERS), flowCommandData.getFlags());
}
use of org.openkilda.rulemanager.action.PortOutAction in project open-kilda by telstra.
the class SingleTableServer42IngressRuleGenerator method buildIngressInstructions.
private Instructions buildIngressInstructions(Switch sw, int outerVlan) {
List<Action> applyActions = new ArrayList<>(buildTransformActions(outerVlan, sw.getFeatures()));
applyActions.add(new PortOutAction(getOutPort(flowPath, flow)));
return Instructions.builder().applyActions(applyActions).build();
}
use of org.openkilda.rulemanager.action.PortOutAction in project open-kilda by telstra.
the class TransitYRuleGenerator method buildTransitCommand.
private SpeakerData buildTransitCommand(Switch sw, int inPort, int outPort) {
Instructions instructions = Instructions.builder().applyActions(Lists.newArrayList(new PortOutAction(new PortNumber(outPort)))).build();
if (sharedMeterId != null && sharedMeterId.getValue() != 0L) {
addMeterToInstructions(sharedMeterId, sw, instructions);
}
FlowSpeakerDataBuilder<?, ?> builder = FlowSpeakerData.builder().switchId(sw.getSwitchId()).ofVersion(OfVersion.of(sw.getOfVersion())).cookie(flowPath.getCookie().toBuilder().yFlow(true).build()).table(multiTable ? OfTable.TRANSIT : OfTable.INPUT).priority(Priority.Y_FLOW_PRIORITY).match(makeTransitMatch(sw, inPort, encapsulation)).instructions(instructions);
if (sw.getFeatures().contains(SwitchFeature.RESET_COUNTS_FLAG)) {
builder.flags(Sets.newHashSet(OfFlowFlag.RESET_COUNTERS));
}
return builder.build();
}
use of org.openkilda.rulemanager.action.PortOutAction in project open-kilda by telstra.
the class EgressRuleGenerator method buildApplyActions.
private List<Action> buildApplyActions(FlowEndpoint egressEndpoint, Switch sw) {
List<Action> result = buildTransformActions(egressEndpoint, sw);
result.add(new PortOutAction(new PortNumber(egressEndpoint.getPortNumber())));
return result;
}
use of org.openkilda.rulemanager.action.PortOutAction in project open-kilda by telstra.
the class MultiTableServer42IngressRuleGenerator method buildIngressInstructions.
private Instructions buildIngressInstructions(Switch sw, int innerVlan) {
List<Action> applyActions = new ArrayList<>(buildTransformActions(innerVlan, sw.getFeatures()));
applyActions.add(new PortOutAction(getOutPort(flowPath, flow)));
return Instructions.builder().applyActions(applyActions).build();
}
Aggregations