Search in sources :

Example 1 with RoutingMetadataBuilder

use of org.openkilda.floodlight.utils.metadata.RoutingMetadata.RoutingMetadataBuilder in project open-kilda by telstra.

the class IngressServer42FlowInstallCommandTest method assertMetadata.

private void assertMetadata(OFFlowMod mod, int expectedOuterVlan, int expectedPort) {
    RoutingMetadataBuilder metadataBuilder = RoutingMetadata32.builder().inputPort(expectedPort);
    if (expectedOuterVlan != 0) {
        metadataBuilder.outerVlanId(expectedOuterVlan);
    }
    RoutingMetadata metadata = metadataBuilder.build(FEATURES);
    assertEquals(metadata.getValue(), mod.getMatch().getMasked(MatchField.METADATA).getValue().getValue());
    assertEquals(metadata.getMask(), mod.getMatch().getMasked(MatchField.METADATA).getMask().getValue());
}
Also used : RoutingMetadataBuilder(org.openkilda.floodlight.utils.metadata.RoutingMetadata.RoutingMetadataBuilder) RoutingMetadata(org.openkilda.floodlight.utils.metadata.RoutingMetadata)

Example 2 with RoutingMetadataBuilder

use of org.openkilda.floodlight.utils.metadata.RoutingMetadata.RoutingMetadataBuilder in project open-kilda by telstra.

the class IngressFlowLoopSegmentInstallCommandTest method assertMetadata.

private void assertMetadata(Match match, int expectedOuterVlan) {
    RoutingMetadataBuilder metadataBuilder = RoutingMetadata32.builder();
    metadataBuilder.outerVlanId(expectedOuterVlan);
    RoutingMetadata metadata = metadataBuilder.build(FEATURES);
    assertEquals(metadata.getValue(), match.getMasked(MatchField.METADATA).getValue().getValue());
    assertEquals(metadata.getMask(), match.getMasked(MatchField.METADATA).getMask().getValue());
}
Also used : RoutingMetadataBuilder(org.openkilda.floodlight.utils.metadata.RoutingMetadata.RoutingMetadataBuilder) RoutingMetadata(org.openkilda.floodlight.utils.metadata.RoutingMetadata)

Aggregations

RoutingMetadata (org.openkilda.floodlight.utils.metadata.RoutingMetadata)2 RoutingMetadataBuilder (org.openkilda.floodlight.utils.metadata.RoutingMetadata.RoutingMetadataBuilder)2