use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.NeighborTransportStateAugmentation in project bgpcep by opendaylight.
the class NeighborStateCliUtils method printTransportState.
private static void printTransportState(final Transport transport, final ShellTable table) {
if (transport == null) {
return;
}
final NeighborTransportStateAugmentation state = transport.getState().getAugmentation(NeighborTransportStateAugmentation.class);
if (state == null) {
return;
}
addHeader(table, "Transport state");
final IpAddress remoteAddress = state.getRemoteAddress();
final String stringRemoteAddress;
if (remoteAddress.getIpv4Address() == null) {
stringRemoteAddress = remoteAddress.getIpv6Address().getValue();
} else {
stringRemoteAddress = remoteAddress.getIpv4Address().getValue();
}
table.addRow().addContent("Remote Address", stringRemoteAddress);
table.addRow().addContent("Remote Port", state.getRemotePort().getValue());
table.addRow().addContent("Local Port", state.getLocalPort().getValue());
}
Aggregations