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