com.sun.jaw.snmp.common
Class SnmpPduPacket

java.lang.Object
  |
  +--com.sun.jaw.snmp.common.SnmpPduPacket
Direct Known Subclasses:
SnmpPduBulk, SnmpPduRequest, SnmpPduTrap

public abstract class SnmpPduPacket
extends java.lang.Object
implements SnmpDefinitions, java.io.Serializable

An SnmpPduPacket object is the fully decoded representation of an SNMP packet.

You normally don't need to use this class except if you decide to implement your own SnmpPduFactoryIf object.

Classes are derived from SnmpPduPacket to represent the different forms of SNMP packets ( SnmpPduRequest, SnmpPduTrap, SnmpPduBulk). The SnmpPduPacket class defines the attributes common to every form of SNMP packets.

See Also:
SnmpMessage, SnmpPduFactoryIf, Serialized Form

Field Summary
 java.net.InetAddress address
          Source or destination address.
 byte[] community
          Community name.
 int port
          Source or destination port.
 int requestId
          Request identifier.
 int type
          PDU type.
 SnmpVarBind[] varBindList
          List of variables.
 int version
          Protocol version.
 
Constructor Summary
SnmpPduPacket()
           
 
Method Summary
static java.lang.String pduTypeToString(int cmd)
          Returns the string representation of a pdu type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

public int type
PDU type. Types are defined in SnmpDefinitions.

version

public int version
Protocol version. Versions are defined in SnmpDefinitions.

community

public byte[] community
Community name.

varBindList

public SnmpVarBind[] varBindList
List of variables.

requestId

public int requestId
Request identifier. Note that this field is not used by SnmpPduTrap.

address

public java.net.InetAddress address
Source or destination address.

For an incoming PDU it's the source.
For an outgoing PDU it's the destination.


port

public int port
Source or destination port.

For an incoming PDU it's the source.
For an outgoing PDU it's the destination.

Constructor Detail

SnmpPduPacket

public SnmpPduPacket()
Method Detail

pduTypeToString

public static java.lang.String pduTypeToString(int cmd)
Returns the string representation of a pdu type. For instance, if the pdu type is SnmpDefinitions.pduGetRequestPdu, the method will return "SnmpGet".
Parameters:
cmd - The int representation of the pdu type.
Returns:
The string representation of the pdu type.