|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.netsnmp.PDU
Primary Data Unit A message that sent to or received from a remote SNMP agent.
import org.netsnmp.* ; class mySysRequest {NetSNMPSession
sess = new org.netsnmp.NetSNMPSession("remotehost", "community") ;PDU
pdu = new PDU(NetSNMP.MSG_SET) ; finalOID
oid = new DefaultOID("iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0") ;NetSNMPAction
l = new NetSNMPAction { public boolean actionPerformed(int result,NetSNMPSession
sess,PDU
receivedPDU, Object o) { } } } sess.addListener(l) ; pdu.addNullEntry(oid) ; sess.send(pdu, null) ;
Nested Class Summary | |
static class |
PDU.entry
Entry of an individual data item. |
static class |
PDU.PDU_COMMAND
Typesafe enum for specific PDU_COMMANDS |
Field Summary | |
byte[] |
agent_addr
|
static int |
ASN_CONSTRUCTOR
|
static int |
ASN_CONTEXT
|
OID |
enterprise
|
PDU.entry[] |
entries
|
int |
errIndex
|
int |
errStatus
|
int |
maxRepetitions
|
int |
nonRepeaters
|
protected int |
requestID
|
static PDU.PDU_COMMAND |
SNMP_MSG_GET
Command type to request values from a remote agent |
static PDU.PDU_COMMAND |
SNMP_MSG_GETBULK
Command type to get 'bulk' repsonses from remote agents |
static PDU.PDU_COMMAND |
SNMP_MSG_GETNEXT
Command type to request the next object from a remote agent |
static PDU.PDU_COMMAND |
SNMP_MSG_INFORM
|
static PDU.PDU_COMMAND |
SNMP_MSG_REPORT
|
static PDU.PDU_COMMAND |
SNMP_MSG_RESPONSE
|
static PDU.PDU_COMMAND |
SNMP_MSG_SET
Command type to set values from a remote agent |
static PDU.PDU_COMMAND |
SNMP_MSG_TRAP
|
static PDU.PDU_COMMAND |
SNMP_MSG_TRAP2
|
int |
specific_type
|
int |
time
|
int |
trap_type
|
PDU.PDU_COMMAND |
type
|
Constructor Summary | |
PDU()
|
|
PDU(PDU.PDU_COMMAND t)
|
Method Summary | |
void |
addEntry(int[] oidDescr,
ASNValue v)
|
void |
addEntry(OID o,
ASNValue v)
|
OID |
addEntry(String desc,
ASNValue v)
Add an entry into the PDU |
void |
addNullEntries(OID[] oids)
Allows you to add a large ammount of oids all at once rather than one at a time |
void |
addNullEntry(OID desc)
Add a null entry to the PDU |
void |
addNullEntry(OID desc,
int instance)
Add a null entry to the PDU |
OID |
addNullEntry(String desc)
Adds a new null entry to the PDU |
void |
addNullEntry(String desc,
int instance)
Adds a new null entry to the PDU |
void |
append(PDU pdu)
Append the entries from pdu to this one. |
String |
errString()
|
ASNValue |
findValue(OID oid)
Retrieve a value from the pdu corresponding to the oid |
ASNValue |
findValue(OID oid,
int inst)
Retrieives a value from the pdu corresponding to the oid and the instance |
int |
nValues()
|
int |
requestID()
|
void |
setEntries(OID[] oids,
ASNValue[] values)
|
void |
setEntries(PDU.entry[] new_entries)
|
void |
setValue(OID oid,
ASNValue value)
Replaces the existing value corresponding to oid in the pdu. |
int |
size()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public byte[] agent_addr
public OID enterprise
public PDU.entry[] entries
public int errStatus
public int errIndex
public int maxRepetitions
public int nonRepeaters
protected int requestID
public int specific_type
public int time
public int trap_type
public PDU.PDU_COMMAND type
public static int ASN_CONSTRUCTOR
public static int ASN_CONTEXT
public static final PDU.PDU_COMMAND SNMP_MSG_GET
public static final PDU.PDU_COMMAND SNMP_MSG_GETBULK
public static final PDU.PDU_COMMAND SNMP_MSG_GETNEXT
public static final PDU.PDU_COMMAND SNMP_MSG_INFORM
public static final PDU.PDU_COMMAND SNMP_MSG_REPORT
public static final PDU.PDU_COMMAND SNMP_MSG_RESPONSE
public static final PDU.PDU_COMMAND SNMP_MSG_SET
public static final PDU.PDU_COMMAND SNMP_MSG_TRAP
public static final PDU.PDU_COMMAND SNMP_MSG_TRAP2
Constructor Detail |
public PDU()
public PDU(PDU.PDU_COMMAND t)
Method Detail |
public void addEntry(int[] oidDescr, ASNValue v)
public void addEntry(OID o, ASNValue v)
o
- OID of the object being addedv
- the value associated with the oidpublic OID addEntry(String desc, ASNValue v) throws MIBItemNotFound
desc
- object ID descriptor
MIBItemNotFound
public void addNullEntries(OID[] oids)
public void addNullEntry(OID desc)
desc
- OID of the entrypublic void addNullEntry(OID desc, int instance)
desc
- descriptor of the objectinstance
- instance of the objectpublic OID addNullEntry(String desc) throws MIBItemNotFound
desc
- symbolic descriptor of the object
MIBItemNotFound
- if the Item was not found in the currently loaded MIBspublic void addNullEntry(String desc, int instance) throws MIBItemNotFound
desc
- symbolc descriptor of the objectinstance
- instance of the object
MIBItemNotFound
- if the item was not found in the currently loaded MIBspublic void append(PDU pdu)
pdu
- PDU to appendpublic String errString()
public ASNValue findValue(OID oid)
oid
- corresponding to the value within the PDU
public ASNValue findValue(OID oid, int inst)
oid
- specifier for the objectinst
- particular instance of the object
public int nValues()
public int requestID()
public void setEntries(PDU.entry[] new_entries)
new_entries
- entries to replace the current entries withpublic void setEntries(OID[] oids, ASNValue[] values)
oids
- OIDs of the entries to replace the current entries withvalues
- values of the entries to replace the current entries withpublic void setValue(OID oid, ASNValue value)
oid
- object identifier for the valuevalue
- to setpublic int size()
public String toString()
toString
in class Object
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |