bgpcep.git
5 years agoFix AbstractAddPathTest resource cleanup 46/78846/2
Robert Varga [Mon, 17 Dec 2018 19:22:51 +0000 (20:22 +0100)]
Fix AbstractAddPathTest resource cleanup

The tests were not calling super.tearDown() for some reason,
fix that up.

Change-Id: Ia8eea6d4315a1d16613b6e66376102e2f713cba1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnforce pcep-spi checkstyle 43/78843/2
Robert Varga [Mon, 17 Dec 2018 16:23:09 +0000 (17:23 +0100)]
Enforce pcep-spi checkstyle

This is trivial conversion, removing reflection-based tests
and killing unneeded final's and splitting long lines.

Change-Id: I158060d63cb59c387428897af9dc47efaf56dcee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not instantiate executor service for tasks 23/78823/2
Robert Varga [Sat, 15 Dec 2018 19:01:09 +0000 (20:01 +0100)]
Do not instantiate executor service for tasks

Netty channel (which backs each BGPSession) is itself backed by
an EventLoop, which is an implementation of ScheduledExecutorService.

Take advantage of this to schedule the timers we need, instead
of leaking threads by allocating executor services again and
again.

Change-Id: I6bb4bf8d63abd0af0c8cf10012a905db8fa0975d
JIRA: BGPCEP-495
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPropagate LLGR configuration 22/78822/1
Robert Varga [Sat, 15 Dec 2018 17:53:42 +0000 (18:53 +0100)]
Propagate LLGR configuration

Add BGPPeer awareness of LLGR, with basic configuration and
negotiation, without following required mechanics yet.

JIRA: BGPCEP-495
Change-Id: I659fcdb35ffc9884f3cfb579d98495cee48d468d
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix a checkstyle violation 21/78821/1
Robert Varga [Sat, 15 Dec 2018 17:23:31 +0000 (18:23 +0100)]
Fix a checkstyle violation

This is a missing space, fix that.

Change-Id: Ia676cab69575ef5408268256a4d2e3920a340cf7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix BGPPeer internal locking 20/78820/1
Robert Varga [Sat, 15 Dec 2018 17:10:56 +0000 (18:10 +0100)]
Fix BGPPeer internal locking

onRouteRefreshMessage() is not synchronized and manipulates
adjRibOutListenerSet, which is a thread-safety hazard.

Fix by holding a lock for the duration needed, as well as
use a single remove() operation instead of get/remove combo.

Finally lower private method synchronization and replace it
with @GuardedBy annotations, so that it is understood those
methods are only ever called with the lock already held.

Change-Id: Idd509a345dfc3afa800e7456fb6d3bdbd1f367e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix more rib-impl checkstyle 15/78815/1
Robert Varga [Sat, 15 Dec 2018 10:54:30 +0000 (11:54 +0100)]
Fix more rib-impl checkstyle

This brings the number of violations below 60.

Change-Id: I177545b21da1f965a6db936341223a732560d4d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix some rib-impl warnigs 55/78755/7
Robert Varga [Thu, 13 Dec 2018 12:56:56 +0000 (13:56 +0100)]
Fix some rib-impl warnigs

This patch addresses about half of the warnings generate rib-impl.

Change-Id: Ibfcddf215c0add72d9b13a192381b7390233cfcf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoJUnit test for treat-as-withdraw procedures 53/78653/34
Matej Perina [Mon, 10 Dec 2018 14:51:05 +0000 (15:51 +0100)]
JUnit test for treat-as-withdraw procedures

add test to verify that parsing UPDATE message with
malformed attribute list result in converting:
- Nlri to withdrawn routes (parser-impl test)
- MP_REACH to MP_UNREACH (extensions/inet test)

JIRA: BGPCEP-359
Change-Id: Ia0ad989c15e1645746942a662e7da1d5a079b9ad
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoRefactor StaleBestPathRoute 12/78512/20
Robert Varga [Fri, 14 Dec 2018 17:07:38 +0000 (18:07 +0100)]
Refactor StaleBestPathRoute

This removes the dependency on RIBSupport by forcing users to provide
proper lists. Since there are only two users, we can create specialized
instances, co-located with them, so that we do not have to cross through
SPI/implementation boundaries.

This allows saves quite a bit of memory in non-addpath case and also
improves code AddPathAbstractRouteEntry isolation, as we no longer
leak List<Long> all over the place.

Change-Id: I48b91d15df738095812736dfdeaa71d88b30598b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPass PathIds to StaleBestRoute 79/78779/6
Robert Varga [Fri, 14 Dec 2018 02:23:38 +0000 (03:23 +0100)]
Pass PathIds to StaleBestRoute

At the end of the day, StaleBestRoute needs to be refactored
so that we have two implementations: one for addpath, one for
non-addpath selection.

As a first step, make sure callers allocate PathIds and pass
them to StaleBestRoute.

Change-Id: Ief9a0280eec1bfa99530f3aedef8451a98ac35df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoConvert treat-as-withdraw update messages 49/78349/52
Robert Varga [Fri, 14 Dec 2018 00:35:40 +0000 (01:35 +0100)]
Convert treat-as-withdraw update messages

When we encounter a treat-as-withdraw error, we need to convert
the Update message to its withdraw equivalent.

JIRA: BGPCEP-359
Change-Id: I383571360f41a3cf874c55e13e6c4212f31522ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoProvide a way to convert MpReach to MpUnreach 99/78799/4
Matej Perina [Fri, 14 Dec 2018 14:04:10 +0000 (15:04 +0100)]
Provide a way to convert MpReach to MpUnreach

BGPUpdateParser needs the ability to convert MP_REACH attributes
to MP_UNREACH equivalents, potentially merging an existing
MP_UNREACH attribute into the mix.

This patch adds that capability by adding teach NlriRegistry to
perform the conversion.

JIRA: BGPCEP-359
Change-Id: I3f3330145b1e4851335f44a0f9183cd1b6c83ea5
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agooperational state of LLGR procedures 22/78122/36
Matej Perina [Fri, 23 Nov 2018 09:32:16 +0000 (10:32 +0100)]
operational state of LLGR procedures

State of (LL)GR operations (restart time, enabled afi-safi...)
is now accessible in operational datastore.

JIRA: BGPCEP-809
Change-Id: If03b74e67750970a08cfdc34ae402cbe8283da15
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoadd interface for LLGR state 43/78743/11
Matej Perina [Thu, 13 Dec 2018 09:12:44 +0000 (10:12 +0100)]
add interface for LLGR state

This implements dedicated interface for LLGR state.

JIRA: BGPCEP-495
Change-Id: I54597dd6461dfed4ea655213d406d8ed8cbb5bfb
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoConvert NLRI to withdrawn routes 80/78780/6
Robert Varga [Fri, 14 Dec 2018 03:34:02 +0000 (04:34 +0100)]
Convert NLRI to withdrawn routes

When we encounter a treat-as-withdraw condition, we need to convert
all reachability information to its withdraw equivalent.

This patch deals with those procedures for NLRI field, appending it
to any Withdrawn Routes field present.

JIRA: BGPCEP-359
Change-Id: I4471e28c1ab6bb8de6016d36911c693c5e897778
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd decoder constraint based on treat-as-withdrawn configuration 61/78561/24
Matej Perina [Sun, 9 Dec 2018 10:15:13 +0000 (11:15 +0100)]
Add decoder constraint based on treat-as-withdrawn configuration

Uses openconfig peer/peer-group -> error-handling ->
treat-as-withdrawn for configuring whether treat-as-withdrawn
procedures should take place.

JIRA: BGPCEP-359
Change-Id: I0fd34df7fbb500b4c7fa7012b2f0cfbef8c1f5e1
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agotreat-as-withdrawn documentation 72/78572/19
Matej Perina [Mon, 10 Dec 2018 09:07:39 +0000 (10:07 +0100)]
treat-as-withdrawn documentation

Provides guide to enable treat-as-withdraw procedures.

JIRA: BGPCEP-359
Change-Id: I7b47580b960d5007416206094737c8a0ca6fe287
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agotreat-as-withdraw configuration example 62/78562/21
Matej Perina [Sun, 9 Dec 2018 17:13:41 +0000 (18:13 +0100)]
treat-as-withdraw configuration example

Basic configuration for enabling threat-as-withdraw
procedures.

JIRA: BGPCEP-359
Change-Id: I3f3cab86e0858a58e7be1d2c2b9df342b8c03748
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoCleanup bgp-openconfig-api helpers 70/78770/4
Robert Varga [Thu, 13 Dec 2018 20:14:30 +0000 (21:14 +0100)]
Cleanup bgp-openconfig-api helpers

This cleans up the custom-coded helpers to work more efficiently,
fixing eclipse warnings at the same time.

Change-Id: I3724a478b73e27382bc1f49766603e16a92396e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd LLGR restart utilities 75/78775/6
Robert Varga [Thu, 13 Dec 2018 22:49:45 +0000 (23:49 +0100)]
Add LLGR restart utilities

This adds utilities for dealing with LLGR capabilities and
advertizements.

JIRA: BGPCEP-495
Change-Id: I34a43270af8792f45e4a9c808eaa45febf1f7d7e
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoTeach BgpSessionImpl about graceful restart Mode 42/78742/8
Matej Perina [Thu, 13 Dec 2018 08:58:18 +0000 (09:58 +0100)]
Teach BgpSessionImpl about graceful restart Mode

This adds API to request graceful restart operational mode.

JIRA: BGPCEP-809
Change-Id: I5f840b167eb635ee10af9570dce9b1dbd71e591b
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agolong-lived graceful restart configuration example 39/78539/20
Matej Perina [Fri, 7 Dec 2018 09:52:17 +0000 (10:52 +0100)]
long-lived graceful restart configuration example

Provide basic ll-graceful-restart configuration within
config-example module/feature.

JIRA:BGPCEP-495
Change-Id: I0bf449c7dc1e08e4c68fcba5673f54de3a4fe0dd
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoValidate Withdrawn Routes and NLRI 77/78777/4
Robert Varga [Fri, 14 Dec 2018 00:36:28 +0000 (01:36 +0100)]
Validate Withdrawn Routes and NLRI

RFC7606 section 5.3 mandates we perform additional validation
on Withdrawn Routes and NLRI fields. This patch adds that validation.

Change-Id: I3b0497afd3a0622bb681935aba718767a13ae235
JIRA: BGPCEP-359
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoThrow ThreatAsWithdrawException on missing mandatory attributes 46/78646/7
Matej Perina [Tue, 11 Dec 2018 12:33:16 +0000 (13:33 +0100)]
Throw ThreatAsWithdrawException on missing mandatory attributes

https://tools.ietf.org/html/rfc7606#section-3:
d.  If any of the well-known mandatory attributes are not present in
    an UPDATE message, then "treat-as-withdraw" MUST be used.

For this to work we need to update BGPTreatAsWithdrawException,
because RFC4271 requires us to report the attribute type.

JIRA: BGPCEP-359
Change-Id: I3f1a1d56a3cf1e7e1b84fe2f7a5933af95129b91
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnable surefire for reuse 63/78763/2
Robert Varga [Thu, 13 Dec 2018 16:28:59 +0000 (17:28 +0100)]
Enable surefire for reuse

Not reusing forked JVMs leads to inability to efficiently cache
invariants, like SchemaContext et al.

Re-enable fork reuse by default, potentially fixing tests which
end up failing.

Change-Id: I1d1ad044d815d1f3bc96e3b56420149ccaa8fd81
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSpeed up CheckUtilTest 65/78765/3
Robert Varga [Thu, 13 Dec 2018 16:54:35 +0000 (17:54 +0100)]
Speed up CheckUtilTest

Waiting 200 seconds for a simple test is simply not acceptable.
Refactor CheckUtil to expose a waitFutureSuccess() which takes
a timeout and use that for testing the class.

Change-Id: I951dd1f1357eb02360e239b0ba41c10db0bfde7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd LLGR openconfig extension 61/78761/3
Robert Varga [Thu, 13 Dec 2018 15:55:53 +0000 (16:55 +0100)]
Add LLGR openconfig extension

This adds the configuration extension, so that LLGR can be
configured through OpenConfig.

JIRA: BGPCEP-495
Change-Id: Iadcd3915e094a750418480df7b237da88fca00cd
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUndo damage done by https://git.opendaylight.org/gerrit/#/c/69403/ 57/78757/2
Robert Varga [Thu, 6 Dec 2018 15:19:04 +0000 (16:19 +0100)]
Undo damage done by https://git.opendaylight.org/gerrit/#/c/69403/

This patch restores the ability to lookup RIBSupportContext
through NodeIdentifierWithPredicates.

Change-Id: I2b9399620f4935a50e8458042a767bc3e1aa5b59
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix extension's groupId 60/78760/1
Robert Varga [Thu, 13 Dec 2018 16:00:07 +0000 (17:00 +0100)]
Fix extension's groupId

Rather than inheriting odlparent, make sure we use bgpcep.

Change-Id: I64c696d67d178c243fc6cf76ef3762c329b7b9ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSwitch from findbugs to spotbugs 44/78744/5
Robert Varga [Thu, 13 Dec 2018 09:33:56 +0000 (10:33 +0100)]
Switch from findbugs to spotbugs

SpotBugs is the replacement for FindBugs, switch to using it.

Change-Id: I2e5b21e87f85d4bb46c343943255364e2231e766
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoTranslate GR RPC 54/78754/2
Robert Varga [Thu, 13 Dec 2018 12:43:56 +0000 (13:43 +0100)]
Translate GR RPC

Rather than blocking current thread, bridge futures so that we
return without blocking.

Change-Id: I8fec49c96b104b952de7a87b83b1bc4daf17f0d6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix remaining checkstyle in bgp-parser-impl 52/78752/4
Robert Varga [Thu, 13 Dec 2018 11:58:47 +0000 (12:58 +0100)]
Fix remaining checkstyle in bgp-parser-impl

This fixes up the last straggler and flips enforcement to on.

Change-Id: I5fad39b6105230cb0e4474b6414525aab6736b00
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix most bgp-parser-impl checkstyle 51/78751/3
Robert Varga [Thu, 13 Dec 2018 11:59:10 +0000 (12:59 +0100)]
Fix most bgp-parser-impl checkstyle

This fixes all but one violation.

Change-Id: I4b34e87cc43946f9bddd485f57573355d076bebf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnforce bgp-parser-spi checkstyle 48/78748/4
Robert Varga [Thu, 13 Dec 2018 10:53:15 +0000 (11:53 +0100)]
Enforce bgp-parser-spi checkstyle

This patch removes the final violations and flips enforcement on.

Change-Id: Ia02483620694df804ed16c97db1815c066a79be5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix most bgp-parser-spi checkstyle violations 47/78747/3
Robert Varga [Thu, 13 Dec 2018 10:53:37 +0000 (11:53 +0100)]
Fix most bgp-parser-spi checkstyle violations

These violations have been piling up, clean most of them up.

Change-Id: I3f42f7d49028117b81b9963ab3efa750082cc7db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnforce checkstyle in labeled-unicast 45/78745/4
Robert Varga [Thu, 13 Dec 2018 10:00:56 +0000 (11:00 +0100)]
Enforce checkstyle in labeled-unicast

This fixes checkstyle violations and flips enforcement on.

Change-Id: I92e080e8a4950727019ce7351afe8311aaac36bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoTurn bgp/extensions into an aggregator 35/78735/6
Robert Varga [Thu, 13 Dec 2018 08:17:47 +0000 (09:17 +0100)]
Turn bgp/extensions into an aggregator

This is a pure aggregator, do not also make it a parent, as that
welds project layout to published artifacts.

Change-Id: Ic5190d94d14c2b56e59812e79ce1064e6a866730
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agodocumentation for graceful restart 23/78123/22
Matej Perina [Sun, 25 Nov 2018 09:26:04 +0000 (10:26 +0100)]
documentation for graceful restart

- documentation for two new capabilities,
  graceful restart and long-lived graceful restart
- update documentation of operational state, which
  now shows state of graceful restart procedures

Change-Id: Ic698b9e70b2242e53469add7e960af575d76e228
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoDo not install/deploy aggregator poms 34/78734/3
Robert Varga [Thu, 13 Dec 2018 07:22:19 +0000 (08:22 +0100)]
Do not install/deploy aggregator poms

THese are just build helpers, there is no point in installing
and deploying them.

Change-Id: Ieda0493d2fb0eb5072c60a234f502fee1a5ad7be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd support for aggregate sonar reports 33/78733/2
Robert Varga [Thu, 13 Dec 2018 07:20:18 +0000 (08:20 +0100)]
Add support for aggregate sonar reports

This patch teaches the top-level aggregator to combine jacoco
reports for all artifacts, so that sonar can pick it up.

Change-Id: Ie116fcb069b6c384783f0a3f751eb15186dd42ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoExtract routeKey/pathId from the identifier 18/78718/6
Robert Varga [Wed, 12 Dec 2018 12:52:46 +0000 (13:52 +0100)]
Extract routeKey/pathId from the identifier

Rather than mucking with old/new route content, extract the needed
information from the identifier, which is always available.

Change-Id: I7fedb4a7b4d670bc837388ef492d6d32ce3a244c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoTeach BGPSessionImpl about LLGR 26/78726/1
Robert Varga [Wed, 12 Dec 2018 23:41:52 +0000 (00:41 +0100)]
Teach BGPSessionImpl about LLGR

This refactors BGPSessionImpl to unify support for both regular
and LL graceful restart.

JIRA: BGPCEP-495
Change-Id: I95e863fd24fa9118d7068c489856f35df0cb49df
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoTeach BGPSession about LLGR 24/78724/1
Robert Varga [Wed, 12 Dec 2018 21:11:26 +0000 (22:11 +0100)]
Teach BGPSession about LLGR

This adds the API to inquire about LLGR capability, as advertized
by the peer. Also refactors normal GR to take the same default-based
approach.

JIRA: BGPCEP-495
Change-Id: I53599053fd3b206e93b470a04511244c2edb74c4
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake LocRibWrite.localAs a long 23/78723/1
Robert Varga [Wed, 12 Dec 2018 20:45:15 +0000 (21:45 +0100)]
Make LocRibWrite.localAs a long

Peer selection is taking a simple long, there is no point in us
retaining the boxed value.

Change-Id: I370382c6225e62e8df0902204551d657e5c02f22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoTeach AbstractPeer about LLGR_STALE routes 22/78722/1
Robert Varga [Wed, 12 Dec 2018 20:34:47 +0000 (21:34 +0100)]
Teach AbstractPeer about LLGR_STALE routes

When filtering routes towards a peer, we need to make sure we do not
send out LLGR_STALE routes if the peer has not advertized the
capability.

JIRA: BGPCEP-495
Change-Id: I3f8bd3b13d632d572efa8626f0b29ece06477ffa
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix LocRibWriter.create() 12/78712/3
Robert Varga [Wed, 12 Dec 2018 12:00:28 +0000 (13:00 +0100)]
Fix LocRibWriter.create()

Create method was relying on raw types without properly capturing
types involved. Fix that by propagating types and clean up some
formatting issues.

Change-Id: Ieadb6f42e8529c1e6b40f058a5e5e17ac65e09ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCache afi/safi type 74/78674/1
Robert Varga [Wed, 12 Dec 2018 11:03:25 +0000 (12:03 +0100)]
Cache afi/safi type

Rather than looking up afi/safi type for each individual route,
look it up once when we know we'll need it and reuse it afterwards.

Change-Id: Ifac6b5df4ef402fa0a0a12026c4fdf96cf7c885c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove ThreadPool in connection release path 63/78463/9
Robert Varga [Wed, 5 Dec 2018 15:13:19 +0000 (16:13 +0100)]
Remove ThreadPool in connection release path

This is a simple read operation, there is no need to allocate
a threadpool to handle the read requests.

Change-Id: I2d482e052a8f321d69f621065a8e11948234a1d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove duplicate OffsetMap code 33/78533/21
Robert Varga [Fri, 7 Dec 2018 04:27:26 +0000 (05:27 +0100)]
Remove duplicate OffsetMap code

Having two copies of the same class is confusing and a problem
with maintenance. Create an abstract base template to hold most
of the code.

Change-Id: I3078c2af94d440701d48e43da31c106fdbac78d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoIntroduce a dedicated RouterId class 03/78503/23
Robert Varga [Thu, 6 Dec 2018 12:28:39 +0000 (13:28 +0100)]
Introduce a dedicated RouterId class

We perform quite a few conversion from/to IP addresses and PeerIds,
for which UnsignedInteger-based lookups are not efficient.

Create an equivalent RouterId class, which understands its
relationship with PeerId, hence we can side-step most of the lookups.

Change-Id: If703c620192496962cde9dc68cdf228fbd2fb6ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix addpath selection performance 30/78530/22
Robert Varga [Thu, 6 Dec 2018 23:30:33 +0000 (00:30 +0100)]
Fix addpath selection performance

As it turns out, the two selection modes operate under completely
different assuptions, rendering
AddPathAbstractRouteEntry.selectBest() utterly useless.

Specialize N-path and All-path selectors to operate in the offset
order, which makes it clear OffsetMap.getRouteKeys() is unneeded
and that a simple offset-based helper,
AddPathAbstractRouteEntry.processOffset() is all that we need to
efficiently select paths.

Also switch N-path to use int, which is more than enough to cover
the uint8 range we really need.

The end result is that we make minimal memory allocations to
fulfill the needed functionality while also improving access
locality, while side-stepping offsetOf() searches.

For bonus points, we get to completely hide RouteKey, OffsetMap,
the AddPathBestPath constructor and all AddPathAbstractRouteEntry
fields.

Change-Id: Ia68cd3f88aef04a04506f3a2cc96d04485c19ad9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoadd P2MP to supported capabilities 19/78619/3
Matej Perina [Mon, 10 Dec 2018 11:12:29 +0000 (12:12 +0100)]
add P2MP to supported capabilities

Extensions to the Path Computation ElementCommunication Protocol (PCEP)
for Point-to-MultipointTraffic Engineering Label Switched Paths
added to list of supported capabilities

JIRA: BGPCEP-406
Change-Id: I899c272f2aaed0899e3946d220a01c4db7c4c31e
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoPrepare EffRibInWriter for LLGR_STALE handling 76/78476/21
Robert Varga [Wed, 5 Dec 2018 18:18:57 +0000 (19:18 +0100)]
Prepare EffRibInWriter for LLGR_STALE handling

When a peer configured with Long-Lived Graceful Restart goes down,
we need to process all tables which it advertised as LLGR-enabled
and mark all routes as being tagged with LLGR_STALE.

LLGR_STALE community must be added to routes behind import
policy processing since policies can also add this community.
This patch should provide procedures necessary to add LLGR_STALE
community to routes.

JIRA: BGPCEP-495
Change-Id: If921e378f998109b073c628f9913f395496b3139
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoUse boxed Path IDs for AddPath 25/78525/15
Robert Varga [Thu, 6 Dec 2018 21:02:28 +0000 (22:02 +0100)]
Use boxed Path IDs for AddPath

AddPath entries are usually used to instantiate PathId objects,
which are forcing boxing. Since we are already keeping path IDs
in boxed format, this patch makes sure we take advantage of this.

Change-Id: Ia2566e48ef44313f5448bf4e23f4ff0f41c8a69b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCentralize PathId allocation 24/78524/15
Robert Varga [Thu, 6 Dec 2018 19:26:03 +0000 (20:26 +0100)]
Centralize PathId allocation

Using long for pathId selection is highly inefficient, as it forces
each AFI/SAFI to deal with it separately. Concenrate allocation in
a single place, so we can actually have a proper interface.

Change-Id: I515d7f0c6fce80b45561939999322f273e8a4197
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoJUnit tests for attribute parsers 72/78472/10
Matej Perina [Wed, 5 Dec 2018 17:28:30 +0000 (18:28 +0100)]
JUnit tests for attribute parsers

poviders coverage for parsers of attributes:
- AGGREGATOR
- ATOMIC-AGGREGATE
- AS-PATH
- LOCAL-PREFERENCE
- MULTI-EXIT-DISCRIMINATOR
- NEXT-HOP
- ORIGIN
- ORIGINATOR-ID

JIRA: BGPCEP-359
Change-Id: I901f6d3474dd8431d52440c25aa1b0158c951cbb
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoprovide way to extract routes from routesContainer 87/78487/11
Robert Varga [Wed, 5 Dec 2018 23:29:44 +0000 (00:29 +0100)]
provide way to extract routes from routesContainer

EffectiveRibInWriter operates with binding databroker and while
we have tools to construct InstanceIdentifier for routesContainer
we are missing tool to extract routes from it. This patch should
provide just that.

JIRA:BGPCEP-495
Change-Id: I1aea06ec4f082d11643566aed761fcc4092b6fcc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoP2MP Request message 17/78417/8
Matej Perina [Wed, 28 Nov 2018 17:15:58 +0000 (18:15 +0100)]
P2MP Request message

change to PCReq message according to
https://tools.ietf.org/html/rfc5440#section-6.4

JIRA: BGPCEP-406
Change-Id: Ief3361b5617318b4cb812bed2e8c405c1a2442c5
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
5 years agoTeach RIBSupport about non-addpath routes 64/78564/2
Robert Varga [Sun, 9 Dec 2018 20:53:22 +0000 (21:53 +0100)]
Teach RIBSupport about non-addpath routes

This patch exposes an explicit method to create a pathId=0 route
key, which allows us to centralize things a bit.

Change-Id: If2ae95ab3298dca400c14ecbb4e77c94712c06a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix RouteEntry.{add,remove}Route() 26/78526/11
Robert Varga [Thu, 6 Dec 2018 21:30:03 +0000 (22:30 +0100)]
Fix RouteEntry.{add,remove}Route()

This API is interfacing with MD-SAL, where values are boxed,
hence these should be propagate as they are, not forcibly unboxed
in LocRibWriter.

This improves non-addpath performance, as we are simply skipping
the unboxing operation, since we do not care at all about pathIds.

Also hide RouteKey constructor and its accessor, as everything
aside of it being an identifier (hence immutable) is a purely
package-private matter.

Change-Id: Ica7612ec5e6df8d07eb16294c1efa5fb0428f884
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUNREACH-DESTINATION Object 20/77820/11
Claudio D. Gasparini [Tue, 13 Nov 2018 15:48:07 +0000 (16:48 +0100)]
UNREACH-DESTINATION Object

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

JIRA: BGPCEP-406
Change-Id: Ie7ef63e7f166059655ff558623c686f087b6302f
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
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>