Sanitize flowspec parsing 29/105629/2
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 23 Apr 2023 17:26:19 +0000 (19:26 +0200)
committerRobert Varga <nite@hq.sk>
Sun, 23 Apr 2023 20:55:12 +0000 (20:55 +0000)
commit6784279cf7433c1a3a203ab5df91c434e93d46e0
treedc83b461fa2408f0d26260fb0712f87993e4ea56
parentc28b4c26f2195f83c35470dbcb64ad2cfbbc77fa
Sanitize flowspec parsing

Flowspec support performs a rather ugly indirection through Object[] to
deal with the fact that base and L3VPN routes have different structure.

The problem core issue here is lack of proper specialization, where
AbstractFlowspec{NlriParser,RIBSupport} really cater to plain Ipv4/Ipv6
supports -- and thus there is no simple-specific meeting point.

Introduce AbstractFlowspecIp{NlriParser,RIBSupport} to act as proper
specialization, which allows us to structure the code correctly.

This patch deals with the parsing path, leaving the serialization path
to a follow-up.

Change-Id: Ifdc3241c9f87c06eec112550103e67b26973c80f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 files changed:
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecIpNlriParser.java [new file with mode: 0644]
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecIpRIBSupport.java [new file with mode: 0644]
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecNlriParser.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecRIBSupport.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv4RIBSupport.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv6RIBSupport.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParser.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv6NlriParser.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/AbstractFlowspecL3vpnNlriParser.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/AbstractFlowspecL3vpnRIBSupport.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/ipv4/FlowspecL3vpnIpv4NlriParser.java
bgp/extensions/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/ipv6/FlowspecL3vpnIpv6NlriParser.java