use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafi in project bgpcep by opendaylight.
the class OpenConfigMappingUtil method toPathSelectionMode.
public static Map<BgpTableType, PathSelectionMode> toPathSelectionMode(final List<AfiSafi> afiSafis, final BGPTableTypeRegistryConsumer tableTypeRegistry, final BGPPeerTracker peerTracker) {
final Map<BgpTableType, PathSelectionMode> pathSelectionModes = new HashMap<>();
for (final AfiSafi afiSafi : afiSafis) {
final BgpNeighborAddPathsConfig afiSafi2 = afiSafi.getAugmentation(GlobalAddPathsConfig.class);
if (afiSafi2 != null) {
final Optional<BgpTableType> bgpTableType = tableTypeRegistry.getTableType(afiSafi.getAfiSafiName());
if (bgpTableType.isPresent()) {
final Short sendMax = afiSafi2.getSendMax();
final PathSelectionMode selectionMode;
if (sendMax > 1) {
selectionMode = new AddPathBestNPathSelection(sendMax.longValue(), peerTracker);
} else {
selectionMode = new AllPathSelection(peerTracker);
}
pathSelectionModes.put(bgpTableType.get(), selectionMode);
}
}
}
return pathSelectionModes;
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafi in project bgpcep by opendaylight.
the class RibImpl method isGlobalEqual.
Boolean isGlobalEqual(final Global global) {
final List<AfiSafi> globalAfiSafi = getAfiSafiWithDefault(global.getAfiSafis(), true);
final Config globalConfig = global.getConfig();
final AsNumber globalAs = globalConfig.getAs();
final Ipv4Address globalRouterId = global.getConfig().getRouterId();
final ClusterIdentifier globalClusterId = getGlobalClusterIdentifier(globalConfig);
return this.afiSafi.containsAll(globalAfiSafi) && globalAfiSafi.containsAll(this.afiSafi) && globalAs.equals(this.asNumber) && globalRouterId.getValue().equals(this.routerId.getValue()) && globalClusterId.getValue().equals(this.clusterId.getValue());
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafi in project bgpcep by opendaylight.
the class GlobalStateCliUtils method displayRibOperationalState.
static void displayRibOperationalState(@NonNull final String ribId, @NonNull final Global global, @NonNull final PrintStream stream) {
final State globalState = global.getState();
final ShellTable table = new ShellTable();
table.column("Attribute").alignLeft();
table.column("Value").alignLeft();
addHeader(table, "RIB state");
table.addRow().addContent("Router Id", ribId);
table.addRow().addContent("As", globalState.getAs());
table.addRow().addContent("Total Paths", globalState.getTotalPaths());
table.addRow().addContent("Total Prefixes", globalState.getTotalPrefixes());
global.getAfiSafis().getAfiSafi().forEach(afiSafi -> displayAfiSafi(afiSafi, table));
table.print(stream);
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafi in project bgpcep by opendaylight.
the class GlobalStateCliUtils method displayAfiSafi.
private static void displayAfiSafi(final AfiSafi afiSafi, final ShellTable table) {
final GlobalAfiSafiStateAugmentation state = afiSafi.getState().getAugmentation(GlobalAfiSafiStateAugmentation.class);
addHeader(table, "AFI/SAFI state");
table.addRow().addContent("Family", afiSafi.getAfiSafiName().getSimpleName());
if (state == null) {
return;
}
table.addRow().addContent("Total Paths", state.getTotalPaths());
table.addRow().addContent("Total Prefixes", state.getTotalPrefixes());
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafi in project bgpcep by opendaylight.
the class NeighborStateCliUtils method printAfiSafiState.
private static void printAfiSafiState(final AfiSafi afiSafi, final ShellTable table) {
final NeighborAfiSafiStateAugmentation state = afiSafi.getState().getAugmentation(NeighborAfiSafiStateAugmentation.class);
addHeader(table, "AFI state");
table.addRow().addContent("Family", afiSafi.getAfiSafiName().getSimpleName());
table.addRow().addContent("Active", state.isActive());
final Prefixes prefixes = state.getPrefixes();
if (prefixes == null) {
return;
}
table.addRow().addContent("Prefixes", "");
table.addRow().addContent("Installed", prefixes.getInstalled());
table.addRow().addContent("Sent", prefixes.getSent());
table.addRow().addContent("Received", prefixes.getReceived());
}
Aggregations