Search in sources :

Example 1 with PacketInMaskBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMaskBuilder in project openflowplugin by opendaylight.

the class SetAsyncInputMessageFactory method decodePacketInMask.

private static List<PacketInMask> decodePacketInMask(ByteBuf input) {
    List<PacketInMask> inMasks = new ArrayList<>();
    PacketInMaskBuilder maskBuilder;
    for (int i = 0; i < SEPARATE_ROLES; i++) {
        maskBuilder = new PacketInMaskBuilder();
        maskBuilder.setMask(decodePacketInReasons(input.readUnsignedInt()));
        inMasks.add(maskBuilder.build());
    }
    return inMasks;
}
Also used : PacketInMask(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMask) PacketInMaskBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMaskBuilder) ArrayList(java.util.ArrayList)

Example 2 with PacketInMaskBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMaskBuilder in project openflowplugin by opendaylight.

the class GetAsyncReplyMessageFactoryTest method createPacketInMask.

private static List<PacketInMask> createPacketInMask() {
    final List<PacketInMask> inMasks = new ArrayList<>();
    PacketInMaskBuilder maskBuilder;
    // OFPCR_ROLE_EQUAL or OFPCR_ROLE_MASTER
    maskBuilder = new PacketInMaskBuilder();
    List<PacketInReason> reasons = new ArrayList<>();
    reasons.add(PacketInReason.OFPRNOMATCH);
    reasons.add(PacketInReason.OFPRACTION);
    reasons.add(PacketInReason.OFPRINVALIDTTL);
    maskBuilder.setMask(reasons);
    inMasks.add(maskBuilder.build());
    // OFPCR_ROLE_SLAVE
    maskBuilder = new PacketInMaskBuilder();
    reasons = new ArrayList<>();
    maskBuilder.setMask(reasons);
    inMasks.add(maskBuilder.build());
    return inMasks;
}
Also used : PacketInMask(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMask) PacketInReason(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PacketInReason) PacketInMaskBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMaskBuilder) ArrayList(java.util.ArrayList)

Example 3 with PacketInMaskBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMaskBuilder in project openflowplugin by opendaylight.

the class SetAsyncInputMessageFactoryTest method createPacketInMask.

private static List<PacketInMask> createPacketInMask() {
    final List<PacketInMask> masks = new ArrayList<>();
    PacketInMaskBuilder builder;
    // OFPCR_ROLE_EQUAL or OFPCR_ROLE_MASTER
    builder = new PacketInMaskBuilder();
    List<PacketInReason> packetInReasonList = new ArrayList<>();
    packetInReasonList.add(PacketInReason.OFPRNOMATCH);
    packetInReasonList.add(PacketInReason.OFPRACTION);
    packetInReasonList.add(PacketInReason.OFPRINVALIDTTL);
    builder.setMask(packetInReasonList);
    masks.add(builder.build());
    // OFPCR_ROLE_SLAVE
    builder = new PacketInMaskBuilder();
    packetInReasonList = new ArrayList<>();
    builder.setMask(packetInReasonList);
    masks.add(builder.build());
    return masks;
}
Also used : PacketInMask(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMask) PacketInReason(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PacketInReason) PacketInMaskBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMaskBuilder) ArrayList(java.util.ArrayList)

Example 4 with PacketInMaskBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMaskBuilder in project openflowplugin by opendaylight.

the class GetAsyncReplyMessageFactoryTest method createPacketInMask.

private static List<PacketInMask> createPacketInMask() {
    final List<PacketInMask> masks = new ArrayList<>();
    PacketInMaskBuilder builder;
    // OFPCR_ROLE_EQUAL or OFPCR_ROLE_MASTER
    builder = new PacketInMaskBuilder();
    List<PacketInReason> packetInReasonList = new ArrayList<>();
    packetInReasonList.add(PacketInReason.OFPRNOMATCH);
    packetInReasonList.add(PacketInReason.OFPRACTION);
    packetInReasonList.add(PacketInReason.OFPRINVALIDTTL);
    builder.setMask(packetInReasonList);
    masks.add(builder.build());
    // OFPCR_ROLE_SLAVE
    builder = new PacketInMaskBuilder();
    packetInReasonList = new ArrayList<>();
    builder.setMask(packetInReasonList);
    masks.add(builder.build());
    return masks;
}
Also used : PacketInMask(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMask) PacketInReason(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PacketInReason) PacketInMaskBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMaskBuilder) ArrayList(java.util.ArrayList)

Example 5 with PacketInMaskBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMaskBuilder in project openflowplugin by opendaylight.

the class GetAsyncReplyMessageFactory method decodePacketInMask.

private static List<PacketInMask> decodePacketInMask(ByteBuf input) {
    List<PacketInMask> inMasks = new ArrayList<>();
    PacketInMaskBuilder maskBuilder;
    for (int i = 0; i < SEPARATE_ROLES; i++) {
        maskBuilder = new PacketInMaskBuilder();
        maskBuilder.setMask(decodePacketInReasons(input.readUnsignedInt()));
        inMasks.add(maskBuilder.build());
    }
    return inMasks;
}
Also used : PacketInMask(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMask) PacketInMaskBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMaskBuilder) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)6 PacketInMask (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMask)6 PacketInMaskBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.async.body.grouping.PacketInMaskBuilder)6 PacketInReason (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PacketInReason)4