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);
}
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);
}
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());
}
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);
}
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);
}
Aggregations