bgpcep.git
4 years agoRevert "Remove OSGi dependency from bgp modules" 23/82223/5
Robert Varga [Thu, 18 Jul 2019 18:28:53 +0000 (20:28 +0200)]
Revert "Remove OSGi dependency from bgp modules"

This partially reverts commit 62b37d2c48880f858e7b0503e9bb60d5e168c412,
which breaks CSIT.

JIRA: BGPCEP-873
Change-Id: I0c2f32004a135f561202ed07c57c2b1ebb1c0721
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove duplicate declarations 14/83114/1
Robert Varga [Thu, 18 Jul 2019 13:17:01 +0000 (15:17 +0200)]
Remove duplicate declarations

This is a sweep-up of duplicate declarations which were introduced
by the conversion to use MDSAL APIs.

Change-Id: Ia770e643cec0282f01444b1a7c55ccacaa5c6801
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse ImmutableOffsetMapTemplate for route keys 54/82954/2
Robert Varga [Mon, 8 Jul 2019 12:30:47 +0000 (14:30 +0200)]
Use ImmutableOffsetMapTemplate for route keys

We are sharing the same key layout for all entries, hence it is
wasteful to instantiate a full ImmutableMap for each of them. Use
pre-computed ImmutableOffsetMapTemplate.ordered() to efficiently
instantiate identifiers.

Change-Id: Id3424f95e7e7ad3a6e7ed75715d8505645a45e69
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove RIBSupport.emptyRoutesCase() 53/82953/1
Robert Varga [Mon, 8 Jul 2019 12:00:58 +0000 (14:00 +0200)]
Remove RIBSupport.emptyRoutesCase()

This method is not used anywhere really, remove it.

Change-Id: I9ab338cf748b66b63a0d640dfde58634a913377c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate to mergeParentStructurePut() 52/82952/1
Robert Varga [Mon, 8 Jul 2019 10:37:47 +0000 (12:37 +0200)]
Migrate to mergeParentStructurePut()

This is an intermediate step, eliminating use of the multiplexing
method in favor of being explicit.

Change-Id: I7d4616213eb00b0dd7652fe0f0d2ad47e52eb5b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoModernize codebase a bit 51/82951/1
Robert Varga [Mon, 8 Jul 2019 10:31:20 +0000 (12:31 +0200)]
Modernize codebase a bit

This takes a pass through usage of deprecated methods, updating
them to their latest equivalents.

Change-Id: I1b4f3f160dba70782765ec0b6968e6ee08ae09f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate to MD-SAL APIs 51/77551/13
Claudio D. Gasparini [Tue, 6 Nov 2018 16:43:09 +0000 (17:43 +0100)]
Migrate to MD-SAL APIs

This patch mass-migrates bgp/config-loader/bmp to MD-SAL APIs,
adjusting tests and blueprints as needed.

JIRA: BGPCEP-844
Change-Id: I02c6e23faf3a5badfa6d22eee2c8efc1534f8ad9
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUpdate keepalive tracking 48/81948/3
Robert Varga [Tue, 7 May 2019 16:40:51 +0000 (18:40 +0200)]
Update keepalive tracking

We should not be scheduling keepalives too aggressively after we
have exceeded the deadline. Also add some debugs to show when
keepalives are triggered.

Change-Id: I916a9d7f937dc6b062742b2726f4d906d91774ed
JIRA: BGPCEP-872
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix unsynchronized LSP counting 05/82905/1
Robert Varga [Wed, 3 Jul 2019 08:40:26 +0000 (10:40 +0200)]
Fix unsynchronized LSP counting

Trying to copy values out of lspData without holding the lock
can result it ConcurrentModificationException and was broken
by the fix for BGPCEP-845.

Restore the lock for the duration of the copy and count the items
outside of the lock.

JIRA: BGPCEP-875
Change-Id: Ic6e839cac51a73c0812aabb58e96cb2f4959c4d6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCleanup AbstractEsiType 71/82871/8
Robert Varga [Mon, 1 Jul 2019 20:44:43 +0000 (22:44 +0200)]
Cleanup AbstractEsiType

Cleanup fluent builder use to minimize bytecode footprint, requiring
ByteBuf return from subclasses.

Change-Id: Ie26a894e977a9020edbd777e709ebd36dbd972ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoOptimize message parsers 72/82872/7
Robert Varga [Mon, 1 Jul 2019 21:26:22 +0000 (23:26 +0200)]
Optimize message parsers

This is a simple pass to optimize builder/ByteBuf usage.

Change-Id: Ic00f4e07ded8b9c5d46473de6a0972d04791f971
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCleanup RouteDistiguisherUtil 70/82870/4
Robert Varga [Mon, 1 Jul 2019 20:26:36 +0000 (22:26 +0200)]
Cleanup RouteDistiguisherUtil

Use fluent nature of StringBuilder to streamline generated
bytecode.

Change-Id: I9c9cb16c248f3a276bf4f353000733418a4efd8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoGet rid of JSR305 annotations 69/82869/9
Robert Varga [Mon, 1 Jul 2019 13:20:34 +0000 (15:20 +0200)]
Get rid of JSR305 annotations

This migrates to JDT/checker annotations removing unneeded dependency,
cleaning up code in process.

Change-Id: Id765ea0c67b9449b583963dba659ed680f1e42bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump mdsal to 4.0.2 62/82362/3
Robert Varga [Fri, 31 May 2019 14:12:44 +0000 (16:12 +0200)]
Bump mdsal to 4.0.2

This picks up the latest fixes.

Change-Id: Id5d911ad610bb406003bd22f26c2d2611724d777
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools to 3.0.1 57/82357/2
Robert Varga [Fri, 31 May 2019 14:09:00 +0000 (16:09 +0200)]
Bump yangtools to 3.0.1

This picks up the latest fixes.

Change-Id: I8d1c3bd20dea4de15355b512bae514b1d3c14290
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump mdsal to 4.0.1 44/81844/5
Robert Varga [Wed, 1 May 2019 11:46:33 +0000 (13:46 +0200)]
Bump mdsal to 4.0.1

This bumps mdsal to 4.0.1.

Change-Id: I81df5c18a85c595489dbb93f890cb7647daa4d3e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix NPE when no node present in PCEP topology config 40/81540/2
Ajay Lele [Wed, 10 Apr 2019 20:07:02 +0000 (13:07 -0700)]
Fix NPE when no node present in PCEP topology config

Change-Id: Ia6e8be1bbe1f822673ab14a8a38307eb516e13f3
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
5 years agoImplement Extended Optional Parameters Length 54/80854/8
Robert Varga [Thu, 14 Mar 2019 11:35:40 +0000 (12:35 +0100)]
Implement Extended Optional Parameters Length

This corrects handling of optional parameters to comply with RFC4271
and adds the ability to use draft-ietf-idr-ext-opt-param-05.

As per the draft, outbound encoding is used only when necessary and
on inbound it is correctly detected when sent by peer.

JIRA: BGPCEP-868
Change-Id: If822d9b9ce4bf982da5f698aac5248b28b0aaa79
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump MDSAL to 4.0.0 84/81384/19
Robert Varga [Thu, 4 Apr 2019 20:33:32 +0000 (22:33 +0200)]
Bump MDSAL to 4.0.0

This bumps MD-SAL references to 4.0.0 and fixes up for API
incompatibilities.

Change-Id: I978a1d8cf05a744115888a4b6a983e517b72dda1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools to 3.0.0 83/81383/14
Robert Varga [Thu, 4 Apr 2019 20:32:47 +0000 (22:32 +0200)]
Bump yangtools to 3.0.0

This bumps yangtools to 3.0.0, making minor adjustements to cope
with the API changes. We also remove checkstyle-logging, as it no
longer ships from yangtools -- spotbugs is more than competent to
handle the validation provided by checkstyle-logging.

Change-Id: I6c4dedcf46a0761d5e2a65fb1a1a25c2d06255fc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump odlparent to 5.0.0 82/81382/11
Robert Varga [Thu, 4 Apr 2019 20:31:31 +0000 (22:31 +0200)]
Bump odlparent to 5.0.0

This bumps all odlparetn references to 5.0.0.

Change-Id: Ia5a4eb29d76d44a9d45d19b026e402f09066e3ef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not use JdkFutureAdapters in BgpPeerRpc 97/81497/1
Robert Varga [Tue, 9 Apr 2019 18:01:47 +0000 (20:01 +0200)]
Do not use JdkFutureAdapters in BgpPeerRpc

ChannelFuture provides listeners, hence we can trivially bridge
results without having to listen in a threadpool.

Change-Id: Ia46c5f406b6be50b9eba293ecf80714db99dabf4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix routing-policy-config 96/81496/1
Robert Varga [Tue, 9 Apr 2019 17:18:55 +0000 (19:18 +0200)]
Fix routing-policy-config

The XML contains illegal constructs, not matching the model, leading
to XML parsing exceptions. Fix that.

Change-Id: I3130f925e862ed9b58db3a32a820cac983770ff5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoProvide RPC to fetch PCEP session stats 07/81107/4
Ajay Lele [Fri, 22 Mar 2019 01:32:49 +0000 (18:32 -0700)]
Provide RPC to fetch PCEP session stats

JIRA: BGPCEP-871
Change-Id: Ia457f3752a004a9abf868d8a53d7c2a46c360263
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
5 years agoRemove use of AttrBuilders 87/81387/1
Robert Varga [Thu, 4 Apr 2019 23:43:35 +0000 (01:43 +0200)]
Remove use of AttrBuilders

We are not interfacing with attributes, there is no point to reference
AttrBuilders, which are going away.

Change-Id: I9a82dca47157fdf492216dde2dc415a16bd6c085
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix logging mismatches 86/81386/1
Robert Varga [Thu, 4 Apr 2019 22:23:19 +0000 (00:23 +0200)]
Fix logging mismatches

Throwables should not be formatted, fix that. Also rework
logging for null tunnels.

Change-Id: I1dbf1b3ce79bbb32b5dbc65b125b405910f7dc88
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix day-1 typo in LU parser registration 33/81333/1
Ajay Lele [Sat, 30 Mar 2019 04:10:44 +0000 (21:10 -0700)]
Fix day-1 typo in LU parser registration

Change-Id: I0400092f70ad64a4f8acc65ec9cb6f9e1a09f3e0
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
5 years agoBGPCEP-695 Make next-hop attribute value mandatory 82/64782/10
Kevin Wang [Thu, 26 Oct 2017 22:59:14 +0000 (15:59 -0700)]
BGPCEP-695 Make next-hop attribute value mandatory

An empty element <ipv4-next-hop /> should not be allowed in input.
When ipv4-next-hop or ipv6-next-hop is specified, the global value
must be provided. If no next-hop is provided, default empty-next-hop
will be used.

Change-Id: Idd01a060750c66a14a4341ae592cf58b4feacf02
Signed-off-by: Kevin Wang <kevixw@gmail.com>
5 years agoUse only our advertized tables to send routes 75/80875/3
Robert Varga [Fri, 15 Mar 2019 06:11:49 +0000 (07:11 +0100)]
Use only our advertized tables to send routes

Previous fix used intersection of advertizements, which is not
accurate: if the peer accepts our proposal, we should be sending
all advertizements, allowing asymmetric setups to work correctly.

JIRA: BGPCEP862
Change-Id: Ie01f2905d76989093b8914fcd08c7a628fa4686a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoInit data-broker before topo-provider registration to prevent NPE 61/80861/2
Ajay Lele [Tue, 12 Mar 2019 22:49:12 +0000 (15:49 -0700)]
Init data-broker before topo-provider registration to prevent NPE

java.lang.NullPointerException: null
        at org.opendaylight.bgpcep.bgp.topology.provider.AbstractTopologyBuilder.initTransactionChain(AbstractTopologyBuilder.java:292)
        at org.opendaylight.bgpcep.bgp.topology.provider.AbstractTopologyBuilder.start(AbstractTopologyBuilder.java:107)
        at org.opendaylight.bgpcep.bgp.topology.provider.config.TopologyReferenceSingletonServiceImpl.instantiateServiceInstance(TopologyReferenceSingletonServiceImpl.java:51)
        . . .

JIRA: BGPCEP-870
Change-Id: Iaec5a537cb5125e1355f197222d9265673d779a9
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
5 years agoDo not allow parameter 255 to be registered 55/80855/1
Robert Varga [Thu, 14 Mar 2019 15:15:11 +0000 (16:15 +0100)]
Do not allow parameter 255 to be registered

Codepoint 255 is claimed by draft-ietf-idr-ext-opt-param and needs
special treatment. Do not allow it to be registered.

Change-Id: I0cdd8f95569ce1b48796c4552b2c90379aa34873
JIRA: BGPCEP-868
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoReduce use of Maps.newHashMap() and Sets.newHashSet() 49/80849/2
Robert Varga [Thu, 14 Mar 2019 10:54:56 +0000 (11:54 +0100)]
Reduce use of Maps.newHashMap() and Sets.newHashSet()

We have the diamond-constructor, which is more explicit, use that
instead of this ancient utility method.

Change-Id: I0685a186e531cafed6f85009ebe795eaea08a049
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not use Lists.newArrayList() 48/80848/3
Robert Varga [Thu, 14 Mar 2019 10:14:02 +0000 (11:14 +0100)]
Do not use Lists.newArrayList()

We have star-constructors, which renders newArrayList() superfluous,
reduce its use.

Change-Id: Id6edab86975a810ad624c138ab74ac7e5623f321
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in ietf-stateful07 47/80847/2
Robert Varga [Thu, 14 Mar 2019 10:04:36 +0000 (11:04 +0100)]
Fix checkstyle in ietf-stateful07

This fixes all offenders and the flips the switch on.

JIRA: BGPCEP-715
Change-Id: I8a7ab1fa50626413cc1294c69bb471a05d97be6f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse ImmutableMap for BGPErrors 50/80850/2
Robert Varga [Thu, 14 Mar 2019 10:57:44 +0000 (11:57 +0100)]
Use ImmutableMap for BGPErrors

This prevents accidental overlaps and improves performance a bit.

Change-Id: Icc6d1227a66c5f287bc95b4a66b7faebfbcc647c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse ImmutableMap for PCEPErrors 46/80846/2
Robert Varga [Thu, 14 Mar 2019 10:13:14 +0000 (11:13 +0100)]
Use ImmutableMap for PCEPErrors

This prevents coding mistakes like duplicate stores and makes
the search a bit more efficient.

Change-Id: I250a8d6a2934f25171183ae0da79c5bc93429a78
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in pcep-segment-routing 45/80845/1
Robert Varga [Thu, 14 Mar 2019 09:40:47 +0000 (10:40 +0100)]
Fix checkstyle in pcep-segment-routing

This fixes the offences and flips the switch on.

JIRA: BGPCEP-715
Change-Id: Id7894f5c0f7a592ed7214debf09af3d74f46ad73
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnforce checkstyle in bgp-linkstate 41/80841/1
Robert Varga [Wed, 13 Mar 2019 14:42:59 +0000 (15:42 +0100)]
Enforce checkstyle in bgp-linkstate

This fixes up a pile of warnings and flips the switch.

JIRA: BGPCEP-713
Change-Id: I0ed6c260558a4fee42c4432da4c137245984c42a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix enable checkstyle in bgp-flowspec 40/80840/2
Robert Varga [Wed, 13 Mar 2019 11:25:22 +0000 (12:25 +0100)]
Fix enable checkstyle in bgp-flowspec

This fixes the violations and flips the switch on.

JIRA: BGPCEP-713
Change-Id: Ia1125469441ea17a8185976bf8a0cd2efab47822
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix SimpleFlowspecIpv4NlriParserTest checkstyle 39/80839/2
Robert Varga [Wed, 13 Mar 2019 11:28:59 +0000 (12:28 +0100)]
Fix SimpleFlowspecIpv4NlriParserTest checkstyle

This is just overly-long lines, reformat to fix it up.

Change-Id: I7daf64e26281c6e7bc4e78a579f13969b09c995c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in RedirectIpNextHopEcHandler 38/80838/2
Robert Varga [Wed, 13 Mar 2019 13:06:35 +0000 (14:06 +0100)]
Fix checkstyle in RedirectIpNextHopEcHandler

Simple offences, like long lines and extra whitespace.

Change-Id: Ib2b5e4fefe4c82073441fdb446d2c67805a69124
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in SimpleFlowspecTypeRegistry 37/80837/2
Robert Varga [Wed, 13 Mar 2019 11:49:32 +0000 (12:49 +0100)]
Fix checkstyle in SimpleFlowspecTypeRegistry

This is just missing whitespace, fix that up.

Change-Id: I99856a89b57ed52478d896a7dc5194a616254025
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in TableTypeActivator 36/80836/2
Robert Varga [Wed, 13 Mar 2019 11:48:43 +0000 (12:48 +0100)]
Fix checkstyle in TableTypeActivator

Simple case of long lines, reformat.

Change-Id: I45c3d1eb5892cf5ff37f3630aa7f8a8847e9c322
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in AbstractFlowspecNlriParser 35/80835/2
Robert Varga [Wed, 13 Mar 2019 11:45:30 +0000 (12:45 +0100)]
Fix checkstyle in AbstractFlowspecNlriParser

- lambda indentation
- split overload methods
- wrong javadoc

Change-Id: I19a4a79474a3a9beb564185dc59e2549ce533abf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnforce bgp-rib-impl checkstyle 13/78813/12
Robert Varga [Fri, 14 Dec 2018 23:34:17 +0000 (00:34 +0100)]
Enforce bgp-rib-impl checkstyle

This patch fixes up remaining violations and flips the switch.

JIRA: BGPCEP-713
Change-Id: Idd37bff2d4156fc6b329302bde0e8eba82ca2efd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix RibImpl checkstyle 34/80834/1
Robert Varga [Wed, 13 Mar 2019 11:16:13 +0000 (12:16 +0100)]
Fix RibImpl checkstyle

RIBImpl cannot really throw an exception, remove the declaration
and remove the corresponding catch block.

Change-Id: I54ebdcc33bf0c2163c646be36b79bb5658da6389
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in LocRibWriter 33/80833/1
Robert Varga [Wed, 13 Mar 2019 11:14:33 +0000 (12:14 +0100)]
Fix checkstyle in LocRibWriter

Just suppress the exception we are logging.

Change-Id: Iba51c10ee4c8034b803150c2a8c4c07fb0ff8981
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in BGPClusterSingletonService 32/80832/1
Robert Varga [Wed, 13 Mar 2019 11:12:42 +0000 (12:12 +0100)]
Fix checkstyle in BGPClusterSingletonService

- do not pass ribImpl around
- rename peers to groupPeers
- suppress warnings on our catch blocks

Change-Id: I5acb95829c4b7d5f802ba5bc34de37a3a1f8e893
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in BGPProtocolSessionPromise 31/80831/1
Robert Varga [Wed, 13 Mar 2019 11:08:15 +0000 (12:08 +0100)]
Fix checkstyle in BGPProtocolSessionPromise

Just suppress the exceptions we are catching here.

Change-Id: I28077afe6e45f238778561ec55dc197b5d972aa9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in BGPPeer 30/80830/1
Robert Varga [Wed, 13 Mar 2019 11:03:26 +0000 (12:03 +0100)]
Fix checkstyle in BGPPeer

- rename session and selectionDeferralTimerSeconds by adding a
  'current' prefix
- rename argument to match super declaration
- refactor session closing to a separate method with checkstyle
  suppression

Change-Id: I1a47f3f184677ecd6166be0da31bfe67f7c543cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in BGPPeerStateImpl 29/80829/1
Robert Varga [Wed, 13 Mar 2019 11:00:19 +0000 (12:00 +0100)]
Fix checkstyle in BGPPeerStateImpl

Rename arguments to not shadow fields.

Change-Id: Ide8ba08aaad590de861a872ebb429f9028ec396b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in CodecsRegistryImpl 28/80828/1
Robert Varga [Wed, 13 Mar 2019 10:58:19 +0000 (11:58 +0100)]
Fix checkstyle in CodecsRegistryImpl

Suppress warning on caught exception and properly log the codec
which caused the failure.

Change-Id: I3d92592c361bf02e264a4debd7da61fb8a328aad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in BgpDeployerImpl 27/80827/1
Robert Varga [Wed, 13 Mar 2019 10:55:51 +0000 (11:55 +0100)]
Fix checkstyle in BgpDeployerImpl

Rename local variable to prevent a clash and suppress warnings
on catch of exception.

Change-Id: I09c01201f59a7d5d676a62d529364dd525e801aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in ApplicationPeer 26/80826/1
Robert Varga [Wed, 13 Mar 2019 10:52:49 +0000 (11:52 +0100)]
Fix checkstyle in ApplicationPeer

Move common parts of write/appear logic so they can be reused in
modify case, eliminating the need for fall-through.

Change-Id: I698c12ef992c5c5ae9abca2a8064a7d0c6e867f2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in BGPSessionStateImpl 19/80819/2
Robert Varga [Wed, 13 Mar 2019 10:43:22 +0000 (11:43 +0100)]
Fix checkstyle in BGPSessionStateImpl

This fixes field shadowing by adding a 'new' prefix.

Change-Id: I666c7475dfc6e0529ebbd47db9420019e3f8fe18
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in BGPSessionImplTest 18/80818/2
Robert Varga [Wed, 13 Mar 2019 10:35:08 +0000 (11:35 +0100)]
Fix checkstyle in BGPSessionImplTest

Rename a local variable and properly assert mocked exception.

Change-Id: I9f5087852f8d6720b9e218debbf86a74edf0942e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in RIBSupportContextRegistry 17/80817/2
Robert Varga [Wed, 13 Mar 2019 10:33:10 +0000 (11:33 +0100)]
Fix checkstyle in RIBSupportContextRegistry

Just move a method to keep overload methods together.

Change-Id: I0790b25224317a1502e771f7c2beefbd43e8697e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in AbstractBGPSessionNegotiator 16/80816/2
Robert Varga [Wed, 13 Mar 2019 10:18:45 +0000 (11:18 +0100)]
Fix checkstyle in AbstractBGPSessionNegotiator

- session refers to instance field
- supress Exception catches
- rename argument

Change-Id: I1647435e13b8ac62b578916faa8a4f5ad8b69ba3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix RIBImpl checkstyle 15/80815/2
Robert Varga [Wed, 13 Mar 2019 10:14:50 +0000 (11:14 +0100)]
Fix RIBImpl checkstyle

This fixes an overly-long line, making checkstyle happier.

Change-Id: Icbcda9f22c27ac38557c197344a1443c4e17e400
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRename BGPRIBStateImpl 14/80814/2
Robert Varga [Wed, 13 Mar 2019 10:12:31 +0000 (11:12 +0100)]
Rename BGPRIBStateImpl

This fixes checkstyle and makes naming consistent, as this class
implements BGPRibState interface.

Change-Id: I995b16c6a7e1a3270f35ed73e57fcfc01d4b0dc1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix AbstractRIBTestSetup checkstyle 13/80813/2
Robert Varga [Wed, 13 Mar 2019 10:10:53 +0000 (11:10 +0100)]
Fix AbstractRIBTestSetup checkstyle

- do not mask exceptions
- rename test listener class

Change-Id: I003d2b67d064cfeda75a1bbf3275fb275baab5fc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix variable naming 12/80812/2
Robert Varga [Wed, 13 Mar 2019 10:07:19 +0000 (11:07 +0100)]
Fix variable naming

This fixes variable names to comply with checkstyle, by either
changing their name or making them static.

Change-Id: I10242c5088d2d1b41321d98c6b3065e3e10e970b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake connectSessionPromise() static 11/80811/2
Robert Varga [Wed, 13 Mar 2019 10:04:12 +0000 (11:04 +0100)]
Make connectSessionPromise() static

This method instantiates a new promise, hence it has no relationship
with the object from which it is being called. Fixes checkstyle
warnings.

Change-Id: I2b5ed703e9234c6faee6fa3ce582c418f0472487
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove OSGi dependency from bgp modules 54/79854/10
Matej Perina [Fri, 11 Jan 2019 09:05:01 +0000 (10:05 +0100)]
Remove OSGi dependency from bgp modules

This change makes modules reusable for projects that
do not use OSGi framework.

BgpPeer, AppPeer and RibImpl creation moved from
blueprint to BgpDeployerImpl.

Change-Id: I1d13ade6f5f8edeb9595ceb94017962401f44ed6
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove superfluous warning 09/80809/1
Robert Varga [Wed, 13 Mar 2019 09:24:48 +0000 (10:24 +0100)]
Remove superfluous warning

Route write path was missing a break; statement, leading to a
warning being emitted when things are perfectly fine.

Change-Id: I418d77ed2efef13c39ee4b40715c1708a45a42fc
JIRA: BGPCEP-869
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnforce outbound parameter/capability length 92/80792/3
Robert Varga [Tue, 12 Mar 2019 12:30:26 +0000 (13:30 +0100)]
Enforce outbound parameter/capability length

Capability and Optional Parameter length fields are only single-byte
entities, limiting the size of capabilities to 255 bytes without
overflow.

Rather than emitting an invalid message, catch this error before
writeout so the operator may make adjustments to ensure this limit
is not exceeded.

JIRA: BGPCEP-867
Change-Id: Idecfcfa1e991aadbdf35cd221f9312dea0f6d0c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDisable LLGR by default 93/80793/2
Robert Varga [Tue, 12 Mar 2019 13:40:33 +0000 (14:40 +0100)]
Disable LLGR by default

LLGR is an unfinished feature and advertizing it by default means
we cannot fit our advertizement into the OPEN message. Disable it
by default, allowing users to test it when they need to.

JIRA: BGPCEP-867
Change-Id: Ife9c4c30125b06c3c8edfe7c884835fd6359d84a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoTake our advertized tables into consideration in RibOut 91/80791/3
Robert Varga [Tue, 12 Mar 2019 11:27:55 +0000 (12:27 +0100)]
Take our advertized tables into consideration in RibOut

Asymmetric configuration of peers can end up with us receiving
tables which we do not advertize towards a peer (but still
process them internally).

In such a case we want to limit adj-rib-out to the intersection
of our advertized and peer-advertized tables.

JIRA: BGPCEP-865
Change-Id: I1b8c0a951c2be513841daf3901ef2b530ed87bf3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd Errata 4493 error codes 62/80762/1
Robert Varga [Mon, 11 Mar 2019 10:35:10 +0000 (11:35 +0100)]
Add Errata 4493 error codes

When we send out a malformed header/update, we may end up receiving
a 1/0 or 3/0 error, which we'll fail to handle on DEBUG level because
we lack the corresponding definition.

Fix this by adding the appropriate references.

JIRA: BGPCEP-864
Change-Id: Ic7437bf34a5e3e6de84f98fc4fd57f8bd1b64bbf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoGuard against torn down peer 59/80759/2
Robert Varga [Mon, 11 Mar 2019 10:04:32 +0000 (11:04 +0100)]
Guard against torn down peer

When we fail to look up peer we should not be throwing a NPE, as we
will end up with inconsistent TransactionChain.

Change-Id: Ia662d4fcb777cce5323fbad820466c9350ec039b
JIRA: BGPCEP-863
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix race between BGP config topology DCN and topology-provider registration 43/80743/1
Ajay Lele [Sat, 9 Mar 2019 00:01:48 +0000 (16:01 -0800)]
Fix race between BGP config topology DCN and topology-provider registration

Change-Id: I827aea0722d1fc97ed066eaeebc705b192f3beb0
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
5 years agoFix EffectiveRibInWriter uptodate handling 69/80569/1
Robert Varga [Mon, 25 Feb 2019 11:19:49 +0000 (12:19 +0100)]
Fix EffectiveRibInWriter uptodate handling

One of the uptodate checking paths was passing entire attributes
rather than just the uptodate leaf. Fix that.

JIRA: BGPCEP-495
Change-Id: Ib66a34d9a97f76234bd2105cd2b985a03f78d7b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd adj-rib-in llgr-stale flag 79/78879/39
Robert Varga [Wed, 19 Dec 2018 18:47:51 +0000 (19:47 +0100)]
Add adj-rib-in llgr-stale flag

Add the ability to signal tables to be LLGR-stale, so that
effective-rib-in can propagate this state properly towards
local rib.

This flag is picked up by before we are applying input policies,
so that routes are transiently marked as LLGR_STALE. The policy
can then decide whether to filter the route or modify its
attributes.

Once the policy has been applied and the flag is set, we check
if NO_LLGR flag is present, and if that is the case, we remove
that route.

This mechanics is required to correctly allow policies to
see LLGR_STALE routes as well as potentially remove the NO_LLGR
flag.

JIRA: BGPCEP-495
Change-Id: Iac9815b29e97aee99a81d015194cd16fb362387d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMove BP xml to OSGI-INF 73/80073/3
Tom Pantelis [Thu, 31 Jan 2019 21:50:08 +0000 (16:50 -0500)]
Move BP xml to OSGI-INF

Change-Id: I328e95b0146376a9fa932135c0b17b757c71c998
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoBump versions by x.y.(z+1) 82/80082/1
jenkins-releng [Fri, 1 Feb 2019 13:06:28 +0000 (13:06 +0000)]
Bump versions by x.y.(z+1)

Change-Id: Ie9d42648fd46a0af79da14ca9a22ea873e3dc717
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
5 years agoUpdate RIB-based constants 89/79989/5
Robert Varga [Tue, 29 Jan 2019 11:20:48 +0000 (12:20 +0100)]
Update RIB-based constants

There are QNames which we are using all over the place, make sure
we concentrate them in a utility holder. Also ensure constants are
suffixed, so we can import them concurrently.

Change-Id: Ie6618aeea776e8278cd7762560636d46ac64bb88
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRework table modification application 55/79955/9
Robert Varga [Sun, 27 Jan 2019 21:54:15 +0000 (22:54 +0100)]
Rework table modification application

This reworks the way a table modification is applied so that we
examine and handle the attributes first -- hence we can understand
that a table has become LLGR_STALE and perform an overwrite.

This also cleans up some the code paths, so they can be optimized
in future, for example the logic for handling route targets.

JIRA: BGPCEP-495
Change-Id: Ic20f55e2fe985b41e971d084ae683eb574b9da33
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOptimize whole-table overwrite 38/79938/15
Robert Varga [Sun, 27 Jan 2019 20:55:01 +0000 (21:55 +0100)]
Optimize whole-table overwrite

When a table is overwritten, we can treat it as a delete followed
by a fill of after-routes. This simplifies the logic quite a bit
and speeds it up. It also allows parts of it to operate on
before/after data rather than a DataTreeCandidateNode, hence it
is a reusable piece we'll need for LLGR_STALE nodes.

JIRA: BGPCEP-495
Change-Id: Ib84296652d84c4616d617583f14e5395058eac1c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not pass explicit TableKey around 86/79986/2
Robert Varga [Tue, 29 Jan 2019 08:08:03 +0000 (09:08 +0100)]
Do not pass explicit TableKey around

TableKey is derived from RIBSupport, hence if we are passing
RIBSupport somewhere, we do not need to pass TableKey, too.

Change-Id: I30b2196cbcf16201f5885c5af9d1f5b2fed8c8d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOptimize deletion of entire adj-rib-in table 32/79932/13
Robert Varga [Fri, 25 Jan 2019 18:43:55 +0000 (19:43 +0100)]
Optimize deletion of entire adj-rib-in table

In case we are deleting an entire table, there is no point in
issuing delete requests for its children.

This refactor eliminates the delete operations, invokes checks
for route target table only once and updates the counters only
once.

This is a stepping stone towards being able to handle LLGR_STALE
routes in an atomic fashion.

JIRA: BGPCEP-495
Change-Id: I3f345cd8764ad83bb39724fbfd42a0bcdc16a009
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix AS number comparison 76/79976/2
Robert Varga [Mon, 28 Jan 2019 18:18:42 +0000 (19:18 +0100)]
Fix AS number comparison

Squashing AS number to an integer makes it possible for it to be
interpreted as a negative number -- which we then fail to squash
to AS_TRANS.

Fix this by forcing the comparison to happen on longs, which does
not suffer from this.

JIRA: BGPCEP-860
Change-Id: Iee10264aef22be70f34b2f122a063331bd0ec142
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFurther cleanup of EffectiveRibInWriter 31/79931/3
Robert Varga [Fri, 25 Jan 2019 18:01:53 +0000 (19:01 +0100)]
Further cleanup of EffectiveRibInWriter

- prevent a potential NPE when empty change is received
- do not store modified children needlessly
- do not log delete duplicates
- do not mask optional to null
- separate out delete/modify/write table methods

Change-Id: I01b340fb3cb3ec0577ccd3856b79388115ff78df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd RIBNodeIdentifiers 30/79930/1
Robert Varga [Fri, 25 Jan 2019 16:56:56 +0000 (17:56 +0100)]
Add RIBNodeIdentifiers

We are allocating constant NodeIdentifiers across the board, some
efficiently, some inefficiently.

Move these constants to a single place where they can be maintained,
optimizing their users.

Change-Id: Ica9f7b299cbcb7f757f4fc7152c916bda58aa63f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup EffectiveRibInWriter 28/79928/1
Robert Varga [Fri, 25 Jan 2019 15:56:42 +0000 (16:56 +0100)]
Cleanup EffectiveRibInWriter

Cleanup argument formatting and remove duplicate key lookup,
as RIBSupport is freely available from RIBSupportContext.

Change-Id: Id99f3c553784647c3f28263b604da9c51864e5a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to mdsal 3.0.6 08/79808/1
Stephen Kitt [Tue, 22 Jan 2019 08:51:00 +0000 (09:51 +0100)]
Bump to mdsal 3.0.6

Change-Id: Ic974f195b06993a955e6884f235ec7befe83258a
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoBump mdsal to 3.0.5 50/79750/4
Robert Varga [Sun, 20 Jan 2019 02:41:03 +0000 (03:41 +0100)]
Bump mdsal to 3.0.5

This aligns with odlparent-4.0.9 and yangtools-2.1.8.

Change-Id: Ie0e9a934feec1e204fe1de3a8cfb7f997a0d94bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools to 2.1.8 48/79748/2
Robert Varga [Sun, 20 Jan 2019 02:36:08 +0000 (03:36 +0100)]
Bump yangtools to 2.1.8

This align with odlparent-4.0.9.

Change-Id: Id057d68ae7cb82300e85aeee78cd18703b304cc7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 4.0.9 62/79662/1
Stephen Kitt [Fri, 18 Jan 2019 15:32:04 +0000 (16:32 +0100)]
Bump to odlparent 4.0.9

Change-Id: Ic87ccbe86130989e442ea9be6fe90bc882fbee7a
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoReuse attributes after apply import policy 91/79491/3
Claudio D. Gasparini [Fri, 11 Jan 2019 23:39:48 +0000 (00:39 +0100)]
Reuse attributes after apply import policy

Update attributes only if there has been any
change applied by import policy. Otherwise
attibutes are the same for the route that
has been already stored.

Change-Id: I288cea16badcd81ce4d5aef21214394421bb992c
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoHandle table deletion under eff-rib-in 98/79498/1
Claudio D. Gasparini [Sun, 13 Jan 2019 13:26:48 +0000 (14:26 +0100)]
Handle table deletion under eff-rib-in

Improve handling of empty tables

Change-Id: If33ad3eea717288f743c8e74e8b5c76263dcc0a3
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoDisable treat-as-withdraw on config example 92/79492/1
Claudio D. Gasparini [Fri, 11 Jan 2019 23:54:23 +0000 (00:54 +0100)]
Disable treat-as-withdraw on config example

given that tears down session with test using
exabgp.

Change-Id: I1d46f942c338c445ddd61591b457b915ceb66bac
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoBump mdsal to 3.0.4 28/79428/2
Robert Varga [Thu, 10 Jan 2019 15:41:29 +0000 (16:41 +0100)]
Bump mdsal to 3.0.4

This realigns odlparent/yangtools/mdsal and brings in the latest
improvements.

Change-Id: Icd864396fb4c0190c5b1311abfd3e1a0f29d8208
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove duplication concepts dependency 42/79442/2
Robert Varga [Thu, 10 Jan 2019 16:04:34 +0000 (17:04 +0100)]
Remove duplication concepts dependency

This fixes a maven warning.

Change-Id: I08f8b6509b4ba5ab2ceb252e44465e608e7fb3e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools to 2.1.7 24/79424/1
Robert Varga [Thu, 10 Jan 2019 15:34:06 +0000 (16:34 +0100)]
Bump yangtools to 2.1.7

This realigns odlparent/yangtools and brings in a few minor
improvements.

Change-Id: I28c6f2b5c2dea41f501fcc479f93eaadd8fc8df7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 4.0.8 72/79372/1
Stephen Kitt [Wed, 9 Jan 2019 14:54:51 +0000 (15:54 +0100)]
Bump to odlparent 4.0.8

Change-Id: Idd2e5a252daef4e17b114d36bad94d8383431d43
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoVerify dataobject is Route 25/79325/2
Claudio D. Gasparini [Tue, 8 Jan 2019 22:22:39 +0000 (23:22 +0100)]
Verify dataobject is Route

before casting when mapping from Normalized node

Change-Id: I4b28b50c42de2c577d325b1f42bd4c435c14592d
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
5 years agoFix feature dependencies 56/79256/1
Robert Varga [Sun, 6 Jan 2019 23:27:03 +0000 (00:27 +0100)]
Fix feature dependencies

Even after migrations, features should depend on odl-mdsal-broker,
not dom-broker, as otherwise they do not correctly squash their
dependencies and they will fail to bring in the implementation.

Change-Id: I4633ed8dacc191f42fad27b8fd624beecf888d2f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse version range for odl-netty-4 55/79255/1
Robert Varga [Sun, 6 Jan 2019 22:34:29 +0000 (23:34 +0100)]
Use version range for odl-netty-4

odlparent features should use ranges, do precisely that.

Change-Id: I4a60dbde4edb2441eb9c0167720bdf7b88bf6831
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unneeded jaxb-api exclusion 54/79254/1
Robert Varga [Sun, 6 Jan 2019 22:28:00 +0000 (23:28 +0100)]
Remove unneeded jaxb-api exclusion

odlparent-4.0.5+ is providing a correct definition, there is no
need to exclude it here.

Change-Id: I837eab31bf2ca4c4d0514051585942fcdbc1b601
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unneeded stax-api 53/79253/1
Robert Varga [Sun, 6 Jan 2019 22:26:52 +0000 (23:26 +0100)]
Remove unneeded stax-api

Normal XML APIs are part of JRE, there is just no need to declare
them explicitly.

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