public abstract class AbstractFlowspecNlriParser extends Object implements NlriParser, NlriSerializer
Modifier and Type | Field and Description |
---|---|
static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier |
DEST_PREFIX_NID |
protected SimpleFlowspecTypeRegistry |
flowspecTypeRegistry |
protected static int |
LENGTH_MAGIC
Add this constant to length value to achieve all ones in the leftmost nibble.
|
protected static int |
MAX_NLRI_LENGTH |
protected static int |
MAX_NLRI_LENGTH_ONE_BYTE |
static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier |
OP_NID |
static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier |
SOURCE_PREFIX_NID |
static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier |
VALUE_NID |
Modifier | Constructor and Description |
---|---|
protected |
AbstractFlowspecNlriParser(SimpleFlowspecTypeRegistry flowspecTypeRegistry) |
Modifier and Type | Method and Description |
---|---|
abstract DestinationType |
createAdvertizedRoutesDestinationType(Object[] nlriFields,
PathId pathId)
Create advertized destination type
|
abstract DestinationType |
createWithdrawnDestinationType(Object[] nlriFields,
PathId pathId)
Create withdrawn destination type
|
List<Flowspec> |
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 Object[] |
parseNlri(io.netty.buffer.ByteBuf nlri)
Override this function to parse additional NLRI fields
|
void |
parseNlri(io.netty.buffer.ByteBuf nlri,
MpReachNlriBuilder builder)
Parse MP REACH NLRI from buffer.
|
void |
parseNlri(io.netty.buffer.ByteBuf nlri,
MpReachNlriBuilder builder,
PeerSpecificParserConstraint constraint)
Invokes
NlriParser.parseNlri(ByteBuf, MpReachNlriBuilder) , so the constraint is omitted. |
void |
parseNlri(io.netty.buffer.ByteBuf nlri,
MpUnreachNlriBuilder builder)
Parse MP UN_REACH NLRI from buffer.
|
void |
parseNlri(io.netty.buffer.ByteBuf nlri,
MpUnreachNlriBuilder builder,
PeerSpecificParserConstraint constraint)
Invokes
NlriParser.parseNlri(ByteBuf, MpUnreachNlriBuilder) , so the constraint is omitted. |
protected List<Flowspec> |
parseNlriFlowspecList(io.netty.buffer.ByteBuf nlri)
Parses Flowspec NLRI into list of Flowspec.
|
static int |
readNlriLength(io.netty.buffer.ByteBuf nlri) |
protected static PathId |
readPathId(io.netty.buffer.ByteBuf nlri,
Class<? extends AddressFamily> afi,
Class<? extends SubsequentAddressFamily> safi,
PeerSpecificParserConstraint constraint) |
void |
serializeAttribute(org.opendaylight.yangtools.yang.binding.DataObject attribute,
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 void |
serializeNlri(List<Flowspec> flowspecList,
io.netty.buffer.ByteBuf buffer) |
protected void |
serializeNlri(Object[] nlriFields,
io.netty.buffer.ByteBuf buffer) |
protected void |
serializeNlri(Object[] nlriFields,
PathId pathId,
io.netty.buffer.ByteBuf buffer)
Serializes Flowspec NLRI to ByteBuf.
|
String |
stringNlri(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode<?> flowspec) |
protected String |
stringNlri(List<Flowspec> flows) |
protected abstract void |
stringSpecificFSNlriType(FlowspecType value,
StringBuilder buffer) |
public static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier DEST_PREFIX_NID
public static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier SOURCE_PREFIX_NID
public static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier OP_NID
public static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier VALUE_NID
protected SimpleFlowspecTypeRegistry flowspecTypeRegistry
protected static final int LENGTH_MAGIC
protected static final int MAX_NLRI_LENGTH
protected static final int MAX_NLRI_LENGTH_ONE_BYTE
protected AbstractFlowspecNlriParser(SimpleFlowspecTypeRegistry flowspecTypeRegistry)
protected abstract void serializeMpReachNlri(DestinationType dstType, io.netty.buffer.ByteBuf byteAggregator)
protected abstract void serializeMpUnreachNlri(DestinationType dstType, io.netty.buffer.ByteBuf byteAggregator)
public abstract void extractSpecificFlowspec(org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode fsType, FlowspecBuilder fsBuilder)
protected abstract void stringSpecificFSNlriType(FlowspecType value, StringBuilder buffer)
public abstract DestinationType createWithdrawnDestinationType(@Nonnull Object[] nlriFields, @Nullable PathId pathId)
nlriFields
- a list of NLRI fields to be included in the destination typepathId
- associated path id with given NLRIpublic abstract DestinationType createAdvertizedRoutesDestinationType(@Nonnull Object[] nlriFields, @Nullable PathId pathId)
nlriFields
- a list of NLRI fields to be included in the destination typepathId
- associated path id with given NLRIpublic final void serializeAttribute(org.opendaylight.yangtools.yang.binding.DataObject attribute, io.netty.buffer.ByteBuf byteAggregator)
serializeAttribute
in interface NlriSerializer
public final void parseNlri(io.netty.buffer.ByteBuf nlri, MpUnreachNlriBuilder builder) throws BGPParsingException
NlriParser
parseNlri
in interface NlriParser
nlri
- Encoded unreachabel NLRI in ByteBuf.builder
- MP UNREACH NLRI builder.BGPParsingException
public final void parseNlri(io.netty.buffer.ByteBuf nlri, MpReachNlriBuilder builder) throws BGPParsingException
NlriParser
parseNlri
in interface NlriParser
nlri
- Encoded reachable NLRI in ByteBuf.builder
- MP REACH NLRI builder.BGPParsingException
protected void serializeNlri(@Nonnull Object[] nlriFields, @Nonnull io.netty.buffer.ByteBuf buffer)
protected final void serializeNlri(List<Flowspec> flowspecList, @Nonnull io.netty.buffer.ByteBuf buffer)
protected final void serializeNlri(@Nonnull Object[] nlriFields, @Nullable PathId pathId, @Nonnull io.netty.buffer.ByteBuf buffer)
nlriFields
- NLRI fields to be serializedpathId
- buffer
- where flowspec NLRI will be serializedpublic String stringNlri(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode<?> flowspec)
public final List<Flowspec> extractFlowspec(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode<?> route)
public static final int readNlriLength(@Nonnull io.netty.buffer.ByteBuf nlri)
protected final List<Flowspec> parseNlriFlowspecList(@Nonnull io.netty.buffer.ByteBuf nlri) throws BGPParsingException
nlri
- byte representation of NLRI which will be parsedBGPParsingException
@Nonnull protected Object[] parseNlri(@Nonnull io.netty.buffer.ByteBuf nlri) throws BGPParsingException
nlri
- NLRI bufferBGPParsingException
public final void parseNlri(@Nonnull io.netty.buffer.ByteBuf nlri, @Nonnull MpReachNlriBuilder builder, @Nullable PeerSpecificParserConstraint constraint) throws BGPParsingException
NlriParser
NlriParser.parseNlri(ByteBuf, MpReachNlriBuilder)
, so the constraint is omitted. Override for specific parser behavior.parseNlri
in interface NlriParser
nlri
- Encoded reachable NLRI in ByteBuf.builder
- MP REACH NLRI builder.constraint
- Peer specific constraints.BGPParsingException
@Nullable protected static final PathId readPathId(@Nonnull io.netty.buffer.ByteBuf nlri, Class<? extends AddressFamily> afi, Class<? extends SubsequentAddressFamily> safi, PeerSpecificParserConstraint constraint)
public final void parseNlri(@Nonnull io.netty.buffer.ByteBuf nlri, @Nonnull MpUnreachNlriBuilder builder, @Nullable PeerSpecificParserConstraint constraint) throws BGPParsingException
NlriParser
NlriParser.parseNlri(ByteBuf, MpUnreachNlriBuilder)
, so the constraint is omitted. Override for specific parser behavior.parseNlri
in interface NlriParser
nlri
- Encoded unreachable NLRI in ByteBuf.builder
- MP UNREACH NLRI builder.constraint
- Peer specific constraints.BGPParsingException
Copyright © 2018 OpenDaylight. All rights reserved.