2362N/A * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * A partially decoded representation of an SNMP packet. It contains 0N/A * the information contained in any SNMP message (SNMPv1, SNMPv2 or 0N/A * <p><b>This API is a Sun Microsystems internal API and is subject 0N/A * to change without notice.</b></p> 0N/A * The protocol version. 0N/A * <P><CODE>decodeMessage</CODE> and <CODE>encodeMessage</CODE> do not 0N/A * perform any check on this value. 0N/A * <BR><CODE>decodeSnmpPdu</CODE> and <CODE>encodeSnmpPdu</CODE> only 0N/A * accept the values 0 (for SNMPv1), 1 (for SNMPv2) and 3 (for SNMPv3). 0N/A * Encoding of the PDU. 0N/A * <P>This is usually the BER encoding of the PDU's syntax 0N/A * defined in RFC1157 and RFC1902. However, this can be authenticated 0N/A * or encrypted data (but you need to implemented your own 0N/A * <CODE>SnmpPduFactory</CODE> class). 0N/A * Number of useful bytes in the <CODE>data</CODE> field. 0N/A * Source or destination address. 0N/A * <BR>For an incoming message it's the source. 0N/A * For an outgoing message it's the destination. 0N/A * Source or destination port. 0N/A * <BR>For an incoming message it's the source. 0N/A * For an outgoing message it's the destination. 0N/A * Security parameters. Contain informations according to Security Model (Usm, community string based, ...). 0N/A * Returns the encoded SNMP version present in the passed byte array. 0N/A * @param data The unmarshalled SNMP message. 0N/A * @return The SNMP version (0, 1 or 3). 0N/A * Returns the associated request ID. 0N/A * @param data The flat message. 0N/A * @return The request ID. 0N/A * Encodes this message and puts the result in the specified byte array. 0N/A * For internal use only. 0N/A * @param outputBytes An array to receive the resulting encoding. 0N/A * @exception ArrayIndexOutOfBoundsException If the result does not fit 0N/A * into the specified array. 0N/A * Decodes the specified bytes and initializes this message. 0N/A * For internal use only. 0N/A * @param inputBytes The bytes to be decoded. 0N/A * @exception SnmpStatusException If the specified bytes are not a valid encoding. 0N/A * Initializes this message with the specified <CODE>pdu</CODE>. 0N/A * This method initializes the data field with an array of 0N/A * <CODE>maxDataLength</CODE> bytes. It encodes the <CODE>pdu</CODE>. 0N/A * The resulting encoding is stored in the data field 0N/A * and the length of the encoding is stored in <CODE>dataLength</CODE>. 0N/A * If the encoding length exceeds <CODE>maxDataLength</CODE>, 0N/A * the method throws an exception. 0N/A * @param pdu The PDU to be encoded. 0N/A * @param maxDataLength The maximum length permitted for the data field. 0N/A * @exception SnmpStatusException If the specified <CODE>pdu</CODE> is not valid. 0N/A * @exception SnmpTooBigException If the resulting encoding does not fit 0N/A * into <CODE>maxDataLength</CODE> bytes. 0N/A * @exception ArrayIndexOutOfBoundsException If the encoding exceeds <CODE>maxDataLength</CODE>. 0N/A * Gets the PDU encoded in this message. 0N/A * This method decodes the data field and returns the resulting PDU. 0N/A * @return The resulting PDU. 0N/A * @exception SnmpStatusException If the encoding is not valid. 0N/A * Dumps the content of a byte buffer using hexadecimal form. 0N/A * @param b The buffer to dump. 0N/A * @param offset The position of the first byte to be dumped. 0N/A * @param len The number of bytes to be dumped starting from offset. 0N/A * @return The string containing the dump. 0N/A int j = b[i] &
0xFF ;
0N/A * Dumps this message in a string. 0N/A * @return The string containing the dump. 0N/A * For SNMP Runtime private use only. 0N/A // Remember: the encoder does backward encoding 0N/A * For SNMP Runtime private use only. 0N/A * For SNMP Runtime private use only. 0N/A * For SNMP Runtime private use only. 0N/A // bugId 4641696 : RuntimeExceptions must be transformed in 0N/A // BerException("Can't build SnmpInt from decoded value."); 0N/A // BerException("Can't build SnmpString from decoded value."); 0N/A // BerException("Can't build SnmpOid from decoded value."); 0N/A // BerException("Can't build SnmpNull from decoded value."); 0N/A // Application syntax 0N/A // BerException("Can't build SnmpIpAddress from decoded value."); 0N/A // BerException("Can't build SnmpCounter from decoded value."); 0N/A // BerException("Can't build SnmpGauge from decoded value."); 0N/A // BerException("Can't build SnmpTimeticks from decoded value."); 0N/A // BerException("Can't build SnmpOpaque from decoded value."); 0N/A // BerException("Can't build SnmpCounter64 from decoded value.");