+
+ @Test
+ public void testRecvdUnsupportedSafi() {
+ final byte[] capaBytes = {
+ //header
+ (byte) 0x47, (byte) 0x15,
+ // Ipv4 Unicast, afiFlags = false, timer = 10
+ (byte) 0x00, (byte) 0x01, (byte) 0x01,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0a,
+ // Unsupported safi, afiFlags = true, timer = 160
+ (byte) 0x00, (byte) 0x01, (byte) 0x85,
+ (byte) 0x80, (byte) 0x00, (byte) 0x00, (byte) 0xa0,
+ //Ipv6 Unicast afiFlags = false, timer = 160
+ (byte) 0x00, (byte) 0x02, (byte) 0x01,
+ (byte) 0x80, (byte) 0x00, (byte) 0x00, (byte) 0xa0
+ };
+
+ final LlGracefulRestartCapability capability = new LlGracefulRestartCapabilityBuilder()
+ .setTables(Arrays.asList(new TablesBuilder()
+ .setAfi(Ipv4AddressFamily.class)
+ .setSafi(UnicastSubsequentAddressFamily.class)
+ .setAfiFlags(new Tables.AfiFlags(Boolean.FALSE))
+ .setLongLivedStaleTime(TEN)
+ .build(),
+ new TablesBuilder()
+ .setAfi(Ipv6AddressFamily.class)
+ .setSafi(UnicastSubsequentAddressFamily.class)
+ .setAfiFlags(new Tables.AfiFlags(Boolean.TRUE))
+ .setLongLivedStaleTime(new Uint24(Uint32.valueOf(160)))
+ .build())).build();
+
+ final CParameters cParameters = new CParametersBuilder().addAugmentation(CParameters1.class,
+ new CParameters1Builder().setLlGracefulRestartCapability(capability).build()).build();
+ LlGracefulCapabilityHandler handler1 = new LlGracefulCapabilityHandler(
+ afir, safir);
+ Assert.assertEquals(cParameters, handler1.parseCapability(Unpooled.wrappedBuffer(capaBytes)
+ .slice(2, capaBytes.length - 2)));
+ }