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.
-
address
- Address of SNMP peer
-
agent_addr
- address of object generating trap
-
command
- Type of this PDU
-
community
- Community string received/sent
-
data
- Encoded data to be sent, or received
-
enterprise
- System OID
-
errindex
- Error index
-
errstat
- Error status
-
remoteHost
- Name of SNMP peer - needed for Applets that cannot resolve hosts
-
remotePort
- Remote port of SNMP peer
-
reqid
- Request id
-
specific_type
- specific type
-
time
- Uptime
-
trap_type
- trap type
-
variables
- list of SnmpVarBind objects
-
version
- SNMP Version number in PDU
-
SnmpPDU(SnmpAPI)
- Constructor, uses api to source SNMP parameters
-
addNull(SnmpOID)
- Add variable binding with specified OID and NULL variable to PDU
-
copy()
- Make copy of PDU
-
decode()
- Decodes received PDU from byte stream
-
fix()
- Fix PDU to eliminate errored variable binding, determined by errindex
-
get_encoded_length()
- Return the length of the encoded pdu
-
printVarBinds()
- Return String of all variable bindings with Tags, e.g.
-
round_trip_delay()
- Return round-trip delay if received response PDU
address
public InetAddress address
- Address of SNMP peer
remoteHost
public String remoteHost
- Name of SNMP peer - needed for Applets that cannot resolve hosts
remotePort
public int remotePort
- Remote port of SNMP peer
command
public byte command
- Type of this PDU
reqid
public int reqid
- Request id
errstat
public int errstat
- Error status
errindex
public int errindex
- Error index
enterprise
public SnmpOID enterprise
- System OID
agent_addr
public InetAddress agent_addr
- address of object generating trap
trap_type
public int trap_type
- trap type
specific_type
public int specific_type
- specific type
time
public long time
- Uptime
variables
public Vector variables
- list of SnmpVarBind objects
community
public String community
- Community string received/sent
data
public byte data[]
- Encoded data to be sent, or received
version
public int version
- SNMP Version number in PDU
SnmpPDU
public SnmpPDU(SnmpAPI api)
- Constructor, uses api to source SNMP parameters
addNull
public void addNull(SnmpOID oid)
- Add variable binding with specified OID and NULL variable to PDU
fix
public void fix()
- Fix PDU to eliminate errored variable binding, determined by errindex
round_trip_delay
public long round_trip_delay()
- Return round-trip delay if received response PDU
printVarBinds
public String printVarBinds()
- Return String of all variable bindings with Tags, e.g. STRING:...
get_encoded_length
public int get_encoded_length()
- Return the length of the encoded pdu
decode
public boolean decode() throws SnmpException
- Decodes received PDU from byte stream
- Throws: SnmpException
- is thrown upon decode errors.
copy
public SnmpPDU copy()
- Make copy of PDU
All Packages Class Hierarchy This Package Previous Next Index