bgpcep.git
3 years agoRelease Magnesium release/magnesium-sr3
jenkins-releng [Tue, 8 Dec 2020 00:45:24 +0000 (00:45 +0000)]
Release Magnesium

3 years agoPropagate only negotiated afi/safi routes to adj-rib-out 72/91972/3
Vikram Singh Kalakoti [Fri, 29 May 2020 16:10:50 +0000 (21:40 +0530)]
Propagate only negotiated afi/safi routes to adj-rib-out

When BGP session comes, empty entries for negotiated afi/safi are
created in peer's adj-rib-out. If routes belonging to afi/safi
that were not negotiated for the peer are present in loc-rib,
those entries are being propagated to the peer, resulting in
ModifiedNodeDoesNotExistException. Patch prevents this by allowing
routes for only the negotiated afi/safi to be propagated from
loc-rib to peer's adj-rib-out.

If routes are written to non-existent afi/safi table in adj-rib-out,
it results in transaction chain failure which leads to a scenario
where multiple threads block to get a lock on BGPPeer but the
thread handling transaction failure is waiting for the submitted
futures to exit. Patch fixes this scenario by preventing wait on
the submtited futures when handling transaction failures.

JIRA: BGPCEP-906
Change-Id: I836d1828c3d552e4d62be0688040490ec3f36912
Signed-off-by: Vikram Singh Kalakoti <vikramskalakoti@gmail.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 12a27cee4bdc5a8e32848ca1f0e11f1883f42c37)

3 years agoBump upstream versions 06/93806/2
Robert Varga [Thu, 12 Nov 2020 11:47:06 +0000 (12:47 +0100)]
Bump upstream versions

Pick up:
- odlparent-6.0.12
- yangtools-4.0.14
- mdsal-5.0.16

Change-Id: Ie5bd9cde8758c5a7e723004d6551dad24ca27658
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoremove some useless empty lines 02/93502/1
guillaume.lambert [Thu, 22 Oct 2020 06:38:45 +0000 (08:38 +0200)]
remove some useless empty lines

Change-Id: I01aad5992f174e82dd5ea31eed69f33a4cc81167
Co-authored-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
(cherry picked from commit 72268e66caa85aa0535f79d6d999e0b93f5eb59e)

3 years agoupdate wiki URL in poms 01/93501/1
guillaume.lambert [Thu, 22 Oct 2020 06:57:56 +0000 (08:57 +0200)]
update wiki URL in poms

Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I1d83a481ff90fe9b1eb30c338bf1704852c4afbc
(cherry picked from commit 322edfbc84c27b4432c7f4d5888d3b32c8f8790d)

3 years agorefine path declaration in config-loader FileWatch 07/93507/1
guillaume.lambert [Mon, 19 Oct 2020 14:05:17 +0000 (16:05 +0200)]
refine path declaration in config-loader FileWatch

Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I2116c38b0b2a03a24c7492dc2662e6a51e9e2f48
(cherry picked from commit c53a40d924e1ae10c683e280f63b79ed8d92a118)

3 years agoHandle the case of empty optional capabilities 95/92095/1
Robert Varga [Mon, 27 Jul 2020 17:02:56 +0000 (19:02 +0200)]
Handle the case of empty optional capabilities

Empty lists are being squashed to null, hence use nonnull to acquire
an empty list back.

JIRA: BGPCEP-915
Change-Id: I6483160e3637d3901e9a1f840cef03dd817b5523
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 2af34886dfd5ec01b8411683c2415392d98d4e8c)

3 years agoBump versions by x.y.(z+1) 90/91990/1
jenkins-releng [Mon, 10 Aug 2020 07:29:34 +0000 (07:29 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: If4968bc9e894f9aa0690ea1149a84ecf91c138e2

3 years agoNon ipv4 advertising peer causes BGP session flaps 34/91734/1
Vikram Singh Kalakoti [Wed, 1 Jul 2020 19:04:08 +0000 (00:34 +0530)]
Non ipv4 advertising peer causes BGP session flaps

During the session establishment phase, if a peer
doesn't advertise ipv4-unicast, controller
automatically adds ipv4-unicast as supported
family for the session to support classic BGP
sessions.

Currently, we are adding Ipv4 family in the
BGPPeer but not updating AdjRibInWriter which
causes the BGP session to not recover from
session flap. Patch fixes this issue by adding
ipv4 support before updating AdjRibInWriter.

JIRA: BGPCEP-910
Change-Id: I669104a17d603e0494f9ac7090a8fd671f67a3a5
Signed-off-by: Vikram Singh Kalakoti <vikramskalakoti@gmail.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit f54f4bd31f5ceb0a15edacb9b2884a63a21cb52d)

3 years agoProcess open mesage more defensively 28/91728/1
Robert Varga [Wed, 29 Jul 2020 15:52:04 +0000 (17:52 +0200)]
Process open mesage more defensively

We are already handling documented exceptions, but we may end up
ignoring a runtime exceptions. Add a defensive catch.

JIRA: BGPCEP-915
Change-Id: I921395d9a36fd7fcadfeef882d181abc10db2b13
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump odlparent/yangtools/mdsal to 6.0.11/4.0.13/5.0.14 58/91558/2
Robert Varga [Wed, 22 Jul 2020 21:28:48 +0000 (23:28 +0200)]
Bump odlparent/yangtools/mdsal to 6.0.11/4.0.13/5.0.14

Pick up latest updates from upstream.

Change-Id: I9c2fcf22f7cda50e310d0934657ded9f16739697
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd an explanatory messages around TCP-MD5 70/91470/1
Robert Varga [Wed, 22 Jul 2020 08:33:11 +0000 (10:33 +0200)]
Add an explanatory messages around TCP-MD5

Just pointing to epoll unavailabality reason is not enough, we
should also explain that the user can get PCEP working without
TCP/MD5 keys.

JIRA: BGPCEP-916
Change-Id: I95d5d087f99a29a6d823041e40a841b2f0367be8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7bfa8189dafc5bbc5e1f6ab7da1e7377a059b944)

3 years agoUse version range for MRI dependencies 98/91398/5
Robert Varga [Fri, 17 Jul 2020 20:06:53 +0000 (22:06 +0200)]
Use version range for MRI dependencies

When referencing MRI features, we should use a range.

Change-Id: Iea9a416b15869164f649019017f1a6f9a3f13bf8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAttach sources to test-jar 15/91415/1
Robert Varga [Sat, 18 Jul 2020 10:41:13 +0000 (12:41 +0200)]
Attach sources to test-jar

Building test-jars without also attaching sources make them painful
to use. Make sure we attach sources.

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

3 years agoBump odlparent/yangtools/mdsal to 6.0.10/4.0.12/5.0.13 87/91387/5
Robert Varga [Fri, 17 Jul 2020 15:24:43 +0000 (17:24 +0200)]
Bump odlparent/yangtools/mdsal to 6.0.10/4.0.12/5.0.13

Pick up latest updates from upstream.

Change-Id: I0f5d792bcf53541e72fd833cb4d342ce987add8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDo not fail on warnings for docs-linkcheck 78/91378/2
Thanh Ha [Fri, 10 Jul 2020 14:55:12 +0000 (10:55 -0400)]
Do not fail on warnings for docs-linkcheck

This is a workaround due to sphinx-tabs being incompatible with the
Sphinx linkchecker which throws a warning. We mainly use linkchecker
to catch broken links so we don't really need to fail on warnings as
the main "docs" builder will still fail for warning level issues so
this is a reasonable workaround.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: Ia3b8425133ffb83f6adddd9e584deffb2b887222

3 years agoFix Path Computation Crashes 90/91090/4
Olivier Dugeon [Fri, 10 Jul 2020 12:28:57 +0000 (14:28 +0200)]
Fix Path Computation Crashes

If Path Computation is called with unknown graph, PCEP session crashes
due to path computation creation error. This patch checks that path
computation is valid and reply with PcErr message for PcReq or PcError
for RPC call.

JIRA: BGPCEP-911
Change-Id: I5fa6919db058c97ada4b69077630101d6f02c4f7
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoPrevent deadlock when updating PCEP stats when Tx chain fails 69/91069/1
Ajay Lele [Tue, 26 May 2020 18:05:10 +0000 (11:05 -0700)]
Prevent deadlock when updating PCEP stats when Tx chain fails

Multiple threads are blocked on TopologyStatsProviderImpl
instance lock which is held from TopologyStatsProviderImpl#unbind()
which in turn is waiting for delete transaction commit
future to complete. The transaction chain has failed but
the callback TopologyStatsProviderImpl#onTransactionChainFailed()
is blocked on lock held by earlier thread, thus creating a deadlock.
Patch avoids this by registering callback on delete transaction
commit future instead of the blocking call.

JIRA: BGPCEP-901
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
Change-Id: I4a65b3dd00fb6f1255bf6eeb8b5f1d03f3b3a182
(cherry picked from commit 2cb352533464b608896336b88e69ddd8f5df0031)

3 years agoFix wrong SR-NAI type for Path Computation 93/91093/4
Olivier Dugeon [Fri, 10 Jul 2020 13:53:02 +0000 (15:53 +0200)]
Fix wrong SR-NAI type for Path Computation

When computing a segment path for PcInitiate message, the Path Computation
Algorithms produce an SR-ERO composed by Node-SIDs (NAI Type = 1 or 2).
However, routers expect a SR-ERO composed by Adjacency-SIDs
(NAI Type = 3 or 4) with M-Flag set to 1. Indeed, Node SID NAI is only valid
for loose path while Path Computation determines strict path.

This patch set change NAI (1/2) by NAI (3/4) in the SR-ERO computed by the
Path Computation Algorithms.

JIRA: BGPCEP-913

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

3 years agoFix Graph documentation 60/91060/4
Olivier Dugeon [Fri, 10 Jul 2020 07:28:32 +0000 (09:28 +0200)]
Fix Graph documentation

Graph users guide references the wrong key 'graph-type' instead of
'domain-scope'.

JIRA: BGPCEP-912

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

3 years agoFix Unreserved Bandwidth verification in algo 02/91202/2
Olivier Dugeon [Fri, 10 Jul 2020 15:21:03 +0000 (17:21 +0200)]
Fix Unreserved Bandwidth verification in algo

Path Computation Algorithms assume that Unreserved Bandwidth values are
ordered by Class-Type priority which could be wrong. This patch set correct
this issue by searching the correct Unreserved Bandwidth value that corresponds
to the Class-Type instead of directly addressing the Unreserved Bandwidth list
with the Class-Type as index.

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

3 years agoBump odlparent/yangtools/mdsal 48/91048/3
Robert Varga [Fri, 10 Jul 2020 05:01:26 +0000 (07:01 +0200)]
Bump odlparent/yangtools/mdsal

This adopts the following versions:
- odlparent-6.0.9
- yangtools-4.0.11
- mdsal-5.0.12

Change-Id: I86333d76e61b99e7ba5a2206f6286b21e9403efc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove superfluous units specification 65/90265/1
Robert Varga [Tue, 9 Jun 2020 14:02:55 +0000 (16:02 +0200)]
Remove superfluous units specification

Units are defined in the base type, there is no need to define
them in the leaf.

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

4 years agoUse IetfInetUtil for IpAddressNoZone formatting 60/90260/1
Robert Varga [Sun, 7 Jun 2020 10:28:34 +0000 (12:28 +0200)]
Use IetfInetUtil for IpAddressNoZone formatting

Rather than going through InetAddress.getHostAddress(), use
provided utilities to instantiate IpAddressNoZone more efficiently.
Fixes the following splat:

java.lang.IllegalArgumentException: Cannot create IpAddress from 2001:db8:1000:0:0:0:0:10%0
    at org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZoneBuilder.getDefaultInstance(IpAddressNoZoneBuilder.java:26) ~[bundleFile:?]
    at org.opendaylight.bgpcep.pcep.topology.provider.AbstractTopologySessionListener.onSessionUp(AbstractTopologySessionListener.java:165) ~[bundleFile:?]
    at org.opendaylight.protocol.pcep.impl.PCEPSessionImpl.sessionUp(PCEPSessionImpl.java:377) [bundleFile:?]
    at org.opendaylight.protocol.pcep.impl.PCEPSessionImpl.handlerAdded(PCEPSessionImpl.java:425) [bundleFile:?]
    at io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:971) [bundleFile:4.1.48.Final]

Change-Id: Ifa13691b0487755de112cee7dea57cde50427972
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump versions by x.y.(z+1) 83/89783/2
jenkins-releng [Fri, 15 May 2020 01:38:42 +0000 (01:38 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I0eb9a3e92dd9f9b41009aa7cdba121b00b0e530a

4 years agoUpgrade compendium dependency 84/89284/2
Robert Varga [Thu, 23 Apr 2020 08:55:08 +0000 (10:55 +0200)]
Upgrade compendium dependency

We are using OSGi R6, the compendium reference should match.

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

4 years agoHandle race-conditions in BGP shutdown code 76/89276/2
Ajay Lele [Tue, 24 Mar 2020 22:43:48 +0000 (15:43 -0700)]
Handle race-conditions in BGP shutdown code

JIRA: BGPCEP-900
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
Change-Id: Id50c83cd226f6786c9830b3b10d7e0eddda9653e
(cherry picked from commit 01ad372373854f644f648e914ed24eaec91fd783)

4 years agoBump odlparent/yangtools/mdsal 37/89337/3
Robert Varga [Fri, 24 Apr 2020 12:34:48 +0000 (14:34 +0200)]
Bump odlparent/yangtools/mdsal

This adopts the following versions:
- odlparent-6.0.6
- yangtools-4.0.8
- mdsal-5.0.10

Change-Id: Ib8e5b891da0dd90cf8dde98e30cd396c05d2d915
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix checkstyle 56/89356/1
Robert Varga [Fri, 24 Apr 2020 15:35:57 +0000 (17:35 +0200)]
Fix checkstyle

Upgraded checkstyle finds a number of issues, fix them up.

Change-Id: I501fe4a7b80efd96cb3904cbb857e1bff9556ae7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove use of projectinfo property 09/88609/1
Robert Varga [Mon, 23 Mar 2020 10:29:21 +0000 (11:29 +0100)]
Remove use of projectinfo property

maven-project-info-reports-plugin is properly declared with a newer
version upstream, remove use of property-based version override.

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

4 years agoBump versions by x.y.(z+1) 15/88515/1
jenkins-releng [Thu, 19 Mar 2020 11:59:37 +0000 (11:59 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I91c6f81a37f7621287cdd971b533b1ad00d6b6ad

4 years agoUpdate PCEP Path Computation Documentation 19/88419/1
Olivier Dugeon [Fri, 13 Mar 2020 10:46:18 +0000 (11:46 +0100)]
Update PCEP Path Computation Documentation

Remove 'Known Bug' section in docs/pce/pcep-user-guide-path-computation.rst
as bug has been resolved.

JIRA: BGPCEP-898

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

4 years agoFix uninitialized LinkstateGraphProvider registration 17/88417/1
Robert Varga [Thu, 12 Mar 2020 21:02:40 +0000 (22:02 +0100)]
Fix uninitialized LinkstateGraphProvider registration

LinkstateGraphProvider is initializing a field and hence cannot
be registered from super class.

JIRA: BGPCEP-898
Change-Id: Iccf819df69957ebee8de3cbe926a7d13113fb244
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEnforce field finality 16/88416/1
Robert Varga [Thu, 12 Mar 2020 16:17:10 +0000 (17:17 +0100)]
Enforce field finality

We really want to safely publish whatever we have gotten and want
to reject nulls. This does not solve the underlying issue, but takes
a step in bracketing where it lies.

JIRA: BGPCEP-898
Change-Id: Id465a5dce3c0e4aaeefbaf1dc6f7d36a2a02712b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoPath Computation & Server Improvement 12/88212/4
Olivier Dugeon [Mon, 2 Mar 2020 18:28:35 +0000 (19:28 +0100)]
Path Computation & Server Improvement

 - Correct a bug in SAMCRA algorithm when delay is not specified
 - Improve debug message for SAMCRA algorithm
 - Add documentation for Path Computation Algorithm bundle
 - Update documentation for PCEP with the Path Computation Server

JIRA: BGPCEP-897
JIRA: BGPCEP-896

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

4 years agoPropogate SR SID info from BGP-LS routes in RIB to link-state topology 93/88293/1
Ajay Lele [Thu, 16 Jan 2020 21:24:54 +0000 (13:24 -0800)]
Propogate SR SID info from BGP-LS routes in RIB to link-state topology

JIRA: BGPCEP-365
Change-Id: Ie4d9701459e163aad24ea1cca61e19fc1661d73a
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 9553bbac51ae890b9a923aa64ce8617ceae06666)

4 years agoPath Computation Server 78/88078/1
Olivier Dugeon [Thu, 16 Jan 2020 14:53:43 +0000 (15:53 +0100)]
Path Computation Server

Initial commit of Path Computation Server.

This is the 3/3 Patch Set to provide Path Computation Element (PCE)
conform to RFC5440. This integrates the Graph model and Algorithms
features. Graph is fulfilled from BGP-LinkState if available otherwise
a graph must be provided.

Details information about how to use the PCE server will be provided
in docs/pcep/pcep-user-guide-pce-server.rst

JIRA: BGPCEP-858

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

4 years agoPath Computation Algorithms 77/88077/1
Olivier Dugeon [Thu, 16 Jan 2020 15:03:08 +0000 (16:03 +0100)]
Path Computation Algorithms

Initial commit of Path Computation Algorithms implementation.

This is the 2/3 Patch Set to implement a full featured PCE server
in conformity to RFC5440. It provides three different algorithms
able to compute paths between end points by taking into account
different constraints:
 - A simple Shortest Path First that takes into account only
   standard IGP metric
 - A Constrained Shortest Path First (CSPF) that takes into
   account the TE Metric and Bandwidth for constraints
 - SAMCRA algorithm that takes into account TE Metric, Delay,
   Loss and Bandwidth for constraints

Details information about how the various algorithms are implemented
and how to use them will be provided in docs/algo directory.

JIRA: BGPCEP-858

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Co-authored-by: Philippe Niger <philippe.niger@orange.com>
Co-authored-by: Philippe Cadro <philippe.cadro@orange.com>
Change-Id: Ifbcf2a65aef08c3fa95a2be54eb53ffdf55dd417

4 years agoGraph modelisation for Path Computation Algorithm 60/87960/1
Olivier Dugeon [Thu, 28 Nov 2019 14:40:07 +0000 (15:40 +0100)]
Graph modelisation for Path Computation Algorithm

Initial commit of Graph Model.

This is the patch set 1/3 to implement the Path Computation Algorithms
to implement a full feature PCE server in conformity to RFC5440.

Details information about the yang model, REST and Java API are
provided in docs/graph directory.

JIRA: BGPCEP-858
Change-Id: Icf7b8320185f9d94377c76cdaecba836b7ef3bc5
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Co-authored-by: Philippe Niger <philippe.niger@orange.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse HashMap.computIfAbsent() in getNode() 57/87957/2
Robert Varga [Tue, 18 Feb 2020 18:14:57 +0000 (19:14 +0100)]
Use HashMap.computIfAbsent() in getNode()

There is no point in performing a lookup + store -- just perform
a conditional load, which saves a bucket lookup in the not-present
case.

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

4 years agoYANG revision dates mass-update 59/87959/1
guillaume.lambert [Wed, 5 Feb 2020 14:20:11 +0000 (15:20 +0100)]
YANG revision dates mass-update

A previous commit mass-converted YANG models to use -no-zone addresses.
https://git.opendaylight.org/gerrit/c/bgpcep/+/87048
66b8611ab00a626167bf20556d7cbb5ec00ca124

Their revision date should have been changed and the code + other YANG
imports adapted accordingly.

Note that:
- even if there is no ODL guidelines on the topic, this is IETF YANG
  recommendation.
- The RESTCONF payload will remain the same for end-users.
- JAVA API and Datastore contents may be affected
  (potential upgrade compatibility issue from existing Sodium instances)

JIRA: BGPCEP-790 BGPCEP-895

Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I526bf90c9e74bc6e72c44da449641a350e12946e
(cherry picked from commit 0fdeddbe3d072a88428599421191f0f60b2864e4)

4 years agoUpdate .gitreview to stable/magnesium 80/87880/1
jenkins-releng [Tue, 18 Feb 2020 22:05:26 +0000 (22:05 +0000)]
Update .gitreview to stable/magnesium

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I5b1e463b098e89bcbfbb36bab8309f6371e0af37

4 years agoMass-convert all compontents to use -no-zone addresses 48/87048/15
Robert Varga [Tue, 7 Jan 2020 08:00:19 +0000 (09:00 +0100)]
Mass-convert all compontents to use -no-zone addresses

Rather than taking a step-by-step approach, this patch mass converts
all utilities and ODL models to use -no-zone addresses and fixes up
the fallout from that.

JIRA: BGPCEP-790
Change-Id: Iaa2a8e207aeffd40aa10a4d438587263d053629c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoIgnore unknown subobjects while parsing RRO/ERO objects in PCEP messages 30/87030/4
Ajay Lele [Fri, 17 Jan 2020 18:18:40 +0000 (10:18 -0800)]
Ignore unknown subobjects while parsing RRO/ERO objects in PCEP messages

Make handling of unknown subobjects more liberal. Log message parsing
exceptions at error level instead of debug to make it easier to detect.

JIRA: BGPCEP-892
Change-Id: I3d142e3d857b1ee154aaedf3d28a09d870932915
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
4 years agoFix buffer read for unsupported LLGR Safi 96/87196/1
Vikram Singh Kalakoti [Tue, 28 Jan 2020 15:40:52 +0000 (21:10 +0530)]
Fix buffer read for unsupported LLGR Safi

In LlGracefulCapabilityHandler, once an unsupported safi is encountered
we should skip all unread bytes in buffer for that Table

JIRA:BGPCEP-893

Signed-off-by: Vikram Singh Kalakoti <vikramskalakoti@gmail.com>
Change-Id: Ib4479f75d70631fff92b8af62f6bd20486a66c2a

4 years agoUse IetfYangUtil.hexStringBytes()/hexStringFor() 53/87053/1
Robert Varga [Mon, 20 Jan 2020 13:44:23 +0000 (14:44 +0100)]
Use IetfYangUtil.hexStringBytes()/hexStringFor()

Utility methods exposed by MD-SAL are quite a bit more efficient, use
them instead of dancing around with strings.

Change-Id: I16dec789353244416dae228f5151fbd2b4c27d6d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate to use MD-SAL's uint24 type 51/87051/2
Robert Varga [Mon, 20 Jan 2020 11:26:30 +0000 (12:26 +0100)]
Migrate to use MD-SAL's uint24 type

MDSAL is providing the type and related utilities, make sure we
pick them up.

Change-Id: I6305b6003502a3cae7a09e1a88de04f6d9fb45ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate deprecated assertThat() 50/87050/1
Robert Varga [Mon, 20 Jan 2020 11:21:27 +0000 (12:21 +0100)]
Migrate deprecated assertThat()

This utility is on its way to Hamcrest, migrate it.

Change-Id: Ie1f6fd928096aad59790d5fb53ac71da620def79
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump to odlparent-6.0.4/yangtools-4.0.6/mdsal-5.0.9 98/86998/2
Robert Varga [Thu, 16 Jan 2020 21:10:51 +0000 (22:10 +0100)]
Bump to odlparent-6.0.4/yangtools-4.0.6/mdsal-5.0.9

Pick up latest fixes and upgrades.

Change-Id: I03d3d421755f9ed4e01618379f856a4cf3af80bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReduce PathKey serialization duplication 59/86759/1
Robert Varga [Mon, 6 Jan 2020 18:45:13 +0000 (19:45 +0100)]
Reduce PathKey serialization duplication

PathKeyUtils.serializePathKey() can take PathKeySubobject, which
makes it readily reusable in RROPathKey128SubobjectParser, reducing
amount of duplication we have.

Change-Id: I23f5c58842c2a1ef073ef3f90b6224247a7a195f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove ipv4/ipv6 ByteBuf utilities to Ipv{4,6}Util 46/86746/4
Robert Varga [Mon, 6 Jan 2020 15:43:16 +0000 (16:43 +0100)]
Move ipv4/ipv6 ByteBuf utilities to Ipv{4,6}Util

There is little point in criss-crossing between util classes
and ByteBufWriteUtil -- move the methods so they are hosted
in their appropriate classes.

Change-Id: Ifa3326c03372b86843ce45b5c72782142e10d9a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove use of UnsignedBytes.toInt() 45/86745/3
Robert Varga [Mon, 6 Jan 2020 15:33:11 +0000 (16:33 +0100)]
Remove use of UnsignedBytes.toInt()

As per javadoc, Java 8 users should be using Byte.toUnsignedInt(),
do precisely that -- except where we are getting input from Netty,
where we use readUnsignedByte() instead.

Change-Id: I519b0bad54101d73127b72b2ae67a4f046cac2a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove ByteBufWriteUtil.IPV{4,6}_PREFIX_BYTE_LENGTH} 44/86744/2
Robert Varga [Mon, 6 Jan 2020 15:23:36 +0000 (16:23 +0100)]
Move ByteBufWriteUtil.IPV{4,6}_PREFIX_BYTE_LENGTH}

These constants are not used outside of the package, hide them and
move them to their respective Ipv{4,6}Util classes.

Change-Id: Ida261113709c35a95615b9f49dde5d2731f38ed0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEliminate ByteBufWriteUtil.writeMedium() 43/86743/2
Robert Varga [Mon, 6 Jan 2020 15:06:43 +0000 (16:06 +0100)]
Eliminate ByteBufWriteUtil.writeMedium()

There are only two users of this method, both operating on primitive
type. Switch them to use ByteBuf.writeMedium() and eliminate the
now-unused method.

Change-Id: I22676f9a2e03f2f5603f46d59fb301b59fc34b29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove ByteBufWriteUtil.writeInt() 42/86742/2
Robert Varga [Mon, 6 Jan 2020 15:01:15 +0000 (16:01 +0100)]
Remove ByteBufWriteUtil.writeInt()

This method has only one user, which is using primitive int. Migrate
the user to ByteBuf.writeInt() and remove the now-unused method.

Change-Id: I9981e7f54d306ce18f2b8b693998b26e6a464f54
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoPurge unused ByteBufWriteUtil methods 41/86741/2
Robert Varga [Mon, 6 Jan 2020 14:57:49 +0000 (15:57 +0100)]
Purge unused ByteBufWriteUtil methods

Most of these methods have an appropriate replacement in either
ByteBufUtils or ByteBuf, or are completely unused. Remove them
along with their tests.

Change-Id: I95e2e8bff6fbfd60471d93470e465ba07ce5ddca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate pcep-ietf-stateful07 to use ByteBufUtils 40/86740/4
Robert Varga [Mon, 6 Jan 2020 14:26:06 +0000 (15:26 +0100)]
Migrate pcep-ietf-stateful07 to use ByteBufUtils

Most of the parser interactions can be reformulated in terms
of ByteBufUtils, do that.

Change-Id: I7576c9de5649509172c91c6904478fe4be0cf154
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate pcep-base-parser to use ByteBufUtils 31/86731/5
Robert Varga [Sun, 5 Jan 2020 22:50:53 +0000 (23:50 +0100)]
Migrate pcep-base-parser to use ByteBufUtils

Most of the parser interactions can be reformulated in terms
of ByteBufUtils, do that.

Change-Id: I73b97e2d4ff5210c45d7b938a09a57110e8f43cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSpecialize Util.writeShortest() for Uint{16,32} 07/86707/5
Robert Varga [Sun, 5 Jan 2020 09:45:04 +0000 (10:45 +0100)]
Specialize Util.writeShortest() for Uint{16,32}

This adds type safety to the picture, so that we end up doing
minimal correct checks on the value supplied. It also allows us
to ditch superfluous use of ByteBufWriteUtils.

Change-Id: Iddf77acd16115ba6b342279f18e6bd1b5411de1c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSwitch common parsers to utils 30/86730/1
Robert Varga [Sun, 5 Jan 2020 21:09:40 +0000 (22:09 +0100)]
Switch common parsers to utils

Using subclassing is not that useful, as we want to reserve that
for actually providing baseline behavior. Switch to composition
by making utility methods properly static.

Change-Id: Iec2c26a3642347fac21a3cbd4b382e453e337651
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReduce use oif ByteBufWriteUtil in pcep-segment-routing 20/86720/1
Robert Varga [Sun, 5 Jan 2020 14:20:25 +0000 (15:20 +0100)]
Reduce use oif ByteBufWriteUtil in pcep-segment-routing

ByteBufUtils or ByteBuf methods provide most of what we need, use
upstreams to reduce use of our home-grown utilities.

Change-Id: If166a719f0ad67009c434d97e1347d75369257ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReduce use of ByteBugWriteUtil in BMP 19/86719/1
Robert Varga [Sun, 5 Jan 2020 14:14:12 +0000 (15:14 +0100)]
Reduce use of ByteBugWriteUtil in BMP

Use either direct ByteBuf interaction or ByteBufUtils methods to
provide better speed & simplicity.

Change-Id: Iff91ab0286c06668dd551adcabaaf2046b8467f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEliminate use of ByteBufWriteUtil in pcep-spi 15/86715/2
Robert Varga [Sun, 5 Jan 2020 12:15:23 +0000 (13:15 +0100)]
Eliminate use of ByteBufWriteUtil in pcep-spi

ByteBufUtils are much better suited to the task at hand, make sure
we use them.

Change-Id: I53b033af2e178c12eaaac45569ae92ea5b2c09d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMinimize use of ByteBufWriteUtil in rsvp-impl 14/86714/2
Robert Varga [Sun, 5 Jan 2020 12:09:17 +0000 (13:09 +0100)]
Minimize use of ByteBufWriteUtil in rsvp-impl

ByteBufUtils are up to most of the tasks, make sure we use them
instead of our home-grown utilities.

Change-Id: I34bcc5410774b2c00749a62249d9e4595a13be16
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEliminate use of ByteBufWriteUtil in rsvp-spi 13/86713/2
Robert Varga [Sun, 5 Jan 2020 11:31:20 +0000 (12:31 +0100)]
Eliminate use of ByteBufWriteUtil in rsvp-spi

Logic in rsvp-spi can easily use ByteBufUtils or direct ByteBuf
methods, remove unneeded use of ByteBufWriteUtil.

Change-Id: Ic12ac3939d4077b18e6d9e29396e8381dd77335c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMinimize use of ByteBufWriteUtil in bgp-parser-impl 12/86712/2
Robert Varga [Sun, 5 Jan 2020 11:20:24 +0000 (12:20 +0100)]
Minimize use of ByteBufWriteUtil in bgp-parser-impl

We can either use direct ByteBuf methods or employ ByteBufUtils
more efficiently.

Change-Id: I5c2c095c12a81007ca581bdd7c6fa493c995c3ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMinimize use of ByteBufWriteUtil in bgp-parser-spi 11/86711/2
Robert Varga [Sun, 5 Jan 2020 11:12:11 +0000 (12:12 +0100)]
Minimize use of ByteBufWriteUtil in bgp-parser-spi

Most of the call sites are easily reformulated in terms of either
raw ByteBuf access or ByteBufUtils.

Change-Id: Ie500b13578ed9be0b94f48d335889e2121d8e034
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEliminate use of ByteBufWriteUtil from route-target 10/86710/2
Robert Varga [Sun, 5 Jan 2020 11:02:37 +0000 (12:02 +0100)]
Eliminate use of ByteBufWriteUtil from route-target

There is a single caller, which can trivially be updated to use
ByteBufUtils with improved efficiency.

Change-Id: I7f636cfc1d7ecb6922bd5e29026d4137783baeba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEliminate use of ByteBufWriteUtil from mvpn 09/86709/2
Robert Varga [Sun, 5 Jan 2020 10:57:33 +0000 (11:57 +0100)]
Eliminate use of ByteBufWriteUtil from mvpn

yangtools is providing ByteBufUtils, which are up to all the jobs
we really need for interacting with ByteBuf.

Since we are touching OpaqueUtil, we slightly optimize its
buildOpaqueValue() by reusing splitter/joiner instances.

Change-Id: Ic415d50c2bc1b14098f0a30b663e9d27790c5fdd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMinimize linkstate use of ByteBufWriteUtils 08/86708/2
Robert Varga [Sun, 5 Jan 2020 10:12:24 +0000 (11:12 +0100)]
Minimize linkstate use of ByteBufWriteUtils

Most of the usage of ByteBufWriteUtils can be replaced by
ByteBufUtils or direct interaction with ByteBuf.

Change-Id: I6d381f30c99b4a6f5d6ff5723385df6aa7474cc2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReduce use of Util.writeShortest() 06/86706/1
Robert Varga [Sun, 5 Jan 2020 09:32:14 +0000 (10:32 +0100)]
Reduce use of Util.writeShortest()

In case we are coming from an Uint8 there really is no point in
going through Util.writeShortest() as the result is always going
to fit in a single byte. Use ByteBufUtils directly to emit that
byte.

Change-Id: I40288d3fa3c149e8effa0fe1c2c8de52f19eeb79
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRedice use of ByteBufWriteUtil in flowspec 05/86705/1
Robert Varga [Sun, 5 Jan 2020 09:20:54 +0000 (10:20 +0100)]
Redice use of ByteBufWriteUtil in flowspec

yangtools is providing ByteBufUtils for dealing with uint types,
use those methods instead of our home-grown ones. In a few cases
going through uints is not necessary, in which case we end up
talking to ByteBuf directly.

Change-Id: If029b90c6773cae0b2428fa6949173c6cb62bca3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate evpn to use ByteBufUtils 04/86704/1
Robert Varga [Sun, 5 Jan 2020 08:51:12 +0000 (09:51 +0100)]
Migrate evpn to use ByteBufUtils

yangtools is providing utility methods similar to ByteBufWriteUtils,
this patch migrates evpn to use those instead of ours.

Change-Id: Ia2f0e16098d3ef6b89fb5e40b4ada60d0411c240
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRefactor RouteDistinguisherUtil 03/86703/2
Robert Varga [Sun, 5 Jan 2020 08:06:24 +0000 (09:06 +0100)]
Refactor RouteDistinguisherUtil

This class is using deprecated ByteBufWriteUtils methods and this
patch refactors it not to, as it only brings invariant checks
to the table.

Serialize method made a dispatcher between the three distinct
implementations.

Each implementation is refactored to first check string validity
by searching for separators -- which is done faster than previous
String.split(String). Only after validation are parts split
and pushed to the buffer.

Change-Id: Ie87fbaf042d75176c584bf15e345c463b4c747f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReturn Pcerr from spi.Util 02/86702/2
Robert Varga [Sun, 5 Jan 2020 00:23:33 +0000 (01:23 +0100)]
Return Pcerr from spi.Util

We are creating an error message, let's not pretend it's anything
else -- making the test simpler.

Change-Id: Ic3272385d4fd6a285b8d534d40885f6b0f686e70
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove useless UnsupportedOperationExceptions 01/86701/4
Robert Varga [Sat, 4 Jan 2020 22:22:28 +0000 (23:22 +0100)]
Remove useless UnsupportedOperationExceptions

It is a common (enforced) pattern to hide utility class constructors,
which is sufficient to make sure they are not instantiated.

Throwing UOE from them leads to unneeded byte code, which is hard to
test (via reflection). Remove all instances of such throws.

Change-Id: I68ff3596b44a2196d5450c220a30f98c014f7ba4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate to use yangtools' ByteBufUtils 92/86692/9
Robert Varga [Sat, 4 Jan 2020 07:14:37 +0000 (08:14 +0100)]
Migrate to use yangtools' ByteBufUtils

yangtools provides common set of methods to deal with uint types,
this patch adopts them.

Change-Id: Ib84f546a11d25eab218712a26d8aa49b651cf3e1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove superfluous constants 00/86700/1
Robert Varga [Sat, 4 Jan 2020 15:15:26 +0000 (16:15 +0100)]
Remove superfluous constants

java.lang.{Byte,Short,Integer,Long,Float} define a BYTES constant
since Java 8, use that instead of brewing our own.

Change-Id: If7a8e75c123fef7d79172f22dadb01012de4b1b5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReduce ByteBuf.writeZero() usage 99/86699/1
Robert Varga [Sat, 4 Jan 2020 14:43:27 +0000 (15:43 +0100)]
Reduce ByteBuf.writeZero() usage

For 1/2/3/4/8-byte output we can use faster methods which put
the appropriately-sized 0 constant into the buffer. Use that.

Change-Id: I2eba6124d1730a7d52a3e992df5542aa080377db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd uint24.yang 95/86695/4
Robert Varga [Sat, 4 Jan 2020 08:47:58 +0000 (09:47 +0100)]
Add uint24.yang

odl-bgp-evpn defines an explicit uint24 type, which is useful as
low as network-concepts. Separate this type into its own module
and reuse it everywhere we are dealing with a 24 bit unsigned types.

This flushes out unneeded tests in LlGracefulCapabilityHandlerTest,
where we are asserting that DTOs are validating the value -- which
is a given and tested in DTO codegen tests.

Change-Id: I423d1af64b0514aa2b0e2f0f0fca728c062ef89a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix YANG file formatting in concepts 94/86694/1
Robert Varga [Sat, 4 Jan 2020 08:37:03 +0000 (09:37 +0100)]
Fix YANG file formatting in concepts

We have mis-indented models here, making them hard to read. Fix
indentation.

Change-Id: I80aa153e419292a24379f383d36c15e1fad5716e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent/yangtools/mdsal to 6.0.3/4.0.3/5.0.6 69/86369/4
Robert Varga [Thu, 12 Dec 2019 07:02:19 +0000 (08:02 +0100)]
Bump odlparent/yangtools/mdsal to 6.0.3/4.0.3/5.0.6

Pick up the latest upgrades and fixes.

Change-Id: I3cbe9d29c2e511f7c77658251816bc332d848b10
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix CSIT regression due to BGPCEP-878 fix 24/86424/2
Ajay Lele [Sat, 14 Dec 2019 04:09:13 +0000 (20:09 -0800)]
Fix CSIT regression due to BGPCEP-878 fix

Handle scenario in BGPClusterSingletonService#restartNeighbors()
where BgpPeer#restart() is called after BgpPeer#closeServiceInstance()
without BgpPeer#restart() getting called in between.

JIRA: BGPCEP-878
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
Change-Id: I5f8ac4ac4992e4641769243c91fac03bd0a96094

4 years agoTurn PathBindingTlvCodec into an abstract class 81/85981/5
Robert Varga [Tue, 26 Nov 2019 15:34:06 +0000 (16:34 +0100)]
Turn PathBindingTlvCodec into an abstract class

Having PathBindingTlvCodec as a private interface is not completely
useful, as we can use an abstract class instead, simplifying
the API and speeding it up, by eliminating unneeded allocations.

Change-Id: Ia1e3eda5a8333c31a8b929dcb73079fcb6edf581
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRegister PCEP session to stats handler only after it is fully initialized 13/86113/1
Ajay Lele [Tue, 3 Dec 2019 03:17:53 +0000 (19:17 -0800)]
Register PCEP session to stats handler only after it is fully initialized

JIRA: BGPCEP-889
Change-Id: I008418426061d51fd3bef1be7e2fca9b63c99100
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
4 years agoUse new Uint* constants 92/85992/2
Robert Varga [Tue, 26 Nov 2019 21:24:51 +0000 (22:24 +0100)]
Use new Uint* constants

This uses public constants for TWO and TEN, speeding up things just
a little bit.

Change-Id: Ie9622d28293033b9fbb0bc7b6a5938763cacfe7b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse Uint16 for path binding type 80/85980/3
Robert Varga [Tue, 26 Nov 2019 15:25:33 +0000 (16:25 +0100)]
Use Uint16 for path binding type

Bindings have a set domain of unsigned shorts, there is little
reason to use Integers in their stead. This switches lookups and
parsing/serialization to operate on Uint16 instead.

Change-Id: I9db97c39599b2f78406e4a38aacb087cd3dbf864
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse direct conversion 78/85978/2
Robert Varga [Tue, 26 Nov 2019 15:12:31 +0000 (16:12 +0100)]
Use direct conversion

Uint types have utility converters for simple conversion among them,
use toUint16() without going through an int (and related checks).

Change-Id: I68927011a5eb933cc67fb1afba258b5d254973d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove checkstyle/spotbugs plugin overrides 82/85982/1
Robert Varga [Tue, 26 Nov 2019 16:14:55 +0000 (17:14 +0100)]
Remove checkstyle/spotbugs plugin overrides

checkstyle/spotbugs come configured in enforcing mode from odlparent,
hence we do not need to override the configuration.

Change-Id: I067ed0914deb0ff0dfc1d434e87c6ddf70bc9e46
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agopcep: End of code cleaning 93/85593/9
Olivier Dugeon [Tue, 5 Nov 2019 14:19:16 +0000 (15:19 +0100)]
pcep: End of code cleaning

 - Remove remaining call to deprecated functions
 - Change last ListArray by ArrayList

JIRA: BGPCEP-715
Change-Id: I17a57aea67f5ad174967c724bf6ab923987bc85a
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoclean pcep/impl 02/85102/21
guillaume.lambert [Mon, 14 Oct 2019 09:34:05 +0000 (11:34 +0200)]
clean pcep/impl

  - Fix remaining checkstyle errors, mainly IllegalCatch
  - Remove superfluous from PCEPValidatorTest, PcepXROSubobjectParserTest,
    PcepRROSubobjectParserTest and PcepEROSubobjectParserTest
  - Remove call to deprecated functions

JIRA: BGPCEP-715

Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Co-authored-by: Olivier Dugeon <olivier.dugeon@orange.com>
Change-Id: Ifff40512f2861246692fbad41de77882c461b2d0
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
4 years agoFix NPE while accessing DomTxChain when bgp/app peer singleton service is restarted 80/84080/6
Ajay Lele [Thu, 29 Aug 2019 21:37:58 +0000 (14:37 -0700)]
Fix NPE while accessing DomTxChain when bgp/app peer singleton service is restarted

Due to cluster partition/heal, singleton service associated with bgp/app
peer instance can get restarted. Create/close of DomTxChain instance used
by the service was not being handled properly resulting in NPE and failure
to register the peer which caused the BGP connection to not get reestablished.

JIRA: BGPCEP-878
Change-Id: I436ad0877db19c65463bf7b7e09faa3b2b42e5a0
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAddress deadlock scenarios in BGP peer, session mgmt code 26/85426/3
Ajay Lele [Wed, 30 Oct 2019 00:13:15 +0000 (17:13 -0700)]
Address deadlock scenarios in BGP peer, session mgmt code

In scenario-1, BGPPeer and BGPSessionImpl was acquiring locks in opposite order,
resulting in deadlock. Addressed it by enforcing same order of locking i.e.
[BGPPeer (listener) -> BGPSessionImpl (session)].
In scenario-2, deadlock was because of BGPProtocolSessionPromise and StrictBGPPeerRegistry
acquiring locks in opposite order. Addressed by using concurrent Set obviating
need to acquire lock on StrictBGPPeerRegistry object.

JIRA: BGPCEP-884
Change-Id: I9e05adde3220191c8f8436bd76fb25dbfc251e49
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
4 years agoBump to odlparent-6.0.1/yangtools-4.0.2/mdsal-5.0.4 25/85625/1
Robert Varga [Wed, 6 Nov 2019 15:40:58 +0000 (16:40 +0100)]
Bump to odlparent-6.0.1/yangtools-4.0.2/mdsal-5.0.4

This picks up latest upgrades and fixes.

Change-Id: I8db358b0af81394a561071d98bffea168dda47cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoClean pcep/base-parser code 25/85325/13
Olivier Dugeon [Tue, 22 Oct 2019 14:18:53 +0000 (16:18 +0200)]
Clean pcep/base-parser code

Fix maven checktyle errors:
 - Missing period at end of first comment for JavaDoc
 - Split line longer than 120 characters
 - Rename XROSRLGSubobjectParser.java to XROSrlgSubobjectParser.java
   and update pcep/impl PCEPXROSubobjectParserTest Junit consequently
 - Replace // fall-through comments by // fallthrough
   for OpenJDK-11 compliance [1]

Improve coding style:
 - Indentation
 - Remove superfluous code when one or several setters
   are called after a builder

[1] https://checkstyle.sourceforge.io/apidocs/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.html
    https://issues.apache.org/jira/browse/MCHECKSTYLE-383

JIRA: BGPCEP-715
Change-Id: Id7799e2705ae80420f8b4f0ec8f86929b85bc395
Co-authored-by: guillaume.lambert <guillaume.lambert@orange.com>
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
4 years agoFurther removal of unused imports 65/85365/1
Robert Varga [Thu, 24 Oct 2019 08:56:56 +0000 (10:56 +0200)]
Further removal of unused imports

This removes imports reported by pyang as unused.

Change-Id: Ia2d931f95715a935edc6ee79fd4226f797c4549e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix odl-bgp-policy module file name 64/85364/1
Robert Varga [Thu, 24 Oct 2019 08:58:00 +0000 (10:58 +0200)]
Fix odl-bgp-policy module file name

File name does not match the declared module, fix that.

Change-Id: I541ddb179a8f7843a52aaeb9bee952521a8804d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix bgp-segment-routing 24/85324/2
Robert Varga [Mon, 21 Oct 2019 08:23:24 +0000 (10:23 +0200)]
Fix bgp-segment-routing

This model is not valid yang, as it is defining overlapping leaves
in choice/case statements. This fixes the violations by providing
encapsulating containers.

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

4 years agoFix rsvp.yang 44/85344/3
Robert Varga [Mon, 21 Oct 2019 08:20:07 +0000 (10:20 +0200)]
Fix rsvp.yang

This model is not valid yang, as it is defining overlapping leaves
in choice/case statements. This fixes the violations by providing
encapsulating containers, i.e. the content within each case is also
put into a container.

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

4 years agoRemove unused imports 39/85339/1
Robert Varga [Wed, 23 Oct 2019 08:53:01 +0000 (10:53 +0200)]
Remove unused imports

pyang validation is turning up warnings about unused imports,
fix them up.

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