亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pdu.java

?? 一個已經(jīng)完善的極其方便的實現(xiàn)snmp的開發(fā)包
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*_############################################################################
  _##
  _##  SNMP4J - PDU.java
  _##
  _##  Copyright (C) 2003-2008  Frank Fock and Jochen Katz (SNMP4J.org)
  _##
  _##  Licensed under the Apache License, Version 2.0 (the "License");
  _##  you may not use this file except in compliance with the License.
  _##  You may obtain a copy of the License at
  _##
  _##      http://www.apache.org/licenses/LICENSE-2.0
  _##
  _##  Unless required by applicable law or agreed to in writing, software
  _##  distributed under the License is distributed on an "AS IS" BASIS,
  _##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  _##  See the License for the specific language governing permissions and
  _##  limitations under the License.
  _##
  _##########################################################################*/



package org.snmp4j;

import org.snmp4j.smi.*;
import org.snmp4j.asn1.*;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Vector;
import org.snmp4j.smi.Integer32;
import org.snmp4j.mp.SnmpConstants;
import java.io.Serializable;

/**
 * The <code>PDU</code> class represents a SNMP protocol data unit. The PDU
 * version supported by the BER decoding and encoding methods of this class
 * is v2.
 * <p>
 * The default PDU type is GET.
 *
 * @author Frank Fock
 * @version 1.1
 * @see PDUv1
 * @see ScopedPDU
 */
public class PDU implements BERSerializable, Serializable {

  private static final long serialVersionUID = 7607672475629607472L;

  /**
   * Denotes a get PDU.
   */
  public static final int GET      = (BER.ASN_CONTEXT | BER.ASN_CONSTRUCTOR | 0x0);
  /**
   * Denotes a getnext (search) PDU.
   */
  public static final int GETNEXT  = (BER.ASN_CONTEXT | BER.ASN_CONSTRUCTOR | 0x1);
  /**
   * Denotes a response PDU.
   */
  public static final int RESPONSE = (BER.ASN_CONTEXT | BER.ASN_CONSTRUCTOR | 0x2);
  /**
   * Denotes a set PDU.
   */
  public static final int SET      = (BER.ASN_CONTEXT | BER.ASN_CONSTRUCTOR | 0x3);
  /**
   * Denotes a SNMPv1 trap PDU. This type can only be used with instances of the
   * {@link PDUv1} class.
   */
  public static final int V1TRAP   = (BER.ASN_CONTEXT | BER.ASN_CONSTRUCTOR | 0x4);
  /**
   * Denotes a SNMPv2c/v3 getbulk PDU.
   */
  public static final int GETBULK  = (BER.ASN_CONTEXT | BER.ASN_CONSTRUCTOR | 0x5);
  /**
   * Denotes a SNMPv2c/v3 inform PDU (unprecisely also known as a confirmed
   * notification).
   */
  public static final int INFORM   = (BER.ASN_CONTEXT | BER.ASN_CONSTRUCTOR | 0x6);
  /**
   * Denotes a SNMPv2c/v3 notification PDU (undistinguishable from
   * {@link #TRAP}).
   */
  public static final int TRAP     = (BER.ASN_CONTEXT | BER.ASN_CONSTRUCTOR | 0x7);
  /**
   * Denotes a SNMPv2c/v3 notification PDU (undistinguishable from
   * {@link #NOTIFICATION}).
   */
  public static final int NOTIFICATION = TRAP;
  /**
   * Denotes a SNMPv3 report PDU.
   */
  public static final int REPORT   = (BER.ASN_CONTEXT | BER.ASN_CONSTRUCTOR | 0x8);


  // Error status constants

  /**
   * Operation success (no error).
   */
  public static final int noError = SnmpConstants.SNMP_ERROR_SUCCESS;

  /**
   * PDU encoding is too big for the transport used.
   */
  public static final int tooBig = SnmpConstants.SNMP_ERROR_TOO_BIG;

  /**
   * No such variable binding name, see error index.
   */
  public static final int noSuchName = SnmpConstants.SNMP_ERROR_NO_SUCH_NAME;

  /**
   * Bad value in variable binding, see error index.
   */
  public static final int badValue = SnmpConstants.SNMP_ERROR_BAD_VALUE;

  /**
   * The variable binding is read-only, see error index.
   */
  public static final int readOnly = SnmpConstants.SNMP_ERROR_READ_ONLY;

  /**
   * An unspecific error caused by a variable binding, see error index.
   */
  public static final int genErr = SnmpConstants.SNMP_ERROR_GENERAL_ERROR;

  /**
   * The variable binding is not accessible by the current MIB view, see error
   * index.
   */
  public static final int noAccess = SnmpConstants.SNMP_ERROR_NO_ACCESS;

  /**
   * The variable binding's value has the wrong type, see error index.
   */
  public static final int wrongType = SnmpConstants.SNMP_ERROR_WRONG_TYPE;

  /**
   * The variable binding's value has the wrong length, see error index.
   */
  public static final int wrongLength = SnmpConstants.SNMP_ERROR_WRONG_LENGTH;

  /**
   * The variable binding's value has a value that could under no circumstances
   * be assigned, see error index.
   */
  public static final int wrongValue = SnmpConstants.SNMP_ERROR_WRONG_VALUE;

  /**
   * The variable binding's value has the wrong encoding, see error index.
   */
  public static final int wrongEncoding =
      SnmpConstants.SNMP_ERROR_WRONG_ENCODING;

  /**
   * The specified object does not exists and cannot be created,
   * see error index.
   */
  public static final int noCreation = SnmpConstants.SNMP_ERROR_NO_CREATION;

  /**
   * The variable binding's value is presently inconsistent with the current
   * state of the target object, see error index.
   */
  public static final int inconsistentValue =
      SnmpConstants.SNMP_ERROR_INCONSISTENT_VALUE;

  /**
   * The resource needed to assign a variable binding's value is presently
   * unavailable, see error index.
   */
  public static final int resourceUnavailable =
      SnmpConstants.SNMP_ERROR_RESOURCE_UNAVAILABLE;

  /**
   * Unable to commit a value, see error index.
   */
  public static final int commitFailed = SnmpConstants.SNMP_ERROR_COMMIT_FAILED;

  /**
   * Unable to undo a committed value, see error index.
   */
  public static final int undoFailed = SnmpConstants.SNMP_ERROR_UNDO_FAILED;

  /**
   * Unauthorized access, see error index.
   */
  public static final int authorizationError =
      SnmpConstants.SNMP_ERROR_AUTHORIZATION_ERROR;

  /**
   * The variable's value cannot be modified, see error index.
   */
  public static final int notWritable = SnmpConstants.SNMP_ERROR_NOT_WRITEABLE;

  /**
   * The specified object does not exists and presently it cannot be created,
   * see error index.
   */
  public static final int inconsistentName =
      SnmpConstants.SNMP_ERROR_INCONSISTENT_NAME;

  protected Vector variableBindings = new Vector();
  protected Integer32 errorStatus = new Integer32();
  protected Integer32 errorIndex = new Integer32();
  protected Integer32 requestID = new Integer32();
  protected int type = GET;

  /**
   * Default constructor.
   */
  public PDU() {
  }

  /**
   * Copy constructor.
   * @param other
   *    the <code>PDU</code> to copy from.
   */
  public PDU(PDU other) {
    variableBindings = (Vector) other.variableBindings.clone();
    errorIndex = (Integer32) other.errorIndex.clone();
    errorStatus = (Integer32) other.errorStatus.clone();
    type = other.type;
    if (other.requestID != null) {
      requestID = (Integer32) other.requestID.clone();
    }
  }

  /**
   * Adds a variable binding to this PDU. A <code>NullPointerException</code>
   * is thrown if <code>VariableBinding</code> or its <code>Variable</code> is
   * <code>null</code>.
   * @param vb
   *   a <code>VariableBinding</code> instance.
   */
  public void add(VariableBinding vb) {
    variableBindings.add(vb);
  }

  /**
   * Adds a new variable binding to this PDU by using the OID of the supplied
   * <code>VariableBinding</code>. The value portion is thus set to
   * <code>null</code>.
   * <p>
   * This method should be used for GET type requests. For SET, TRAP and INFORM
   * requests, the {@link #add} method should be used instead.
   * @param vb
   *   a <code>VariableBinding</code> instance.
   * @since 1.8
   */
  public void addOID(VariableBinding vb) {
    VariableBinding cvb = new VariableBinding(vb.getOid());
    variableBindings.add(cvb);
  }

  /**
   * Adds an array of variable bindings to this PDU (see
   * {@link #add(VariableBinding vb)}).
   * @param vbs
   *   an array of <code>VariableBinding</code> instances. The instances in the
   *   array will be appended to the current list of variable bindings in the
   *   PDU.
   */
  public void addAll(VariableBinding[] vbs) {
    variableBindings.ensureCapacity(variableBindings.size()+vbs.length);
    for (int i=0; i<vbs.length; i++) {
      add(vbs[i]);
    }
  }

  /**
   * Adds new <code>VariableBindings</code> each with the OID of the
   * corresponding variable binding of the supplied array to this PDU (see
   * {@link #addOID(VariableBinding vb)}).
   * @param vbs
   *   an array of <code>VariableBinding</code> instances. For each instance
   *   in the supplied array, a new VariableBinding created by
   *   <code>new VariableBinding(OID)</code> will be appended to the current
   *   list of variable bindings in the PDU.
   * @since 1.8
   */
  public void addAllOIDs(VariableBinding[] vbs) {
    variableBindings.ensureCapacity(variableBindings.size()+vbs.length);
    for (int i=0; i<vbs.length; i++) {
      addOID(vbs[i]);
    }
  }

  /**
   * Gets the variable binding at the specified position.
   * @param index
   *    a zero based positive integer (<code>0 <= index < {@link #size()}</code>)
   * @return
   *    a VariableBinding instance. If <code>index</code> is out of bounds
   *    an exception is thrown.
   */
  public VariableBinding get(int index) {
    return (VariableBinding)variableBindings.get(index);
  }

  /**
   * Sets the variable binding at the specified position.
   * @param index
   *    a zero based positive integer (<code>0 <= index < {@link #size()}</code>)
   *    If <code>index</code> is out of bounds
   *    an exception is thrown.
   * @param vb
   *    a VariableBinding instance (<code>null</code> is not allowed).
   * @return
   *    the variable binding that has been replaced.
   */
  public VariableBinding set(int index, VariableBinding vb) {
    if (vb == null) {
      throw new NullPointerException("Variable binding must not be null");
    }
    return (VariableBinding)variableBindings.set(index, vb);
  }

  /**
   * Removes the variable binding at the supplied position.
   * @param index
   *    a position >= 0 and < {@link #size()}.
   */
  public void remove(int index) {
    variableBindings.remove(index);
  }

  /**
   * Gets the number of variable bindings in the PDU.
   * @return
   *    the size of the PDU.
   */
  public int size() {
    return variableBindings.size();
  }

  /**
   * Gets the variable binding vector.
   * @return
   *    the internal <code>Vector</code> containing the PDU's variable bindings.
   */
  public Vector getVariableBindings() {
    return variableBindings;
  }

  /**
   * Remove the last variable binding from the PDU, if such an element exists.
   */
  public void trim() {
    if (variableBindings.size() > 0) {
      variableBindings.remove(variableBindings.size() - 1);
    }
  }

  /**
   * Sets the error status of the PDU.
   * @param errorStatus
   *    a SNMP error status.
   * @see SnmpConstants
   */
  public void setErrorStatus(int errorStatus) {
    this.errorStatus.setValue(errorStatus);
  }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费观看高清完整版在线观看 | 奇米一区二区三区av| 免费观看成人av| 91老师片黄在线观看| 欧美电视剧在线看免费| 国产精品二区一区二区aⅴ污介绍| 午夜精品福利在线| 99久久99久久精品免费观看 | av亚洲精华国产精华| 欧美一区二区福利在线| 亚洲精品成a人| 国产99精品视频| 日韩欧美精品在线视频| 亚洲国产精品欧美一二99| 成人午夜激情视频| 亚洲国产日韩精品| 91麻豆视频网站| 日韩亚洲欧美在线观看| 欧美精品乱码久久久久久| 天天操天天色综合| 欧美成人综合网站| 岛国一区二区在线观看| 一区二区三区精品在线观看| 91麻豆精品国产91久久久资源速度 | 91国偷自产一区二区开放时间 | 精品日韩一区二区| 波多野结衣中文字幕一区| 亚洲一区二区在线观看视频| 91精品国产色综合久久不卡蜜臀| 国产一区二区免费在线| 亚洲精品你懂的| www国产成人免费观看视频 深夜成人网| 成人在线综合网站| 亚洲国产精品综合小说图片区| 欧美一区二区免费观在线| 成人激情综合网站| 免费观看久久久4p| 一区二区三区四区视频精品免费| 欧美白人最猛性xxxxx69交| av在线不卡电影| 久久精品国产99国产精品| 亚洲美女屁股眼交3| 26uuu精品一区二区在线观看| 色狠狠一区二区| 国产91精品在线观看| 性做久久久久久| 国产精品久久久久久久久晋中 | 亚洲裸体在线观看| 精品国产sm最大网站免费看| 欧美色精品在线视频| 国产精品1024久久| 麻豆精品视频在线观看免费| 一区二区不卡在线视频 午夜欧美不卡在| 2欧美一区二区三区在线观看视频| 色8久久精品久久久久久蜜| 国产福利91精品| 免费在线视频一区| 午夜精品福利久久久| 亚洲精品中文在线| 亚洲欧美在线视频| 亚洲国产成人自拍| 久久亚洲欧美国产精品乐播 | 激情图区综合网| 婷婷六月综合网| 亚洲高清免费视频| 一区二区久久久| 一区二区不卡在线视频 午夜欧美不卡在 | 精品嫩草影院久久| 欧美精品久久99久久在免费线 | 国产精品网站一区| 久久毛片高清国产| 国产性色一区二区| 国产日韩三级在线| 国产欧美精品一区二区三区四区 | 亚洲国产精品v| 国产婷婷色一区二区三区在线| 精品乱码亚洲一区二区不卡| 日韩亚洲欧美一区| 精品女同一区二区| 午夜精品久久久久影视| 亚洲精品国产一区二区三区四区在线| 自拍av一区二区三区| 国产精品水嫩水嫩| 国产精品高潮呻吟久久| 亚洲视频一区二区在线| 亚洲欧美电影一区二区| 一区二区三区欧美日韩| 亚洲aⅴ怡春院| 无码av免费一区二区三区试看| 丝袜亚洲精品中文字幕一区| 免费不卡在线视频| 国产精品一二三四| av亚洲产国偷v产偷v自拍| 色偷偷成人一区二区三区91| 欧美日韩你懂的| 欧美一级艳片视频免费观看| 久久综合狠狠综合久久综合88| 国产亚洲精品7777| 亚洲欧美日韩国产手机在线| 亚洲一区二区三区四区五区中文| 视频一区欧美精品| 狠狠狠色丁香婷婷综合激情| 成人高清视频在线观看| 91丨国产丨九色丨pron| 欧美视频第二页| 日韩欧美三级在线| 国产欧美在线观看一区| 亚洲欧美日韩中文播放| 日韩国产在线观看| 国产成人精品www牛牛影视| 91麻豆福利精品推荐| 欧美顶级少妇做爰| 国产欧美日韩三级| 五月激情丁香一区二区三区| 国产乱人伦偷精品视频免下载| 色综合天天视频在线观看| 欧美日韩亚洲综合一区二区三区| 欧美精品一区二区三区蜜桃视频 | 亚洲高清在线视频| 国内精品自线一区二区三区视频| 99久久99久久精品免费观看| 日韩一本二本av| 亚洲乱码一区二区三区在线观看| 免费成人深夜小野草| 91美女在线视频| 欧美sm极限捆绑bd| 亚洲成a人片综合在线| 国产成人一区在线| 欧美一区二区久久久| 亚洲日本一区二区| 国产老妇另类xxxxx| 欧美三日本三级三级在线播放| 国产亲近乱来精品视频 | 免费人成黄页网站在线一区二区| 风间由美性色一区二区三区| 91精品欧美一区二区三区综合在 | 亚洲一二三区不卡| 大胆欧美人体老妇| 日韩欧美中文字幕一区| 亚洲毛片av在线| 成人av小说网| 久久综合九色综合97_久久久| 亚洲地区一二三色| 9l国产精品久久久久麻豆| 亚洲精品在线一区二区| 婷婷综合久久一区二区三区| 色欧美日韩亚洲| **网站欧美大片在线观看| 国内外成人在线视频| 日韩视频免费观看高清在线视频| 一区二区三国产精华液| 色综合天天综合网天天狠天天 | 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 久久影院午夜论| 视频在线观看91| 欧美日韩性生活| 一区二区三区在线视频免费观看 | 91免费观看视频| 国产精品国产三级国产普通话蜜臀 | 欧美日韩成人高清| 一区二区三区四区五区视频在线观看| jizzjizzjizz欧美| 国产精品天干天干在观线| 国产剧情一区二区三区| 亚洲精品一区二区三区在线观看 | 亚洲在线视频免费观看| 色狠狠综合天天综合综合| 亚洲精品菠萝久久久久久久| 色播五月激情综合网| 亚洲综合网站在线观看| 欧美日韩中文字幕一区| 亚洲成人tv网| 7799精品视频| 麻豆国产精品官网| 精品成人a区在线观看| 国产一区二区视频在线| 久久精品视频一区二区| 成人免费毛片a| 亚洲免费电影在线| 欧美日韩久久久久久| 日本欧洲一区二区| 精品国产91洋老外米糕| 成人蜜臀av电影| 亚洲欧美成aⅴ人在线观看| 欧美视频在线观看一区| 视频一区中文字幕| 久久久三级国产网站| 成人激情午夜影院| 亚洲综合视频在线观看| 欧美精品在欧美一区二区少妇| 蜜桃一区二区三区在线观看| 国产亚洲污的网站| 色诱视频网站一区| 首页国产欧美日韩丝袜| 精品国产成人系列| 91老师片黄在线观看| 日韩va亚洲va欧美va久久| 久久精品在线观看| 欧美性生活一区| 精品制服美女丁香|