Search in sources :

Example 1 with CtZoneCaseValue

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue in project openflowplugin by opendaylight.

the class CtZoneConvertor method convert.

@Override
public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
    CtZoneCaseValue ctZoneCaseValue = (CtZoneCaseValue) input.getMatchEntryValue();
    NxmNxCtZoneBuilder ctZoneBuilder = new NxmNxCtZoneBuilder();
    ctZoneBuilder.setCtZone(ctZoneCaseValue.getCtZoneValues().getCtZone());
    return resolveAugmentation(ctZoneBuilder.build(), path, NxmNxCtZoneKey.class);
}
Also used : NxmNxCtZoneBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.ct.zone.grouping.NxmNxCtZoneBuilder) CtZoneCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue)

Example 2 with CtZoneCaseValue

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue in project openflowplugin by opendaylight.

the class CtZoneCodec method serialize.

@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
    serializeHeader(input, outBuffer);
    CtZoneCaseValue ctZoneCase = (CtZoneCaseValue) input.getMatchEntryValue();
    outBuffer.writeShort(ctZoneCase.getCtZoneValues().getCtZone());
}
Also used : CtZoneCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue)

Example 3 with CtZoneCaseValue

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue in project openflowplugin by opendaylight.

the class CtZoneCodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    input = ctZoneCodec.deserialize(buffer);
    final CtZoneCaseValue result = (CtZoneCaseValue) input.getMatchEntryValue();
    assertEquals(Nxm1Class.class, input.getOxmClass());
    assertEquals(NxmNxCtZone.class, input.getOxmMatchField());
    assertEquals(false, input.isHasMask());
    assertEquals(2, result.getCtZoneValues().getCtZone().shortValue());
}
Also used : CtZoneCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue) Test(org.junit.Test)

Example 4 with CtZoneCaseValue

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue in project openflowplugin by opendaylight.

the class CtZoneConvertorTest method testConvert1.

@Test
public void testConvert1() throws Exception {
    final CtZoneValuesBuilder ctZoneValuesBuilder = new CtZoneValuesBuilder().setCtZone(2);
    final CtZoneCaseValueBuilder ctZoneCaseValueBuilder = new CtZoneCaseValueBuilder().setCtZoneValues(ctZoneValuesBuilder.build());
    final CtZoneCaseValue ctZoneCaseValue = ctZoneCaseValueBuilder.build();
    when(matchEntry.getMatchEntryValue()).thenReturn(ctZoneCaseValue);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ctZoneConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
    Assert.assertEquals(2L, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ctZoneConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
    Assert.assertEquals(2L, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ctZoneConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
    Assert.assertEquals(2L, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ctZoneConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
    Assert.assertEquals(2L, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
}
Also used : CtZoneCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValueBuilder) Extension(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension) CtZoneValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.ct.zone.grouping.CtZoneValuesBuilder) CtZoneCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue) Test(org.junit.Test)

Example 5 with CtZoneCaseValue

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue in project openflowplugin by opendaylight.

the class CtZoneConvertorTest method testConvert.

@Test
public void testConvert() throws Exception {
    final MatchEntry converted = ctZoneConvertor.convert(extension);
    Assert.assertEquals(1L, ((CtZoneCaseValue) converted.getMatchEntryValue()).getCtZoneValues().getCtZone().longValue());
}
Also used : MatchEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry) Test(org.junit.Test)

Aggregations

CtZoneCaseValue (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue)4 Test (org.junit.Test)3 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)1 CtZoneValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.ct.zone.grouping.CtZoneValuesBuilder)1 CtZoneCaseValueBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValueBuilder)1 Extension (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension)1 NxmNxCtZoneBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.ct.zone.grouping.NxmNxCtZoneBuilder)1