snmp
Class AsnObject
java.lang.Object
|
+--snmp.AsnObject
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- AsnInteger, AsnNull, AsnObjectId, AsnOctets, AsnSequence, AsnUnsInteger
- public abstract class AsnObject
- extends java.lang.Object
- implements java.io.Serializable
ASN.1 base class
- Version:
- $Revision: 1.1.1.1 $ $State: Exp $
- Author:
- Steve Bush
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SNMP_ERR_NOERROR
public static final byte SNMP_ERR_NOERROR
SNMP_ERR_TOOBIG
public static final byte SNMP_ERR_TOOBIG
SNMP_ERR_NOSUCHNAME
public static final byte SNMP_ERR_NOSUCHNAME
SNMP_ERR_BADVALUE
public static final byte SNMP_ERR_BADVALUE
SNMP_ERR_READONLY
public static final byte SNMP_ERR_READONLY
SNMP_ERR_GENERR
public static final byte SNMP_ERR_GENERR
SNMP_VERSION_1
public static final byte SNMP_VERSION_1
GET_REQ_MSG
public static final byte GET_REQ_MSG
GETNEXT_REQ_MSG
public static final byte GETNEXT_REQ_MSG
GET_RSP_MSG
public static final byte GET_RSP_MSG
SET_REQ_MSG
public static final byte SET_REQ_MSG
TRP_REQ_MSG
public static final byte TRP_REQ_MSG
CONS_SEQ
public static final byte CONS_SEQ
pdu_type
public byte pdu_type
AsnObject
public AsnObject()
LengthBytes
public int LengthBytes(int length)
- Returns length field size for a packet length
- Parameters:
length
- Length of data to see if it fits in packet.
AsnBuildHeader
public void AsnBuildHeader(java.io.OutputStream out,
byte type,
int length)
throws java.io.IOException
- Encode ASN header
- Parameters:
out
- Output streamtype
- Typelength
- Length
AsnMakeMe
public AsnObject AsnMakeMe(java.io.InputStream in,
byte type)
throws java.io.IOException
- Build an ASN.1 PDU.
- Parameters:
in
- Input streamtype
- SNMP Pdu or data type
AsnReadHeader
public AsnObject AsnReadHeader(java.io.InputStream in)
throws java.io.IOException
- Retrieve the ASN header from the input stream.
- Parameters:
in
- Input stream- Returns:
- Header ASN object
write
public abstract void write(java.io.OutputStream out)
throws java.io.IOException
size
public int size()
add
public AsnObject add(AsnObject child)
- Add a child to the sequence
- Parameters:
child
- An ASN object to the child- Returns:
- The child
findPdu
public AsnObject findPdu()
- Recursively look for a pduSequence object.
If not overridden - then not a sequence -
- Returns:
- A PduSequence object.