Search in sources :

Example 6 with TcpFlags

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.flowspec.destination.flowspec.flowspec.type.tcp.flags._case.TcpFlags in project bgpcep by opendaylight.

the class AbstractFlowspecNlriParser method stringTcpFlags.

private static String stringTcpFlags(final List<TcpFlags> flags) {
    final StringBuilder buffer = new StringBuilder("where TCP flags ");
    boolean isFirst = true;
    for (final TcpFlags item : flags) {
        buffer.append(BitmaskOperandParser.INSTANCE.toString(item.getOp(), isFirst));
        buffer.append(item.getValue());
        buffer.append(' ');
        if (isFirst) {
            isFirst = false;
        }
    }
    return buffer.toString();
}
Also used : TcpFlags(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.flowspec.destination.flowspec.flowspec.type.tcp.flags._case.TcpFlags)

Example 7 with TcpFlags

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.flowspec.destination.flowspec.flowspec.type.tcp.flags._case.TcpFlags in project bgpcep by opendaylight.

the class FSTcpFlagsHandler method serializeTcpFlags.

private static void serializeTcpFlags(final List<TcpFlags> flags, final ByteBuf nlriByteBuf) {
    for (final Iterator<TcpFlags> it = flags.iterator(); it.hasNext(); ) {
        final TcpFlags flag = it.next();
        final ByteBuf flagsBuf = Unpooled.buffer();
        Util.writeShortest(flag.getValue(), flagsBuf);
        BitmaskOperandParser.INSTANCE.serialize(flag.getOp(), flagsBuf.readableBytes(), !it.hasNext(), nlriByteBuf);
        nlriByteBuf.writeBytes(flagsBuf);
    }
}
Also used : TcpFlags(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.flowspec.destination.flowspec.flowspec.type.tcp.flags._case.TcpFlags) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

TcpFlags (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.flowspec.destination.flowspec.flowspec.type.tcp.flags._case.TcpFlags)4 ByteBuf (io.netty.buffer.ByteBuf)2 ArrayList (java.util.ArrayList)2 TcpFlagsContainer (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.approved.extensions.rev160802.TcpFlagsContainer)2 TcpFlagsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.flowspec.destination.flowspec.flowspec.type.tcp.flags._case.TcpFlagsBuilder)2 Test (org.junit.Test)1 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)1 TcpFlagsMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TcpFlagsMatch)1 TcpFlagsMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TcpFlagsMatchBuilder)1 TcpFlags (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.approved.extensions.rev160802.oxm.container.match.entry.value.experimenter.id._case.TcpFlags)1 ExperimenterIdCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCase)1 BitmaskOperand (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.BitmaskOperand)1 Uint16 (org.opendaylight.yangtools.yang.common.Uint16)1 UnkeyedListEntryNode (org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode)1