@Override protected String ipv4AddressString(final Ipv4Address addr) { return addr.getValue(); }
@Override public Ipv4Address getBgpId() { return new Ipv4Address("127.0.0.1"); }
/** * Increment Address * * @param ipv4Address ipv4 address to be incremented * @return new ipv4 address */ public static Ipv4Address incrementIpv4Address(final Ipv4Address ipv4Address) { return new Ipv4Address(incrementIpv4Address(ipv4Address.getValue())); }
public ServiceFunctionForwarder getExistingSFF(String ipAddress) { ServiceFunctionForwarders existingSffs = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, sffIid); if (existingSffs != null && existingSffs.getServiceFunctionForwarder() != null && !existingSffs.getServiceFunctionForwarder().isEmpty()) { List<ServiceFunctionForwarder> existingSffList = existingSffs.getServiceFunctionForwarder(); for (ServiceFunctionForwarder sff : existingSffList) { if (sff.getIpMgmtAddress().getIpv4Address().equals(new Ipv4Address(ipAddress))) { return sff; } } } return null; }
private static BgpApplicationPeerBuilder toBgpPeerConfig(final Neighbor neighbor, final TargetRib rib) { final BgpApplicationPeerBuilder bgpAppPeerBuilder = new BgpApplicationPeerBuilder(); bgpAppPeerBuilder.setTargetRib(rib); final Ipv4Address address = neighbor.getNeighborAddress().getIpv4Address(); bgpAppPeerBuilder.setBgpPeerId(new BgpId(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715. Ipv4Address(address.getValue()))); bgpAppPeerBuilder.setApplicationRibId(new ApplicationRibId(createAppRibName(address))); return bgpAppPeerBuilder; }
@Override public void onFailure(Throwable t) { LOG.warn("ARP Request for IP {} was NOT sent from {}.", tpa.getValue(), egressNcIid); } };
public static Ipv4Address getDefaultInstance(String defaultValue) { return new Ipv4Address(defaultValue); }
private @Nullable Ipv4Address createSenderIpAddress(EndpointL3 l3Ep, ReadTransaction rTx) { Subnet subnetOfL3Ep = readSubnet(l3Ep, rTx); if (subnetOfL3Ep == null) { return null; } SubnetInfo subnetInfo = new SubnetUtils(subnetOfL3Ep.getIpPrefix().getIpv4Prefix().getValue()).getInfo(); String senderIp = subnetInfo.getHighAddress(); if (senderIp.equals(l3Ep.getKey().getIpAddress().getIpv4Address().getValue())) { senderIp = subnetInfo.getLowAddress(); } return new Ipv4Address(senderIp); }
@Override public void onFailure(Throwable t) { LOG.warn("ARP Request for IP {} was NOT sent from {}.", tpa.getValue(), ncIid); } };
public static Ipv4Address getDefaultInstance(String defaultValue) { return new Ipv4Address(defaultValue); }
private static Neighbor toAppNeighbor(final BGPAppPeerInstanceConfiguration config) { final IpAddress ipAddress = new IpAddress(new Ipv4Address(config.getBgpId().getValue())); return new NeighborBuilder() .setNeighborAddress(ipAddress) .setKey(new NeighborKey(ipAddress)) .setConfig( new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.ConfigBuilder() .addAugmentation(Config1.class, new Config1Builder().setPeerGroup(OpenConfigUtil.APPLICATION_PEER_GROUP_NAME).build()) .build()) .build(); } }
@Override public void onSuccess(RpcResult<Void> result) { LOG.debug("ARP Request for IP {} was sent from {}.", tpa.getValue(), ncIid); }
public static @Nullable Ipv4Address bytesToIp(byte[] ipv4AsBytes) { try { return new Ipv4Address(InetAddress.getByAddress(ipv4AsBytes).getHostAddress()); } catch (UnknownHostException e) { return null; } }
@Override public void onSuccess(RpcResult<Void> result) { LOG.debug("ARP Request for IP {} was sent from {}.", tpa.getValue(), egressNcIid); }
public static @Nullable Ipv4Address bytesToIp(byte[] ipv4AsBytes) { try { return new Ipv4Address(InetAddress.getByAddress(ipv4AsBytes).getHostAddress()); } catch (UnknownHostException e) { return null; } }
public RrClusterIdType(Ipv4Address _ipv4Address) { super(); this._ipv4Address = _ipv4Address; this._uint32 = null; this._value = _ipv4Address.getValue().toString().toCharArray(); }
public static @Nullable Ipv4Address bytesToIp(byte[] ipv4AsBytes) { try { return new Ipv4Address(InetAddress.getByAddress(ipv4AsBytes).getHostAddress()); } catch (UnknownHostException e) { return null; } }
public IpAddress(Ipv4Address _ipv4Address) { super(); this._ipv4Address = _ipv4Address; this._ipv6Address = null; this._value = _ipv4Address.getValue().toString().toCharArray(); }
/** * Converts a byte array to a {@link Ipv4Address} object. * @param ipv4AsBytes byte array * @return ip as a {@link Ipv4Address} object */ public static Ipv4Address bytesToIp(byte[] ipv4AsBytes) { try { return new Ipv4Address(InetAddress.getByAddress(ipv4AsBytes).getHostAddress()); } catch (UnknownHostException e) { LOG.error("Failed to convert bytes to IP", e); return null; } }
private Inet4Address getInet4Address( final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address address) { if (address != null) { final InetAddress out = getByName(address.getValue()); if (out != null && out instanceof Inet4Address) { return (Inet4Address) out; } } return null; }