org.snmp4j.PDU.getBERLength()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中org.snmp4j.PDU.getBERLength()方法的一些代码示例,展示了PDU.getBERLength()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PDU.getBERLength()方法的具体详情如下:
包路径:org.snmp4j.PDU
类名称:PDU
方法名:getBERLength

PDU.getBERLength介绍

[英]Computes the length in bytes of the BER encoded variable bindings without including the length of BER sequence length.
[中]计算BER编码变量绑定的字节长度,不包括BER序列长度。

代码示例

代码示例来源:origin: org.kaazing/snmp4j

public int getBERPayloadLength() {
 int length = super.getBERLength();
 int cid = (contextEngineID == null) ? 0 : contextEngineID.length();
 int cn = (contextName == null) ? 0 : contextName.length();
 length += BER.getBERLengthOfLength(cid) + 1
   + cid + BER.getBERLengthOfLength(cn) + 1 + cn;
 return length;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

public int getBERPayloadLength() {
 int length = super.getBERLength();
 int cid = (contextEngineID == null) ? 0 : contextEngineID.length();
 int cn = (contextName == null) ? 0 : contextName.length();
 length += BER.getBERLengthOfLength(cid) + 1
   + cid + BER.getBERLengthOfLength(cn) + 1 + cn;
 return length;
}

代码示例来源:origin: org.snmp4j/snmp4j

public int getBERPayloadLength() {
 int length = super.getBERLength();
 int cid = (contextEngineID == null) ? 0 : contextEngineID.length();
 int cn = (contextName == null) ? 0 : contextName.length();
 length += BER.getBERLengthOfLength(cid) + 1
   + cid + BER.getBERLengthOfLength(cn) + 1 + cn;
 return length;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

protected int getBERPayloadLengthPDU() {
 int length = getBERLength(variableBindings);
 length += BER.getBERLengthOfLength(length) + 1;
 // req id, error status, error index
 Integer32 i32 = new Integer32(requestID.getValue());
 length += i32.getBERLength();
 i32 = errorStatus;
 length += i32.getBERLength();
 i32 = errorIndex;
 length += i32.getBERLength();
 i32 = null;
 return length;
}

代码示例来源:origin: org.snmp4j/snmp4j

protected int getBERPayloadLengthPDU() {
  int length = getBERLength(variableBindings);
  length += BER.getBERLengthOfLength(length) + 1;
  // req id, error status, error index
  Integer32 i32 = new Integer32(requestID.getValue());
  length += i32.getBERLength();
  i32 = errorStatus;
  length += i32.getBERLength();
  i32 = errorIndex;
  length += i32.getBERLength();
  i32 = null;
  return length;
}

代码示例来源:origin: org.kaazing/snmp4j-agent

return (response.getBERLength() <
    requestEvent.getMaxSizeResponsePDU());

代码示例来源:origin: org.kaazing/snmp4j

VariableBinding vb = new VariableBinding(col);
pdu.add(vb);
if (pdu.getBERLength() > target.getMaxSizeRequestPDU()) {
 pdu.trim();
 break;

代码示例来源:origin: com.rogueai/snmp2bean

int length = pdu.getBERLength();
length += community.getBERLength();
length += version.getBERLength();

代码示例来源:origin: org.snmp4j/snmp4j-agent

return (response.getBERLength() <
    source.getMaxSizeResponsePDU());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

Integer32 version = new Integer32(messageProcessingModel);
int length = pdu.getBERLength();
length += community.getBERLength();
length += version.getBERLength();

代码示例来源:origin: org.kaazing/snmp4j

Integer32 version = new Integer32(messageProcessingModel);
int length = pdu.getBERLength();
length += community.getBERLength();
length += version.getBERLength();

代码示例来源:origin: org.snmp4j/snmp4j

Integer32 version = new Integer32(messageProcessingModel);
int length = pdu.getBERLength();
length += community.getBERLength();
length += version.getBERLength();

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

Integer32 version = new Integer32(messageProcessingModel);
int length = pdu.getBERLength();
length += community.getBERLength();
length += version.getBERLength();

代码示例来源:origin: org.kaazing/snmp4j

Integer32 version = new Integer32(messageProcessingModel);
int length = pdu.getBERLength();
length += community.getBERLength();
length += version.getBERLength();

代码示例来源:origin: org.snmp4j/snmp4j

Integer32 version = new Integer32(messageProcessingModel);
int length = pdu.getBERLength();
length += community.getBERLength();
length += version.getBERLength();

代码示例来源:origin: org.snmp4j/snmp4j

VariableBinding vb = new VariableBinding(col);
pdu.add(vb);
if (pdu.getBERLength() > target.getMaxSizeRequestPDU()) {
  pdu.trim();
  break;

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

VariableBinding vb = new VariableBinding(col);
pdu.add(vb);
if (pdu.getBERLength() > target.getMaxSizeRequestPDU()) {
 pdu.trim();
 break;

代码示例来源:origin: org.snmp4j/snmp4j-agent

MessageDispatcher disp = requestEvent.getMessageDispatcher();
try {
  if (response.getBERLength() > requestEvent.getMaxSizeResponsePDU()) {
            (response.getBERLength() >
                requestEvent.getMaxSizeResponsePDU())) {
          response.trim();
    if (response.getBERLength() > requestEvent.getMaxSizeResponsePDU()) {
      fireIncrementCounter(new CounterEvent(this,
          SnmpConstants.snmpSilentDrops));

代码示例来源:origin: org.kaazing/snmp4j-agent

MessageDispatcher disp = requestEvent.getMessageDispatcher();
try {
 if (response.getBERLength() > requestEvent.getMaxSizeResponsePDU()) {
        (response.getBERLength() >
        requestEvent.getMaxSizeResponsePDU())) {
     response.trim();
  if (response.getBERLength() > requestEvent.getMaxSizeResponsePDU()) {
   fireIncrementCounter(new CounterEvent(this,
                      SnmpConstants.snmpSilentDrops));

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

int scopedPDULength = pdu.getBERLength();
BEROutputStream scopedPDU;
 tooBigPDU.setErrorStatus(SnmpConstants.SNMP_ERROR_TOO_BIG);
 tooBigPDU.setErrorIndex(0);
 scopedPDULength = tooBigPDU.getBERLength();
 scopedPDU = new BEROutputStream(ByteBuffer.allocate(scopedPDULength));
 tooBigPDU.encodeBER(scopedPDU);

相关文章