Search in sources :

Example 26 with BGPDocumentedException

use of org.opendaylight.protocol.bgp.parser.BGPDocumentedException in project bgpcep by opendaylight.

the class MPReachAttributeParser method parseAttribute.

@Override
public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder, final PeerSpecificParserConstraint constraint) throws BGPDocumentedException {
    try {
        final MpReachNlri mpReachNlri = this.reg.parseMpReach(buffer, constraint);
        final Attributes1 a = new Attributes1Builder().setMpReachNlri(mpReachNlri).build();
        builder.addAugmentation(Attributes1.class, a);
    } catch (final BGPParsingException e) {
        throw new BGPDocumentedException("Could not parse MP_REACH_NLRI", BGPError.OPT_ATTR_ERROR, e);
    }
}
Also used : Attributes1Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.Attributes1Builder) BGPDocumentedException(org.opendaylight.protocol.bgp.parser.BGPDocumentedException) BGPParsingException(org.opendaylight.protocol.bgp.parser.BGPParsingException) Attributes1(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.Attributes1) MpReachNlri(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.update.attributes.MpReachNlri)

Example 27 with BGPDocumentedException

use of org.opendaylight.protocol.bgp.parser.BGPDocumentedException in project bgpcep by opendaylight.

the class MPUnreachAttributeParser method parseAttribute.

@Override
public void parseAttribute(final ByteBuf buffer, final AttributesBuilder builder, final PeerSpecificParserConstraint constraint) throws BGPDocumentedException {
    try {
        final MpUnreachNlri mpUnreachNlri = this.reg.parseMpUnreach(buffer, constraint);
        final Attributes2 a = new Attributes2Builder().setMpUnreachNlri(mpUnreachNlri).build();
        builder.addAugmentation(Attributes2.class, a);
    } catch (final BGPParsingException e) {
        throw new BGPDocumentedException("Could not parse MP_UNREACH_NLRI", BGPError.OPT_ATTR_ERROR, e);
    }
}
Also used : Attributes2Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.Attributes2Builder) MpUnreachNlri(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.update.attributes.MpUnreachNlri) BGPDocumentedException(org.opendaylight.protocol.bgp.parser.BGPDocumentedException) Attributes2(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.Attributes2) BGPParsingException(org.opendaylight.protocol.bgp.parser.BGPParsingException)

Aggregations

BGPDocumentedException (org.opendaylight.protocol.bgp.parser.BGPDocumentedException)27 BGPParsingException (org.opendaylight.protocol.bgp.parser.BGPParsingException)9 Test (org.junit.Test)5 AsNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber)5 Notification (org.opendaylight.yangtools.yang.binding.Notification)5 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)4 ByteBuf (io.netty.buffer.ByteBuf)3 ArrayList (java.util.ArrayList)3 BGPSessionPreferences (org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionPreferences)3 BmpDeserializationException (org.opendaylight.protocol.bmp.spi.parser.BmpDeserializationException)3 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)3 Keepalive (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Keepalive)3 Open (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Open)3 Update (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Update)3 BgpParameters (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.BgpParameters)3 BgpTableTypeImpl (org.opendaylight.protocol.bgp.parser.BgpTableTypeImpl)2 BGPSessionListener (org.opendaylight.protocol.bgp.rib.spi.BGPSessionListener)2 KeepaliveBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.KeepaliveBuilder)2 Notify (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Notify)2 OpenBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.OpenBuilder)2