bgpcep.git
11 months agoRelease bgpcep v0.18.7
jenkins-releng [Thu, 1 Jun 2023 09:21:23 +0000 (09:21 +0000)]
Release bgpcep

11 months agoBump upstreams 29/106329/2
Robert Varga [Thu, 1 Jun 2023 07:15:07 +0000 (09:15 +0200)]
Bump upstreams

Adopt:
- odlparent-11.0.6
- yangtools-9.0.8
- infrautils-4.0.6
- mdsal-10.0.8
- controller-6.0.9
- aaa-0.16.9
- netconf-4.0.7

Change-Id: I7b3423fcdaae802af4bbf96e0a2cfd9a42b796a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 months agoFix yang-data-tree-api dependency 35/105635/2
Robert Varga [Sun, 23 Apr 2023 20:34:48 +0000 (22:34 +0200)]
Fix yang-data-tree-api dependency

We pull in yang-data-tree-api through bgp-rib-spi, which we expect
all extensions to depend on. Relegating it to scope=test does the wrong
thing, breaking build at least in Eclipse.

While we are at it, fix dependencies for all extensions.

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

12 months agoImprove CMulticastUtil 37/105637/2
Robert Varga [Sun, 23 Apr 2023 21:25:46 +0000 (23:25 +0200)]
Improve CMulticastUtil

Use builder fluently to maximize bytecode density.

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

12 months agoImprove RouteDistinguisherUtil 36/105636/2
Robert Varga [Sun, 23 Apr 2023 21:23:06 +0000 (23:23 +0200)]
Improve RouteDistinguisherUtil

Do not muck with NormalizedNodes.findNode(), as we have the same
functionlity directly available.

Eliminate RDType -- it is a noble idea, but all we really need is just
valid constants. This improves both paths, as the arguments are now
known compile-time constants.

Finally improve nullness annotations, eliminating the need for a
requireNonNull() in flowspec.

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

12 months agoConvert users of Optional.get() 27/105627/1
Robert Varga [Sat, 22 Apr 2023 17:42:01 +0000 (19:42 +0200)]
Convert users of Optional.get()

Upgraded modernized plugin is flagging callers of Optional.get(). This
is a good opportunity to inspect how exactly we use Optionals.

It turns out we can improve things significantly by taking advantage of
improved interfaces in yang.data.api: using childByArg()/getChildByArg()
we can:
- remove explicit calls to verifyNotNull()
- remove duplicate lookups of nodes
- remove Optional.ifPresent() indirection

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

12 months agoMove future declaration 26/105626/1
Robert Varga [Tue, 11 Apr 2023 17:20:16 +0000 (19:20 +0200)]
Move future declaration

Co-locate declaration and initialization.

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

12 months agoUse instanceof patterns in BGPPeer 25/105625/1
Robert Varga [Tue, 11 Apr 2023 17:15:54 +0000 (19:15 +0200)]
Use instanceof patterns in BGPPeer

Reduce the risk of mismatched casts by using an explicit pattern.

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

12 months agoMake BGPPeer.addPathTableMaps immutable 24/105624/1
Robert Varga [Tue, 11 Apr 2023 17:14:56 +0000 (19:14 +0200)]
Make BGPPeer.addPathTableMaps immutable

This is field is always immutable, make that contract explicit.

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

12 months agoMove afiClass/safiClass assignment 23/105623/1
Robert Varga [Thu, 12 Jan 2023 11:26:28 +0000 (12:26 +0100)]
Move afiClass/safiClass assignment

Having a requireNonNull() silences a warning reported by eclipse.

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

12 months agoClean up use of NormalizedNodeBuilders 22/105622/1
Robert Varga [Wed, 2 Nov 2022 21:10:45 +0000 (22:10 +0100)]
Clean up use of NormalizedNodeBuilders

Do not reference implementations directly, but rather use
ImmutableNodes/Builders indirections. Also use builders fluently,
which improves readability and density.

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

12 months agoMigrate tests away from Optional.get() 12/105612/1
Robert Varga [Sun, 23 Apr 2023 09:21:55 +0000 (11:21 +0200)]
Migrate tests away from Optional.get()

Upgraded modernizer plugin is flagging these violations, migrate to
alternatives.

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

13 months agoBump versions to 0.18.7-SNAPSHOT 86/105486/1
Robert Varga [Tue, 18 Apr 2023 17:58:31 +0000 (19:58 +0200)]
Bump versions to 0.18.7-SNAPSHOT

This starts the next development iteration.

Change-Id: I784defc6d12c3bf17456ab43b2e2d4d7f318329d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoReduce Mockito workaround 84/105484/2
Robert Varga [Tue, 18 Apr 2023 16:21:24 +0000 (18:21 +0200)]
Reduce Mockito workaround

The problem is use of inline mockmaker, this patch minimizes the
workaround to the affected test.

Change-Id: I8156c9487fd280c1d556f620d4a6209a5beaf400
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoBump upstreams 77/105477/5
Robert Varga [Mon, 17 Apr 2023 12:26:24 +0000 (14:26 +0200)]
Bump upstreams

Adopt:
- odlparent-11.0.5
- yangtools-9.0.7
- infrautils-4.0.5
- mdsal-10.0.7
- controller-6.0.8
- aaa-0.16.8
- netconf-4.0.6

Change-Id: Id2a589f303e330c80fe64d3e2371476ed968256c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoUse ArgumentMatchers.anyList() 56/105056/1
Robert Varga [Tue, 4 Apr 2023 07:18:59 +0000 (09:18 +0200)]
Use ArgumentMatchers.anyList()

This is type-safe alternative, use it to remove a warning.

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

13 months agoUse Uint32.saturatedOf() 16/105116/2
Robert Varga [Fri, 31 Mar 2023 14:39:13 +0000 (16:39 +0200)]
Use Uint32.saturatedOf()

We are receiving a splat when the sum ends up being negative. While the
underlying cause needs to be investigated, we also should be properly
defensive. Uint32.saturatedOf() catches negative values and squashes
them to 0.

JIRA: BGPCEP-1021
Change-Id: Ia376305aa677ebd05a41629c5083f8829891615f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoFix session shutdown race 15/105115/1
Robert Varga [Fri, 31 Mar 2023 11:05:26 +0000 (13:05 +0200)]
Fix session shutdown race

We must not shut down the underlying transaction chain before we have
cleared all possible interactions with it.

JIRA: BGPCEP-1020
Change-Id: Iad2836827eb0b7781152cc5d8dc1997547482596
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit a5a311b52cdf5cbe9bce5f0dff057cb3e7e71ea6)

16 months agoBump versions to 0.18.6-SNAPSHOT 22/103922/1
Robert Varga [Wed, 4 Jan 2023 18:59:24 +0000 (19:59 +0100)]
Bump versions to 0.18.6-SNAPSHOT

This starts the next development iteration.

Change-Id: Ie35075105f92c0667a61d74899fd53fb08039733
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoBump upstreams 05/103905/4
Robert Varga [Tue, 3 Jan 2023 14:32:24 +0000 (15:32 +0100)]
Bump upstreams

Adopt:
- odlparent-11.0.4
- yangtools-9.0.6
- infrautils-4.0.4
- mdsal-10.0.6
- controller-6.0.7
- aaa-0.16.7
- netconf-4.0.5

Change-Id: Ibd971a9de6e633b6822c94dca51dd16ea816a4f2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 months agoFixup manve-dependency-plugin configuration 21/103921/1
Robert Varga [Wed, 4 Jan 2023 15:11:38 +0000 (16:11 +0100)]
Fixup manve-dependency-plugin configuration

We have a bunch of violations that surface with newer plugin, clean them
up.

Change-Id: I9f1071f61ae13568daaf3c4a4261264df7803ae3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
17 months agoBump versions to 0.18.5-SNAPSHOT 71/103571/1
Robert Varga [Sun, 4 Dec 2022 15:37:01 +0000 (16:37 +0100)]
Bump versions to 0.18.5-SNAPSHOT

This starts the nxt development iteration.

Change-Id: I94bf1b112d54938ee521ccfdcb961248cad4b0c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
17 months agoBump upstreams 70/103570/1
Robert Varga [Sun, 4 Dec 2022 15:36:16 +0000 (16:36 +0100)]
Bump upstreams

Adopt:
- odlparent-11.0.3
- yangtools-9.0.5
- infrautils-4.0.4
- mdsal-10.0.5
- controller-6.0.5
- aaa-0.16.6
- netconf-4.0.4

Change-Id: Ia4d758fd3614258e0bf3dedfc6adafe33106b0f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
17 months agoUpdate LSP: check LSP presence in payload 50/103550/2
Ivan Hrasko [Wed, 16 Nov 2022 15:38:10 +0000 (16:38 +0100)]
Update LSP: check LSP presence in payload

Check if LSP object is present in update-lsp RPC payload.

If not immediately return error of type 6 with value 8
and do no send PCUpd message to PCC.

JIRA: BGPCEP-1015
Change-Id: I7e10c2c534f6cc29326a4e01732def70d41f9997
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
(cherry picked from commit db6dd4df10cc0a5bc9c784eb7c084589e2d3cba3)

18 months agoBump versions to 0.18.4-SNAPSHOT 24/103124/1
Robert Varga [Mon, 7 Nov 2022 09:41:44 +0000 (10:41 +0100)]
Bump versions to 0.18.4-SNAPSHOT

This starts the next development iteration.

Change-Id: I9615f0b0d7b4b74e2867573ecffac693d7b7ebe3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
18 months agoBump upstreams 22/103122/1
Robert Varga [Mon, 7 Nov 2022 09:08:50 +0000 (10:08 +0100)]
Bump upstreams

Adopt:
- odlparent-11.0.2
- yangtools-9.0.2
- infrautils-4.0.2
- mdsal-10.0.3
- controller-6.0.3
- aaa-0.16.4
- netconf-4.0.3

Change-Id: I46d9ef5174200a042618796e314bff883ce829ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
19 months agoBump versions to 0.18.3-SNAPSHOT 53/102453/1
Robert Varga [Fri, 23 Sep 2022 11:57:47 +0000 (13:57 +0200)]
Bump versions to 0.18.3-SNAPSHOT

This starts the next development iteration.

Change-Id: I0d77337e0957489c21d727fbdf1d7a5a5f94bf38
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
19 months agoRemove an unneeded import 50/102450/2
Robert Varga [Tue, 20 Sep 2022 11:22:08 +0000 (13:22 +0200)]
Remove an unneeded import

odl-pcep-topology-sync-optimizations-config is not using pcep-config,
remove the import.

Change-Id: I3859ab42c4277aed722538213d4b2d61072134ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
19 months agoBump upstreams 49/102449/2
Robert Varga [Fri, 23 Sep 2022 08:31:31 +0000 (10:31 +0200)]
Bump upstreams

Adopt:
- mdsal-10.0.2
- controller-6.0.2
- aaa-0.16.3
- netconf-4.0.2

Change-Id: I493c848bcc366ffb17b189d5eb41b0d640114591
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
20 months agoUse ImmutableLists in AbstractPrependAsPath 91/102191/3
Robert Varga [Sat, 20 Aug 2022 21:25:21 +0000 (23:25 +0200)]
Use ImmutableLists in AbstractPrependAsPath

ImmutableList.Builder allow for fluent building and does not allow the
result to be modified. Use it instead of an an ArrayList.

Change-Id: I3ca9b4c0b206ac9521efbe62c21f8df7f65cac06
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoBump versions to 0.18.2-SNAPSHOT 61/102161/1
Robert Varga [Fri, 19 Aug 2022 06:21:06 +0000 (08:21 +0200)]
Bump versions to 0.18.2-SNAPSHOT

This starts the next development iteration.

Change-Id: I64fb149c6ace714be93fcf37cae8fe0bfa30257f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoBump upstreams 60/102160/1
Robert Varga [Fri, 19 Aug 2022 06:20:51 +0000 (08:20 +0200)]
Bump upstreams

Adopt:
- odlparent-11.0.1
- yangtools-9.0.1
- infrautils-4.0.1
- mdsal-10.0.1
- controller-6.0.1
- aaa-0.16.1
- netconf-4.0.1

Change-Id: I6d5064eb146c18c0b5190cef8e975f2c1f2c83e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoBump versions to 0.18.1-SNAPSHOT 25/101925/2
Robert Varga [Fri, 29 Jul 2022 18:22:52 +0000 (20:22 +0200)]
Bump versions to 0.18.1-SNAPSHOT

This starts the next development iteration.

Change-Id: I013bde0f706c6b5beba9fda6b827804f2f379fa9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoMove stats update timer 52/101952/8
Robert Varga [Wed, 3 Aug 2022 09:36:00 +0000 (11:36 +0200)]
Move stats update timer

Update interval is a global tuneable, but we really want it to be
adjustable on per-topology basis. Move the definition and update it
route it towards scheduler.

JIRA: BGPCEP-1011
Change-Id: Ia6946782b91da964409d1c7786253fb6c7648460
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoRework statistics updates 62/101962/9
Robert Varga [Wed, 3 Aug 2022 14:06:00 +0000 (16:06 +0200)]
Rework statistics updates

Rather than using an unrelated transaction chain from
TopologyStatsProvider, call back into the session to perform the update
on the corresponding transaction chain.

This eliminates the problem of conflicting updates during session churn
and allows for future evolution.

JIRA: BGPCEP-1005
Change-Id: I4d70b985d1089266c108798c34a0176826016200
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoMigrate datastore callback 61/101961/5
Robert Varga [Wed, 3 Aug 2022 13:14:09 +0000 (15:14 +0200)]
Migrate datastore callback

TopologyNodeState should not see the session, that should be part of
SessionListener lifecycle. Return the datastore future back to caller
so we can clean this up in future.

JIRA: BGPCEP-1005
Change-Id: I995ecf4d57fc90d37aab8208a2364603161b308f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoUse a Timer for TopologyStatsProvider 51/101951/9
Robert Varga [Tue, 2 Aug 2022 23:10:31 +0000 (01:10 +0200)]
Use a Timer for TopologyStatsProvider

At the end of the day, we do not need a ScheduleExectorService if we
take advantate of our global Timer.

JIRA: BGPCEP-1011
Change-Id: I5b2d8f0e2e5a50e9c154188dbd51b747dd492ddf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoCleanup ServerSessionManager 71/101971/3
Robert Varga [Fri, 5 Aug 2022 08:51:29 +0000 (10:51 +0200)]
Cleanup ServerSessionManager

Make sure invariants are packed together and eliminate use of
AtomicBoolean.

Change-Id: Ib22f0336d6644794442364b73cb64778b879aea6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoIntegrate TopologyStatsRpcServiceImpl 53/101953/1
Robert Varga [Wed, 3 Aug 2022 10:32:22 +0000 (12:32 +0200)]
Integrate TopologyStatsRpcServiceImpl

This is a simple RPC service, just integrate it into
PCEPTopologyTracker.

JIRA: BGPCEP-960
Change-Id: Ie6330ca5c6229e4172c98931485279c4991ffabf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoIntegrate TopologyStatsProviderImpl 50/101950/2
Robert Varga [Tue, 2 Aug 2022 21:29:32 +0000 (23:29 +0200)]
Integrate TopologyStatsProviderImpl

Provider is an implementation detail of PCEPTopologyTracker, make sure
it is managed internally. Also rename the interface and the class a bit
and clean up the shutdown semantics.

JIRA: BGPCEP-1011
Change-Id: I9c0c21c4ba47b8e6fec05765027462adbb8ee393
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoTurn SyncOptimization into a record 48/101948/2
Robert Varga [Tue, 2 Aug 2022 21:01:50 +0000 (23:01 +0200)]
Turn SyncOptimization into a record

Trim down the overhead by using a simple record.

Change-Id: If9aeb13e4f3e55b768191a4541301c1bf46787f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoClean up SyncOptimization 47/101947/2
Robert Varga [Tue, 2 Aug 2022 20:26:17 +0000 (22:26 +0200)]
Clean up SyncOptimization

SyncOptimization is a pure DTO, which is immutable and does not directly
interact with PCEPSession.

Change-Id: I73a2f503d925f618c04c204477531ac11cfc2b06
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoClean up SessionStateImpl lifecycle 46/101946/2
Robert Varga [Tue, 2 Aug 2022 19:49:04 +0000 (21:49 +0200)]
Clean up SessionStateImpl lifecycle

SessionStateImpl is inherently bound to statistics updater, hence
it needs to follow bind/unbind lifecycle. This has the benefit of
better isolation -- which is demonstrated by removal of unneeded
listenerState clearing.

On the side of TopologyStatsProviderImpl, we are gaining the benefits of
Registration atomicity, and therefore have a better reign over
invoke-once semantics.

JIRA: BGPCEP-1005
Change-Id: I1b58fc9891c0bfb2a7084cc6eccf9c56b41cd8fc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoRemove ServerSessionManager.bind()/unbind() 45/101945/2
Robert Varga [Tue, 2 Aug 2022 18:23:44 +0000 (20:23 +0200)]
Remove ServerSessionManager.bind()/unbind()

This is a useless indirection through dependencies, let's remove it.

Change-Id: I5b2c320030f8457011700552acbbc296328a487d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoUse a global Timer 39/101939/2
Robert Varga [Mon, 1 Aug 2022 11:10:33 +0000 (13:10 +0200)]
Use a global Timer

We should not be instantiating a timer for each ServerSessionManager,
but rather keep a single instance for all of them. This allows us to
reuse the timer for other things as well.

Change-Id: I0ce8489d4fdba6c9e4d37d515462b0b15481afc1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoRemove an unneeded synchronized block 38/101938/1
Robert Varga [Mon, 1 Aug 2022 10:42:18 +0000 (12:42 +0200)]
Remove an unneeded synchronized block

updateStats() is already synchronized, there is no need to synchronize
further.

Change-Id: I961a5a40d75e376e216e903fbd3a28cfaa4dab00
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoDo not expose Timer from ServerSessionManager 37/101937/3
Robert Varga [Mon, 1 Aug 2022 09:31:20 +0000 (11:31 +0200)]
Do not expose Timer from ServerSessionManager

The timer has a strict lifecycle, make sure it cannot be leaked.

Change-Id: I63356ce6f706bf3864cca4cd8a953bf758449ba3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoEliminate network-pcep-topology-config 26/98726/8
Robert Varga [Fri, 26 Nov 2021 12:35:07 +0000 (13:35 +0100)]
Eliminate network-pcep-topology-config

Integrate dispatcher configuration with the topology-specific augment,
eliminating one level of indirection. This bumps netconf-topology-pcep
to revision 2022-07-30 and updates documentation accordingly.

JIRA: BGPCEP-990
Change-Id: Ifdf83b5390664ace5af11f696632d504d636df83
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoGraph: add Multi-Topology support 61/101861/8
Olivier Dugeon [Wed, 20 Jul 2022 16:28:47 +0000 (18:28 +0200)]
Graph: add Multi-Topology support

Graph supports IPv4 or IPv6 topology but with IS-IS Multi-Topology
it is possible to advertise both IPv4 and IPv6 topologies. Recent
versions of BGP-LS speaker also support this Multi-Topology.
This patch changes the Graph yang model (including the revision date)
to handle IPv4 and IPv6 simultaneously on Edges and Vertices for
IS-IS Multi-Topology.

JIRA: BGPCEP-1010
Change-Id: Icfcf9e8a27f5f9d3fd9a928dba8d3adffaf8de50
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoCorrect ReachTlvParser to handle IPv6 prefix 39/101839/6
Olivier Dugeon [Tue, 12 Jul 2022 07:52:40 +0000 (09:52 +0200)]
Correct ReachTlvParser to handle IPv6 prefix

ReachTlvParser class supports Ipv6 prefix only in serialization
methods. ParseTlvBody handles only IPv4 prefix. Thus, if a peer
BGP Link State router sends an Update Message with an IPv6
prefix in IP Reachability Information NLRI, ParseTlvBody
method fails to parse the IPv6 prefix and assert a
BGPDocumentedException.

This patch looks to the length of the buffer to be parsed to
determine if the prefix is an IPv4 or an IPv6 one. SerializeModel
method has been also updated to avoid exception to determine
if the prefix is an IPv4 or an IPv6 one.

JIRA: BGPCEP-1009
Change-Id: Ia5bac0fb2a6087e5c5cfbca0e3eee7d8fd7b822c
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoDowngrade aggregator javadoc 04/101904/3
Robert Varga [Fri, 29 Jul 2022 13:34:44 +0000 (15:34 +0200)]
Downgrade aggregator javadoc

maven-javadoc-plugin-3.2.0+ does not generate any javadocs, hence we
need a downgraded version.

Change-Id: I7934eea64b81bb4aa1e69aaecc3bffc513db3e0f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
21 months agoBump netconf to 4.0.0 03/101903/2
Robert Varga [Fri, 29 Jul 2022 12:53:57 +0000 (14:53 +0200)]
Bump netconf to 4.0.0

Use released version instead of SNAPSHOT.

Change-Id: Ic1c120786b45a9fc4bf379306950a0053eb64ec3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoUse FrameworkUtil.asDictionary() 29/101829/1
Robert Varga [Mon, 11 Jul 2022 21:31:54 +0000 (23:31 +0200)]
Use FrameworkUtil.asDictionary()

We do not need a Hashtable, use FrameworkUtil to give us what we need.

Change-Id: Ib44bd7e7af921d17040110209da7df0e5a03384d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoBump upstreams to 2022.09 35/101735/22
Robert Varga [Tue, 5 Jul 2022 00:38:02 +0000 (02:38 +0200)]
Bump upstreams to 2022.09

Adopt the following versions:
- odlparent-11.0.0
- infrautils-4.0.0
- yangtools-9.0.0
- mdsal-10.0.0
- controller-6.0.0
- aaa-0.16.0
- netconf-4.0.0-SNAPSHOT

This requires some major surgery around identities.

Change-Id: I346020355d66bcca621bc479f5099c3069de4b61
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoBump versions to 0.18.0-SNAPSHOT 59/101759/1
Robert Varga [Wed, 6 Jul 2022 16:23:20 +0000 (18:23 +0200)]
Bump versions to 0.18.0-SNAPSHOT

This starts the next major development iteration.

Change-Id: I535b20afc90f2e75f02f6bc92c65ff60b18c3c45
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoBump versions to 0.17.6-SNAPSHOT 55/101555/1
Robert Varga [Thu, 9 Jun 2022 21:01:00 +0000 (23:01 +0200)]
Bump versions to 0.17.6-SNAPSHOT

This starts the next development iteration.

Change-Id: I5ef65428dc793a1537546e09d52cb41b0573e91f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoBump jxr plugin to 3.2.0 54/101554/1
Robert Varga [Thu, 9 Jun 2022 20:57:58 +0000 (22:57 +0200)]
Bump jxr plugin to 3.2.0

https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12317527&version=12344185
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12317527&version=12330848

Change-Id: I52c2c3e98aa495fb893e35104bfe46d74d31cecb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoBump netconf to 3.0.5 53/101553/1
Robert Varga [Thu, 9 Jun 2022 20:57:13 +0000 (22:57 +0200)]
Bump netconf to 3.0.5

Pick up fixes from upstream.

Change-Id: Ie539d179b8461c211d8c8862bb40cc58cd5d7525
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoBump versions to 0.17.5-SNAPSHOT 06/101506/1
Robert Varga [Wed, 8 Jun 2022 14:43:06 +0000 (16:43 +0200)]
Bump versions to 0.17.5-SNAPSHOT

This starts the next development iteration.

Change-Id: I616cf75e83dec4a13ab1733089dfdde1f1338b32
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoBump upstream versions 02/101502/1
Robert Varga [Wed, 8 Jun 2022 13:30:24 +0000 (15:30 +0200)]
Bump upstream versions

Adopt:
- yangtools-8.0.6
- mdsal-9.0.4
- controller-5.0.5
- aaa-0.15.5
- netconf-3.0.4

Change-Id: I16403efb1fe225739842a67a457393339f5ec72b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 0.17.4-SNAPSHOT 30/101130/1
Robert Varga [Sat, 14 May 2022 09:39:28 +0000 (11:39 +0200)]
Bump versions to 0.17.4-SNAPSHOT

This starts the next development iteration.

Change-Id: I535e71f4fed5b7e64c49128900b00585a7048dcb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstream versions 07/101107/12
Robert Varga [Fri, 13 May 2022 08:08:03 +0000 (10:08 +0200)]
Bump upstream versions

Adopt:
- odlparent-10.0.2
- infrautils-3.0.1
- yangtools-8.0.5
- mdsal-9.0.3
- controller-5.0.5
- aaa-0.15.4
- netconf-3.0.3

Change-Id: I7682592c13171ac85e20127018732dd20a632f35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix checkstyle 16/101116/1
Robert Varga [Fri, 13 May 2022 13:47:47 +0000 (15:47 +0200)]
Fix checkstyle

There are unneeded qualifiers, fix them.

Change-Id: I1c83aa40d35e76f9a61ea3653de62e6b2555d5ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 0.17.3-SNAPSHOT 90/100790/2
Robert Varga [Mon, 25 Apr 2022 12:22:50 +0000 (14:22 +0200)]
Bump versions to 0.17.3-SNAPSHOT

This starts the next development iteration.

Change-Id: I18a4fccc5194bfc4d9312f5450384bb77f266672
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup ietf-p2mp-te-lsp 11/101111/1
Robert Varga [Fri, 13 May 2022 11:06:10 +0000 (13:06 +0200)]
Cleanup ietf-p2mp-te-lsp

protocol.util is only needed for tests, clean that up.

Change-Id: I61ea64d21390ede2c314c15a5f385e1cc07e7db3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup bgp-parser-spi dependency 06/101106/1
Robert Varga [Fri, 13 May 2022 10:51:35 +0000 (12:51 +0200)]
Cleanup bgp-parser-spi dependency

The yang-data-impl dependency is only needed for tests, add proper
scope.

Change-Id: I289959de2587f9b08b479a16dcee3b332a5a03fc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstream versions 89/100789/1
Robert Varga [Mon, 25 Apr 2022 09:52:05 +0000 (11:52 +0200)]
Bump upstream versions

Adopt:
- controller-5.0.3
- aaa-0.15.3
- netconf-3.0.2

Change-Id: I22abe120f318afa8ecae7e751c4bbe186470f41c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDrop synchronization from ServerSessionManager.{bind,unbind} 16/100716/3
Robert Varga [Thu, 21 Apr 2022 23:12:28 +0000 (01:12 +0200)]
Drop synchronization from ServerSessionManager.{bind,unbind}

We are not touching any state, there is no point in synchronizing
here.

Change-Id: Ia5f39ec274a2b26bd94c4375506043acb63ff7f1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoReplace per-request j.u.Timer with a Netty Timer 05/100705/6
Robert Varga [Fri, 22 Apr 2022 17:20:05 +0000 (19:20 +0200)]
Replace per-request j.u.Timer with a Netty Timer

We are currently spawning a full java.util.Timer for every request we are
sending out. That is rather wasteful in terms of resources: each such
timer costs us a thread.

Rather than doing that, use Netty's HashedWheelTimer, which can easily
cope with a large number of timeouts.

JIRA: BGPCEP-1006
Change-Id: I4f3b6bf6a435170c8a054aa0e012418c60b17e96
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoTerminate outstanding requests on clean shutdown 27/100727/1
Robert Varga [Fri, 22 Apr 2022 17:20:05 +0000 (19:20 +0200)]
Terminate outstanding requests on clean shutdown

When we initiate session shutdown we need to cancel all requests. Update
tests to disable RPC timeouts to expose the fact we have been failing to
do that.

JIRA: BGPCEP-1007
Change-Id: I4159de8fa4c69041608032cd172e2f66afd2060c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup PCETriggeredInitialSyncProcedureTest 26/100726/1
Robert Varga [Fri, 22 Apr 2022 16:41:33 +0000 (18:41 +0200)]
Cleanup PCETriggeredInitialSyncProcedureTest

Remove useless override and use List.of() instead of
Collections.emptyList().

Change-Id: I505904047331d0a7f862b825d20b3c323cbd94f1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup StateSynchronizationAvoidanceProcedureTest 25/100725/1
Robert Varga [Fri, 22 Apr 2022 16:40:48 +0000 (18:40 +0200)]
Cleanup StateSynchronizationAvoidanceProcedureTest

Use List.of() instead of Collections and prettify builder invocation.

Change-Id: I87d77a51b5fef07e0b9bdb70c1ce19ddc7a896cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup SyncOptimizationTest 24/100724/1
Robert Varga [Fri, 22 Apr 2022 16:36:36 +0000 (18:36 +0200)]
Cleanup SyncOptimizationTest

Use MockitoJUnitRunner and prettify builder use.

Change-Id: Ie421464b5941aeb026b4b6b290c05ef81c1ed094
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup TopologyStatsRpcServiceImplTest 22/100722/1
Robert Varga [Fri, 22 Apr 2022 16:32:48 +0000 (18:32 +0200)]
Cleanup TopologyStatsRpcServiceImplTest

Use List.of() instead of Collections.{empty,singleton}List and
Arrays.asList().

Change-Id: I07c83de4b59c53645a35e20b4d11ba67db286e7c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoProperly inject Ticker into PCEPSessionImpl 21/100721/4
Robert Varga [Fri, 22 Apr 2022 14:35:14 +0000 (16:35 +0200)]
Properly inject Ticker into PCEPSessionImpl

Rather than having a mutable static field with the potential pitfalls
from that, use an explicit field to hold the associated ticker and
inject it from tests. Also cleanup the class and do not leak
ChannelFuture. The new field's overhead is eliminating by using a shared
constant for the keepalive message.

Change-Id: Id6f5cd263ea71b50e8a942c804a26ebb047edcc2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoModernize PCEPSessionImplTest 20/100720/2
Robert Varga [Fri, 22 Apr 2022 14:24:45 +0000 (16:24 +0200)]
Modernize PCEPSessionImplTest

Use static imports and proper hamcrest assertions.

Change-Id: I4f1c24a0d0d72554d688f9f7f71dc9d8ac9001ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoModernize PCEPDispatcherImplTest 19/100719/2
Robert Varga [Fri, 22 Apr 2022 14:10:42 +0000 (16:10 +0200)]
Modernize PCEPDispatcherImplTest

Use assertThrows() and hamcrest assertions for exceptions. Also use
static imports for assertions.

Change-Id: Iac6f30f1290d2653af9615468658b36f12ab3b56
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSimplify Mockito.any() reference 18/100718/1
Robert Varga [Fri, 22 Apr 2022 11:44:02 +0000 (13:44 +0200)]
Simplify Mockito.any() reference

We have a static import of this method, just use that.

Change-Id: I73f93fa579942231de3901f118716154048aabde
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup PCEPTopologySessionListenerTest 17/100717/1
Robert Varga [Fri, 22 Apr 2022 11:42:29 +0000 (13:42 +0200)]
Cleanup PCEPTopologySessionListenerTest

Restructure a builder and use List.of() instead of Lists and
Collections.

Change-Id: Ieda2c92034c95c7f06c2f39ba49098d10f129c5e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoTopologySessionListener is not AutoCloseable 14/100714/1
Robert Varga [Thu, 21 Apr 2022 17:28:52 +0000 (19:28 +0200)]
TopologySessionListener is not AutoCloseable

Using AutoCloseable hides internal callers. We also will need an
asynchronous shutdown facility, so let's just define a close() method
we can evolve.

JIRA: BGPCEP-1005
Change-Id: I95be847237ad38644e57bc6400bb38be64af2784
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse RpcResult.buildFuture() 13/100713/1
Robert Varga [Thu, 21 Apr 2022 17:28:14 +0000 (19:28 +0200)]
Use RpcResult.buildFuture()

We can simplify our code a bit, use utility future builder.

Change-Id: I5eb8566528421f4286376fb5d2bffe5c3d6346f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not use Stopwatch in PCEPRequest 08/100708/4
Robert Varga [Thu, 21 Apr 2022 14:38:22 +0000 (16:38 +0200)]
Do not use Stopwatch in PCEPRequest

While a Stopwatch is useful, we are not using its Ticker-based utility.
Use System.nanoTime() directly to keep track of our elapsed time,
improving our memory footprint slightly.

Change-Id: I12cb3c6070dcac56ab4d80ec18b9be3a647e9f00
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse atomic state transitions in PCEPRequest 06/100706/3
Robert Varga [Thu, 21 Apr 2022 13:58:08 +0000 (15:58 +0200)]
Use atomic state transitions in PCEPRequest

PCEPRequest is has only three logical states it can go to and performs
callouts only once it's done. Use a VarHandle and its atomic operations
to perform transitions between these states.

Change-Id: I8b858b129da96a17499ff68ec90a04b83faab490
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove MISSING_XML_TAG and MESSAGE_HEADER 11/100711/3
Robert Varga [Thu, 21 Apr 2022 15:29:05 +0000 (17:29 +0200)]
Move MISSING_XML_TAG and MESSAGE_HEADER

The only users of these fields are in PCEPTopologySessionListener,
move and hide them there, reducing clutter.

JIRA: BGPCEP-1005
Change-Id: I3090c3a4c0947ec1ab78259ef23be1f9f15b4a27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoClean up createUpdateMessageSync() a bit 10/100710/3
Robert Varga [Thu, 21 Apr 2022 15:21:48 +0000 (17:21 +0200)]
Clean up createUpdateMessageSync() a bit

We can use a simple fluent builder if we just shuffle the code around
a bit.

Change-Id: I72d0d23cd89fdb8cf38da900275a5caca85c827f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo no use Optional to pass down null 09/100709/3
Robert Varga [Thu, 21 Apr 2022 15:10:21 +0000 (17:10 +0200)]
Do no use Optional to pass down null

We have a complicated way of passing null to tested method, fix that.

Change-Id: I10e7c5a812d0b5cdc3b29130d15418d5e5ac7971
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix ClassCastExceptions in TopologyProgrammingTest 12/100712/1
Robert Varga [Thu, 21 Apr 2022 16:57:07 +0000 (18:57 +0200)]
Fix ClassCastExceptions in TopologyProgrammingTest

e000cc610f7b12f91b7df4221c582f96b5d9864c mocked the method returns
using an Optional rather than with an OperationResult, resulting in
CCEs being reported. Fix that up.

Change-Id: Idd724d448bc4237edac7436f41abfd291476088d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImplement TopologySessionStats in AbstractTopologySessionListener 86/100686/4
Robert Varga [Wed, 20 Apr 2022 21:33:42 +0000 (23:33 +0200)]
Implement TopologySessionStats in AbstractTopologySessionListener

Pull down more state tracking down into the superclass, eliminating
the need for an upcall when the session is up.

JIRA: BGPCEP-1005
Change-Id: If2ca511ef65a65c7fc1b4cc8b07b1825d3b94e7a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAbstractTopologySessionListener is not generic 85/100685/3
Robert Varga [Wed, 20 Apr 2022 20:23:46 +0000 (22:23 +0200)]
AbstractTopologySessionListener is not generic

We have exactly one subclass, remove generic arguments to make coupling
more obvious.

JIRA: BGPCEP-1005
Change-Id: Icc18d6dfa3b101e892dcb969bfa5fc5651f70804
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoreleaseNodeState() should not care about the PCEPSession 84/100684/2
Robert Varga [Wed, 20 Apr 2022 20:04:59 +0000 (22:04 +0200)]
releaseNodeState() should not care about the PCEPSession

We only need the InetAddress, make sure to reduce exposure.

Change-Id: Id89623db74544253a0ff096f8ff61dd41261136d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove superfluous 'this.' qualifiers 83/100683/3
Robert Varga [Wed, 20 Apr 2022 19:50:26 +0000 (21:50 +0200)]
Remove superfluous 'this.' qualifiers

This is completely unneeded verbosity, remove it.

Change-Id: I6a64c01e9eada84e968e6f3e9020e1f3272b264d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoIntegrate pcep-topology-stats with pcep-topology-provider 53/100653/9
Robert Varga [Tue, 19 Apr 2022 18:42:08 +0000 (20:42 +0200)]
Integrate pcep-topology-stats with pcep-topology-provider

These two components are tightly coupled and are tripping over each
other. Remove the unneccessary indirections to reign in the lifecycle.

JIRA: BGPCEP-1005
Change-Id: I65bcee1d8cb756e774ce0ecd6df92bcf743cd06c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not propagate PCEPSession in onSessionUp 76/100676/3
Robert Varga [Wed, 20 Apr 2022 15:45:36 +0000 (17:45 +0200)]
Do not propagate PCEPSession in onSessionUp

We have only a single implementation and that implementation is just
filling the builder. Make sure do not allow it to do anything with
the incoming session -- allowing us to better reason about state
transitions here.

JIRA: BGPCEP-1005
Change-Id: I784120c4232036dc846e2e3c60dedffe13731b3a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove isLspDbRetreived 81/100681/1
Robert Varga [Wed, 20 Apr 2022 18:20:29 +0000 (20:20 +0200)]
Remove isLspDbRetreived

We are calling this method only from a place where we have
syncOptimization initialized. Eliminate the method and cache its
result in a local boolean.

Change-Id: Id5ebb0fe3d5564c58888d41048d65e9b17a3e840
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRe-enable dependency enforcement 71/100671/3
Robert Varga [Wed, 20 Apr 2022 12:31:31 +0000 (14:31 +0200)]
Re-enable dependency enforcement

We should have artifacts in good enough shape now, make sure we
enforce them being clean.

Change-Id: I18437afc1d884a96c71c3019e96714a9851d38c7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMinimize storeNode() locking 69/100669/2
Robert Varga [Wed, 20 Apr 2022 12:19:24 +0000 (14:19 +0200)]
Minimize storeNode() locking

Locking only covers transaction interactions, callbacks should be
invoked without the lock being held.

JIRA: BGPCEP-1005
Change-Id: I21ca6ae62ba1936e8c8109fc6e09d733cc054ad0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoClarify putTopologyNode() locking 68/100668/3
Robert Varga [Wed, 20 Apr 2022 12:03:59 +0000 (14:03 +0200)]
Clarify putTopologyNode() locking

This method is always invoked with the lock held, make sure we document
this. Also add FIXME for other oddities we have in this class.

JIRA: BGPCEP-1005
Change-Id: I51f1f54bf62c4f952486ba2c9478e98514a1a78c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove onSessionUp()/onMessage() method declarations 67/100667/2
Robert Varga [Wed, 20 Apr 2022 11:50:39 +0000 (13:50 +0200)]
Move onSessionUp()/onMessage() method declarations

There is a completely superfluous suppression here, co-locate methods
to fix the reported violation.

Change-Id: I7aa045870b1b0539ad36de0c0e8d267e97de5400
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSimplify session/state references 66/100666/2
Robert Varga [Wed, 20 Apr 2022 11:33:49 +0000 (13:33 +0200)]
Simplify session/state references

While we are update our object's state, make sure we use local variables
to it is clear that things cannot change. This makes invariants a bit
more visible.

JIRA: BGPCEP-1005
Change-Id: I1b3b1bd2b6a12822685acd4651f4ead4e769f175
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove TopologyStatsRpcServiceImpl.init() 64/100664/3
Robert Varga [Wed, 20 Apr 2022 08:00:51 +0000 (10:00 +0200)]
Remove TopologyStatsRpcServiceImpl.init()

There is just no point in splitting initialization here, remove the
method and initialize in the constructor.

JIRA: BGPCEP-1005
Change-Id: I4fae3966888cc589e994106dc0d58014dd6ccf15
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>