use of org.openkilda.rulemanager.Instructions in project open-kilda by telstra.
the class MultiTableIngressRuleGenerator method buildInstructions.
private Instructions buildInstructions(Switch sw, List<Action> actions) {
Instructions instructions = Instructions.builder().applyActions(actions).goToTable(OfTable.POST_INGRESS).build();
addMeterToInstructions(flowPath.getMeterId(), sw, instructions);
if (flowPath.isOneSwitchFlow()) {
RoutingMetadata metadata = RoutingMetadata.builder().oneSwitchFlowFlag(true).build(sw.getFeatures());
instructions.setWriteMetadata(new OfMetadata(metadata.getValue(), metadata.getMask()));
}
return instructions;
}
use of org.openkilda.rulemanager.Instructions in project open-kilda by telstra.
the class BfdCatchRuleGenerator method generateCommands.
@Override
public List<SpeakerData> generateCommands(Switch sw) {
if (!sw.getFeatures().contains(SwitchFeature.BFD)) {
return Collections.emptyList();
}
Set<FieldMatch> match = catchRuleMatch(sw);
Instructions instructions = Instructions.builder().applyActions(Collections.singletonList(new PortOutAction(new PortNumber(SpecialPortType.LOCAL)))).build();
return Collections.singletonList(FlowSpeakerData.builder().switchId(sw.getSwitchId()).ofVersion(OfVersion.of(sw.getOfVersion())).cookie(new Cookie(CATCH_BFD_RULE_COOKIE)).table(OfTable.INPUT).priority(CATCH_BFD_RULE_PRIORITY).match(match).instructions(instructions).build());
}
use of org.openkilda.rulemanager.Instructions in project open-kilda by telstra.
the class EgressIslVlanRuleGenerator method generateCommands.
@Override
public List<SpeakerData> generateCommands(Switch sw) {
Set<FieldMatch> match = Sets.newHashSet(FieldMatch.builder().field(Field.IN_PORT).value(islPort).build());
Instructions instructions = Instructions.builder().goToTable(OfTable.EGRESS).build();
return Collections.singletonList(FlowSpeakerData.builder().switchId(sw.getSwitchId()).ofVersion(OfVersion.of(sw.getOfVersion())).cookie(new PortColourCookie(CookieType.MULTI_TABLE_ISL_VLAN_EGRESS_RULES, islPort)).table(OfTable.INPUT).priority(ISL_EGRESS_VLAN_RULE_PRIORITY_MULTITABLE).match(match).instructions(instructions).build());
}
use of org.openkilda.rulemanager.Instructions in project open-kilda by telstra.
the class LldpInputPreDropRuleGenerator method generateCommands.
@Override
public List<SpeakerData> generateCommands(Switch sw) {
Set<FieldMatch> match = Sets.newHashSet(FieldMatch.builder().field(Field.ETH_TYPE).value(EthType.LLDP).build());
Instructions instructions = buildSendToControllerInstructions();
Cookie cookie = new Cookie(LLDP_INPUT_PRE_DROP_COOKIE);
return buildCommands(sw, cookie, OfTable.INPUT, Priority.LLDP_INPUT_PRE_DROP_PRIORITY, match, instructions);
}
Aggregations