@Override protected String ipv4AddressString(final Ipv4Address addr) { return addr.getValue(); }
@Override public void onFailure(Throwable t) { LOG.warn("ARP Request for IP {} was NOT sent from {}.", tpa.getValue(), egressNcIid); } };
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; }
public char[] getValue() { if (_value == null) { if (_ipv4Address != null) { _value = _ipv4Address.getValue().toString().toCharArray(); } else if (_ipv6Address != null) { _value = _ipv6Address.getValue().toString().toCharArray(); } } return _value == null ? null : _value.clone(); }
/** * Creates an UNI node Id with an IP Address. * @param ipAddress The IP address of the UNI * @return A NodeId for a Specific UNI Node Id */ public static NodeId createUniNodeId(IpAddress ipAddress) { return new NodeId(UnimgrConstants.UNI_PREFIX + ipAddress.getIpv4Address().getValue().toString()); }
public List<TpId> getRoute(Endpoints endpoints) { RouteInfoKey routeInfoKey = new RouteInfoKey(endpoints.getSrc().getValue(), endpoints.getDst().getValue()); RouteInfoValue routeInfoValue = this.routeInfo.get(routeInfoKey); if (null == routeInfoValue) { return null; } else { return routeInfoValue.getRoute(); } }
private Flow createIpv4ToIpv4Flow(FlowId flowId, Short tableId, int priority, Ipv4Address srcIp, Ipv4Address dstIp, Long meterId, NodeConnectorRef dstPort) { String flowName = srcIp.getValue() + "|" + dstIp.getValue(); Match match = createIpv4Match(srcIp, dstIp); Instructions instructions; if (meterId != null && meterId > 0) { instructions = createInstructions(dstPort, meterId); } else { instructions = createInstructions(dstPort, NO_METER_SPECIFIED); } return createFlow(flowId,flowName, tableId, priority, match, instructions); }
/** * 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())); }
Boolean isGlobalEqual(final Global global) { final List<AfiSafi> globalAfiSafi = global.getAfiSafis().getAfiSafi(); final AsNumber globalAs = global.getConfig().getAs(); final Ipv4Address globalRouterId = global.getConfig().getRouterId(); return this.afiSafi.containsAll(globalAfiSafi) && globalAfiSafi.containsAll(this.afiSafi) && globalAs.equals(this.asNumber) && globalRouterId.getValue().equals(this.routerId.getValue()); }
@Override protected void add(InstanceIdentifier<Floatingip> identifier, Floatingip input) { if (LOG.isTraceEnabled()) { LOG.trace("Neutron Floating IP created: key: " + identifier + ", value=" + input); } IpAddress fixedIp = input.getFixedIpAddress(); if (fixedIp != null) { addToFloatingIpInfo(input.getRouterId().getValue(), input.getFloatingNetworkId(), input.getPortId() .getValue(), fixedIp.getIpv4Address().getValue(), input.getFloatingIpAddress().getIpv4Address() .getValue()); } }
private static String getStringIpAddress(final IpAddress ipAddress) { if (ipAddress.getIpv4Address() != null) { return ipAddress.getIpv4Address().getValue(); } return ipAddress.getIpv6Address().getValue(); }
@Override protected void remove(InstanceIdentifier<Floatingip> identifier, Floatingip input) { if (LOG.isTraceEnabled()) { LOG.trace("Neutron Floating IP deleted : key: " + identifier + ", value=" + input); } IpAddress fixedIp = input.getFixedIpAddress(); if (fixedIp != null) { clearFromFloatingIpInfo(input.getRouterId().getValue(), input.getPortId().getValue(), fixedIp .getIpv4Address().getValue()); } }
private static String getStringIpAddress(IpAddress ipAddress) { if (ipAddress.getIpv4Address() != null) { return ipAddress.getIpv4Address().getValue(); } return ipAddress.getIpv6Address().getValue(); }
public static String getStringIpAddress(IpAddress ipAddress) { if (ipAddress.getIpv4Address() != null) { return ipAddress.getIpv4Address().getValue(); } return ipAddress.getIpv6Address().getValue(); }
private String getAddressString(final IpAddress address) { Preconditions.checkArgument(address.getIpv4Address() != null || address.getIpv6Address() != null, "Address %s is invalid", address); if (address.getIpv4Address() != null) { return address.getIpv4Address().getValue(); } return address.getIpv6Address().getValue(); }
public static String touniqueIpAddress(TypedAddressData ipAddress) { if (ipAddress.getAddress() instanceof Ipv4AddressData) { return ((Ipv4AddressData) ipAddress.getAddress()).getIpv4().getValue().replaceAll("^ipv4:", ""); } if (ipAddress.getAddress() instanceof Ipv6AddressData) { return uniqueIpv6String( ((Ipv6AddressData) ipAddress.getAddress()).getIpv6(). getValue().replaceAll("^ipv6:", "")); } return null; } }
private InetSocketAddress getAddress() { final InetAddress inetAddr; try { inetAddr = InetAddress.getByName(getBindingAddress() .getIpv4Address() != null ? getBindingAddress() .getIpv4Address().getValue() : getBindingAddress() .getIpv6Address().getValue()); } catch (final UnknownHostException e) { throw new IllegalArgumentException("Illegal binding address " + getBindingAddress(), e); } return new InetSocketAddress(inetAddr, getBindingPort().getValue()); }
/** * Creates {@link ArpMatch} containing Reply ARP operation, THA and TPA for the given target * address and SPA for the given sender protocol address */ public static ArpMatch createArpMatch(ArpMessageAddress targetAddress, Ipv4Address senderProtocolAddress) { return new ArpMatchBuilder().setArpOp(ArpOperation.REPLY.intValue()) .setArpTargetHardwareAddress( new ArpTargetHardwareAddressBuilder().setAddress(targetAddress.getHardwareAddress()).build()) .setArpTargetTransportAddress(new Ipv4Prefix(targetAddress.getProtocolAddress().getValue() + HOST_MASK)) .setArpSourceTransportAddress(new Ipv4Prefix(senderProtocolAddress.getValue() + HOST_MASK)) .build(); }
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; }
public static Action setIpv4DstAction(Ipv4Address ipAddress) { Ipv4Builder ipDest = new Ipv4Builder(); Ipv4Prefix prefixdst = new Ipv4Prefix(new Ipv4Prefix(ipAddress.getValue() + "/32")); ipDest.setIpv4Address(prefixdst); SetNwDstActionBuilder setNwDstActionBuilder = new SetNwDstActionBuilder(); setNwDstActionBuilder.setAddress(ipDest.build()); return new SetNwDstActionCaseBuilder().setSetNwDstAction(setNwDstActionBuilder.build()).build(); }