use of org.openkilda.rulemanager.utils.RoutingMetadata in project open-kilda by telstra.
the class MultiTableServer42IngressRuleGenerator method buildServer42PreIngressCommand.
private FlowSpeakerData buildServer42PreIngressCommand(Switch sw, FlowEndpoint endpoint) {
FlowSharedSegmentCookie cookie = FlowSharedSegmentCookie.builder(SharedSegmentType.SERVER42_QINQ_OUTER_VLAN).portNumber(switchProperties.getServer42Port()).vlanId(endpoint.getOuterVlanId()).build();
RoutingMetadata metadata = RoutingMetadata.builder().outerVlanId(endpoint.getOuterVlanId()).build(sw.getFeatures());
Instructions instructions = Instructions.builder().applyActions(Lists.newArrayList(new PopVlanAction())).writeMetadata(new OfMetadata(metadata.getValue(), metadata.getMask())).goToTable(OfTable.INGRESS).build();
FlowSpeakerDataBuilder<?, ?> builder = FlowSpeakerData.builder().switchId(endpoint.getSwitchId()).ofVersion(OfVersion.of(sw.getOfVersion())).cookie(cookie).table(OfTable.PRE_INGRESS).priority(SERVER_42_PRE_INGRESS_FLOW_PRIORITY).match(Sets.newHashSet(FieldMatch.builder().field(Field.IN_PORT).value(switchProperties.getServer42Port()).build(), FieldMatch.builder().field(Field.VLAN_VID).value(endpoint.getOuterVlanId()).build())).instructions(instructions);
return builder.build();
}
use of org.openkilda.rulemanager.utils.RoutingMetadata 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;
}
Aggregations