use of org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunityParser in project bgpcep by opendaylight.
the class SimpleExtendedCommunityRegistry method parseExtendedCommunity.
@Override
public ExtendedCommunities parseExtendedCommunity(final ByteBuf buffer) throws BGPDocumentedException, BGPParsingException {
final short type = buffer.readUnsignedByte();
final short subtype = buffer.readUnsignedByte();
final ExtendedCommunityParser parser = this.handlers.getParser(createKey(type, subtype));
if (parser == null) {
buffer.skipBytes(EXTENDED_COMMUNITY_LENGTH);
LOG.info("Skipping unknown extended-community type/sub-type {}/{}.", type, subtype);
return null;
}
return new ExtendedCommunitiesBuilder().setTransitive(isTransitive(type)).setExtendedCommunity(parser.parseExtendedCommunity(buffer)).build();
}
Aggregations