Search in sources :

Example 1 with ExtendedCommunityParser

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();
}
Also used : ExtendedCommunityParser(org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunityParser) ExtendedCommunitiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.ExtendedCommunitiesBuilder)

Aggregations

ExtendedCommunityParser (org.opendaylight.protocol.bgp.parser.spi.extended.community.ExtendedCommunityParser)1 ExtendedCommunitiesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.ExtendedCommunitiesBuilder)1