Search in sources :

Example 1 with ActionResubmit

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit in project openflowplugin by opendaylight.

the class ResubmitConvertor method convert.

@Override
public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(final Action input, final ActionPath path) {
    NxActionResubmit action = ((ActionResubmit) input.getActionChoice()).getNxActionResubmit();
    NxResubmitBuilder builder = new NxResubmitBuilder();
    builder.setInPort(action.getInPort());
    builder.setTable(action.getTable());
    return resolveAction(builder.build(), path);
}
Also used : NxActionResubmit(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.resubmit.grouping.NxActionResubmit) ActionResubmit(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit) NxResubmitBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.resubmit.grouping.NxResubmitBuilder) NxActionResubmit(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.resubmit.grouping.NxActionResubmit)

Example 2 with ActionResubmit

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit in project openflowplugin by opendaylight.

the class ResubmitCodecTest method getSubTypeTest2.

/**
 * If table != null or table != OFP_TABLE_ALL
 * SUBTYPE should be set to NXAST_RESUBMIT_TABLE_SUBTYPE.
 */
@Test
public void getSubTypeTest2() {
    Byte table = new Byte((byte) 1);
    action = createAction(null, table);
    ActionResubmit actionResubmit = (ActionResubmit) action.getActionChoice();
    byte result = resubmitCodec.getSubType(actionResubmit);
    assertEquals(NXAST_RESUBMIT_TABLE_SUBTYPE, result);
}
Also used : ActionResubmit(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit) Test(org.junit.Test)

Example 3 with ActionResubmit

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit in project openflowplugin by opendaylight.

the class ResubmitCodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    action = resubmitCodec.deserialize(buffer);
    ActionResubmit result = (ActionResubmit) action.getActionChoice();
    assertEquals(1, result.getNxActionResubmit().getInPort().intValue());
    assertEquals(2, result.getNxActionResubmit().getTable().byteValue());
    assertEquals(0, buffer.readableBytes());
}
Also used : ActionResubmit(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit) Test(org.junit.Test)

Example 4 with ActionResubmit

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit in project openflowplugin by opendaylight.

the class ResubmitCodec method serialize.

@Override
public void serialize(final Action input, final ByteBuf outBuffer) {
    byte table = OFP_TABLE_ALL;
    short inPort = OFP_IN_PORT;
    ActionResubmit action = (ActionResubmit) input.getActionChoice();
    serializeHeader(LENGTH, getSubType(action), outBuffer);
    if (action.getNxActionResubmit().getInPort() != null) {
        inPort = action.getNxActionResubmit().getInPort().shortValue();
    }
    if (action.getNxActionResubmit().getTable() != null) {
        table = action.getNxActionResubmit().getTable().byteValue();
    }
    outBuffer.writeShort(inPort);
    outBuffer.writeByte(table);
    outBuffer.writeZero(PADDING);
}
Also used : ActionResubmit(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit)

Example 5 with ActionResubmit

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit in project openflowplugin by opendaylight.

the class ResubmitCodecTest method getSubTypeTest1.

/**
 * If table == null or table == OFP_TABLE_ALL
 * SUBTYPE should be set to NXAST_RESUBMIT_SUBTYPE.
 */
@Test
public void getSubTypeTest1() {
    action = createAction(null, null);
    ActionResubmit actionResubmit = (ActionResubmit) action.getActionChoice();
    byte result = resubmitCodec.getSubType(actionResubmit);
    assertEquals(NXAST_RESUBMIT_SUBTYPE, result);
}
Also used : ActionResubmit(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit) Test(org.junit.Test)

Aggregations

ActionResubmit (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit)7 Test (org.junit.Test)4 NxActionResubmit (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.resubmit.grouping.NxActionResubmit)3 Before (org.junit.Before)1 NxResubmit (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.resubmit.grouping.NxResubmit)1 NxResubmitBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.resubmit.grouping.NxResubmitBuilder)1