Class AbstractFlowspecNlriParser
java.lang.Object
org.opendaylight.protocol.bgp.flowspec.AbstractFlowspecNlriParser
- All Implemented Interfaces:
NlriParser
,NlriSerializer
- Direct Known Subclasses:
AbstractFlowspecL3vpnNlriParser
,SimpleFlowspecIpv4NlriParser
,SimpleFlowspecIpv6NlriParser
public abstract class AbstractFlowspecNlriParser
extends Object
implements NlriParser, NlriSerializer
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier
protected final FlowspecTypeRegistry
static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier
static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier
static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractFlowspecNlriParser
(FlowspecTypeRegistry flowspecTypeRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected static final void
appendNlri
(@Nullable PathId pathId, @NonNull io.netty.buffer.ByteBuf nlri, @NonNull io.netty.buffer.ByteBuf output) Appends a Flowspec NLRI buffer to an output ByteBuf.extractFlowspec
(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode route) abstract void
extractSpecificFlowspec
(org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode fsType, FlowspecBuilder fsBuilder) protected abstract @NonNull DestinationType
parseAdvertizedNlri
(@NonNull io.netty.buffer.ByteBuf nlri, @Nullable PathId pathId) Create advertized destination type.final void
parseNlri
(io.netty.buffer.ByteBuf nlri, MpReachNlriBuilder builder, PeerSpecificParserConstraint constraint) Parse MP UN_REACH NLRI from buffer.final void
parseNlri
(io.netty.buffer.ByteBuf nlri, MpUnreachNlriBuilder builder, PeerSpecificParserConstraint constraint) Parse MP UN_REACH NLRI from buffer.parseNlriFlowspecList
(@NonNull io.netty.buffer.ByteBuf nlri) Parses Flowspec NLRI into list of Flowspec.protected abstract @NonNull DestinationType
parseWithdrawnNlri
(@NonNull io.netty.buffer.ByteBuf nlri, @Nullable PathId pathId) Parse and create withdrawn destination type.static int
readNlriLength
(@NonNull io.netty.buffer.ByteBuf nlri) protected static final @Nullable PathId
readPathId
(@NonNull io.netty.buffer.ByteBuf nlri, AddressFamily afi, SubsequentAddressFamily safi, PeerSpecificParserConstraint constraint) final void
serializeAttribute
(Attributes pathAttributes, io.netty.buffer.ByteBuf byteAggregator) protected abstract void
serializeMpReachNlri
(DestinationType dstType, io.netty.buffer.ByteBuf byteAggregator) protected abstract void
serializeMpUnreachNlri
(DestinationType dstType, io.netty.buffer.ByteBuf byteAggregator) protected final void
serializeNlri
(List<Flowspec> flowspecList, @NonNull io.netty.buffer.ByteBuf buffer) protected final String
stringNlri
(List<Flowspec> flows) stringNlri
(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode flowspec) protected abstract void
stringSpecificFSNlriType
(FlowspecType value, StringBuilder buffer) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opendaylight.protocol.bgp.parser.spi.NlriParser
convertMpReachToMpUnReach
-
Field Details
-
DEST_PREFIX_NID
public static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier DEST_PREFIX_NID -
SOURCE_PREFIX_NID
public static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier SOURCE_PREFIX_NID -
OP_NID
public static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier OP_NID -
VALUE_NID
public static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier VALUE_NID -
flowspecTypeRegistry
-
-
Constructor Details
-
AbstractFlowspecNlriParser
-
-
Method Details
-
serializeMpReachNlri
protected abstract void serializeMpReachNlri(DestinationType dstType, io.netty.buffer.ByteBuf byteAggregator) -
serializeMpUnreachNlri
protected abstract void serializeMpUnreachNlri(DestinationType dstType, io.netty.buffer.ByteBuf byteAggregator) -
extractSpecificFlowspec
public abstract void extractSpecificFlowspec(org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode fsType, FlowspecBuilder fsBuilder) -
stringSpecificFSNlriType
-
serializeAttribute
public final void serializeAttribute(Attributes pathAttributes, io.netty.buffer.ByteBuf byteAggregator) - Specified by:
serializeAttribute
in interfaceNlriSerializer
-
serializeNlri
-
appendNlri
protected static final void appendNlri(@Nullable PathId pathId, @NonNull io.netty.buffer.ByteBuf nlri, @NonNull io.netty.buffer.ByteBuf output) Appends a Flowspec NLRI buffer to an output ByteBuf.- Parameters:
pathId
- path IDnlri
- NLRI to be appendedoutput
- where flowspec NLRI will be appended
-
stringNlri
public String stringNlri(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode flowspec) -
stringNlri
-
extractFlowspec
-
readNlriLength
public static int readNlriLength(@NonNull io.netty.buffer.ByteBuf nlri) -
parseNlriFlowspecList
Parses Flowspec NLRI into list of Flowspec.- Parameters:
nlri
- byte representation of NLRI which will be parsed- Returns:
- list of Flowspec
-
parseNlri
public final void parseNlri(io.netty.buffer.ByteBuf nlri, MpReachNlriBuilder builder, PeerSpecificParserConstraint constraint) throws BGPParsingException Description copied from interface:NlriParser
Parse MP UN_REACH NLRI from buffer.- Specified by:
parseNlri
in interfaceNlriParser
- Parameters:
nlri
- Encoded reachable NLRI in ByteBuf.builder
- MP REACH NLRI builder.constraint
- Peer specific constraints.- Throws:
BGPParsingException
- exception.
-
parseNlri
public final void parseNlri(io.netty.buffer.ByteBuf nlri, MpUnreachNlriBuilder builder, PeerSpecificParserConstraint constraint) throws BGPParsingException Description copied from interface:NlriParser
Parse MP UN_REACH NLRI from buffer.- Specified by:
parseNlri
in interfaceNlriParser
- Parameters:
nlri
- Encoded unreachable NLRI in ByteBuf.builder
- MP UNREACH NLRI builder.constraint
- Peer specific constraints.- Throws:
BGPParsingException
- exception.
-
parseAdvertizedNlri
protected abstract @NonNull DestinationType parseAdvertizedNlri(@NonNull io.netty.buffer.ByteBuf nlri, @Nullable PathId pathId) throws BGPParsingException Create advertized destination type.- Parameters:
nlri
- on-wire NLRI, with path ID already peeledpathId
- associated path id with given NLRI- Returns:
- created destination type
- Throws:
BGPParsingException
-
parseWithdrawnNlri
protected abstract @NonNull DestinationType parseWithdrawnNlri(@NonNull io.netty.buffer.ByteBuf nlri, @Nullable PathId pathId) throws BGPParsingException Parse and create withdrawn destination type.- Parameters:
nlri
- on-wire NLRI, with path ID already peeledpathId
- associated path id with given NLRI- Returns:
- created destination type
- Throws:
BGPParsingException
-
readPathId
protected static final @Nullable PathId readPathId(@NonNull io.netty.buffer.ByteBuf nlri, AddressFamily afi, SubsequentAddressFamily safi, PeerSpecificParserConstraint constraint)
-