}
}
+ grouping neighbor-afi-safi-ll-graceful-restart-state {
+ leaf ll-received {
+ type boolean;
+ description
+ "This leaf indicates whether the neighbor advertised the
+ ability to support long-lived graceful-restart for this AFI-SAFI";
+ }
+ leaf ll-advertised {
+ type boolean;
+ description
+ "This leaf indicates whether the ability to support
+ long-lived graceful-restart has been advertised to the peer";
+ }
+ leaf ll-stale-timer {
+ type uint32;
+ description
+ "Value of timer used during long-lived graceful restart in nseconds.
+ If table is both advertised and received use lower value. Zero value
+ means table is not supported by any side";
+ units seconds;
+ }
+ }
+
augment /netinst:network-instances/netinst:network-instance/netinst:protocols/netinst:protocol {
ext:augment-identifier network-instance-protocol;
uses openconfig-bgp:bgp-top {
augment bgp/neighbors/neighbor/afi-safis/afi-safi/graceful-restart/state {
ext:augment-identifier neighbor-afi-safi-graceful-restart_state-augmentation;
uses bgp-op:bgp-neighbor-afi-safi-graceful-restart_state;
+ uses neighbor-afi-safi-ll-graceful-restart-state;
}
augment bgp/peer-groups/peer-group/state {
ext:augment-identifier peer-group_state-augmentation;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPAfiSafiState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPErrorHandlingState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPGracelfulRestartState;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPLlGracelfulRestartState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPPeerMessagesState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPPeerState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPSessionState;
new NeighborGracefulRestartStateAugmentationBuilder()
.setLocalRestarting(neighbor.isLocalRestarting())
.setPeerRestartTime(neighbor.getPeerRestartTime())
- //.setMode(mode) TBD once implemented
+ .setMode(neighbor.getMode())
.setPeerRestarting(neighbor.isPeerRestarting()).build();
return new GracefulRestartBuilder().setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp
private static org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi
.safi.list.afi.safi.GracefulRestart buildAfiSafiGracefulRestartState(
- @Nonnull final BGPGracelfulRestartState neighbor, @Nonnull final TablesKey tablesKey) {
+ @Nonnull final BGPLlGracelfulRestartState neighbor, @Nonnull final TablesKey tablesKey) {
final NeighborAfiSafiGracefulRestartStateAugmentation builder =
new NeighborAfiSafiGracefulRestartStateAugmentationBuilder()
.setAdvertised(neighbor.isGracefulRestartAdvertized(tablesKey))
- .setReceived(neighbor.isGracefulRestartReceived(tablesKey)).build();
+ .setReceived(neighbor.isGracefulRestartReceived(tablesKey))
+ .setLlAdvertised(neighbor.isLlGracefulRestartAdvertised(tablesKey))
+ .setLlReceived(neighbor.isLlGracefulRestartReceived(tablesKey))
+ .setLlStaleTimer((long) neighbor.getLlGracefulRestartTimer(tablesKey)).build();
return new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi
.safi.list.afi.safi.GracefulRestartBuilder().setState(new org.opendaylight.yang.gen.v1.http.openconfig
.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.graceful.restart.StateBuilder()
doReturn(false).when(this.bgpAfiSafiState).isAfiSafiSupported(eq(TABLES_KEY));
doReturn(false).when(this.bgpAfiSafiState).isGracefulRestartAdvertized(eq(TABLES_KEY));
doReturn(false).when(this.bgpAfiSafiState).isGracefulRestartReceived(eq(TABLES_KEY));
+ doReturn(false).when(this.bgpAfiSafiState).isLlGracefulRestartAdvertised((eq(TABLES_KEY)));
+ doReturn(false).when(this.bgpAfiSafiState).isLlGracefulRestartReceived((eq(TABLES_KEY)));
+ doReturn(0).when(this.bgpAfiSafiState).getLlGracefulRestartTimer((eq(TABLES_KEY)));
+
+
}
@Test
final GracefulRestart graceful = new GracefulRestartBuilder()
.setState(new StateBuilder().addAugmentation(NeighborAfiSafiGracefulRestartStateAugmentation.class,
- new NeighborAfiSafiGracefulRestartStateAugmentationBuilder().setAdvertised(false)
- .setReceived(false).build()).build()).build();
+ new NeighborAfiSafiGracefulRestartStateAugmentationBuilder()
+ .setAdvertised(false)
+ .setReceived(false)
+ .setLlReceived(false)
+ .setLlAdvertised(false)
+ .setLlStaleTimer(0L)
+ .build()).build()).build();
final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi
.list.afi.safi.State afiSafiState = new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafiBuilder;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.GracefulRestartBuilder;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.graceful.restart.StateBuilder;
+import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.operational.rev151009.BgpAfiSafiGracefulRestartState;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.operational.rev151009.BgpNeighborState;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.operational.rev151009.bgp.neighbor.prefix.counters_state.PrefixesBuilder;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.graceful.restart.GracefulRestart;
doReturn(true).when(this.bgpGracelfulRestartState).isLocalRestarting();
doReturn(true).when(this.bgpGracelfulRestartState).isPeerRestarting();
doReturn(this.restartTime).when(this.bgpGracelfulRestartState).getPeerRestartTime();
+ doReturn(BgpAfiSafiGracefulRestartState.Mode.BILATERAL).when(this.bgpGracelfulRestartState).getMode();
doReturn(this.bgpAfiSafiState).when(this.bgpPeerState).getBGPAfiSafiState();
doReturn(Collections.singleton(TABLES_KEY)).when(this.bgpAfiSafiState).getAfiSafisAdvertized();
doReturn(true).when(this.bgpAfiSafiState).isAfiSafiSupported(any());
doReturn(true).when(this.bgpAfiSafiState).isGracefulRestartAdvertized(any());
doReturn(true).when(this.bgpAfiSafiState).isGracefulRestartReceived(any());
+ doReturn(true).when(this.bgpAfiSafiState).isLlGracefulRestartAdvertised(any());
+ doReturn(true).when(this.bgpAfiSafiState).isLlGracefulRestartReceived(any());
+ doReturn(60).when(this.bgpAfiSafiState).getLlGracefulRestartTimer(any());
}
@Override
.setGracefulRestart(new GracefulRestartBuilder().setState(new StateBuilder().setEnabled(false)
.addAugmentation(NeighborAfiSafiGracefulRestartStateAugmentation.class,
new NeighborAfiSafiGracefulRestartStateAugmentationBuilder()
- .setAdvertised(true).setReceived(true).build())
+ .setAdvertised(true)
+ .setReceived(true)
+ .setLlStaleTimer(60L)
+ .setLlAdvertised(true)
+ .setLlReceived(true)
+ .build())
.build()).build())
.setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp
.common.afi.safi.list.afi.safi.StateBuilder().setEnabled(false).addAugmentation(
gracefulAugmentation.setLocalRestarting(false);
gracefulAugmentation.setPeerRestartTime(0);
gracefulAugmentation.setLocalRestarting(true)
- .setPeerRestarting(true).setPeerRestartTime(this.restartTime);
+ .setPeerRestarting(true)
+ .setPeerRestartTime(this.restartTime)
+ .setMode(BgpAfiSafiGracefulRestartState.Mode.BILATERAL);
final GracefulRestart gracefulRestart = new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp
.rev151009.bgp.graceful.restart.GracefulRestartBuilder().setState(new org.opendaylight.yang.gen.v1.http
.openconfig.net.yang.bgp.rev151009.bgp.graceful.restart.graceful.restart.StateBuilder()