Java Code Examples for org.onosproject.net.host.InterfaceIpAddress#ipAddress()
The following examples show how to use
org.onosproject.net.host.InterfaceIpAddress#ipAddress() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PeerConnectivityManager.java From onos with Apache License 2.0 | 5 votes |
private Collection<PointToPointIntent> buildSpeakerIntents(BgpConfig.BgpSpeakerConfig speaker, EncapsulationType encap) { List<PointToPointIntent> intents = new ArrayList<>(); // Get the BGP Speaker VLAN Id VlanId bgpSpeakerVlanId = speaker.vlan(); for (IpAddress peerAddress : speaker.peers()) { Interface peeringInterface = interfaceService.getMatchingInterface(peerAddress); if (peeringInterface == null) { log.debug("No peering interface found for peer {} on speaker {}", peerAddress, speaker); continue; } IpAddress bgpSpeakerAddress = null; for (InterfaceIpAddress address : peeringInterface.ipAddressesList()) { if (address.subnetAddress().contains(peerAddress)) { bgpSpeakerAddress = address.ipAddress(); break; } } checkNotNull(bgpSpeakerAddress); VlanId peerVlanId = peeringInterface.vlan(); intents.addAll(buildIntents(speaker.connectPoint(), bgpSpeakerVlanId, bgpSpeakerAddress, peeringInterface.connectPoint(), peerVlanId, peerAddress, encap)); } return intents; }
Example 2
Source File: PimInterface.java From onos with Apache License 2.0 | 5 votes |
/** * Return a single "best" IP address. * * @return the chosen IP address or null if none */ public IpAddress getIpAddress() { if (onosInterface.ipAddressesList().isEmpty()) { return null; } IpAddress ipaddr = null; for (InterfaceIpAddress ifipaddr : onosInterface.ipAddressesList()) { ipaddr = ifipaddr.ipAddress(); break; } return ipaddr; }