public final void decodeBER(BERInputStream inputStream) throws IOException { BER.MutableByte type = new BER.MutableByte(); int length = BER.decodeHeader(inputStream, type); long startPos = inputStream.getPosition(); if (type.getValue() != BER.SEQUENCE) { throw new IOException("Invalid sequence encoding: " + type.getValue()); } oid.decodeBER(inputStream); variable = AbstractVariable.createFromBER(inputStream); if (BER.isCheckSequenceLength()) { BER.checkSequenceLength(length, (int) (inputStream.getPosition() - startPos), this); } }
public final void decodeBER(BERInputStream inputStream) throws IOException { BER.MutableByte type = new BER.MutableByte(); int length = BER.decodeHeader(inputStream, type); long startPos = inputStream.getPosition(); if (type.getValue() != BER.SEQUENCE) { throw new IOException("Invalid sequence encoding: " + type.getValue()); } oid.decodeBER(inputStream); variable = AbstractVariable.createFromBER(inputStream); if (BER.isCheckSequenceLength()) { BER.checkSequenceLength(length, (int) (inputStream.getPosition() - startPos), this); } }
public final void decodeBER(BERInputStream inputStream) throws IOException { BER.MutableByte type = new BER.MutableByte(); int length = BER.decodeHeader(inputStream, type); long startPos = inputStream.getPosition(); if (type.getValue() != BER.SEQUENCE) { throw new IOException("Invalid sequence encoding: " + type.getValue()); } oid.decodeBER(inputStream); variable = AbstractVariable.createFromBER(inputStream); if (BER.isCheckSequenceLength()) { BER.checkSequenceLength(length, (int) (inputStream.getPosition() - startPos), this); } }
public void decodeBER(BERInputStream message) throws IOException { BER.MutableByte type = new BER.MutableByte(); int length = BER.decodeHeader(message, type); if (type.getValue() != BER.SEQUENCE) { throw new IOException("Unexpected sequence header type: " + type.getValue()); } msgID.decodeBER(message); msgMaxSize.decodeBER(message); if (msgMaxSize.getValue() < 484) { throw new IOException("Invalid msgMaxSize: " + msgMaxSize); } msgFlags.decodeBER(message); if (msgFlags.length() != 1) { throw new IOException("Message flags length != 1: " + msgFlags.length()); } securityModel.decodeBER(message); if (logger.isDebugEnabled()) { logger.debug("SNMPv3 header decoded: msgId=" + msgID + ", msgMaxSize=" + msgMaxSize + ", msgFlags=" + msgFlags.toHexString() + ", secModel=" + securityModel); } BER.checkSequenceLength(length, this); }
public void decodeBER(BERInputStream message) throws IOException { BER.MutableByte type = new BER.MutableByte(); int length = BER.decodeHeader(message, type); if (type.getValue() != BER.SEQUENCE) { throw new IOException("Unexpected sequence header type: " + type.getValue()); } msgID.decodeBER(message); msgMaxSize.decodeBER(message); if (msgMaxSize.getValue() < 484) { throw new IOException("Invalid msgMaxSize: " + msgMaxSize); } msgFlags.decodeBER(message); if (msgFlags.length() != 1) { throw new IOException("Message flags length != 1: " + msgFlags.length()); } securityModel.decodeBER(message); if (logger.isDebugEnabled()) { logger.debug("SNMPv3 header decoded: msgId=" + msgID + ", msgMaxSize=" + msgMaxSize + ", msgFlags=" + msgFlags.toHexString() + ", secModel=" + securityModel); } BER.checkSequenceLength(length, this); }
public void decodeBER(BERInputStream message) throws IOException { BER.MutableByte type = new BER.MutableByte(); int length = BER.decodeHeader(message, type); if (type.getValue() != BER.SEQUENCE) { throw new IOException("Unexpected sequence header type: " + type.getValue()); } msgID.decodeBER(message); msgMaxSize.decodeBER(message); if (msgMaxSize.getValue() < 484) { throw new IOException("Invalid msgMaxSize: " + msgMaxSize); } msgFlags.decodeBER(message); if (msgFlags.length() != 1) { throw new IOException("Message flags length != 1: " + msgFlags.length()); } securityModel.decodeBER(message); if (logger.isDebugEnabled()) { logger.debug("SNMPv3 header decoded: msgId=" + msgID + ", msgMaxSize=" + msgMaxSize + ", msgFlags=" + msgFlags.toHexString() + ", secModel=" + securityModel); } BER.checkSequenceLength(length, this); }
/** * Decodes a <code>ScopedPDU</code> from an <code>InputStream</code>. * * @param inputStream an <code>InputStream</code> containing a BER encoded * byte stream. * @throws IOException * if there is a BER encoding error or other IO exception in the input stream. */ public void decodeBER(BERInputStream inputStream) throws IOException { MutableByte mutableByte = new MutableByte(); int length = BER.decodeHeader(inputStream, mutableByte); long startPos = inputStream.getPosition(); contextEngineID.decodeBER(inputStream); contextName.decodeBER(inputStream); super.decodeBER(inputStream); if (BER.isCheckSequenceLength()) { BER.checkSequenceLength(length, (int) (inputStream.getPosition() - startPos), this); } }
/** * Decodes a <code>ScopedPDU</code> from an <code>InputStream</code>. * * @param inputStream an <code>InputStream</code> containing a BER encoded * byte stream. * @throws IOException */ public void decodeBER(BERInputStream inputStream) throws IOException { MutableByte mutableByte = new MutableByte(); int length = BER.decodeHeader(inputStream, mutableByte); long startPos = inputStream.getPosition(); contextEngineID.decodeBER(inputStream); contextName.decodeBER(inputStream); super.decodeBER(inputStream); if (BER.isCheckSequenceLength()) { BER.checkSequenceLength(length, (int) (inputStream.getPosition() - startPos), this); } }
/** * Decodes a <code>ScopedPDU</code> from an <code>InputStream</code>. * * @param inputStream an <code>InputStream</code> containing a BER encoded * byte stream. * @throws IOException * if there is a BER encoding error or other IO exception in the input stream. */ public void decodeBER(BERInputStream inputStream) throws IOException { MutableByte mutableByte = new MutableByte(); int length = BER.decodeHeader(inputStream, mutableByte); long startPos = inputStream.getPosition(); contextEngineID.decodeBER(inputStream); contextName.decodeBER(inputStream); super.decodeBER(inputStream); if (BER.isCheckSequenceLength()) { BER.checkSequenceLength(length, (int) (inputStream.getPosition() - startPos), this); } }
public void decodeBER(BERInputStream inputStream) throws IOException { BER.MutableByte pduType = new BER.MutableByte(); int length = BER.decodeHeader(inputStream, pduType); int pduStartPos = (int) inputStream.getPosition(); switch (pduType.getValue()) { case PDU.SET: case PDU.GET: case PDU.GETNEXT: case PDU.GETBULK: case PDU.INFORM: case PDU.REPORT: case PDU.TRAP: case PDU.RESPONSE: break; default: throw new IOException("Unsupported PDU type: " + pduType.getValue()); } this.type = pduType.getValue(); requestID.decodeBER(inputStream); errorStatus.decodeBER(inputStream); errorIndex.decodeBER(inputStream); variableBindings = decodeVariableBindings(inputStream); if (BER.isCheckSequenceLength()) { BER.checkSequenceLength(length, (int) inputStream.getPosition() - pduStartPos, this); } }
BER.checkSequenceLength(length, (int) inputStream.getPosition() - pduStartPos, this);
v2cPDU.decodeBER(wholeMsg); BER.checkSequenceLength(length, (int)wholeMsg.getPosition() - startPos, v2cPDU);
if (BER.isCheckSequenceLength()) { BER.checkSequenceLength(length, (int) (inputStream.getPosition() - startPosSeq), this); BER.checkSequenceLength(octetLength, (int) (inputStream.getPosition() - startPos), this);
if (BER.isCheckSequenceLength()) { BER.checkSequenceLength(length, (int) (inputStream.getPosition() - startPosSeq), this); BER.checkSequenceLength(octetLength, (int) (inputStream.getPosition() - startPos), this);
if (BER.isCheckSequenceLength()) { BER.checkSequenceLength(length, (int) (inputStream.getPosition() - startPosSeq), this); BER.checkSequenceLength(octetLength, (int) (inputStream.getPosition() - startPos), this);
v2cPDU.decodeBER(wholeMsg); BER.checkSequenceLength(length, (int)wholeMsg.getPosition() - startPos, v2cPDU);
v1PDU.decodeBER(wholeMsg); BER.checkSequenceLength(length, (int)wholeMsg.getPosition() - startPos, v1PDU);
v2cPDU.decodeBER(wholeMsg); BER.checkSequenceLength(length, (int)wholeMsg.getPosition() - startPos, v2cPDU);
v2cPDU.decodeBER(wholeMsg); BER.checkSequenceLength(length, (int)wholeMsg.getPosition() - startPos, v2cPDU);
v1PDU.decodeBER(wholeMsg); BER.checkSequenceLength(length, (int)wholeMsg.getPosition() - startPos, v1PDU);