Fix parsing issue of PcReport Objects 78/96978/6
authorOlivier Dugeon <olivier.dugeon@orange.com>
Wed, 21 Jul 2021 16:52:23 +0000 (18:52 +0200)
committerRobert Varga <nite@hq.sk>
Fri, 10 Sep 2021 09:33:18 +0000 (09:33 +0000)
commitea833a352533c0a0643dc9ee79a87477e2c33be4
tree7d718ef13accf683e0dab8908a92f985d2da3b2c
parent3411c37dec079573d2fe54982df26ad2aa2b9cc6
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
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/StatefulPCReportMessageParser.java
pcep/ietf-stateful/src/test/java/org/opendaylight/protocol/pcep/ietf/PCEPValidatorTest.java
pcep/ietf-stateful/src/test/resources/PCRpt.4.bin [new file with mode: 0644]