2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.bgp.parser.spi;
10 import io.netty.buffer.ByteBuf;
11 import javax.annotation.Nonnull;
12 import javax.annotation.Nullable;
13 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.MpReachNlriBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.MpUnreachNlriBuilder;
18 * Common interface for NLRI parser implementation.
20 public interface NlriParser {
22 * Parse MP UN_REACH NLRI from buffer.
24 * @param nlri Encoded reachable NLRI in ByteBuf.
25 * @param builder MP REACH NLRI builder.
26 * @param constraint Peer specific constraints.
27 * @throws BGPParsingException exception.
30 @Nonnull final ByteBuf nlri,
31 @Nonnull final MpReachNlriBuilder builder,
32 @Nullable final PeerSpecificParserConstraint constraint)
33 throws BGPParsingException;
35 * Parse MP UN_REACH NLRI from buffer.
37 * @param nlri Encoded unreachable NLRI in ByteBuf.
38 * @param builder MP UNREACH NLRI builder.
39 * @param constraint Peer specific constraints.
40 * @throws BGPParsingException exception.
43 @Nonnull final ByteBuf nlri,
44 @Nonnull final MpUnreachNlriBuilder builder,
45 @Nullable final PeerSpecificParserConstraint constraint)
46 throws BGPParsingException;