Search in sources :

Example 1 with FlowEntriesMap

use of org.openkilda.testing.service.floodlight.model.FlowEntriesMap in project open-kilda by telstra.

the class StubServiceFactory method buildFlowEntries.

private FlowEntriesMap buildFlowEntries(SwitchId switchId, String switchVersion) {
    FlowEntriesMap result = new FlowEntriesMap();
    // broadcast verification flow (for all OF versions)
    FlowEntry flowEntry = buildFlowEntry("flow-0x8000000000000002", FlowMatchField.builder().ethDst("08:ed:02:ef:ff:ff").build(), FlowInstructions.builder().applyActions(FlowApplyActions.builder().flowOutput("controller").field(switchId.toMacAddress() + "->eth_dst").build()).build());
    result.put(flowEntry.getCookie(), flowEntry);
    // define drop flow
    FlowEntry dropFlow = FlowEntry.builder().instructions(FlowInstructions.builder().none("drop").build()).priority(1).cookie("flow-0x8000000000000001").build();
    result.put(dropFlow.getCookie(), dropFlow);
    if ("OF_13".equals(switchVersion)) {
        // non-broadcast flow for versions 13 and later
        FlowEntry flowFor13Version = buildFlowEntry("flow-0x8000000000000003", FlowMatchField.builder().ethDst(switchId.toMacAddress()).build(), FlowInstructions.builder().applyActions(FlowApplyActions.builder().flowOutput("controller").field(switchId.toMacAddress() + "->eth_dst").build()).build());
        result.put(flowFor13Version.getCookie(), flowFor13Version);
    }
    return result;
}
Also used : FlowEntry(org.openkilda.testing.service.floodlight.model.FlowEntry) FlowEntriesMap(org.openkilda.testing.service.floodlight.model.FlowEntriesMap)

Aggregations

FlowEntriesMap (org.openkilda.testing.service.floodlight.model.FlowEntriesMap)1 FlowEntry (org.openkilda.testing.service.floodlight.model.FlowEntry)1