All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Snmp.SnmpPDU

java.lang.Object
   |
   +----Snmp.SnmpPDU

public class SnmpPDU
extends Object
The SnmpPDU class. Most of it is based on required SNMP PDU components.

To send a request a PDU needs to be instantiated and filled in. The request type, SnmpPDU.command, e.g. SnmpAPI.SNMP_GET_REQ, has to be set for the PDU. Also, the remote SNMP peer address and remotePort are needed, if they have not already been set for the session.

When a PDU is re-used, ensure the reqid field is set properly. If reqid is set nonzero, the API leaves it alone. If it's 0 the API assigns a unique reqid, to ensure no conflict with other requests. So, if you do not want to manage the reqids yourself, set it to 0 before each request. With syncSend() you don't need to care what the value is. With send(), the reqid assigned is returned.


Variable Index

 o address
Address of SNMP peer
 o agent_addr
address of object generating trap
 o command
Type of this PDU
 o community
Community string received/sent
 o data
Encoded data to be sent, or received
 o enterprise
System OID
 o errindex
Error index
 o errstat
Error status
 o remoteHost
Name of SNMP peer - needed for Applets that cannot resolve hosts
 o remotePort
Remote port of SNMP peer
 o reqid
Request id
 o specific_type
specific type
 o time
Uptime
 o trap_type
trap type
 o variables
list of SnmpVarBind objects
 o version
SNMP Version number in PDU

Constructor Index

 o SnmpPDU(SnmpAPI)
Constructor, uses api to source SNMP parameters

Method Index

 o addNull(SnmpOID)
Add variable binding with specified OID and NULL variable to PDU
 o copy()
Make copy of PDU
 o decode()
Decodes received PDU from byte stream
 o fix()
Fix PDU to eliminate errored variable binding, determined by errindex
 o get_encoded_length()
Return the length of the encoded pdu
 o printVarBinds()
Return String of all variable bindings with Tags, e.g.
 o round_trip_delay()
Return round-trip delay if received response PDU

Variables

 o address
 public InetAddress address
Address of SNMP peer

 o remoteHost
 public String remoteHost
Name of SNMP peer - needed for Applets that cannot resolve hosts

 o remotePort
 public int remotePort
Remote port of SNMP peer

 o command
 public byte command
Type of this PDU

 o reqid
 public int reqid
Request id

 o errstat
 public int errstat
Error status

 o errindex
 public int errindex
Error index

 o enterprise
 public SnmpOID enterprise
System OID

 o agent_addr
 public InetAddress agent_addr
address of object generating trap

 o trap_type
 public int trap_type
trap type

 o specific_type
 public int specific_type
specific type

 o time
 public long time
Uptime

 o variables
 public Vector variables
list of SnmpVarBind objects

 o community
 public String community
Community string received/sent

 o data
 public byte data[]
Encoded data to be sent, or received

 o version
 public int version
SNMP Version number in PDU

Constructors

 o SnmpPDU
 public SnmpPDU(SnmpAPI api)
Constructor, uses api to source SNMP parameters

Methods

 o addNull
 public void addNull(SnmpOID oid)
Add variable binding with specified OID and NULL variable to PDU

 o fix
 public void fix()
Fix PDU to eliminate errored variable binding, determined by errindex

 o round_trip_delay
 public long round_trip_delay()
Return round-trip delay if received response PDU

 o printVarBinds
 public String printVarBinds()
Return String of all variable bindings with Tags, e.g. STRING:...

 o get_encoded_length
 public int get_encoded_length()
Return the length of the encoded pdu

 o decode
 public boolean decode() throws SnmpException
Decodes received PDU from byte stream

Throws: SnmpException
is thrown upon decode errors.
 o copy
 public SnmpPDU copy()
Make copy of PDU


All Packages  Class Hierarchy  This Package  Previous  Next  Index