bgpcep.git
2 years agoRelease bgpcep v0.16.14
jenkins-releng [Mon, 14 Feb 2022 21:54:53 +0000 (21:54 +0000)]
Release bgpcep

2 years agoBump controller to 4.0.10 44/99744/1
Robert Varga [Mon, 14 Feb 2022 20:01:36 +0000 (21:01 +0100)]
Bump controller to 4.0.10

Controller misaligned yangtools versions, pick up the fix.

Change-Id: If601dc3eb5e4a1e113b7a0c7476af8a95fa5d511
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstreams 11/99411/3
Robert Varga [Thu, 20 Jan 2022 17:45:58 +0000 (18:45 +0100)]
Bump upstreams

Adopt:
- odlparent-9.0.13
- infrautils-2.0.13
- mdsal-8.0.11
- controller-4.0.9
- aaa-0.14.9
- netconf-2.0.13

Change-Id: I0a70a8728d53377907b71e596bf6fd0875d696a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix IPv6 leafs descriptions 47/99047/1
Ivan Hrasko [Thu, 3 Feb 2022 18:57:51 +0000 (19:57 +0100)]
Fix IPv6 leafs descriptions

Change-Id: I4b9cd6dbb750aa661fc7cfeb489a3941aade567a
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
(cherry picked from commit 4be87f1df99330b4d1892f522ef66f5d5d128557)

2 years agoalgo: Fix NPE if ClassType is not specified 10/99410/1
Olivier Dugeon [Tue, 23 Nov 2021 16:38:22 +0000 (17:38 +0100)]
algo: Fix NPE if ClassType is not specified

Path computation algorithms failed during edge pruning if ClassType
is not specified raising a NPE.

In addition, setting ClassType to 0 by default ito handle the NPE is
not conform to RFC5455.

This patch modify edge pruning when ClassType is not specified (set
to 0) and remove default setting to avoid problem when enforcing LSP
with a ClassType equal 0.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Change-Id: I8930393359960dc9406fb9cc112bc194049cb35a
(cherry picked from commit 42282fe0eac1a45e0afdedd55c4984195ceddb8d)

2 years agoRemove DefaultTopologyReference service entry 09/99409/1
marekzatko [Wed, 24 Nov 2021 16:21:04 +0000 (17:21 +0100)]
Remove DefaultTopologyReference service entry

Another case of service being registered, but
never accessed, remove it, making
pcep-topology-provider viable to non OSGi users.

JIRA: BGPCEP-960
Change-Id: I3f69f176891c845c1f399430ffb0a7c20fdb2cc6
Signed-off-by: marekzatko <Marek.Zatko@pantheon.tech>
(cherry picked from commit 93af921a040849938b2a80e0234bc9985b0f517b)

2 years agoSimplify pcep-stats blueprint 08/99408/1
marekzatko [Fri, 26 Nov 2021 12:15:02 +0000 (13:15 +0100)]
Simplify pcep-stats blueprint

We don't need to subclass Timer, use
TimerTask instead, ditch factory-ref since we can
instantiate the normal way.

Change-Id: I5cb047408392a51424bdb5356f18ad0095043f74
Signed-off-by: marekzatko <Marek.Zatko@pantheon.tech>
(cherry picked from commit c042b269052171a4720cff85f51f77303b5dc0ac)

2 years agoBump versions to 0.16.14-SNAPSHOT 91/98691/1
Robert Varga [Thu, 25 Nov 2021 15:26:55 +0000 (16:26 +0100)]
Bump versions to 0.16.14-SNAPSHOT

This starts the next development iteration.

Change-Id: Ie41875192aafd7ffb36a07b8131b780f330e9aca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump netconf to 2.0.11 90/98690/1
Robert Varga [Thu, 25 Nov 2021 13:38:48 +0000 (14:38 +0100)]
Bump netconf to 2.0.11

Adopt latest release.

Change-Id: I8781955f9c98a80d4b868a8ae6dc6de7ce3fbbc1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove unused service registry entry 37/97837/23
marekzatko [Mon, 22 Nov 2021 09:05:41 +0000 (10:05 +0100)]
Remove unused service registry entry

TopologyReference service is registered into
service registry but never accessed, remove
the registration, making bgp-topology-provider
viable to non OSGi users.

JIRA: BGPCEP-980
Change-Id: I384ec2749e7f53873b1a0bf10f8d15316131b00a
Signed-off-by: marekzatko <Marek.Zatko@pantheon.tech>
2 years agoBump versions to 0.16.13-SNAPSHOT 51/98651/1
Robert Varga [Tue, 23 Nov 2021 11:07:07 +0000 (12:07 +0100)]
Bump versions to 0.16.13-SNAPSHOT

This starts the next development iteration.

Change-Id: I482b4d90b9e07f1e2cd0dcb398afbee200ce6753
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump netconf to 2.0.10 50/98650/1
Robert Varga [Tue, 23 Nov 2021 11:06:15 +0000 (12:06 +0100)]
Bump netconf to 2.0.10

Pick up a regression fix.

Change-Id: If4ae1a645dd66053c1b0c770e9706cf76ad1231b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse DTCL to maintain LSPDB versions 22/98622/6
Robert Varga [Fri, 19 Nov 2021 18:56:40 +0000 (19:56 +0100)]
Use DTCL to maintain LSPDB versions

Rather than issuing synchronous writes, use a DTCL to acquire
versions populated in the datastore. This eliminates a failure code
path and makes connections a tad faster.

JIRA: BGPCEP-989
Change-Id: I90c45dfac9a610f1d153eec1d95fbb50bad86800
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 0.16.12-SNAPSHOT 26/98626/1
Robert Varga [Sun, 21 Nov 2021 14:26:15 +0000 (15:26 +0100)]
Bump versions to 0.16.12-SNAPSHOT

This starts the next development iteration.

Change-Id: I78005a23985fed60956f413c67396d54c879a5b5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove ClusterSingletonServiceRegistrationHelper 25/98625/4
Robert Varga [Sun, 21 Nov 2021 11:05:40 +0000 (12:05 +0100)]
Remove ClusterSingletonServiceRegistrationHelper

This class is no longer useful, remove it.

Change-Id: Id04af866ca273e306845e5efe26de80f6185c2fa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix closing of peers and rib 44/98444/25
marekzatko [Fri, 12 Nov 2021 10:29:45 +0000 (11:29 +0100)]
Fix closing of peers and rib

Migration to OSGi DS has the side effect that we get proper component
restarts based on their dependencies changing. This exposes the fact
we are not properly shutting down our singleton instances.

Since RibImpl has a captive RIBImpl instance, which undergoes lifecycle,
we have to synchronize all access to it. This is unfortunate, but
addressing this (as well as their naming) will be subject to a separate
effort.

Properly track peers, so we understand when we need to restart them.
While doing such restarts, wait for each peer to properly go down before
starting it up again.

While we are in the area, also improve BGPClusterSingletonService method
names so their intent is a tad more readable. The same goes for BgpPeer,
which is now a package-private abstract class to hide internal machinery
from the outside world.

Also ditch use of ClusterSingletonServiceRegistrationHelper -- it is a
remnant of a bygone era where ClusterSingletonServiceProvider was
incorrectly managing state -- that issue has been resolved a few years
ago. Cutting it out allows us to properly manage our lifecycle,
especially with regards to multiple registrations/instantiations.

JIRA: BGPCEP-988
Change-Id: Idb6748042ddb9a5765c3cea80f15ef319c13368b
Signed-off-by: marekzatko <Marek.Zatko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove SpeakerIdMapping 17/98617/9
Robert Varga [Fri, 19 Nov 2021 15:05:48 +0000 (16:05 +0100)]
Remove SpeakerIdMapping

Tunnelling this simple map through PCEPTopologyConfiguration is
completely unnecessary as PCEPStatefulPeerProposal can easily have
it pushed via a DTCL and keep it close by.

JIRA: BGPCEP-983
Change-Id: I76abc4e94f3f69c4fab00b39dbaf0cfd6b11e055
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd PCEPTopoloy{Instance,Singleton,Tracker} 02/98602/21
Robert Varga [Wed, 17 Nov 2021 17:58:40 +0000 (18:58 +0100)]
Add PCEPTopoloy{Instance,Singleton,Tracker}

Rework topology instantiation to split the individual concerns.
PCEPTopologyTracker is responsible for finding out when a particular
topology becomes interesting to the underlying code (and when becomes
uninteresting).

For each such topology, a PCEPTopologySingleton is instantiated. It then
handles allocation of the underlying InstructionScheduler as well as
bootstrapping a cluster-wide singleton PCEPTopologyInstance to handle
that topology's configuration.

PCEPTopologyInstance tracks configuration datastore changes for a single
topology. For each update it constructs an immutable
PCEPTopologyConfiguration and forwards it to its PCEPTopologyProvider.

PCEPTopologyProvider handles updates of the configuration in the most
graceful manner possible, sequencing possible Netty Channel restart, but
otherwise just updaing the low-level componennts

JIRA: BGPCEP-893
Change-Id: I56c47b89ab87cf33a6be1016fa132b6c1aa98cbb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDisconnect PCEPStatefulPeerProposal 16/98616/2
Robert Varga [Fri, 19 Nov 2021 13:45:01 +0000 (14:45 +0100)]
Disconnect PCEPStatefulPeerProposal

PCEPStatefulPeerProposal is a proper implementation of a well-known
contract. Eliminate the nasty entanglement with ServerSessionManager.

JIRA: BGPCEP-983
Change-Id: Ie8cb5bb61396548a736b8d7fb616f99449971e12
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove SpeakerIdMapping to topology provider 14/98614/1
Robert Varga [Fri, 19 Nov 2021 13:24:21 +0000 (14:24 +0100)]
Move SpeakerIdMapping to topology provider

Speaker identifiers are not something that should be visible on the
dispatcher level. Move them to pcep-topology-provider, as that is the
only component which cares about them.

JIRA: BGPCEP-983
Change-Id: Icfc7a572d79faa35904e45a6aadff73400d611db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove createStatefulPeerProposal() 87/98587/3
Robert Varga [Wed, 17 Nov 2021 14:07:54 +0000 (15:07 +0100)]
Remove createStatefulPeerProposal()

This is a useless indirection in front of a constructor, remove it.

Change-Id: Idebba9b0b00b92a96283d6a5857fd8cf76f27489
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove TopologySessionListenerFactory 86/98586/5
Robert Varga [Wed, 17 Nov 2021 13:16:11 +0000 (14:16 +0100)]
Remove TopologySessionListenerFactory

We can cater to TopologyProgrammingTest's needs by spying on
ServerSessionManager, eliminating the need for the indirection created
via TopologySessionListenerFactory. This cleans up the tests quite a
bit.

JIRA: BGPCEP-983
Change-Id: I221db41388e80e779750c0192a41a3c52744f564
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup TopologyProgrammingTest 84/98584/1
Robert Varga [Wed, 17 Nov 2021 12:00:00 +0000 (13:00 +0100)]
Cleanup TopologyProgrammingTest

We have a ton of mocks for something which is quite straightfoward,
cleanup the entire test.

Change-Id: I92fbeb1af5e17a7f9ca7b73380dd64ac088e7328
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMark PCEPStatefulPeerProposal for evolution 83/98583/1
Robert Varga [Wed, 17 Nov 2021 11:47:15 +0000 (12:47 +0100)]
Mark PCEPStatefulPeerProposal for evolution

As it turns out, we have a number of datastore interactions outside
of PCEPTopologyDeployerImpl. Mark another a synchronous read() for
evolution, as we clearly need to rework the entire configuration
lifecycle.

JIRA: BGPCEP-893
Change-Id: Ibac9c98877d72b5fb3c44a46fd97b075f80433a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove InstructionScheduler instantiation 82/98582/1
Robert Varga [Wed, 17 Nov 2021 11:22:41 +0000 (12:22 +0100)]
Move InstructionScheduler instantiation

There is fair amount of confusion about the relationship between
the scheduler and the singleton service. Move instantiation around
to make sure we match lifecycles.

JIRA: BGPCEP-983
Change-Id: Ibdefa44fabc7f8492d8df8f951674a5b87092bf2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoInitialize PCEPTopologyDeployerImpl in constructor 81/98581/1
Robert Varga [Wed, 17 Nov 2021 10:32:03 +0000 (11:32 +0100)]
Initialize PCEPTopologyDeployerImpl in constructor

There is nothing that could possibly during instantiation, eliminate
the init() method, allowing us to focus on lifecycle.

JIRA: BGPCEP-983
Change-Id: I5844ed57bc81acaeaf3fdfe08d956da9321c27d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoInstructionScheduler should be a Registration 80/98580/1
Robert Varga [Wed, 17 Nov 2021 10:21:30 +0000 (11:21 +0100)]
InstructionScheduler should be a Registration

Unregistration is implied as not being possible to fail in its only
implementation. Exposed that to users so they know they do not have
to worry about exceptions.

JIRA: BGPCEP-983
Change-Id: I3edb6bf26a732798536d536c42374f27343a0f35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSplit out PCEPTopologyProviderSingleton 78/98578/3
Robert Varga [Wed, 17 Nov 2021 07:09:22 +0000 (08:09 +0100)]
Split out PCEPTopologyProviderSingleton

We are using a rather weird indirection to hide the singleton service.
Split it out into its own class to make this much easier to see, so that
we can perform a proper cleanup.

JIRA: BGPCEP-893
Change-Id: If12ba8f0ae8cf26c29f06fbc809e9da626cf4337
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup PCEPTopologyProviderBean 77/98577/5
Robert Varga [Wed, 17 Nov 2021 06:39:28 +0000 (07:39 +0100)]
Cleanup PCEPTopologyProviderBean

This class is a bit of a mess, perform minor cleanups before going
further.

JIRA: BGPCEP-983
Change-Id: I96b53c7f3c9b9e9b80aaebc2aa746d40f0676491
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove SessionConfig acquisition to PCEPTopologyConfiguration 72/98572/6
Robert Varga [Tue, 16 Nov 2021 13:12:28 +0000 (14:12 +0100)]
Move SessionConfig acquisition to PCEPTopologyConfiguration

The configuration is always acquired from Topology, hence there is no
point in bothering users with it.

JIRA: BGPCEP-893
Change-Id: I773e5e827c85cab451dd1bcf123c7ef370fbbdb2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoKeyMapping is immutable 71/98571/6
Robert Varga [Tue, 16 Nov 2021 12:16:00 +0000 (13:16 +0100)]
KeyMapping is immutable

This core concept should be immutable and protect its byte[] from
modification. This allows us to reason about its lifecycle.

JIRA: BGPCEP-983
Change-Id: I63c6a377ff1b62f058fd2bfb4c7e0ff07f8a2516
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSpeakerIdMapping is immutable 70/98570/3
Robert Varga [Tue, 16 Nov 2021 10:32:08 +0000 (11:32 +0100)]
SpeakerIdMapping is immutable

The intent here is to provide an immutable view of which address maps
to which ID. Do not subclass HashMap for that, as that just wrecks the
ability to reason about what is going on.

JIRA: BGPCEP-983
Change-Id: I8f41e22e5b3b64c7dc49a0219eeeeb673bd5c111
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup ServerSessionManager a bit 69/98569/1
Robert Varga [Tue, 16 Nov 2021 09:43:14 +0000 (10:43 +0100)]
Cleanup ServerSessionManager a bit

Prior to untangling depndency mess, perform a minor self-contained
clean up of ServerSessionManager.

JIRA: BGPCEP-983
Change-Id: Ica3b8a1e298514e27c219c0b94adb2c84a9d7279
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup PCEPTopologyProvider a bit 68/98568/1
Robert Varga [Tue, 16 Nov 2021 09:33:13 +0000 (10:33 +0100)]
Cleanup PCEPTopologyProvider a bit

Prior to diving into untangling activation mess, perform self-contained
cleanups in PCEPTopologyProvider.

JIRA: BGPCEP-983
Change-Id: I456a852665dd28a64c71251a56aaf69c6b25f74b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoConvert PCEPTopologySessionListenerFactory to OSGi DS 67/98567/1
Robert Varga [Tue, 16 Nov 2021 08:08:40 +0000 (09:08 +0100)]
Convert PCEPTopologySessionListenerFactory to OSGi DS

This is an utterly simplistic component, break it out of blueprint.

JIRA: BGPCEP-960
Change-Id: I28f2af2b15eb5e7a6ab917220eb090060f46ae9d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDitch blueprint dependency from PCEPTopologyDeployerImpl 66/98566/1
Robert Varga [Tue, 16 Nov 2021 08:01:44 +0000 (09:01 +0100)]
Ditch blueprint dependency from PCEPTopologyDeployerImpl

Indirecting through blueprint makes the logic hard to follow, inline
instantiation into PCEPTopologyDeployerImpl, making it clear what
the lifecycle is.

JIRA: BGPCEP-983
Change-Id: I4a33016184f003510bf9e58b3835341b00853870
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup PCEPTopologyDeployerImpl 45/98545/3
Robert Varga [Tue, 16 Nov 2021 07:18:44 +0000 (08:18 +0100)]
Cleanup PCEPTopologyDeployerImpl

General cleanup of the logic flow in the class, documenting locking
rules.

Change-Id: Ife8eee1eb7190a2f8355c4a909ba2030cf1162ad
JIRA: BGPCEP-983
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions 0.16.11-SNAPSHOT 34/98534/1
Robert Varga [Mon, 15 Nov 2021 20:25:33 +0000 (21:25 +0100)]
Bump versions 0.16.11-SNAPSHOT

This starts the next development iteration.

Change-Id: Ie40ae6bf4ec4f69bd76b0d8f6973b0a6e631451b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSynchronize BgpPeer.close() 29/98529/2
Robert Varga [Mon, 15 Nov 2021 08:46:27 +0000 (09:46 +0100)]
Synchronize BgpPeer.close()

We may be racing with other callbacks, make sure we synchronize. Also
ensure we guard registrations properly.

Change-Id: If6b1e679b91bd2da21d82f0ac81f570c51284f10
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse a concurrent set for registrations 30/98530/1
Robert Varga [Mon, 15 Nov 2021 08:54:38 +0000 (09:54 +0100)]
Use a concurrent set for registrations

Rather than copying the entire list, use a concurrent set, which
offers better performance characteristics.

Change-Id: I097eb29fb9ef60d40e1ff457678a52ee3c1d1529
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump to controller-4.0.7/netconf-2.0.9 04/98504/1
Robert Varga [Sun, 14 Nov 2021 17:53:46 +0000 (18:53 +0100)]
Bump to controller-4.0.7/netconf-2.0.9

Adopt latest fixes from upstream.

Change-Id: I25517867df2b0491bafc19172a517314a5e548fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove superfluous version declaration 03/98503/1
Robert Varga [Sun, 14 Nov 2021 17:52:04 +0000 (18:52 +0100)]
Remove superfluous version declaration

infrautils-testutils is advertized in infrautils-artifacts, drop
unneeded version/scope directives.

Change-Id: I5829014cda1abad4b99cc425741ea5affac8068f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSilence SCR errors 87/98387/7
marekzatko [Wed, 10 Nov 2021 09:06:39 +0000 (10:06 +0100)]
Silence SCR errors

SCR does not like overloaded constructors containing arrays/iterables.
Remove them in favor of using lists. Also improve diagnostics in
OSGiRIBExtensionConsumerContext.

Change-Id: Iccee38dbafa1df4b7de59aedc759b0e765481b39
Signed-off-by: marekzatko <Marek.Zatko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix Graph deletion which cause NPE 71/98371/1
Olivier Dugeon [Tue, 9 Nov 2021 10:12:16 +0000 (11:12 +0100)]
Fix Graph deletion which cause NPE

Graph is deleted twice when stopping ODL which cause a NPE.

When ODL stops, AbstractTopologyBuilder() calls
LinkStateGraphBuilder.clearTopology() which call
ConnectedGraphImpl.clear(). Then ConnectedGraphServer() stops by
calling destroyOperationalGraphModel() which browse all stored graphs
and call again ConnectedGraphImpl.clear() which cause the NPE.

Fix removes graph from ConnectedGraphServer graphs Map in
clearGraph() method instead of deleteGraph() method.

JIRA: BGPCEP-977

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Change-Id: I55209e77ffa2c317ea85ca29cc794016f338c488

2 years agoBump versions to 0.16.10-SNAPSHOT 48/98348/1
Robert Varga [Mon, 8 Nov 2021 06:04:33 +0000 (07:04 +0100)]
Bump versions to 0.16.10-SNAPSHOT

This starts the next development iteration.

Change-Id: I32581a67f3f157098fc4d7338132f3ea235ef114
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump controller-4.0.6/netconf-2.0.8 46/98346/1
Robert Varga [Sun, 7 Nov 2021 23:31:50 +0000 (00:31 +0100)]
Bump controller-4.0.6/netconf-2.0.8

Pick up latest updates.

Change-Id: I41143d2cd3f4b2ca7ac899e7bbd8ef54989bd7cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 0.16.9-SNAPSHOT 08/98208/1
Robert Varga [Thu, 28 Oct 2021 17:37:19 +0000 (19:37 +0200)]
Bump versions to 0.16.9-SNAPSHOT

This starts the next development iteration.

Change-Id: Id31c5b9760758cbfa6b2f30dbfe115a367d12f71
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix BGP operational state 37/98137/14
marekzatko [Tue, 26 Oct 2021 10:57:03 +0000 (12:57 +0200)]
Fix BGP operational state

- Operational state of BGP was not present in datastore
   due to missing registrations of RIB/Peers state providers.
   (registration was deleted in
        I3ff92bedc6f6c7b215fb7dba7ef0eb4df9f59072)
- Rename/cleanup some classes to be more transparent

JIRA: BGPCEP-958
Change-Id: I8217c008b044133fabea6258e824416497e011e6
Signed-off-by: marekzatko <Marek.Zatko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRename distribution-karaf artifact to bgpcep-karaf 78/98178/5
Tomas Cere [Thu, 28 Oct 2021 10:12:03 +0000 (12:12 +0200)]
Rename distribution-karaf artifact to bgpcep-karaf

We need to be able to distinguish between different mri
distributions in csit scripts so rename this to something
less vague.

Change-Id: I904b0cd2d8e78902f2571a67d8c74b2a1be4583e
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
2 years agoAdd infrautils features to bgpcep distribution 77/98177/4
Tomas Cere [Thu, 28 Oct 2021 11:06:42 +0000 (13:06 +0200)]
Add infrautils features to bgpcep distribution

These are needed for csit.

Change-Id: I18386d41b8a447283f8f7b4570adc83ab9c33e94
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd controller-testing features to bgpcep distribution 76/98176/5
Tomas Cere [Thu, 28 Oct 2021 09:55:09 +0000 (11:55 +0200)]
Add controller-testing features to bgpcep distribution

We need these for testing, for now.

Change-Id: I2a565bd007972faa56c8bd5ba54d5c0e9999c59d
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
2 years agoPublish karaf distribution 75/98175/2
Tomas Cere [Thu, 28 Oct 2021 09:50:45 +0000 (11:50 +0200)]
Publish karaf distribution

Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Change-Id: I6351851bf37e65b0d564013e8f88cc3c294d6b69

2 years agoBump upstreams 66/98166/1
Robert Varga [Wed, 27 Oct 2021 15:56:35 +0000 (17:56 +0200)]
Bump upstreams

Adopt:
- odlparent-9.0.8
- infrautils-2.0.8
- mdsal-8.0.7
- controller-4.0.5
- aaa-0.14.5
- netconf-2.0.7

Also re-enable dependency conversion checks.

Change-Id: I564a7eaa8ddc740e8fa2e8ebae2f94a4c8286197
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump MRI upstreams 40/98140/2
Robert Varga [Tue, 26 Oct 2021 12:40:48 +0000 (14:40 +0200)]
Bump MRI upstreams

Adopt:
- odlparent-9.0.7
- yangtools-7.0.9
- mdsal-8.0.6
- controller-4.0.4
- infrautils-2.0.7
- aaa-0.14.4
- netconf-2.0.6

Change-Id: I714dd09cd02df0cf2dcf0cc1acc9f6c56dee8826
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdded JSON and XML payloads tabs with working RFC 8040 URL 99/90499/15
Aman [Thu, 18 Jun 2020 18:57:13 +0000 (00:27 +0530)]
Added JSON and XML payloads tabs with working RFC 8040 URL

Modified docs/bgp/bgp-user-guide-bgp-application-peer.rst by adding JSON,XML examples with corresponding sphinx tabs

Change-Id: Ic8aaa0728a43936cd4c6e1ed590e01ba8f0fbf2c
Signed-off-by: Aman <170030039@iitdh.ac.in>
2 years agoRecognized Extended Administrative Group TLV 33/98033/4
Robert Varga [Thu, 21 Oct 2021 13:29:02 +0000 (15:29 +0200)]
Recognized Extended Administrative Group TLV

Recognize TLV 1173 and print a milder message when we encounter it.
Also change 'invalid' to 'unrecognized' in the warning we do print
for things we do not recognize.

JIRA: BGPCEP-987
Change-Id: I3eb8f903bbf4842fc00549f2afdc6548f85be6e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMigrate bgp-rib-impl to OSGi DS 95/97195/9
marekzatko [Fri, 6 Aug 2021 11:44:44 +0000 (13:44 +0200)]
Migrate bgp-rib-impl to OSGi DS

Also split BgpDeployerImpl into:
- DefaultBgpDeployer
- OSGiBgpDeployer

JIRA: BGPCEP-958
Change-Id: I3ff92bedc6f6c7b215fb7dba7ef0eb4df9f59072
Signed-off-by: marekzatko <Marek.Zatko@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoClose read-only transaction in BgpDeployerImpl 32/98032/1
Robert Varga [Thu, 21 Oct 2021 12:47:03 +0000 (14:47 +0200)]
Close read-only transaction in BgpDeployerImpl

We are not closing the transaction, which is rather inefficient. Fix
that through a simple try-with-resources.

Change-Id: I2cdfa734e83daef9a968031a289b6406eb031e4a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd source of incoming message to the log 81/97881/2
Kostiantyn Nosach [Wed, 13 Oct 2021 13:42:26 +0000 (16:42 +0300)]
Add source of incoming message to the log

Add source's socket address of incoming message to the log

JIRA: BGPCEP-984
Change-Id: I614c8406f770b7253706f860c5f240d7158263c6
Signed-off-by: Kostiantyn Nosach <kostiantyn.nosach@pantheon.tech>
2 years agoBump versions to 0.16.8-SNAPSHOT 73/97673/1
Robert Varga [Tue, 28 Sep 2021 16:42:55 +0000 (18:42 +0200)]
Bump versions to 0.16.8-SNAPSHOT

This starts the next development iteration.

Change-Id: Ica208a1f8dfa8e2aaa279452679481c48d224167
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFormat PCEPErrors in UnknownObject.toString() 72/97672/1
Robert Varga [Tue, 28 Sep 2021 16:40:49 +0000 (18:40 +0200)]
Format PCEPErrors in UnknownObject.toString()

Rather than printing a binding DTO, use the well-known enum, which
has symbolic names.

JIRA: BGPCEP-981
Change-Id: I1e458c25cce265a5fb0d8499bcb5343af51c8bcd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix PCCActivator registration 71/97671/1
Robert Varga [Tue, 28 Sep 2021 16:20:16 +0000 (18:20 +0200)]
Fix PCCActivator registration

All providers need to provide ServiceLoader entries, make sure pccmock
does as well. Also remove commented-out code which used to do the
activation before.

JIRA: BGPCEP-981
Change-Id: I39a7ac95836a0e7269b33f9070d441884dfe806b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove InitiatedPCInitiateMessageParser diagnostics 63/97663/2
Robert Varga [Tue, 28 Sep 2021 12:37:20 +0000 (14:37 +0200)]
Improve InitiatedPCInitiateMessageParser diagnostics

Unlike everywhere else we are just stomping over the object queue
here, leading to the cryptic CCE. Add a simple utility which turns
mismatches into properly-reported exceptions.

JIRA: BGPCEP-981
Change-Id: I0edcde9e285bab2926cdcc6f368db487e2b18bef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove UnknownObject observability 62/97662/2
Robert Varga [Tue, 28 Sep 2021 12:36:15 +0000 (14:36 +0200)]
Improve UnknownObject observability

Add an UnknownObject.toString() method, so that UnknownObjects expose
their state for debugging purposes.

JIRA: BGPCEP-981
Change-Id: I414e5cbd6967811bb6174f6d289f88fba1d1db08
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not reference http://opendaylight.org/xmlns/blueprint/v1.0.0 12/97612/1
Robert Varga [Thu, 23 Sep 2021 14:59:02 +0000 (16:59 +0200)]
Do not reference opendaylight.org/xmlns/blueprint/v1.0.0

bgp-rib-impl is not using any Blueprint extensions, hence there is no
need to bind to this namespace.

JIRA: BGPCEP-958
Change-Id: If6c1a3ddaad47f6f8e0df4d0b8accbe21d3b625c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSwitch bgp-topology-provider to OSGi DS 11/97611/1
Robert Varga [Thu, 23 Sep 2021 12:38:50 +0000 (14:38 +0200)]
Switch bgp-topology-provider to OSGi DS

The container we use here is extremely simple, migrate it to Declarative
Services.

JIRA: BGPCEP-959
Change-Id: Ib7f6f7f1925949f2b94ac8a4427c36dac838fa59
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 0.16.7-SNAPSHOT 10/97610/1
Robert Varga [Thu, 23 Sep 2021 11:48:37 +0000 (13:48 +0200)]
Bump versions to 0.16.7-SNAPSHOT

This starts the next development iteration.

Change-Id: I615061b5db91275b19a617e858c4fd04d2218631
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoIntern constant QNames 08/97608/2
Robert Varga [Thu, 23 Sep 2021 10:59:05 +0000 (12:59 +0200)]
Intern constant QNames

We really want to reuse global constants here, make sure that happens.

Change-Id: I7cc78f29fbfae873b3920b3684bde8c331a3d0af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUpdate withdraw()/advertize() 07/97607/1
Robert Varga [Thu, 23 Sep 2021 10:46:57 +0000 (12:46 +0200)]
Update withdraw()/advertize()

We have a simple boolean dispatch here, mark the boolean and use a
a simple return expression.

Change-Id: I5f45d160ef30d9b307a2e28578609dbeca27bd95
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse DistinctNodeContainer.getChildByArg() 06/97606/1
Robert Varga [Thu, 23 Sep 2021 10:00:00 +0000 (12:00 +0200)]
Use DistinctNodeContainer.getChildByArg()

The check implied by Optional.get() differs only by the exception thrown
-- and VerifyException is more appropriate. By same token we can
side-step the Optional and use childByArg() instead.

Change-Id: I317577ef635c621be360297a2b5b376edbbbd2d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup AdjRibOutListener a bit 05/97605/1
Robert Varga [Thu, 23 Sep 2021 09:51:05 +0000 (11:51 +0200)]
Cleanup AdjRibOutListener a bit

We have a few single-caller methods which can be inline a tad
more efficiently.

Change-Id: I79d85e30a1deb05e0341b8b20ee6925182287dbf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoPrefix/PathId leaf names are constant 04/97604/1
Robert Varga [Thu, 23 Sep 2021 09:38:43 +0000 (11:38 +0200)]
Prefix/PathId leaf names are constant

With the switch to DOM processing, these have become proper constants,
make sure we use their shared versions and make make a few methods
static as a result ot that.

Change-Id: I09115b77ea33bbd9f0427f923e5bfa7b21c1127d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRevert "Flush session on AdjRibOutListener convergence" 03/97603/1
Robert Varga [Thu, 23 Sep 2021 09:41:10 +0000 (11:41 +0200)]
Revert "Flush session on AdjRibOutListener convergence"

This reverts commit b2c79a62bd1d45a7b9ff83332386c30d3ea1b8d3, as it
seems to be causing problems in CSIT.

Change-Id: Id023247a624c4e0459e0573a9105986a96cb3351
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix PCEP registry warning 76/97576/1
Robert Varga [Tue, 21 Sep 2021 11:58:21 +0000 (13:58 +0200)]
Fix PCEP registry warning

We are logging getClass(), which is a bit confusing, as that is not the
key we are looking up. Make things obvious by logging
implementedInterface().

Change-Id: I80540b21554de1909a8e77930306b77ced3c9be3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 0.16.6-SNAPSHOT 75/97575/1
Robert Varga [Tue, 21 Sep 2021 11:52:38 +0000 (13:52 +0200)]
Bump versions to 0.16.6-SNAPSHOT

This starts the next development iteration.

Change-Id: If1238818b8e7cbd891c112f77d42bcdf4daa1fe8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix test tool shading 73/97573/2
Robert Varga [Tue, 21 Sep 2021 10:24:03 +0000 (12:24 +0200)]
Fix test tool shading

We are shading a number of jars which provide services, which are
overlapping. Make sure we use ServicesResourceTransformer to merge these
entries.

Change-Id: Id5fab04d52575dc2e68526fe9c0b42dee6addef7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup pcc-mock 74/97574/2
Robert Varga [Tue, 21 Sep 2021 10:44:49 +0000 (12:44 +0200)]
Cleanup pcc-mock

Eliminate duplicate version specification. Also cleanup Mockito usage
and builder layout.

Change-Id: I579d39f1a101884be5e83a3ebd247d5a9cb951ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMigrate bmp-impl tests 71/97571/1
Robert Varga [Tue, 21 Sep 2021 09:33:21 +0000 (11:33 +0200)]
Migrate bmp-impl tests

Do not use MockitoAnnotations.initmocks(), but rather
MockitoJUnitRunner, which has further benefits.

Change-Id: I85589b5264f62a07bbe87f13daf899fa3e947aed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix BmpDeployerImpl activation 70/97570/1
Robert Varga [Tue, 21 Sep 2021 09:27:58 +0000 (11:27 +0200)]
Fix BmpDeployerImpl activation

Ie114a01b8ec1f87926f752b31cd7762a542e5db3 broke activation by failing to
annotate BmpDeployerImpl. This patch adds the appropriate annotations.

JIRA: BGPCEP-953
Change-Id: I8a59fc6977ddcd3e4861d02ff8df7f61820aced9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 0.16.5-SNAPSHOT 29/97529/1
Robert Varga [Sun, 19 Sep 2021 20:46:36 +0000 (22:46 +0200)]
Bump versions to 0.16.5-SNAPSHOT

This starts the next development iteration.

Change-Id: I81e654de999396cdb688307acdd4de25b0ee640d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix PcRequest Message Parser in presence of LSP 07/97007/9
Olivier Dugeon [Thu, 16 Sep 2021 15:07:04 +0000 (17:07 +0200)]
Fix PcRequest Message Parser in presence of LSP

Since RFC8231, PcRequest messages can include a LSP Object.
However, the insertObject() method of the PCEPRequestMessageParser class
does not handle LSP Objects.
Thus, when a PCC sends a PcRequest message with a LSP, ODL throws a
Java Exception about Unknown Object and sends a PcError with RP
Missing Object type.

- override initial PcRequest parser with a new StatefulPcRequest
  message parser in the ietf-stateful package
- add support for LSP Objects when validating the PcRequest message

JIRA: BGPCEP-975
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Change-Id: I525cd933237bf3633da8c2ff854989b1f9968aa8

2 years agoBump upstreams 10/97510/2
Robert Varga [Fri, 17 Sep 2021 11:25:18 +0000 (13:25 +0200)]
Bump upstreams

Adopt netconf-2.0.5 et al.

Change-Id: I54c1d4f581a4701def076b590c6215d181edecd0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix parsing issue of PcReport Objects 78/96978/6
Olivier Dugeon [Wed, 21 Jul 2021 16:52:23 +0000 (18:52 +0200)]
Fix parsing issue of PcReport Objects

StatefulPCReportMessageParser() class assumes that PCEP Objects in the
PcReport message are sent in a certain order. However, the order of
Object in the PcReport has changed between old draft version and final
RFC8231.

Indeed, as per RFC8231, the PcReport is composed of:
 - [SRP], <LSP>, <path> where:
   - <path> = <intended-path>
              [<actual-attribute-list><actual-path>]
              <intended-attribute-list>
   - <intended-path> = ERO
   - <actual-attribute-list> = BANDWIDTH, METRICS & <actual-path> = RRO
   - <intended-attribute-list> = LSPA, BANDWIDTH, METRICS, IRO

While in old draft version, <intended-attribute-list> was placed just
right after the <intended-path>.

Thus, the state machine should be flexible enough to accommodate to
PCCs that continue to use old draft and PCCs that are compliant to the
RFC8231.

JIRA: BGPCEP-974

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Change-Id: I97c4e339d8fe66d5e6a10fbb7055c91941351eda

2 years agoBump versions to 0.16.4-SNAPSHOT 33/97333/1
Robert Varga [Thu, 26 Aug 2021 08:36:56 +0000 (10:36 +0200)]
Bump versions to 0.16.4-SNAPSHOT

This starts the next development iteration.

Change-Id: I1c075a44da98ea9f0930c3736ce25de207a8d718
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstream versions 31/97331/2
Robert Varga [Thu, 26 Aug 2021 07:38:59 +0000 (09:38 +0200)]
Bump upstream versions

Adopt netconf-2.0.3 et al. Unfortunately maven-dependency-plugin's logic
seems to have shifted, hence we disable that for now.

Change-Id: Id2e47947f544aab08ba32759199a907d87616a76
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 0.16.3-SNAPSHOT 84/97084/1
Robert Varga [Thu, 5 Aug 2021 14:44:43 +0000 (16:44 +0200)]
Bump versions to 0.16.3-SNAPSHOT

This starts the next development iteration.

Change-Id: Ie0b44359c2dbb9ac2cf0f215d9b0f0532f44a576
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstream versions 64/97064/1
Robert Varga [Tue, 3 Aug 2021 11:59:43 +0000 (13:59 +0200)]
Bump upstream versions

adopt yangtools-7.0.4, mdsal-8.0.1, controller-4.0.1 and netconf-2.0.2.

Change-Id: I9c4264b4bf81a596365d65f412d3f6defec06ea8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove Pcep Server 09/97009/5
Olivier Dugeon [Thu, 22 Jul 2021 12:35:18 +0000 (14:35 +0200)]
Improve Pcep Server

Some PCCs send a PcRequest message with Metrics and/or Bandwidth set
with value equal to 0 which result to a NO_PATH when calling path
computation. Indeed, it is impossible to determine a path with a metric
less or equal to 0.

This patch set skip Metrics and/or Bandwidth equal to 0 when building
the list ofi constraints for the path computation algorithm.

Change-Id: I3b343e67fc35f3393d4ed136aa4224082823f066
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRedefine AbstractMessageParser object parsing 83/96983/5
Robert Varga [Wed, 21 Jul 2021 20:24:11 +0000 (22:24 +0200)]
Redefine AbstractMessageParser object parsing

All AbstractMessageParser.validate() interact with the list of objects
by peeking at the first element and removing it when handled. While
the List contract supports it, there is no efficient implementation:
LinkedList is wasteful with memory (and its locality), ArrayList ends
up shifting arrays all the time.

Deal with this dilemma by recognizing we are dealing with a Queue, and
realize it through ArrayDeque. Let users deal with the logic rewrite,
which ends up being rather sensible: they are always looking only at the
first element anyway.

This also exposes a few places where we can run into runtime exceptions
-- mark those with FIXMEs for future improvement.

JIRA: BGPCEP-976
Change-Id: I882c7208dddd61f368499fd661e6d090752d144d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup ReoptimizationBandwidth reference 85/96985/1
Robert Varga [Thu, 22 Jul 2021 10:48:32 +0000 (12:48 +0200)]
Cleanup ReoptimizationBandwidth reference

We have this class imported, use short name to reference it.

Change-Id: Ie6aee18db947f7d806b43b69df8548323658ce26
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoModernize AbstractMessageParser 82/96982/1
Robert Varga [Wed, 21 Jul 2021 19:57:56 +0000 (21:57 +0200)]
Modernize AbstractMessageParser

- use List.of(item) instead of Collections.singletonList()
- reuse requireNonNull()'s return
- reformat builder usage
- use Optional.ifPresent() to propagate present values

Change-Id: I20022f19c80f2ca832f47914ac801fca124f568e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not wipe data in ApplicationPeer 77/96977/1
Robert Varga [Wed, 21 Jul 2021 15:00:42 +0000 (17:00 +0200)]
Do not wipe data in ApplicationPeer

Unfortunately the wipe here is causing lifecycle issues, as there is a
pre-populated structure we rely on when things start coming in.

Change-Id: Ib58bf34e96e68e0db2fd3a8e580cade0d01099c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoOptimize uint interactions in bgp-linkstate 69/96969/2
Robert Varga [Wed, 21 Jul 2021 08:28:48 +0000 (10:28 +0200)]
Optimize uint interactions in bgp-linkstate

Use writeUint{8,16,32} instead of manual conversions. Also protect
a hexDump() call. Also add obvious ByteBuf sizing hints.

Change-Id: I462b9d3d566efc2bee020df15ac08ed6c89dea8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoEliimnate use to Uint8.toJava() in rsvp-impl 68/96968/2
Robert Varga [Wed, 21 Jul 2021 08:10:40 +0000 (10:10 +0200)]
Eliimnate use to Uint8.toJava() in rsvp-impl

We have ByteBufUtils.writeUint8(), which is a tad simpler, use that
instead of dual conversion.

Change-Id: Ibd58934382e9244a0428c68722ef59611801f94b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix LinkstateGraphBuilder.ipv6toKey() 66/96966/3
Robert Varga [Tue, 20 Jul 2021 19:04:08 +0000 (21:04 +0200)]
Fix LinkstateGraphBuilder.ipv6toKey()

We are picking 8 most significant bytes of the address, which is
contrary to what the comment says. Add an explicit test and fixup
the implementation.

Change-Id: Ie3817bde8be858c0a5031b643994645aa61932df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDo not copy Ipv{4,6}Addresses 65/96965/1
Robert Varga [Tue, 20 Jul 2021 18:53:57 +0000 (20:53 +0200)]
Do not copy Ipv{4,6}Addresses

Ipv{4,6}InterfaceIdentifier are specializations of Ipv{4,6}Address, hence
we do not need to copy them.

Change-Id: I23ba5837cf315e38a1c0dd57f51a88dee35d9e91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove unneeded wrapping 64/96964/1
Robert Varga [Tue, 20 Jul 2021 18:50:26 +0000 (20:50 +0200)]
Remove unneeded wrapping

We are re-wrapping an IpPrefix, let's just reuse it, improving clarity
and performance.

Change-Id: Ib27930c3ab998647a969f45afceea8ff74c93519
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove a blind cast 63/96963/1
Robert Varga [Tue, 20 Jul 2021 18:48:05 +0000 (20:48 +0200)]
Remove a blind cast

We have a null check here, let's use an instanceof check instead,
which is essentially the same thing, except more type-safe.

Change-Id: I2538e4e2f58513aa51bcefe26d4e55ad8ab59283
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove Ipv{4,6}Address handling 61/96961/1
Robert Varga [Tue, 20 Jul 2021 18:17:07 +0000 (20:17 +0200)]
Improve Ipv{4,6}Address handling

Ipv4Address can actually contain a zone, which would break prefix
creation. Use IetfInetUtil to convert address to prefix.

Change-Id: I5434d8c9b3164f6cee8c47b44a65bad5e02abf8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSimplify LinkstateGraphBuilder.getLinkAttributes() 60/96960/1
Robert Varga [Tue, 20 Jul 2021 18:09:17 +0000 (20:09 +0200)]
Simplify LinkstateGraphBuilder.getLinkAttributes()

If have too many if/else statements here and a blind cast. Refactor
checks and use a simple return.

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