@Override protected String ipv4AddressString(final Ipv4Address addr) { return addr.getValue(); }
public static Ipv4Address getDefaultInstance(String defaultValue) { return new Ipv4Address(defaultValue); }
return false; } else if(!_ipv4Address.equals(other._ipv4Address)) { return false;
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_forwardingAddress == null) ? 0 : _forwardingAddress.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); hash = result; hashValid = true; return result; }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_forwardingAddress == null) ? 0 : _forwardingAddress.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); hash = result; hashValid = true; return result; }
public IpAddress(Ipv4Address _ipv4Address) { super(); this._ipv4Address = _ipv4Address; this._ipv6Address = null; this._value = _ipv4Address.getValue().toString().toCharArray(); }
public static Ipv4Address getDefaultInstance(String defaultValue) { return new Ipv4Address(defaultValue); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_ipv4Address == null) ? 0 : _ipv4Address.hashCode()); result = prime * result + ((_ipv6Address == null) ? 0 : _ipv6Address.hashCode()); result = prime * result + ((_value == null) ? 0 : Arrays.hashCode(_value)); return result; }
return false; } else if(!_forwardingAddress.equals(other.getForwardingAddress())) { return false;
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(); }
public static boolean isValid(String val, int type, String name) { switch (type) { case INT : try { int i = Integer.parseInt(val); } catch (NumberFormatException nme) { System.err.println("error: value of "+name+" is not an integer"); return false; } break; case IPADDR: try { Ipv4Address addr = new Ipv4Address(val); } catch (Exception e) { System.err.println("error: value of "+name+" is not an IP address"); return false; } break; default: return false; } return true; }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_afi == null) ? 0 : _afi.hashCode()); result = prime * result + ((_ipv4Address == null) ? 0 : _ipv4Address.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); hash = result; hashValid = true; return result; }
return false; } else if(!_forwardingAddress.equals(other.getForwardingAddress())) { return false;
protected synchronized void remove(InstanceIdentifier<Neighbors> iid, Neighbors val) { LOG.debug("received remove Neighbors config val {}", val.getAddress().getValue()); synchronized(BgpConfigurationManager.this) { BgpRouter br = getClient(yangObj); if (br == null) { return; } String peerIp = val.getAddress().getValue(); try { //itmProvider.deleteTunnelsToDCGW(new IpAddress(val.getAddress().getValue().toCharArray())); br.delNeighbor(peerIp); } catch (Exception e) { LOG.error(yangObj+" Delete received exception: \""+e+"\"; " +delWarn); } } }
public static IpAddress getDefaultInstance(final String defaultValue) { final Matcher ipv4Matcher = IPV4_PATTERN.matcher(defaultValue); if (ipv4Matcher.matches()) { if (IPV6_PATTERN1.matcher(defaultValue).matches() && IPV6_PATTERN2.matcher(defaultValue).matches()) { throw new IllegalArgumentException( String.format("Cannot create IpAddress from \"%s\", matches both %s and %s", defaultValue, Ipv4Address.class.getSimpleName(), Ipv6Address.class.getSimpleName())); } return new IpAddress(new Ipv4Address(defaultValue)); } else if (IPV6_PATTERN1.matcher(defaultValue).matches() && IPV6_PATTERN2.matcher(defaultValue).matches()) { return new IpAddress(new Ipv6Address(defaultValue)); } else { throw new IllegalArgumentException("Cannot create IpAddress from " + defaultValue); } }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_afi == null) ? 0 : _afi.hashCode()); result = prime * result + ((_ipv4Address == null) ? 0 : _ipv4Address.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); hash = result; hashValid = true; return result; }
return false; } else if(!_ipv4Address.equals(other.getIpv4Address())) { return false;
protected synchronized void add(InstanceIdentifier<UpdateSource> iid, UpdateSource val) { LOG.debug("received add UpdateSource config val {}", val.getSourceIp().getValue()); synchronized(BgpConfigurationManager.this) { BgpRouter br = getClient(yangObj); if (br == null) { return; } String peerIp = val.getPeerIp().getValue(); try { br.addUpdateSource(peerIp, val.getSourceIp().getValue()); } catch (Exception e) { LOG.error(yangObj+"Add received exception: \""+e+"\"; " +addWarn); } } }
public static IpAddress getDefaultInstance(final String defaultValue) { final Matcher ipv4Matcher = IPV4_PATTERN.matcher(defaultValue); if (ipv4Matcher.matches()) { if (IPV6_PATTERN1.matcher(defaultValue).matches() && IPV6_PATTERN2.matcher(defaultValue).matches()) { throw new IllegalArgumentException( String.format("Cannot create IpAddress from \"%s\", matches both %s and %s", defaultValue, Ipv4Address.class.getSimpleName(), Ipv6Address.class.getSimpleName())); } return new IpAddress(new Ipv4Address(defaultValue)); } else if (IPV6_PATTERN1.matcher(defaultValue).matches() && IPV6_PATTERN2.matcher(defaultValue).matches()) { return new IpAddress(new Ipv6Address(defaultValue)); } else { throw new IllegalArgumentException("Cannot create IpAddress from " + defaultValue); } }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_ipv4LocalAddress == null) ? 0 : _ipv4LocalAddress.hashCode()); result = prime * result + ((_ipv6LocalAddress == null) ? 0 : _ipv6LocalAddress.hashCode()); result = prime * result + ((_pccCapabilities == null) ? 0 : _pccCapabilities.hashCode()); result = prime * result + ((_teRouterIdIpv4 == null) ? 0 : _teRouterIdIpv4.hashCode()); result = prime * result + ((_teRouterIdIpv6 == null) ? 0 : _teRouterIdIpv6.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); hash = result; hashValid = true; return result; }