use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.update.message.Nlri in project bgpcep by opendaylight.
the class FSIpProtocolHandler method parseProtocolIp.
private static List<ProtocolIps> parseProtocolIp(final ByteBuf nlri) {
final List<ProtocolIps> ips = new ArrayList<>();
boolean end = false;
// we can do this as all fields will be rewritten in the cycle
final ProtocolIpsBuilder builder = new ProtocolIpsBuilder();
while (!end) {
final byte b = nlri.readByte();
final NumericOperand op = NumericOneByteOperandParser.INSTANCE.parse(b);
builder.setOp(op);
builder.setValue(ByteBufUtils.readUint8(nlri));
end = op.getEndOfList();
ips.add(builder.build());
}
return ips;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.update.message.Nlri in project bgpcep by opendaylight.
the class AbstractFlowspecL3vpnNlriParser method readRouteDistinguisher.
/**
* For flowspec-l3vpn, there is a route distinguisher field at the beginning of NLRI (8 bytes).
*/
private static RouteDistinguisher readRouteDistinguisher(final ByteBuf nlri) {
final RouteDistinguisher rd = RouteDistinguisherUtil.parseRouteDistinguisher(nlri);
LOG.trace("Route Distinguisher read from NLRI: {}", rd);
return rd;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.update.message.Nlri in project bgpcep by opendaylight.
the class AbstractFlowspecL3vpnNlriParser method parseL3vpnNlriFlowspecList.
protected final List<Flowspec> parseL3vpnNlriFlowspecList(final ByteBuf nlri) {
if (!nlri.isReadable()) {
return null;
}
final List<Flowspec> fss = new ArrayList<>();
while (nlri.isReadable()) {
final FlowspecBuilder builder = new FlowspecBuilder();
builder.setFlowspecType(flowspecTypeRegistry.parseFlowspecType(nlri));
fss.add(builder.build());
}
return fss;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.update.message.Nlri in project bgpcep by opendaylight.
the class FSTcpFlagsHandler method parseTcpFlags.
private static List<TcpFlags> parseTcpFlags(final ByteBuf nlri) {
final List<TcpFlags> flags = new ArrayList<>();
boolean end = false;
// we can do this as all fields will be rewritten in the cycle
final TcpFlagsBuilder builder = new TcpFlagsBuilder();
while (!end) {
final byte b = nlri.readByte();
final BitmaskOperand op = BitmaskOperandParser.INSTANCE.parse(b);
builder.setOp(op);
final short length = AbstractOperandParser.parseLength(b);
builder.setValue(Uint16.valueOf(ByteArray.bytesToInt(ByteArray.readBytes(nlri, length))));
end = op.getEndOfList();
flags.add(builder.build());
}
return flags;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.update.message.Nlri in project bgpcep by opendaylight.
the class AbstractFSFragmentHandler method parseFragments.
private List<Fragments> parseFragments(final ByteBuf nlri) {
final List<Fragments> fragments = new ArrayList<>();
boolean end = false;
// we can do this as all fields will be rewritten in the cycle
final FragmentsBuilder builder = new FragmentsBuilder();
while (!end) {
final byte b = nlri.readByte();
final BitmaskOperand op = BitmaskOperandParser.INSTANCE.parse(b);
builder.setOp(op);
builder.setValue(parseFragment(nlri.readByte()));
end = op.getEndOfList();
fragments.add(builder.build());
}
return fragments;
}
Aggregations