use of org.openkilda.rulemanager.utils.RoutingMetadata in project open-kilda by telstra.
the class InputLldpRuleGenerator method buildLldpInputCustomerFlowCommand.
private SpeakerData buildLldpInputCustomerFlowCommand(Switch sw, FlowEndpoint endpoint) {
RoutingMetadata metadata = RoutingMetadata.builder().lldpFlag(true).build(sw.getFeatures());
FlowSpeakerDataBuilder<?, ?> builder = FlowSpeakerData.builder().switchId(endpoint.getSwitchId()).ofVersion(OfVersion.of(sw.getOfVersion())).cookie(new PortColourCookie(CookieType.LLDP_INPUT_CUSTOMER_TYPE, endpoint.getPortNumber())).table(OfTable.INPUT).priority(Constants.Priority.LLDP_INPUT_CUSTOMER_PRIORITY).match(Sets.newHashSet(FieldMatch.builder().field(Field.IN_PORT).value(endpoint.getPortNumber()).build(), FieldMatch.builder().field(Field.ETH_TYPE).value(EthType.LLDP).build())).instructions(Instructions.builder().goToTable(OfTable.PRE_INGRESS).writeMetadata(new OfMetadata(metadata.getValue(), metadata.getMask())).build());
// todo add RESET_COUNTERS flag
return builder.build();
}
use of org.openkilda.rulemanager.utils.RoutingMetadata in project open-kilda by telstra.
the class InputArpRuleGenerator method buildArpInputCustomerFlowCommand.
private SpeakerData buildArpInputCustomerFlowCommand(Switch sw, FlowEndpoint endpoint) {
RoutingMetadata metadata = RoutingMetadata.builder().arpFlag(true).build(sw.getFeatures());
FlowSpeakerDataBuilder<?, ?> builder = FlowSpeakerData.builder().switchId(endpoint.getSwitchId()).ofVersion(OfVersion.of(sw.getOfVersion())).cookie(new PortColourCookie(CookieType.ARP_INPUT_CUSTOMER_TYPE, endpoint.getPortNumber())).table(OfTable.INPUT).priority(Priority.ARP_INPUT_CUSTOMER_PRIORITY).match(Sets.newHashSet(FieldMatch.builder().field(Field.IN_PORT).value(endpoint.getPortNumber()).build(), FieldMatch.builder().field(Field.ETH_TYPE).value(EthType.ARP).build())).instructions(Instructions.builder().goToTable(OfTable.PRE_INGRESS).writeMetadata(new OfMetadata(metadata.getValue(), metadata.getMask())).build());
// todo add RESET_COUNTERS flag
return builder.build();
}
use of org.openkilda.rulemanager.utils.RoutingMetadata in project open-kilda by telstra.
the class MultiTableServer42IngressRuleGenerator method buildServer42IngressSingleVlanCommand.
private FlowSpeakerData buildServer42IngressSingleVlanCommand(Switch sw, FlowEndpoint ingressEndpoint) {
RoutingMetadata metadata = RoutingMetadata.builder().inputPort(ingressEndpoint.getPortNumber()).outerVlanId(ingressEndpoint.getOuterVlanId()).build(sw.getFeatures());
Set<FieldMatch> match = Sets.newHashSet(FieldMatch.builder().field(Field.IN_PORT).value(switchProperties.getServer42Port()).build(), FieldMatch.builder().field(Field.METADATA).value(metadata.getValue()).mask(metadata.getMask()).build());
return buildServer42IngressCommand(sw, ingressEndpoint, match, SERVER_42_INGRESS_SINGLE_VLAN_FLOW_PRIORITY);
}
use of org.openkilda.rulemanager.utils.RoutingMetadata in project open-kilda by telstra.
the class ArpIngressRuleGenerator method generateCommands.
@Override
public List<SpeakerData> generateCommands(Switch sw) {
RoutingMetadata metadata = buildMetadata(RoutingMetadata.builder().arpFlag(true), sw);
Set<FieldMatch> match = Sets.newHashSet(FieldMatch.builder().field(Field.METADATA).value(metadata.getValue()).mask(metadata.getMask()).build());
Instructions instructions = buildSendToControllerInstructions();
Cookie cookie = new Cookie(ARP_INGRESS_COOKIE);
return buildCommands(sw, cookie, OfTable.INGRESS, Priority.ARP_INGRESS_PRIORITY, match, instructions);
}
use of org.openkilda.rulemanager.utils.RoutingMetadata in project open-kilda by telstra.
the class ArpPostIngressRuleGenerator method generateCommands.
@Override
public List<SpeakerData> generateCommands(Switch sw) {
RoutingMetadata metadata = buildMetadata(RoutingMetadata.builder().arpFlag(true), sw);
Set<FieldMatch> match = Sets.newHashSet(FieldMatch.builder().field(Field.METADATA).value(metadata.getValue()).mask(metadata.getMask()).build());
Instructions instructions = buildSendToControllerInstructions();
Cookie cookie = new Cookie(ARP_POST_INGRESS_COOKIE);
return buildCommands(sw, cookie, OfTable.POST_INGRESS, Priority.ARP_POST_INGRESS_PRIORITY, match, instructions);
}
Aggregations