Examples of Integer32


Examples of org.snmp4j.smi.Integer32

      return SnmpConstants.SNMP_MP_UNSUPPORTED_SECURITY_MODEL;
    }


    OctetString community = new OctetString(securityName);
    Integer32 version = new Integer32(messageProcessingModel);
    // compute total length
    int length = pdu.getBERLength();
    length += community.getBERLength();
    length += version.getBERLength();

    ByteBuffer buf = ByteBuffer.allocate(length +
                                         BER.getBERLengthOfLength(length) + 1);
    // set the buffer of the outgoing message
    outgoingMessage.setBuffer(buf);

    // encode the message
    BER.encodeHeader(outgoingMessage, BER.SEQUENCE, length);
    version.encodeBER(outgoingMessage);

    community.encodeBER(outgoingMessage);
    pdu.encodeBER(outgoingMessage);

    return SnmpConstants.SNMP_MP_OK;
View Full Code Here

Examples of org.snmp4j.smi.Integer32

    if (mutableByte.getValue() != BER.SEQUENCE) {
      String txt = "SNMPv1 PDU must start with a SEQUENCE";
      logger.error(txt);
      throw new IOException(txt);
    }
    Integer32 version = new Integer32();
    version.decodeBER(wholeMsg);

    securityName.decodeBER(wholeMsg);
    securityLevel.setValue(SecurityLevel.NOAUTH_NOPRIV);
    securityModel.setValue(SecurityModel.SECURITY_MODEL_SNMPv1);
    messageProcessingModel.setValue(ID);
View Full Code Here

Examples of org.snmp4j.smi.Integer32

    for (Entry<Object, Object> entry : p.entrySet()) {
      oidValue = entry.getValue().toString();
      descr = entry.getKey().toString();
      PDU pdu = new PDU();
      pdu.add(new VariableBinding(new OID(oidValue)));
      pdu.setRequestID(new Integer32(1));
      pdu.setType(PDU.GET);

      try {
        response = snmp.get(pdu, comtarget);
      } catch (IOException e) {
View Full Code Here

Examples of org.snmp4j.smi.Integer32

    // Create the PDU
    PDU pdu = new PDU();
      pdu.add(varBind);
      pdu.setType(PDU.SET);
      pdu.setRequestID(new Integer32(1));

    logger.debug("SNMP: Send CMD PDU {} {}", providerCmd.getAddress(itemName, command), pdu);

    if (snmp == null) {
      logger.error("SNMP: snmp not initialised - aborting request");
View Full Code Here

Examples of org.snmp4j.smi.Integer32

          newElement.address = GenericAddress.parse("udp:" + outMatcher.group(2).toString() + "/161");
          newElement.community = new OctetString(outMatcher.group(3).toString());
          newElement.oid = new OID(outMatcher.group(4).toString());

          // Only Integer commands accepted at this time.
          newElement.value = new Integer32(Integer.parseInt(outMatcher.group(5).toString()));

          Command command = TypeParser.parseCommand(item.getAcceptedCommandTypes(), commandAsString);
          if (command == null) {
            logger.error("SNMP can't resolve command {} for item {}", commandAsString, item);
          } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.