bgpcep.git
5 years agoUpdate error handling of PE Distinguisher Labels 58/78358/10
Robert Varga [Mon, 3 Dec 2018 05:31:26 +0000 (06:31 +0100)]
Update error handling of PE Distinguisher Labels

RFC6514 actually specifies behavior consistent with RFC7606, make
sure we use the same mechanism to correct handling.

Change-Id: If9c5f313bfdf4b54f9f3ae09f91c08e2a7ae8d65
JIRA: BGPCEP-359
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate LinkstateAttributeParser 57/78357/12
Robert Varga [Mon, 3 Dec 2018 05:30:35 +0000 (06:30 +0100)]
Migrate LinkstateAttributeParser

While the error handling of linkstate attribute is not quite clear
yet, migrate it to inherit from AbstractAttributeParser.

Change-Id: I7900d3ec816451daf248c3bacef902d607809ae2
JIRA: BGPCEP-159
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd AbstractAttributeParser 54/78354/19
Robert Varga [Mon, 3 Dec 2018 01:27:51 +0000 (02:27 +0100)]
Add AbstractAttributeParser

While AttributeParser makes revised error handling optional, this
class makes it mandatory, providing a common baseline for parsers
dealing with attributes which have revised error handling specified.

Also migrate parsers for following attributes to use it:
- ORIGIN (Section 7.1)
- AS_PATH (Section 7.2)
- NEXT_HOP (Section 7.3)
- MULTI_EXIT_DISC (Section 7.4)
- LOCAL_PREF (Section 7.5)
- ATOMIC_AGGREGATE (Section 7.6)
- AGGREGATOR (Section 7.7)
- Community (Section 7.8)
- ORIGINATOR_ID (Section 7.9)
- CLUSTER_LIST (Section 7.10)
- MP_REACH (Section 7.11)
- MP_UNREACH (Section 7.12)
- Extended Community (Section 7.14)

JIRA: BGPCEP-359
Change-Id: I47de7426f811962f6771a5925486b133986f0a44
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSVEC object flags 19/77819/10
Claudio D. Gasparini [Tue, 13 Nov 2018 07:23:45 +0000 (08:23 +0100)]
SVEC object flags

https://tools.ietf.org/html/rfc8306#section-3.12

JIRA: BGPCEP-406
Change-Id: I4a37a79c415e845d984c81707a5a5393423080d9
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoBranch Node Object 18/77818/10
Claudio D. Gasparini [Mon, 12 Nov 2018 14:49:20 +0000 (15:49 +0100)]
Branch Node Object

https://tools.ietf.org/html/rfc8306#section-3.11.1

JIRA: BGPCEP-406
Change-Id: I3ae8105f1ec4ec5afbbf94fc34b86f16a8b8f5f6
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoP2MP end points 16/77816/13
Claudio D. Gasparini [Thu, 8 Nov 2018 09:23:05 +0000 (10:23 +0100)]
P2MP end points

JIRA: BGPCEP-406

Change-Id: Ia582bf5e93aef41340bc3f7f19cf9bdfe6003655
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoP2MP path computation capability 40/77840/16
Claudio D. Gasparini [Thu, 8 Nov 2018 09:21:16 +0000 (10:21 +0100)]
P2MP path computation capability

https://tools.ietf.org/html/rfc8306#section-3.1.2

JIRA: BGPCEP-406
Change-Id: Idee90c040d1cf242c3b3146722097f8c68a8b9f8
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agofix graceful restart test race-condition 38/78538/2
Matej Perina [Fri, 7 Dec 2018 09:32:57 +0000 (10:32 +0100)]
fix graceful restart test race-condition

There is possibility that we close session faster
than EOR is send to peer. In order to verify no notification
was sent after OPEN receival we need to wait for EOR to be
sent before we send OPEN.

JIRA:BGPCEP-495
Change-Id: Ifc2b4fa5d74f18bb1d460161559a1cdec10a6282
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoAdd new revision for pcep types model 17/77817/12
Claudio D. Gasparini [Fri, 9 Nov 2018 16:21:53 +0000 (17:21 +0100)]
Add new revision for pcep types model

With P2MP extension model changes we
also need new revision to mark this addition.

JIRA: BGPCEP-406
Change-Id: I90de459addfe451013f2a39e1674e9f4eb3cf933
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoSpeed up PeerSpecificParserConstraintImpl 73/78373/6
Robert Varga [Mon, 3 Dec 2018 10:34:19 +0000 (11:34 +0100)]
Speed up PeerSpecificParserConstraintImpl

This improves design by taking advantage of ClassToInstanceMap,
which provides a type-safe getInstance() method. Furthermore we
recognize that the this class is used mostly for lookups of a few
classes, we use an ImmutableClassToInstanceMap updated concurrently
via a compare-and-set.

This yields significantly faster lookups for the common cases, where
the map is empty or has a single entry. In other cases the speed up
is still there, although not as pronounced.

Change-Id: I4da36e592e88cf22d5ad1654f126eec81660c98c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoclose effRibInWriter properly 02/78502/5
Matej Perina [Thu, 6 Dec 2018 13:55:43 +0000 (14:55 +0100)]
close effRibInWriter properly

We cannot close effRibInWriter before we clear tables
without graceful restart support.

Change-Id: Ife2f76aa4b2a9db991b570c9930084c17aeb2cc0
JIRA:BGPCEP-495
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoDo not rebox pathId 10/78510/6
Robert Varga [Thu, 6 Dec 2018 17:30:14 +0000 (18:30 +0100)]
Do not rebox pathId

Path IDs are stored in boxed array, using a long temporary forces
it to be unboxed, only to be boxed again when we put it into the
list.

Change-Id: I591f1259c61a0bc2c4a410af3810222b4fe7dc87
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix unit of BGP operational neighbor uptime in doc 27/78227/3
Ajay Lele [Tue, 27 Nov 2018 19:31:24 +0000 (11:31 -0800)]
Fix unit of BGP operational neighbor uptime in doc

Change-Id: I3873b68f23b57219d1f7b10170ae414c898bcb50
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
5 years agoSplit out EffectiveRibInWriter.processModifications() 06/78506/4
Robert Varga [Thu, 6 Dec 2018 14:34:59 +0000 (15:34 +0100)]
Split out EffectiveRibInWriter.processModifications()

If we have non-empty modifications, we know we will need a transaction,
separate that handling into a separate method, so we can side-step
null checks.

Change-Id: Ic391790c5ab55a8259849ce330d3af94db3cf6f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRIBImpl.vpnTableRefresher should be final 05/78505/4
Robert Varga [Thu, 6 Dec 2018 14:41:01 +0000 (15:41 +0100)]
RIBImpl.vpnTableRefresher should be final

This field not updated from anywhere, make it final.

Change-Id: I843bc7c87d5eb69b6c48841013ec3d7d11aa93a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not always update eff-rib-in attributes 75/78475/6
Robert Varga [Wed, 5 Dec 2018 19:08:56 +0000 (20:08 +0100)]
Do not always update eff-rib-in attributes

Check if the attributes changed before propagating the change,
reducing the number of operations executed.

Change-Id: I6435a50aefbaefabec86f8d6d7f220c9a1bfaa20
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCorrect infinite loop in base parser 61/78261/11
Olivier Dugeon [Wed, 28 Nov 2018 13:15:28 +0000 (14:15 +0100)]
Correct infinite loop in base parser

When sending a PCReply message with more than one ERO object, as per RFC540,
the PCEP base parser start infinite loop and stop with a java heap exception.

The problem is located in PCEPReplyMessageParser.java (pcep-base-parser
package) at line 217 in handleEro() method. handleEro() is called with the first
ERO object and remaining object to parse metrics associated with this ERO. The
parsing is done by parserPath() method, but this method expect to find only
metrics object. When a second ERO follow the last metric of the first ERO,
parsePath() method do nothing and handleEro() method start infinite loop at line
220 as the object list is not empty and parsePath() will not empty it.

This patch replace handleEro() method by handleEros() in order to parse
correctly multiple ERO in PCReply message. It also add a new test in
PCEPValidatorTest.java class: testPCRepMsgWithTwoEros() in order to verify
that a PCPep Message with two EROs is correctly parse.

JIRA: BGPCEP-851 PCEP base parser is unable to handle multiple ERO

Change-Id: I194b7cbb347a3b377e7b3000f93ef1d21a86f39a
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
5 years agoPrevent unnecessary boxing in AddPathBestPath 98/78498/1
Robert Varga [Thu, 6 Dec 2018 11:56:18 +0000 (12:56 +0100)]
Prevent unnecessary boxing in AddPathBestPath

The callers are of two varieties: boxed and unboxed. Unboxing is
inherently faster, hence force the single boxed callsite to unbox
allowing us to convert it when needed.

Change-Id: Ie4d80398724b2f98a186e500c73e33ed1775a406
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPrevent boxing of AS in BasePathSelector 97/78497/1
Robert Varga [Thu, 6 Dec 2018 11:52:10 +0000 (12:52 +0100)]
Prevent boxing of AS in BasePathSelector

Superclass uses long, just as all callers. Ditch intermediate
boxing.

Change-Id: I67e8678ebbac4084460e69766686b0feb25ae3db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOptimize path selectors 96/78496/1
Robert Varga [Thu, 6 Dec 2018 11:48:15 +0000 (12:48 +0100)]
Optimize path selectors

Creating multiple object just for the purposes of LOG.trace() is
utterly wasteful. Guard the LOG.trace() with isTraceEnabled() and
also expose a String-only formatter.

Change-Id: If6f3011e89772f82948816a975034a38a82a7922
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix RouteKey and surrounding code 95/78495/1
Robert Varga [Thu, 6 Dec 2018 11:39:20 +0000 (12:39 +0100)]
Fix RouteKey and surrounding code

This cleans up RouteKey to be a properly-designed and efficient
DTO:
- prevent useless boxing
- use proper prime in hashCode
- make sure nullness is propagated
- improve compareTo performance

Change-Id: Ibfa1f57fee8dbc4a0a4c1a0f0e47664b48f4d055
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unneeded casts 94/78494/1
Robert Varga [Thu, 6 Dec 2018 10:57:50 +0000 (11:57 +0100)]
Remove unneeded casts

We already are comparing longs, no need to cast.

Change-Id: I96b9bb5e4a85a96236295abb995bb8b421a57039
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAllow AttributeRegistry to signal treat-as-withdraw 52/78352/12
Robert Varga [Wed, 5 Dec 2018 22:18:34 +0000 (23:18 +0100)]
Allow AttributeRegistry to signal treat-as-withdraw

When any attribute indicates we should be treating the resulting
message as withdraw, we need to report this indication upwards,
so that the it can be evaluated once the complete contents of
the message are known.

This can result in either a conversion of reachability to
unreachability, or, if we fail to parse the NLRI-bearing fields,
in a session teardown.

Change-Id: I8c3b7b9d9f9523b42a328820cc6b7c9168976aeb
JIRA: BGPCEP-359
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOptimize AbstractBestPathSelector 70/78470/4
Robert Varga [Wed, 5 Dec 2018 17:15:52 +0000 (18:15 +0100)]
Optimize AbstractBestPathSelector

There are inefficiencies in how we compare local preference, let's
refactor the code to have clear comparisons without unnecessary
boxing.

Also remove implicit boxing of AS numbers, as we are already getting
them as primitive longs.

Change-Id: I3cbba14fa2c2bd2add35c0f827da8ba4a06a0b4b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPropagate depreferenced status through AbstractAdvertizedRoute 82/78482/2
Robert Varga [Wed, 5 Dec 2018 21:53:20 +0000 (22:53 +0100)]
Propagate depreferenced status through AbstractAdvertizedRoute

AbstractPeer will need this info to differentiate which routes
to advertize when, propagate it out of selection state.

Change-Id: I83a243ffe98e55c719913f7c7b708b0ccab2cee2
JIRA: BGPCEP-495
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMerge ActualBestPathRoutes and AdvertizedRoute 81/78481/3
Robert Varga [Wed, 5 Dec 2018 21:22:27 +0000 (22:22 +0100)]
Merge ActualBestPathRoutes and AdvertizedRoute

These two classes are almost identical, extract the common bits
to a common superclass, reducing complexity and allowing them
us to share codepaths.

Change-Id: Ib6bbf1e4285ed0f1376d932367c8cb0d3f6f2662
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix isFirstBestPath brain damage 80/78480/3
Robert Varga [Wed, 5 Dec 2018 21:26:28 +0000 (22:26 +0100)]
Fix isFirstBestPath brain damage

Using a List.indexOf() followed by equality to 0 is ... inefficient
to say the least.

Kill isFirstBestPath() and use a simple check against the first path,
if the list is non-empty.

Also optimize list allocation and remove useless copying while we're
at it.

Change-Id: Ia1a48736ff363ab15776b9f188207720f23169e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoIntroduce BGPTreatAsWithdrawException 51/78351/12
Robert Varga [Mon, 3 Dec 2018 00:10:55 +0000 (01:10 +0100)]
Introduce BGPTreatAsWithdrawException

Attribute parsers need to be able to report that the attribute
failed to parse and the UPDATE message needs to enter
treat-as-withdraw error recovery.

BGPTreatAsWithdrawException holds this information and can be
reported from individual attribute parsers.

Change-Id: I459eb70692cde1035ca03110f414acb60d302abd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoTeach AbstractBestPathSelector about depreferenced routes 73/78473/3
Robert Varga [Wed, 5 Dec 2018 17:48:07 +0000 (18:48 +0100)]
Teach AbstractBestPathSelector about depreferenced routes

draft-uttaro-idr-bgp-persistence-04 mandates that routes tagged
with LLGR_STALE are to be used as routes of least preference.

Teach best path selection about this use it as the first step
of discrimination: depreferenced paths will always lose to
non-depreferenced paths.

JIRA: BGPCEP-495
Change-Id: I81a1ba1d09c554dee754329b5a907fbff3d6bf84
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoTeach BestPathState about depreferenced routes 71/78471/2
Robert Varga [Wed, 5 Dec 2018 17:38:44 +0000 (18:38 +0100)]
Teach BestPathState about depreferenced routes

draft-uttaro-idr-bgp-persistence-04 defines the concept of a
"depreferenced" route, i.e. routes which are tagged with LLGR_STALE
community. These routes should be used as routes of last resort.

Change-Id: I19032bf94dce2f073458dfd9a9cd120a496db4f6
JIRA: BGPCEP-495
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd Long-lived Graceful restart capabilities 68/78468/1
Robert Varga [Wed, 5 Dec 2018 16:12:00 +0000 (17:12 +0100)]
Add Long-lived Graceful restart capabilities

This adds the definition of protocol-level capabilities
for draft-uttaro-idr-bgp-persistence-04.

Change-Id: I9885f65615678d8f01e238b0f2aa367de61bb60c
JIRA: BGPCEP-495
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix eclipse nullness warnings 67/78467/1
Robert Varga [Wed, 5 Dec 2018 16:49:56 +0000 (17:49 +0100)]
Fix eclipse nullness warnings

Eclipse does not understand that Attributes is expected to be
immutable, hence it emits warnings about items being potentially
null.

Since normally we get attributes from the datastore, it is actually
helpful to store them in local variables, preventing roundtrips
to LazyDataObject -- fixing warnings as well.

Change-Id: I82fc82a69b07c739af566a069d225bbf18db98ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd Long-lived Graceful Restart communities 61/78461/1
Robert Varga [Wed, 5 Dec 2018 14:54:59 +0000 (15:54 +0100)]
Add Long-lived Graceful Restart communities

https://tools.ietf.org/html/draft-uttaro-idr-bgp-persistence-04
introduces two new communities, NO_LLGR and LLGR_STALE.

This patch adds support for them.

JIRA: BGPCEP-495
Change-Id: I21745dffe9d57164f55020cf50bb443fcf6fc533
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoClean up PeerTrackerInformation 57/78457/1
Robert Varga [Wed, 5 Dec 2018 14:05:00 +0000 (15:05 +0100)]
Clean up PeerTrackerInformation

Fix documentation and add a final qualifier.

Change-Id: I19446071c07b1613629501f137b6db90cc9daeeb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDistinguish between ignored and erroring attributes 50/78350/9
Robert Varga [Sun, 2 Dec 2018 23:49:24 +0000 (00:49 +0100)]
Distinguish between ignored and erroring attributes

MP_REACH/MP_UNREACH attributes need to cause a BGPDocumentedException
to be thrown when in RFC7606 mode. This adds that capability and
makes parser report it.

Change-Id: Iabbd16e64332ad9ffd823e942262b7ba324ad328
JIRA: MDSAL-359
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse templates for predicates 54/78154/6
Robert Varga [Mon, 26 Nov 2018 09:48:50 +0000 (10:48 +0100)]
Use templates for predicates

This speeds up instantiation slightly.

Change-Id: I325ff2e7ffe197553d922abd0169d5b21e15e483
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c6c29b64ca7ca58aef3e5e8d6aa08505ce5b75cd)

5 years agoDecouple and create features per each topology bundle 70/78370/3
Claudio D. Gasparini [Mon, 3 Dec 2018 08:17:08 +0000 (09:17 +0100)]
Decouple and create features per each topology bundle

Change-Id: I06e914041d48b4aefb6d234094f6c2af0f94b55b
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoUse features instead od bundles 42/78342/4
Claudio D. Gasparini [Sun, 2 Dec 2018 20:26:45 +0000 (21:26 +0100)]
Use features instead od bundles

under existent features. Avoid duplication

Change-Id: Ia7503d65e7b63d82de114c8d9485028ba6de8984
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agosend EOR marker after initial route exchange 09/77509/14
Matej Perina [Mon, 5 Nov 2018 11:30:19 +0000 (12:30 +0100)]
send EOR marker after initial route exchange

JIRA: BGPCEP-807

Change-Id: I374826c8faaa94e8ba8394588b7de0a00acf101f
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoMigrate Matchers.any() 53/78353/4
Robert Varga [Mon, 3 Dec 2018 01:18:21 +0000 (02:18 +0100)]
Migrate Matchers.any()

This method has been moved to ArgumentMatchers, make the switch.

Change-Id: I710791942f2f342e636cc77713e8867b3a75cd32
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd RevisedErrorHandlingSupport ParserConstraint 25/78025/8
Robert Varga [Sun, 2 Dec 2018 23:44:54 +0000 (00:44 +0100)]
Add RevisedErrorHandlingSupport ParserConstraint

We need to communicate to the parser whether RFC7606 is enabled
and whether the peer is internal or external. This patch adds
the interface to do that.

JIRA: BGPCEP-359
Change-Id: Id123c4d25019bd1be1ec7b228cd010c81186a4a4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agointroduce graceful restart speaker capability 45/76245/16
Matej Perina [Wed, 19 Sep 2018 06:48:18 +0000 (08:48 +0200)]
introduce graceful restart speaker capability

JIRA: BGPCEP-808

Change-Id: I6c4ac1b7697311c31405d0c660fb3e53ca1d8e78
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoAdd Ipv4Util.prefixForByteBuf(ByteBuf, int) 48/78348/1
Robert Varga [Sun, 2 Dec 2018 23:42:20 +0000 (00:42 +0100)]
Add Ipv4Util.prefixForByteBuf(ByteBuf, int)

This utility method is needed to parse the IPv4 prefix in two separate
validation steps.

Change-Id: I43f05987222c2cd953760d0b57c3f73240d75f1b
JIRA: BGPCEP-359
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to yangtools-2.1.4 and mdsal-3.0.2 41/78141/4
Robert Varga [Mon, 26 Nov 2018 09:20:49 +0000 (10:20 +0100)]
Bump to yangtools-2.1.4 and mdsal-3.0.2

This bumps the dependencies to 2.1.4 and 3.0.2, respectively.

Change-Id: I73c9ae102298ae3c7bae7f3d1a74a43b626509ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agointroduce graceful restart listener capability 43/76143/43
Matej Perina [Thu, 6 Sep 2018 09:37:46 +0000 (11:37 +0200)]
introduce graceful restart listener capability

JIRA: BGPCEP-807

Change-Id: I0f31bd03d63ec48749d8cf4a2491016e30180c0f
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoadd option to close peer session without notification 88/77988/3
Matej Perina [Tue, 20 Nov 2018 14:15:57 +0000 (15:15 +0100)]
add option to close peer session without notification

- from RFC4724 comes need to have option to close
  session without sending NOTIFICATION in certain
  situations

JIRA: BGPCEP-807

Change-Id: Ib560c3a15c1f2227829c151697a6fde98e3a7eed
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoRemove AttributeParser.parseAttribute(ByteBuf, int) 21/78021/2
Robert Varga [Wed, 21 Nov 2018 09:31:27 +0000 (10:31 +0100)]
Remove AttributeParser.parseAttribute(ByteBuf, int)

We require peer information for parsing, promote the peer-aware
parsing method as the primary contract.

JIRA: BGPCEP-359
Change-Id: I7fe039034563ce416ac6f6d08fbf6de867c35344
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove MessageParser.parseMessageBody(ByteBuf, int) 79/77979/5
Robert Varga [Tue, 20 Nov 2018 13:34:34 +0000 (14:34 +0100)]
Remove MessageParser.parseMessageBody(ByteBuf, int)

This method is no longer the proper entrypoint, remove it and update
all parsers to implement the replacement.

JIRA: BGPCEP-359
Change-Id: I6fff6cf9f0275d9562c9e37ce55d34287251794b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoReduce use of newArrayList()/newHashSet() 76/77976/2
Robert Varga [Tue, 20 Nov 2018 12:10:44 +0000 (13:10 +0100)]
Reduce use of newArrayList()/newHashSet()

These methods are not needed with modern java, do not use them.

Change-Id: If6cb8780f2277c80ef84d72daa89f92833677e84
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRequire Peer to return a FluentFuture 75/77975/1
Robert Varga [Tue, 20 Nov 2018 12:01:51 +0000 (13:01 +0100)]
Require Peer to return a FluentFuture

Rather than specifying ListenableFuture, make sure we get a FluentFuture.

Change-Id: I35999c0c7ae8c0c5fa64fdbf4391b6604c60f91c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove duplicate message type check 74/77974/1
Robert Varga [Tue, 20 Nov 2018 11:59:44 +0000 (12:59 +0100)]
Remove duplicate message type check

Rather than performing two instanceof checks, use an if/else
construct to dispatch message.

Change-Id: I4ce5aba7e1c826fe343b279c9767193d0ba83154
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSERO & SRRO 15/77815/2
Claudio D. Gasparini [Wed, 14 Nov 2018 17:18:35 +0000 (18:18 +0100)]
SERO & SRRO

https://tools.ietf.org/html/rfc8306#section-3.2

JIRA: BGPCEP-406
Change-Id: I47e496fc821325b30c31368a4f906a2cb66434b2
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoDecouple sero/srro subojects models from sero/srro objects models 13/77813/2
Claudio D. Gasparini [Thu, 8 Nov 2018 09:15:01 +0000 (10:15 +0100)]
Decouple sero/srro subojects models from sero/srro objects models

JIRA: BGPCEP-406

Change-Id: I197735ed18278dec010f5e595c7619efb8c5d232
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoAssert route change identifier being IdentifiableItem 61/77861/1
Robert Varga [Thu, 15 Nov 2018 18:17:00 +0000 (19:17 +0100)]
Assert route change identifier being IdentifiableItem

Rather than doing a straight cast, verify the object beforehand,
giving us a proper data instead of a ClassCastException.

Change-Id: Ia9dafc9d62028fbe66fc11036d6873821c5ef8a7
JIRA: BGPCEP-848
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix an eclipse nullness warning 24/77824/1
Robert Varga [Wed, 14 Nov 2018 21:14:43 +0000 (22:14 +0100)]
Fix an eclipse nullness warning

Eclipse (rightfully) flags this access as potentiall null. Since
we are invoking an interface getter, it is not statically known that
the two invocations will return the same value.

Cache the second field access in a local variable, which ensures
we access the property exactly once, which keeps eclipse happy.

In case the implementation LazyDataObjectModification, this has
the benefit of not deserializing twice.

Change-Id: Idfb8c631bc0267a63710c2cb650e6bda1c227df3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agouse multi thread executor in unit tests 79/77779/2
Matej Perina [Wed, 14 Nov 2018 11:11:16 +0000 (12:11 +0100)]
use multi thread executor in unit tests

- instantiatie AbstractConcurentDataBroker the way to use
  CachedThreadPoolExecutor instead of DirectExecutor
- with new executor we are not in sync with .get() on transaction
  future, so timers continuos verification with timeout is used
  in tests where needed

JIRA: BGPCEP-847

Change-Id: I86cbe54a17e65d4ac7bdc7ca447ac58f345c473a
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoBGP Stats collector 77/77677/3
Claudio D. Gasparini [Mon, 12 Nov 2018 07:12:03 +0000 (08:12 +0100)]
BGP Stats collector

simplify synchronization of stats

JIRA: BGPCEP-846
Change-Id: I55d30f9cddb33006fb8d2519ddbe9f8b330de71b
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoPCEP Thread deadlock 67/77667/3
Claudio D. Gasparini [Sat, 10 Nov 2018 17:53:15 +0000 (18:53 +0100)]
PCEP Thread deadlock

Change-Id: I7b1f6fcf8c678c76750c501ce979813a20fa8313
JIRA: BGPCEP-845
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoDo not create empty route list container 46/77646/4
Claudio D. Gasparini [Fri, 9 Nov 2018 12:27:47 +0000 (13:27 +0100)]
Do not create empty route list container

to keep consistency with mdsal changes

Change-Id: Ibd58e7538fbefda96f96d7b3166553c3f8f27181
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoEncode with Base64 Linkstate route key 56/77656/1
Claudio D. Gasparini [Fri, 9 Nov 2018 15:03:11 +0000 (16:03 +0100)]
Encode with Base64 Linkstate route key

Change-Id: Ib9e9803d6c8287dffb97e9c89b5e975db60bc979
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoUpdate ObjectParser API 31/77631/2
Claudio D. Gasparini [Thu, 8 Nov 2018 14:05:02 +0000 (15:05 +0100)]
Update ObjectParser API

- return Object Class
- return Object Type

This will allow to simplify parser registration
and remove duplicated code.

Change-Id: I1f712f87ad0be190db45e77cc13f55ab6352c2a7
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoFix application peer handling of DISAPPEARED / APPEARED case 28/77628/2
Claudio D. Gasparini [Thu, 8 Nov 2018 16:36:53 +0000 (17:36 +0100)]
Fix application peer handling of DISAPPEARED / APPEARED case

JIRA: BGPCEP-843

Change-Id: I82368d8cf029ffe83391333c6e11633511688b69
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoSolve deadlock 55/77555/1
Claudio D. Gasparini [Tue, 6 Nov 2018 12:26:37 +0000 (13:26 +0100)]
Solve deadlock

JIRA: BGPCEP-841
Change-Id: I9daaa786e9d1b1cf7aa74141d346f1bd86b36452
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoMigrate bgp-benchmark to MD-SAL APIs 49/77449/4
Claudio D. Gasparini [Thu, 1 Nov 2018 14:20:43 +0000 (15:20 +0100)]
Migrate bgp-benchmark to MD-SAL APIs

Change-Id: Ie6a1bfcd810524b08485537b6b2e54ceb6c2bf49
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoMigrate pcep to MD-SAL APIs 48/77448/5
Claudio D. Gasparini [Tue, 30 Oct 2018 21:03:38 +0000 (22:03 +0100)]
Migrate pcep to MD-SAL APIs

Change-Id: Id3e35a7636cd6b4b7e0d319a022ba588840de67c
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoMigrate programming controller mdsal 47/77447/4
Claudio D. Gasparini [Thu, 1 Nov 2018 11:53:11 +0000 (12:53 +0100)]
Migrate programming controller mdsal

Change-Id: If52a3d8ac73e92965d207d3fe8b1e1c154a5947a
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoMigrate controller mdsal 46/77446/5
Claudio D. Gasparini [Wed, 31 Oct 2018 14:01:41 +0000 (15:01 +0100)]
Migrate controller mdsal

Change-Id: Ie2e5014495890f0f153df3011d49558939c4d6d8
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoMove back to using RC7223 models 69/77469/1
Robert Varga [Sat, 3 Nov 2018 13:03:19 +0000 (14:03 +0100)]
Move back to using RC7223 models

Bumping to RFC8343 was a mistake, move back to using RFC7223.

Change-Id: I57fc1d0ff1229b91b8d641d5a0caa9a0a766a027
JIRA: TSC-179
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unnecesary feature 64/77464/2
Claudio D. Gasparini [Fri, 2 Nov 2018 17:11:45 +0000 (18:11 +0100)]
Remove unnecesary feature

from config loaader feature

Change-Id: I48b767c52265f50072bb82afde7df8b1c5dede97
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoFix handleDeletions 63/77463/1
Claudio D. Gasparini [Fri, 2 Nov 2018 16:50:05 +0000 (17:50 +0100)]
Fix handleDeletions

JIRA: BGPCEP-840
Change-Id: Icef3407608e526f95621ae786524b70c0358d3d1
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agouse thread-safe list in ConfigLoaderImplTest 75/77375/1
Matej Perina [Wed, 31 Oct 2018 10:22:13 +0000 (11:22 +0100)]
use thread-safe list in ConfigLoaderImplTest

- to prevent ConcurrentModificationException in
  situation when List.stream() is called at same
  time as List.clear()

JIRA: BGPCEP-829

Change-Id: I9e69971de5ec75ca515e81e2b95fe44e50489fda
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoFix LEAK: ByteBuf.release() 91/77291/2
Claudio D. Gasparini [Fri, 26 Oct 2018 08:36:24 +0000 (10:36 +0200)]
Fix LEAK: ByteBuf.release()

JIRA: BGPCEP-839
Change-Id: I07692d26e7b8cbb3b1134a61f2ea0c5947b8bd81
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoIntegrate MRI projects for Neon 06/75006/32
Robert Varga [Thu, 9 Aug 2018 13:36:25 +0000 (15:36 +0200)]
Integrate MRI projects for Neon

This patch bumps:
- odlparent to 4.0.2
- yangtools to 2.1.2
- mdsal to 3.0.1

It also fixes assumptions around list presence when it is empty.

JIRA: BGPCEP-827
Change-Id: Ifecf9e3a7909f2a95776a90e27316f0902ca12cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix LinkstateTopologyBuilder NPE 39/77239/1
Claudio D. Gasparini [Wed, 24 Oct 2018 06:16:56 +0000 (08:16 +0200)]
Fix LinkstateTopologyBuilder NPE

JIRA: BGPCEP-838

Change-Id: Ie5ba13434245195d77e3c29850cf54ef973e3441
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoremove redundant ImmutableMap call 70/77170/1
Matej Perina [Mon, 22 Oct 2018 11:05:06 +0000 (13:05 +0200)]
remove redundant ImmutableMap call

Change-Id: Idfbbfa44a0835a9caaf0c094b89a2c841224bb09
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoInclude Routes Node when generating route path 53/77053/1
Claudio D. Gasparini [Wed, 17 Oct 2018 06:40:04 +0000 (08:40 +0200)]
Include Routes Node when generating route path

Given that it is common node, therefore
duplicate code can removed and is easier for user.

Change-Id: I5babaf17c9b70258aa7772e7cd5c443dcad9a442
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoRemove unneeded references to yang-maven-plugin 78/76978/1
Robert Varga [Sun, 14 Oct 2018 01:48:40 +0000 (03:48 +0200)]
Remove unneeded references to yang-maven-plugin

This artifacts do not contain a yang model, there is no point
in invoking the plugin.

Change-Id: I8f9dc452e61542310bd28afc3dc024551f754c28
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBGPCEP-829 fix concurrent access to config file 82/76782/1
Matej Perina [Tue, 9 Oct 2018 10:28:27 +0000 (12:28 +0200)]
BGPCEP-829 fix concurrent access to config file

- calling handleConfigFile from two differrent threads was
  causing ConncurentModificationException in ConfigLoaderImpl
  test

Change-Id: I9ada792c98aafc06daa8971b75df22b85b3ff4c1
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoHandle RT removal at different level 15/76715/1
Claudio D. Gasparini [Fri, 5 Oct 2018 19:50:28 +0000 (21:50 +0200)]
Handle RT removal at different level

under eff-rib-in.

JIRA:BGPCEP-830

Change-Id: Id0539fe1334a03847c1cfeb66dfb074821e8b6ae
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoMigrate bgpcep docs to the bgpcep project 67/75867/1
Thanh Ha [Sun, 9 Sep 2018 00:36:10 +0000 (20:36 -0400)]
Migrate bgpcep docs to the bgpcep project

Issue: DOCS-69
Change-Id: I855bbc445316b0b0fef428666cd31eb56f7bac12
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoBootstrap bgpcep documentation 66/75866/1
Thanh Ha [Sun, 9 Sep 2018 00:30:30 +0000 (20:30 -0400)]
Bootstrap bgpcep documentation

Issue: DOCS-69
Change-Id: Ia94987eddf0ce52e73b1244770a97f43555e4a8b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoSwitch PCEP to no-zone ip addresses 71/72771/11
Robert Varga [Thu, 7 Jun 2018 16:44:43 +0000 (18:44 +0200)]
Switch PCEP to no-zone ip addresses

This patch adjusts the model to take advantage of the fact we never
see a zone here -- which leads to slightly faster serialization.

Change-Id: I1aced577b32822a9e8541ed15fcdb958cf1b766d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBGPCEP-826: Add route target extension StatementActivator service 00/75700/1
Claudio D. Gasparini [Mon, 3 Sep 2018 14:23:45 +0000 (16:23 +0200)]
BGPCEP-826: Add route target extension StatementActivator service

to META-INF.services

Change-Id: Iab969af474936dd226d255d5bf6d618d0b3845ba
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
(cherry picked from commit ae9ede56f51ed2530c867b1d9a8626163be33bc2)

5 years agoFix findbugs warnings 33/75333/2
Robert Varga [Mon, 20 Aug 2018 15:29:30 +0000 (17:29 +0200)]
Fix findbugs warnings

These bugs are reported by upgraded findbugs, fix them prior
to the actual upgrade.

Change-Id: I0c21059a289abec1631f3a7b324c771091930804
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoReturn Set instead of Iterable in test setup 38/75338/2
Robert Varga [Mon, 20 Aug 2018 18:02:27 +0000 (20:02 +0200)]
Return Set instead of Iterable in test setup

This allows us to define equality in superclass, hence return
proper Set.

Change-Id: Ic37c3283ff234181320201f18e14047d6aa92d37
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove references to mdsal-model-artifacts 18/75118/1
Robert Varga [Sat, 11 Aug 2018 07:32:28 +0000 (09:32 +0200)]
Remove references to mdsal-model-artifacts

This artifact is going away, migrate to mdsal-artifacts.

Change-Id: I1810e2f18c600e219610d6975241edbd6e9faf22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump versions by x.(y+1).z for next dev cycle 86/74986/1
Anil Belur [Thu, 9 Aug 2018 12:40:14 +0000 (18:10 +0530)]
Bump versions by x.(y+1).z for next dev cycle

Change-Id: Iaad861760cea380b06505b3ebe54f7d77ac48a20
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
5 years agoBump yangtools to 2.0.10 84/74884/1
Robert Varga [Mon, 6 Aug 2018 15:48:24 +0000 (17:48 +0200)]
Bump yangtools to 2.0.10

This fixes an issue with actions, hence we need it in Fluorine.

Change-Id: Ie12ee96d9659441d45a144cc99ef46af912dab76
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse newly-introduced type-safe methods 24/74724/2
Robert Varga [Wed, 1 Aug 2018 09:47:52 +0000 (11:47 +0200)]
Use newly-introduced type-safe methods

New methods allow us to precisely target specific case items.

Change-Id: I22c3df0c9bb94767b769020e3d87cad9b4cf7f2d
JIRA: MDSAL-342
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoWorkaround for jenkins Route target test 41/74741/1
Claudio D. Gasparini [Wed, 1 Aug 2018 14:48:48 +0000 (16:48 +0200)]
Workaround for jenkins Route target test

JIRA: BGPCEP-817
Change-Id: I4bb5bbc0c39388669bb811ad85b12df2394a21f6
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoAdjust for API change 07/74607/2
Robert Varga [Sat, 28 Jul 2018 09:50:45 +0000 (11:50 +0200)]
Adjust for API change

Returned collection type changed slightly, fix that up.

Change-Id: Ib0fede6f8646692d8a9c06740572f51063ba8ccf
JIRA: MDSAL-342
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools to 2.0.9 70/74570/1
Robert Varga [Fri, 27 Jul 2018 12:06:00 +0000 (14:06 +0200)]
Bump yangtools to 2.0.9

This patch bumps yangtools to latest release.

Change-Id: Ie31438a7ce35a149f72a8b024ac2e19e4b736bcd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agofix timing issue in server creation for BmpMockTest 90/74390/6
Matej Perina [Tue, 24 Jul 2018 10:55:24 +0000 (12:55 +0200)]
fix timing issue in server creation for BmpMockTest

- add wait unitl server is created

Change-Id: Id217822e57be8c7df1139341af9ade2517dad516
JIRA: BGPCEP-815
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoBump to odlparent 3.1.3 91/74191/3
Stephen Kitt [Wed, 18 Jul 2018 16:06:37 +0000 (18:06 +0200)]
Bump to odlparent 3.1.3

Change-Id: I10266e55e95d2697ab8c92c47ac0f08c05a31d71
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoUse moved BindingReflections 67/74367/8
Robert Varga [Tue, 24 Jul 2018 01:02:46 +0000 (03:02 +0200)]
Use moved BindingReflections

BindingReflections is moving away, make sure we are using the new
version.

Change-Id: I972cad0c094457519a12dba058d43836b045a78c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoReduce use of waitFutureSuccess utility 72/74272/3
Claudio D. Gasparini [Fri, 20 Jul 2018 08:21:31 +0000 (10:21 +0200)]
Reduce use of waitFutureSuccess utility

Change-Id: I5c24101645c592052155402cc3835e63dfc690d1
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoRework BmpMockDispatcherTest 67/74267/4
Claudio D. Gasparini [Fri, 20 Jul 2018 06:51:43 +0000 (08:51 +0200)]
Rework BmpMockDispatcherTest

- Use test timeout instead of waitFutureSuccess utility
- use blocking futures

JIRA: BGPCEP-814
Change-Id: If21621f2e0aaf3c903671f395d051d6dfca0daa0
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoFix calculation and roll-over of BGP operational neighbor uptime value. 58/74158/3
Ajay Lele [Tue, 17 Jul 2018 21:09:14 +0000 (14:09 -0700)]
Fix calculation and roll-over of BGP operational neighbor uptime value.

Change-Id: I15211d925664f275f1980df863cf6cefce8c0ba4
JIRA: BGPCEP-813
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
5 years agoCleanup feature dependencies 39/74239/1
Robert Varga [Thu, 19 Jul 2018 13:21:57 +0000 (15:21 +0200)]
Cleanup feature dependencies

Some of our basic features do a rather massive over-inclusion,
fix that.

Change-Id: I483d6b9d83b60087c64589abb19d7fa13e3ff75c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove powermock dependency 85/74185/1
Robert Varga [Wed, 18 Jul 2018 11:31:39 +0000 (13:31 +0200)]
Remove powermock dependency

powermock is not used anywhere, remove the dependency declaration.

Change-Id: I475eda21b1448cbab46837796f03bdaef409fbfb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>