use of org.projectfloodlight.openflow.protocol.match.Match in project open-kilda by telstra.
the class Server42IslRttInputFlowGenerator method generateFlowMod.
/**
* Generated OFFlowMod for Server 42 ISL RTT input rule.
*/
public static OFFlowMod generateFlowMod(IOFSwitch sw, int udpOffset, int islPort, int server42Port, String magicIslRttMacAddress) {
OFFactory ofFactory = sw.getOFFactory();
Match match = buildMatch(ofFactory, server42Port, udpOffset + islPort, convertDpIdToMac(sw.getId()));
List<OFAction> actions = Lists.newArrayList(actionSetUdpSrcAction(ofFactory, TransportPort.of(SERVER_42_ISL_RTT_FORWARD_UDP_PORT)), actionSetDstMac(ofFactory, org.projectfloodlight.openflow.types.MacAddress.of(magicIslRttMacAddress)), actionSetOutputPort(ofFactory, OFPort.of(islPort)));
return prepareFlowModBuilder(ofFactory, encodeServer42IslRttInput(islPort), SERVER_42_ISL_RTT_INPUT_PRIORITY, INPUT_TABLE_ID).setMatch(match).setInstructions(ImmutableList.of(buildInstructionApplyActions(ofFactory, actions))).build();
}
use of org.projectfloodlight.openflow.protocol.match.Match in project open-kilda by telstra.
the class Server42IslRttTurningFlowGenerator method generateFlow.
@Override
public SwitchFlowTuple generateFlow(IOFSwitch sw) {
OFFactory ofFactory = sw.getOFFactory();
Match match = buildMatch(ofFactory, MacAddress.of(kildaCore.getConfig().getServer42IslRttMagicMacAddress()));
List<OFAction> actions = ImmutableList.of(actionSetUdpSrcAction(ofFactory, TransportPort.of(SERVER_42_ISL_RTT_REVERSE_UDP_PORT)), actionSetOutputPort(ofFactory, OFPort.IN_PORT));
OFFlowMod flowMod = prepareFlowModBuilder(ofFactory, SERVER_42_ISL_RTT_TURNING_COOKIE, SERVER_42_ISL_RTT_TURNING_PRIORITY, INPUT_TABLE_ID).setMatch(match).setInstructions(ImmutableList.of(buildInstructionApplyActions(ofFactory, actions))).build();
return SwitchFlowTuple.builder().sw(sw).flow(flowMod).build();
}
use of org.projectfloodlight.openflow.protocol.match.Match in project open-kilda by telstra.
the class LldpIngressFlowGenerator method getLldpFlowMod.
@Override
OFFlowMod getLldpFlowMod(IOFSwitch sw, OFInstructionMeter meter, List<OFAction> actionList) {
OFFactory ofFactory = sw.getOFFactory();
RoutingMetadata metadata = buildMetadata(RoutingMetadata.builder().lldpFlag(true), sw);
Match match = ofFactory.buildMatch().setMasked(MatchField.METADATA, OFMetadata.of(metadata.getValue()), OFMetadata.of(metadata.getMask())).build();
actionList.add(actionSendToController(sw.getOFFactory()));
OFInstructionApplyActions actions = ofFactory.instructions().applyActions(actionList).createBuilder().build();
return prepareFlowModBuilder(ofFactory, getCookie(), LLDP_INGRESS_PRIORITY, INGRESS_TABLE_ID).setMatch(match).setInstructions(meter != null ? ImmutableList.of(meter, actions) : ImmutableList.of(actions)).build();
}
use of org.projectfloodlight.openflow.protocol.match.Match in project open-kilda by telstra.
the class Server42FlowRttVxlanTurningFlowGenerator method generateFlow.
@Override
public SwitchFlowTuple generateFlow(IOFSwitch sw) {
Set<SwitchFeature> switchFeatures = featureDetectorService.detectSwitch(sw);
if (!switchFeatures.contains(NOVIFLOW_SWAP_ETH_SRC_ETH_DST) && !switchFeatures.contains(KILDA_OVS_SWAP_FIELD)) {
return SwitchFlowTuple.getEmpty();
}
OFFactory ofFactory = sw.getOFFactory();
Match match = buildMatch(sw.getId(), ofFactory);
List<OFAction> actions = ImmutableList.of(actionSetUdpSrcAction(ofFactory, TransportPort.of(SERVER_42_FLOW_RTT_REVERSE_UDP_VXLAN_PORT)), buildSwapAction(switchFeatures, ofFactory), actionSetOutputPort(ofFactory, OFPort.IN_PORT));
OFFlowMod flowMod = prepareFlowModBuilder(ofFactory, SERVER_42_FLOW_RTT_VXLAN_TURNING_COOKIE, SERVER_42_FLOW_RTT_VXLAN_TURNING_PRIORITY, INPUT_TABLE_ID).setMatch(match).setInstructions(ImmutableList.of(buildInstructionApplyActions(ofFactory, actions))).build();
return SwitchFlowTuple.builder().sw(sw).flow(flowMod).build();
}
use of org.projectfloodlight.openflow.protocol.match.Match in project open-kilda by telstra.
the class VerificationFlowGenerator method buildVerificationRule.
private OFFlowMod buildVerificationRule(IOFSwitch sw, boolean isBroadcast, long cookie, OFInstructionMeter meter, ArrayList<OFAction> actionList) {
OFFactory ofFactory = sw.getOFFactory();
if (!isBroadcast && ofFactory.getVersion().compareTo(OF_12) <= 0) {
return null;
}
OFInstructionApplyActions actions = ofFactory.instructions().applyActions(actionList).createBuilder().build();
Match match = matchVerification(sw, isBroadcast);
return prepareFlowModBuilder(ofFactory, cookie, VERIFICATION_RULE_PRIORITY, INPUT_TABLE_ID).setInstructions(meter != null ? ImmutableList.of(meter, actions) : ImmutableList.of(actions)).setMatch(match).build();
}
Aggregations