use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PortStatusMask in project openflowplugin by opendaylight.
the class SetAsyncInputMessageFactory method decodePortStatusMask.
private static List<PortStatusMask> decodePortStatusMask(ByteBuf input) {
List<PortStatusMask> inMasks = new ArrayList<>();
PortStatusMaskBuilder maskBuilder;
for (int i = 0; i < SEPARATE_ROLES; i++) {
maskBuilder = new PortStatusMaskBuilder();
maskBuilder.setMask(decodePortReasons(input.readUnsignedInt()));
inMasks.add(maskBuilder.build());
}
return inMasks;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PortStatusMask in project openflowplugin by opendaylight.
the class GetAsyncReplyMessageFactory method decodePortStatusMask.
private static List<PortStatusMask> decodePortStatusMask(ByteBuf input) {
List<PortStatusMask> inMasks = new ArrayList<>();
PortStatusMaskBuilder maskBuilder;
for (int i = 0; i < SEPARATE_ROLES; i++) {
maskBuilder = new PortStatusMaskBuilder();
maskBuilder.setMask(decodePortReasons(input.readUnsignedInt()));
inMasks.add(maskBuilder.build());
}
return inMasks;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PortStatusMask in project openflowplugin by opendaylight.
the class GetAsyncReplyMessageFactoryTest method testGetAsyncReplyMessage.
/**
* Testing {@link GetAsyncReplyMessageFactory} for correct translation into POJO.
*/
@Test
public void testGetAsyncReplyMessage() {
ByteBuf bb = BufferHelper.buildBuffer("00 00 00 07 " + "00 00 00 00 " + "00 00 00 07 " + "00 00 00 00 " + "00 00 00 0F " + "00 00 00 00");
GetAsyncOutput builtByFactory = BufferHelper.deserialize(asyncFactory, bb);
BufferHelper.checkHeaderV13(builtByFactory);
Assert.assertEquals("Wrong packetInMask", createPacketInMask(), builtByFactory.getPacketInMask());
Assert.assertEquals("Wrong portStatusMask", createPortStatusMask(), builtByFactory.getPortStatusMask());
Assert.assertEquals("Wrong flowRemovedMask", createFlowRemovedMask(), builtByFactory.getFlowRemovedMask());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PortStatusMask in project openflowplugin by opendaylight.
the class GetAsyncReplyMessageFactoryTest method createPortStatusMask.
private static List<PortStatusMask> createPortStatusMask() {
final List<PortStatusMask> inMasks = new ArrayList<>();
PortStatusMaskBuilder maskBuilder;
// OFPCR_ROLE_EQUAL or OFPCR_ROLE_MASTER
maskBuilder = new PortStatusMaskBuilder();
List<PortReason> reasons = new ArrayList<>();
reasons.add(PortReason.OFPPRADD);
reasons.add(PortReason.OFPPRDELETE);
reasons.add(PortReason.OFPPRMODIFY);
inMasks.add(maskBuilder.setMask(reasons).build());
// OFPCR_ROLE_SLAVE
maskBuilder = new PortStatusMaskBuilder();
reasons = new ArrayList<>();
maskBuilder.setMask(reasons);
inMasks.add(maskBuilder.build());
return inMasks;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PortStatusMask in project openflowplugin by opendaylight.
the class SetAsyncInputMessageFactoryTest method createPortStatusMask.
private static List<PortStatusMask> createPortStatusMask() {
final List<PortStatusMask> masks = new ArrayList<>();
PortStatusMaskBuilder builder;
builder = new PortStatusMaskBuilder();
// OFPCR_ROLE_EQUAL or OFPCR_ROLE_MASTER
List<PortReason> portReasonList = new ArrayList<>();
portReasonList.add(PortReason.OFPPRADD);
portReasonList.add(PortReason.OFPPRDELETE);
portReasonList.add(PortReason.OFPPRMODIFY);
builder.setMask(portReasonList);
masks.add(builder.build());
// OFPCR_ROLE_SLAVE
builder = new PortStatusMaskBuilder();
portReasonList = new ArrayList<>();
builder.setMask(portReasonList);
masks.add(builder.build());
return masks;
}
Aggregations