/** * Sets the authoritative engine ID of this target. * @param authoritativeEngineID * a possibly zero length byte array (must not be <code>null</code>). */ public void setAuthoritativeEngineID(byte[] authoritativeEngineID) { this.authoritativeEngineID.setValue(authoritativeEngineID); }
/** * Sets the authoritative engine ID of this target. * @param authoritativeEngineID * a possibly zero length byte array (must not be <code>null</code>). */ public void setAuthoritativeEngineID(byte[] authoritativeEngineID) { this.authoritativeEngineID.setValue(authoritativeEngineID); }
/** * Sets the authoritative engine ID of this target. * @param authoritativeEngineID * a possibly zero length byte array (must not be <code>null</code>). */ public void setAuthoritativeEngineID(byte[] authoritativeEngineID) { this.authoritativeEngineID.setValue(authoritativeEngineID); }
public void setAuthoritativeEngineID(byte[] authoritativeEngineID) { if (authoritativeEngineID == null) { throw new NullPointerException("Authoritative engine ID must not be null"); } this.authoritativeEngineID.setValue(authoritativeEngineID); } public void setAuthoritativeEngineBoots(int authoritativeEngineBoots) {
public void setAuthoritativeEngineID(byte[] authoritativeEngineID) { if (authoritativeEngineID == null) { throw new NullPointerException("Authoritative engine ID must not be null"); } this.authoritativeEngineID.setValue(authoritativeEngineID); } public void setAuthoritativeEngineBoots(int authoritativeEngineBoots) {
public void setAuthoritativeEngineID(byte[] authoritativeEngineID) { if (authoritativeEngineID == null) { throw new NullPointerException("Authoritative engine ID must not be null"); } this.authoritativeEngineID.setValue(authoritativeEngineID); } public void setAuthoritativeEngineBoots(int authoritativeEngineBoots) {
public void setValue(String value) { setValue(value.getBytes()); }
public void setValue(String value) { setValue(value.getBytes()); }
public void setValue(String value) { setValue(value.getBytes()); }
public void setSysDescr(OctetString sysDescr) { this.sysDescr.setValue(sysDescr.getValue()); }
public void setSysDescr(OctetString sysDescr) { this.sysDescr.setValue(sysDescr.getValue()); }
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.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.OCTETSTRING) { throw new IOException("Wrong type encountered when decoding OctetString: "+ type.getValue()); } setValue(v); }
/** * Creates a local engine ID based on the local IP address. * * @return * a new local engine ID. */ public static byte[] createLocalEngineID() { byte[] engineID = new byte[5]; engineID[0] = (byte)(0x80 | ((enterpriseID >> 24) & 0xFF)); engineID[1] = (byte)((enterpriseID >> 16) & 0xFF); engineID[2] = (byte)((enterpriseID >> 8) & 0xFF); engineID[3] = (byte)(enterpriseID & 0xFF); engineID[4] = 2; OctetString os = new OctetString(); try { byte[] b = InetAddress.getLocalHost().getAddress(); if (b.length == 4) { engineID[4] = 1; } os.setValue(b); } catch (UnknownHostException ex) { logger.debug("Local host cannot be determined for creation of local engine ID"); engineID[4] = 4; os.setValue("SNMP4J".getBytes()); } OctetString ownEngineID = new OctetString(engineID); ownEngineID.append(os); return ownEngineID.getValue(); }
public VariableBinding parseVariableBinding(String text) throws ParseException { String[] tokens = text.split(SEPARATOR, 3); if (tokens.length != 3) { throw new ParseException("Invalid format: "+ text, 0); } OID oid = new OID(oidFormat.parse(tokens[0])); String typeName = tokens[1]; String valueString = tokens[2]; if (typeName.equals(TYPE_NAME_4_OCTETSTRING_IN_HEX)) { OctetString os = (OctetString)parse(SMIConstants.SYNTAX_OCTET_STRING, ""); os.setValue(OctetString.fromHexString(valueString).getValue()); return new VariableBinding(oid, os); } else if (typeName.equals(AbstractVariable.getSyntaxString(BER.BITSTRING))) { BitString bs = (BitString)parse(BER.BITSTRING, ""); bs.setValue(BitString.fromHexString(valueString).getValue()); return new VariableBinding(oid, bs); } else { return new VariableBinding( oid, parse(AbstractVariable.getSyntaxFromString(typeName), valueString) ); } }
tmp.append(random); hash.update(tmp.getValue()); tmp.setValue(hash.digest()); delta.append(new byte[digestLength]); for (int kk=0; kk < digestLength; kk++) {