[CORD-630] IPv6 filtering rules
Changes:
- Udpates TMAC table in order to handle IPv6 protocol;
- Updates ACL table in order to handle ICMPv6 traffic and traffic for the router;
- Udpates UNICAST table in order to handle the traffic towards the other routers;
- Updates the router ip in the netcfg in order to handle IPv6 address;
- Substitutes IpAddress and IpPrefix in many parts;
- Updates cpqd and ofdpa drivers to handle the above cases;
- Fixes the interaction with NRM when neighbordiscovery is activated;
- Introduces the IPv6 loopback and IPv6 node sid;
Change-Id: I0a3003be6f2f4b581cabe224c47a0cfbf51e8f9c
diff --git a/apps/segmentrouting/src/test/java/org/onosproject/segmentrouting/config/SegmentRoutingDeviceConfigTest.java b/apps/segmentrouting/src/test/java/org/onosproject/segmentrouting/config/SegmentRoutingDeviceConfigTest.java
index 74f6498..7f165d8 100644
--- a/apps/segmentrouting/src/test/java/org/onosproject/segmentrouting/config/SegmentRoutingDeviceConfigTest.java
+++ b/apps/segmentrouting/src/test/java/org/onosproject/segmentrouting/config/SegmentRoutingDeviceConfigTest.java
@@ -41,6 +41,7 @@
*/
public class SegmentRoutingDeviceConfigTest {
private SegmentRoutingDeviceConfig config;
+ private SegmentRoutingDeviceConfig ipv6Config;
private Map<Integer, Set<Integer>> adjacencySids1;
private Map<Integer, Set<Integer>> adjacencySids2;
@@ -48,6 +49,8 @@
public void setUp() throws Exception {
InputStream jsonStream = SegmentRoutingDeviceConfigTest.class
.getResourceAsStream("/device.json");
+ InputStream ipv6JsonStream = SegmentRoutingDeviceConfigTest.class
+ .getResourceAsStream("/device-ipv6.json");
adjacencySids1 = new HashMap<>();
Set<Integer> ports1 = new HashSet<>();
@@ -68,10 +71,20 @@
String key = "segmentrouting";
ObjectMapper mapper = new ObjectMapper();
JsonNode jsonNode = mapper.readTree(jsonStream);
+ JsonNode ipv6JsonNode = mapper.readTree(ipv6JsonStream);
ConfigApplyDelegate delegate = new MockDelegate();
config = new SegmentRoutingDeviceConfig();
config.init(subject, key, jsonNode, mapper, delegate);
+
+ ipv6Config = new SegmentRoutingDeviceConfig();
+ ipv6Config.init(subject, key, ipv6JsonNode, mapper, delegate);
+ }
+
+ @Test
+ public void testIsValid() {
+ assertTrue(config.isValid());
+ assertTrue(ipv6Config.isValid());
}
@Test
@@ -89,13 +102,19 @@
@Test
public void testRouterIp() throws Exception {
- assertThat(config.routerIp(), is(IpAddress.valueOf("10.0.1.254")));
+ assertThat(config.routerIpv4(), is(IpAddress.valueOf("10.0.1.254")));
+ assertThat(ipv6Config.routerIpv4(), is(IpAddress.valueOf("10.0.1.254")));
+ assertThat(ipv6Config.routerIpv6(), is(IpAddress.valueOf("2000::c0a8:0101")));
}
@Test
public void testSetRouterIp() throws Exception {
- config.setRouterIp("10.0.2.254");
- assertThat(config.routerIp(), is(IpAddress.valueOf("10.0.2.254")));
+ config.setRouterIpv4("10.0.2.254");
+ assertThat(config.routerIpv4(), is(IpAddress.valueOf("10.0.2.254")));
+ ipv6Config.setRouterIpv4("10.0.2.254");
+ assertThat(ipv6Config.routerIpv4(), is(IpAddress.valueOf("10.0.2.254")));
+ ipv6Config.setRouterIpv6("2000::c0a9:0101");
+ assertThat(ipv6Config.routerIpv6(), is(IpAddress.valueOf("2000::c0a9:0101")));
}
@Test
@@ -111,13 +130,19 @@
@Test
public void testNodeSid() throws Exception {
- assertThat(config.nodeSid(), is(101));
+ assertThat(config.nodeSidIPv4(), is(101));
+ assertThat(ipv6Config.nodeSidIPv4(), is(101));
+ assertThat(ipv6Config.nodeSidIPv6(), is(111));
}
@Test
public void testSetNodeSid() throws Exception {
- config.setNodeSid(200);
- assertThat(config.nodeSid(), is(200));
+ config.setNodeSidIPv4(200);
+ assertThat(config.nodeSidIPv4(), is(200));
+ ipv6Config.setNodeSidIPv4(200);
+ assertThat(ipv6Config.nodeSidIPv4(), is(200));
+ ipv6Config.setNodeSidIPv6(201);
+ assertThat(ipv6Config.nodeSidIPv6(), is(201));
}
@Test
@@ -144,7 +169,7 @@
private class MockDelegate implements ConfigApplyDelegate {
@Override
- public void onApply(Config config) {
+ public void onApply(Config configFile) {
}
}
-}
\ No newline at end of file
+}