private InetAddress getNetMask() { SnmpValue value = getValue(IP_ADDR_ENT_NETMASK); return value == null ? null : value.toInetAddress(); }
public InetAddress getIPAddress(String key) { SnmpValue val = getValue(key); return (val == null ? null : val.toInetAddress()); }
/** * <p>getIpNetToMediaNetAddress</p> * * @return a {@link java.net.InetAddress} object. */ public InetAddress getIpNetToMediaNetAddress(){ SnmpValue value = getValue(IPNETTOMEDIA_TABLE_NETADDR); if (value == null) { return null; } return value.toInetAddress(); }
public InetAddress getOspfNbrIpAddress() { return getValue(OSPF_NBR_IPADDRESS).toInetAddress(); }
public InetAddress getOspfIpAddress() { return getValue(OSPF_IF_IPADDRESS).toInetAddress(); }
public InetAddress getIPAddress(String key) { SnmpValue val = getValue(key); return (val == null ? null : val.toInetAddress()); }
private InetAddress getNetMask() { SnmpValue value = getValue(IP_ADDR_ENT_NETMASK); return value == null ? null : value.toInetAddress(); }
public InetAddress getOspfNbrRouterId() { return getValue(OSPF_NBR_ROUTERID).toInetAddress(); }
public static InetAddress getEffectiveTrapAddress(TrapInformation trapInfo, boolean useAddressFromVarbind) { if (useAddressFromVarbind) { final SnmpVarBindDTO varBindDTO = getFirstVarBindWithOid(trapInfo, SNMP_TRAP_ADDRESS_OID); if (varBindDTO != null) { return varBindDTO.getSnmpValue().toInetAddress(); } } return trapInfo.getTrapAddress(); }
public static InetAddress getEffectiveTrapAddress(TrapInformation trapInfo, boolean useAddressFromVarbind) { if (useAddressFromVarbind) { final SnmpVarBindDTO varBindDTO = getFirstVarBindWithOid(trapInfo, SNMP_TRAP_ADDRESS_OID); if (varBindDTO != null) { return varBindDTO.getSnmpValue().toInetAddress(); } } return trapInfo.getTrapAddress(); }
public OspfLink get(OspfLink link) { //use point to point by default link.setOspfIpMask(InetAddressUtils.addr("255.255.255.252")); List<SnmpValue> val = get(link.getOspfIpAddr()); if (val != null && val.size() == 2 ) { if (!val.get(0).isNull() && val.get(0).isNumeric() ) link.setOspfIfIndex(val.get(0).toInt()); if (!val.get(1).isNull() && !val.get(1).isError()) { try { link.setOspfIpMask(val.get(1).toInetAddress()); } catch (IllegalArgumentException e) { } } } return link; }
public OspfElement get(OspfElement element) { //loopback mask by default element.setOspfRouterIdNetmask(InetAddressUtils.addr("255.255.255.255")); //-1 ifindex by default element.setOspfRouterIdIfindex(-1); List<SnmpValue> val = get(element.getOspfRouterId()); if (val != null && val.size() == 2) { if (!val.get(0).isNull() && val.get(0).isNumeric()) element.setOspfRouterIdIfindex(val.get(0).toInt()); if (!val.get(1).isNull() && !val.get(1).isError()) { try { element.setOspfRouterIdNetmask(val.get(1).toInetAddress()); } catch (IllegalArgumentException e) { } } } return element; }
public String getIpAddress() { SnmpValue value = getValue(IP_ADDR_ENT_ADDR); if (value != null) { return InetAddressUtils.str(value.toInetAddress()); } else { // instance for ipAddr Table it ipAddr SnmpInstId inst = getInstance(); if (inst != null) { final String addr = InetAddressUtils.normalize(inst.toString()); if (addr == null) { throw new IllegalArgumentException("cannot convert "+inst+" to an InetAddress"); } return addr; } else { return null; } } }
public String getIpAddress() { SnmpValue value = getValue(IP_ADDR_ENT_ADDR); if (value != null) { return InetAddressUtils.str(value.toInetAddress()); } else { // instance for ipAddr Table it ipAddr SnmpInstId inst = getInstance(); if (inst != null) { final String addr = InetAddressUtils.normalize(inst.toString()); if (addr == null) { throw new IllegalArgumentException("cannot convert "+inst+" to an InetAddress"); } return addr; } else { return null; } } }