public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); byte[] value = BER.decodeString(inputStream, type); if (type.getValue() != BER.IPADDRESS) { throw new IOException("Wrong type encountered when decoding Counter: "+ type.getValue()); } if (value.length != 4) { throw new IOException("IpAddress encoding error, wrong length: " + value.length); } inetAddress = InetAddress.getByAddress(value); }
public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); byte[] value = BER.decodeString(inputStream, type); if (type.getValue() != BER.IPADDRESS) { throw new IOException("Wrong type encountered when decoding Counter: "+ type.getValue()); } if (value.length != 4) { throw new IOException("IpAddress encoding error, wrong length: " + value.length); } inetAddress = InetAddress.getByAddress(value); }
public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); byte[] value = BER.decodeString(inputStream, type); if (type.getValue() != BER.IPADDRESS) { throw new IOException("Wrong type encountered when decoding Counter: "+ type.getValue()); } if (value.length != 4) { throw new IOException("IpAddress encoding error, wrong length: " + value.length); } inetAddress = InetAddress.getByAddress(value); }
@Override public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); byte[] value = BER.decodeString(inputStream, type); if (type.getValue() != BER.IPADDRESS) { throw new IOException("Wrong type encountered when decoding IpAddress: "+ type.getValue()); } if (value.length != 4) { if ( (value.length == 8) && Boolean.getBoolean("org.opennms.snmp.workarounds.allow64BitIpAddress") ) { byte[] tempValue = new byte[4]; System.arraycopy(value, 0, tempValue, 0, 4); value = tempValue; LOG.debug("Working around misencoded IpAddress (8 bytes, truncating to 4); likely dealing with a buggy Net-SNMP agent"); } else { throw new IOException("IpAddress encoding error, wrong length: " + value.length); } } else if ( (value.length == 0 ) && Boolean.getBoolean("org.opennms.snmp.workarounds.allowZeroLengthIpAddress") ) { byte tempValue[] = { 0, 0, 0, 0 }; value = tempValue; LOG.debug("Working around misencoded IpAddress (0 bytes, substituting 0.0.0.0); likely dealing with a buggy DrayTek Vigor2820 Series router"); } this.setInetAddress(InetAddress.getByAddress(value)); }
@Override public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); byte[] value = BER.decodeString(inputStream, type); if (type.getValue() != BER.IPADDRESS) { throw new IOException("Wrong type encountered when decoding IpAddress: "+ type.getValue()); } if (value.length != 4) { if ( (value.length == 8) && Boolean.getBoolean("org.opennms.snmp.workarounds.allow64BitIpAddress") ) { byte[] tempValue = new byte[4]; System.arraycopy(value, 0, tempValue, 0, 4); value = tempValue; LOG.debug("Working around misencoded IpAddress (8 bytes, truncating to 4); likely dealing with a buggy Net-SNMP agent"); } else { throw new IOException("IpAddress encoding error, wrong length: " + value.length); } } else if ( (value.length == 0 ) && Boolean.getBoolean("org.opennms.snmp.workarounds.allowZeroLengthIpAddress") ) { byte tempValue[] = { 0, 0, 0, 0 }; value = tempValue; LOG.debug("Working around misencoded IpAddress (0 bytes, substituting 0.0.0.0); likely dealing with a buggy DrayTek Vigor2820 Series router"); } this.setInetAddress(InetAddress.getByAddress(value)); }
public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); byte[] v = BER.decodeString(inputStream, type); if (type.getValue() != BER.OCTETSTRING) { throw new IOException("Wrong type encountered when decoding OctetString: "+ type.getValue()); } setValue(v); }
public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); byte[] v = BER.decodeString(inputStream, type); if (type.getValue() != BER.BITSTRING) { throw new IOException("Wrong type encountered when decoding BitString: "+ type.getValue()); } setValue(v); }
public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); byte[] v = BER.decodeString(inputStream, type); if (type.getValue() != BER.BITSTRING) { throw new IOException("Wrong type encountered when decoding BitString: "+ type.getValue()); } setValue(v); }
public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); byte[] v = BER.decodeString(inputStream, type); if (type.getValue() != BER.OCTETSTRING) { throw new IOException("Wrong type encountered when decoding OctetString: "+ type.getValue()); } setValue(v); }
public void decodeBER(BERInputStream inputStream) throws IOException { BER.MutableByte type = new BER.MutableByte(); byte[] v = BER.decodeString(inputStream, type); if (type.getValue() != (BER.ASN_APPLICATION | 0x04)) { throw new IOException("Wrong type encountered when decoding OctetString: "+ type.getValue()); } setValue(v); }
public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); byte[] v = BER.decodeString(inputStream, type); if (type.getValue() != BER.OCTETSTRING) { throw new IOException("Wrong type encountered when decoding OctetString: "+ type.getValue()); } setValue(v); }
public void decodeBER(BERInputStream inputStream) throws IOException { BER.MutableByte type = new BER.MutableByte(); byte[] v = BER.decodeString(inputStream, type); if (type.getValue() != (BER.ASN_APPLICATION | 0x04)) { throw new IOException("Wrong type encountered when decoding OctetString: "+ type.getValue()); } setValue(v); }
public void decodeBER(BERInputStream inputStream) throws IOException { BER.MutableByte type = new BER.MutableByte(); byte[] v = BER.decodeString(inputStream, type); if (type.getValue() != (BER.ASN_APPLICATION | 0x04)) { throw new IOException("Wrong type encountered when decoding OctetString: "+ type.getValue()); } setValue(v); }
public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); byte[] v = BER.decodeString(inputStream, type); if (type.getValue() != BER.BITSTRING) { throw new IOException("Wrong type encountered when decoding BitString: "+ type.getValue()); } setValue(v); }
public void decodeBER(BERInputStream inputStream) throws java.io.IOException { BER.MutableByte type = new BER.MutableByte(); byte[] value = BER.decodeString(inputStream, type); if (type.getValue() != BER.IPADDRESS) { throw new IOException("Wrong type encountered when decoding Counter: "+ type.getValue()); } if (value.length != 4) { if ( (value.length == 8) && Boolean.getBoolean("org.opennms.snmp.workarounds.allow64BitIpAddress") ) { byte[] tempValue = { 0,0,0,0 }; for (int i = 0; i < 4; i++) { tempValue[i] = value[i]; } value = tempValue; if (log().isDebugEnabled()) { log().debug("Working around misencoded IpAddress (8 bytes, truncating to 4); likely dealing with a buggy Net-SNMP agent"); } } else { throw new IOException("IpAddress encoding error, wrong length: " + value.length); } } this.setInetAddress(InetAddress.getByAddress(value)); }
public void decodeBER(BERInputStream inputStream) throws IOException { BER.MutableByte type = new BER.MutableByte(); byte[] value = BER.decodeString(inputStream, type); if (type.getValue() != BER.IPADDRESS) { throw new IOException( "Wrong type encountered when decoding Counter: " + type.getValue() ); } if (value.length != 4) { logger.warn( "IpAddress encoding is invalid, wrong length: " + value.length ); super.setInetAddress(null); rawValue = value; } else { setAddress(value); } }