Search in sources :

Example 1 with NeighborTransportStateAugmentation

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());
}
Also used : NeighborTransportStateAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.NeighborTransportStateAugmentation) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)

Aggregations

IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)1 NeighborTransportStateAugmentation (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.NeighborTransportStateAugmentation)1