AGENT++
4.0.3
|
An instance of the class MibLeaf represents a leaf object in the managed object registration tree. More...
#include <mib.h>
Public Member Functions | |
MibLeaf () | |
Default constructor. | |
MibLeaf (const Oidx &, mib_access, NS_SNMP SmiUINT32) | |
Construct a MibLeaf object. | |
MibLeaf (const Oidx &, mib_access, NS_SNMP SnmpSyntax *) | |
Construct a MibLeaf object. | |
MibLeaf (const Oidx &, mib_access, NS_SNMP SnmpSyntax *, int) | |
Construct a MibLeaf object. | |
MibLeaf (const MibLeaf &) | |
Copy Constructor. | |
virtual | ~MibLeaf () |
Destructor. | |
virtual void | init (NS_SNMP SnmpSyntax *, int) |
Initialize a MibLeaf object. | |
virtual mib_type | type () const |
Return the type of the receiver. | |
virtual MibEntryPtr | clone () |
Clone the receiver object. | |
virtual bool | serialize (char *&, int &) |
Serialize the value of the receiver. | |
virtual bool | deserialize (char *, int &) |
Read the value of the receiver from a byte stream. | |
virtual NS_SNMP SmiUINT32 | get_syntax () const |
Get the syntax of the receiver's value. | |
virtual Vbx | get_value () const |
Get the value of the receiver. | |
virtual int | get_value (NS_SNMP SnmpSyntax &s) const |
Get the value of the receiver. | |
virtual int | get_value (int &i) const |
Get the value of the receiver. | |
virtual int | get_value (long &i) const |
Get the value of the receiver. | |
virtual int | get_value (unsigned long &i) const |
Get the value of the receiver. | |
virtual int | get_value (char *c) const |
Get the value of the receiver. | |
virtual void | set_value (const NS_SNMP SnmpSyntax &) |
Set the value of the receiver by value. | |
virtual void | set_value (const unsigned long) |
Set the unsigned integer value of the receiver. | |
virtual int | set_value (const Vbx &) |
Set the value of the receiver from a variable binding and checks for validity of the variable binding and compatible syntax and oid. | |
virtual void | replace_value (NS_SNMP SnmpSyntax *s) |
Set the value of the receiver by reference. | |
virtual OidxPtr | max_key () |
Return the immediate successor of the greatest object identifier within the receiver's scope. | |
virtual void | get_request (Request *, int) |
Interface methods dispatch table <-> instrumentation. | |
virtual void | get_next_request (Request *, int) |
Let the receiver process a SNMP GETNEXT subrequest. | |
virtual int | commit_set_request (Request *, int) |
Let the receiver commit a SNMP SET subrequest. | |
virtual int | prepare_set_request (Request *, int &) |
Let the receiver prepare a SNMP SET subrequest. | |
virtual int | undo_set_request (Request *, int &) |
Let the receiver undo a SNMP SET subrequest. | |
virtual void | cleanup_set_request (Request *, int &) |
Clean up resources used for performing (or undoing) set requests. | |
virtual bool | value_ok (const Vbx &) |
Check whether the receiver's value may be set to the given new value. | |
virtual int | set (const Vbx &vb) |
Set the receiver's value and backup its old value for a later undo. | |
virtual int | unset () |
Undo a previous set. | |
MibTable * | get_reference_to_table () |
Return a pointer to the table the receiver belongs to. | |
MibTableRow * | get_reference_to_row () |
Return a pointer to the row the receiver belongs to. | |
int | valid () |
Gets the flags (bits) that determine the type/stage of validity of the leaf's value. | |
bool | has_default () |
Return whether the receiver has a default value. | |
bool | is_locked () |
Return whether the receiver has a default value. | |
void | set_reference_to_table (MibTable *t) |
Set the receiver's reference to its table. | |
void | set_reference_to_row (MibTableRow *r) |
Set the receiver's reference to its row. | |
void | set_access (mib_access a) |
Set the maximum access rights of the receiver. | |
Oidx | get_oid () const |
Get the instance OID of the MibLeaf object. | |
Public Member Functions inherited from MibEntry | |
MibEntry () | |
Default constructor. | |
MibEntry (const Oidx &, mib_access) | |
Construct a MibEntry instance with a given object identifier and maximum access rights. | |
MibEntry (const MibEntry &) | |
Copy constructor. | |
virtual | ~MibEntry () |
Destructor. | |
virtual Oidx | find_succ (const Oidx &, Request *req=0) |
Return the successor of a given object identifier within the receiver's scope and the context of a given Request. | |
virtual void | load_from_file (const char *) |
Load the value(s) of the receiver node from a file. | |
virtual void | save_to_file (const char *) |
Save the value(s) of the receiver node to a file. | |
virtual bool | is_empty () |
Check whether the receiver node contains any instance of a managed object. | |
virtual void | notify_change (const Oidx &, mib_change) |
Notify all registered nodes of changes to an object managed by the receiver node. | |
virtual void | register_for_notifications (MibEntry *) |
Register an MibEntry object to receive notifications about changes of the receiver node. | |
virtual void | add_change_notification (MibEntry *e) |
Wrapper function for register_for_notifications. | |
virtual void | change_notification (const Oidx &, mib_change) |
Receive a notification about changes to a managed object. | |
OidxPtr | key () |
Return a pointer to the key (object identifier) of the receiver. | |
virtual mib_access | get_access () |
Return the maximum access rights for the managed object represented by the receiver node. | |
virtual bool | is_volatile () |
Check whether the entry is volatile or not. | |
virtual void | reset () |
Resets (clears) the content of this entry. | |
int | operator< (const MibEntry &) const |
int | operator> (const MibEntry &) const |
int | operator== (const MibEntry &) const |
int | operator< (const Oidx &) const |
int | operator> (const Oidx &) const |
int | operator<= (const Oidx &) const |
int | operator>= (const Oidx &) const |
int | operator== (const Oidx &) const |
Public Member Functions inherited from ThreadManager | |
ThreadManager () | |
Default constructor. | |
virtual | ~ThreadManager () |
Destructor. | |
void | start_synch () |
Start synchronized execution. | |
void | end_synch () |
End synchronized execution. | |
Public Member Functions inherited from Synchronized | |
Synchronized () | |
~Synchronized () | |
void | wait () |
Causes current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object. | |
bool | wait (unsigned long timeout) |
Causes current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed. | |
void | notify () |
Wakes up a single thread that is waiting on this object's monitor. | |
void | notify_all () |
Wakes up all threads that are waiting on this object's monitor. | |
bool | lock () |
Enter a critical section. | |
TryLockResult | trylock () |
Try to enter a critical section. | |
bool | unlock () |
Leave a critical section. | |
Protected Member Functions | |
int | get_value_mode () |
Return the value handle mode. | |
void | set_validity (int flags) |
Sets the flags (bits) that determine the type/stage of validity of the leaf's value. | |
void | set_syntax (NS_SNMP SmiUINT32) |
Set the syntax of the receiver's value and delete the old value. | |
void | free_value () |
Frees the receiver's value and sets it to NULL. | |
Protected Member Functions inherited from MibEntry | |
void | set_oid (const Oidx &) |
Set the object identifier of the receiver node. | |
Protected Attributes | |
NS_SNMP SnmpSyntax * | value |
NS_SNMP SnmpSyntax * | undo |
int | value_mode |
int | validity |
Set of flags (bits) that determine the type/stage of validity of the leaf's value. | |
MibTable * | my_table |
MibTableRow * | my_row |
Protected Attributes inherited from MibEntry | |
Oidx | oid |
mib_access | access |
List< MibEntry > | notifies |
Friends | |
class | MibTable |
class | MibTableRow |
Additional Inherited Members | |
Public Types inherited from Synchronized | |
enum | TryLockResult { LOCKED = 1, BUSY = 0, OWNED = -1 } |
Static Public Member Functions inherited from ThreadManager | |
static void | start_global_synch () |
Start global synchronized execution. | |
static void | end_global_synch () |
End global synchronized execution. | |
An instance of the class MibLeaf represents a leaf object in the managed object registration tree.
MibLeaf objects can be used to model scalar managed objects as well as objects of SNMP tables. The objects of a table are defined by defining their corresponding columnar objects. The instances of each columnar object (which is itself not accessible) are then cloned from it.
In order to save memory space, from version 3.4.7 on the key() method does no longer return the complete OID (instance OID) of columnar MibLeaf objects (thus MibLeaf objects that are part of a table). Instead, MibLeaf::key() only returns the last subid that identifies the column the MibLeaf is part of. From v3.4.7 on, there is the get_oid() method that returns the entiry OID value for columnar objects as well as for other MibLeaf objects. For columnar objects this method computes the OID value from the table's OID plus the MibLeaf's column (key()), and the row's index value.
MibLeaf is a sub-class of the abstract MibEntry class. As MibLeaf represents a managed object instance a MibLeaf object contains management information. So each MibLeaf object contains a pointer "value" to that management information which can be any object derived from SnmpSyntax.
MibLeaf::MibLeaf | ( | ) |
Default constructor.
MibLeaf::MibLeaf | ( | const Oidx & | , |
mib_access | , | ||
NS_SNMP | SmiUINT32 | ||
) |
Construct a MibLeaf object.
o | - The object identifier of the managed object. If it is part of a table, only the column subidentifier is given. If it is a scalar object the object identifier given includes the full registration oid including the suffix ".0". |
a | - The maximum access rights for the managed object. |
s | - The syntax of the managed object. |
MibLeaf::MibLeaf | ( | const Oidx & | , |
mib_access | , | ||
NS_SNMP SnmpSyntax * | |||
) |
Construct a MibLeaf object.
o | - The object identifier of the managed object. If it is part of a table, only the column subidentifier is given. If it is a scalar object the object identifier given includes the full registration oid including the suffix ".0". |
a | - The maximum access rights for the managed object. |
s | - A pointer to the SnmpSyntax object to be used for storing the value of the managed object. NOTE: Do not delete this pointer from outside MibLeaf. It will be deleted by ~MibLeaf |
MibLeaf::MibLeaf | ( | const Oidx & | , |
mib_access | , | ||
NS_SNMP SnmpSyntax * | , | ||
int | |||
) |
Construct a MibLeaf object.
oid | the object identifier of the managed object. If it is part of a table, only the column subidentifier is given. If it is a scalar object the object identifier given includes the full registration oid including the suffix ".0". |
access | the maximum access rights for the managed object. |
value | a pointer to the SnmpSyntax object to be used for storing the value of the managed object. NOTE: Do not delete this pointer from outside MibLeaf. It will be deleted by ~MibLeaf |
valueMode | contains an ored value of one or more of the following modes: VMODE_DEFAULT: the value of the object pointed by value will be used as default value, otherwise the managed object has no default value. VMODE_LOCKED: value is locked (cannot be modified) while the row status of the receiver's row is active(1). This mode has no effect, if the the leaf is a scalar or otherwise if the receiver's row has no snmpRowStatus. |
MibLeaf::MibLeaf | ( | const MibLeaf & | ) |
Copy Constructor.
|
virtual |
Destructor.
|
virtual |
Clean up resources used for performing (or undoing) set requests.
req | - A pointer to the whole SNMP SET request. |
ind | - The index of the subrequest to be processed. |
Reimplemented from MibEntry.
|
virtual |
Clone the receiver object.
Reimplemented from MibEntry.
Reimplemented in DateAndTime, TimeStamp, SnmpAdminString, SnmpMessageProcessingModel, SnmpSecurityLevel, SnmpSecurityModel, OctetStrMinMax, SnmpInt32MinMax, snmpRowStatus, StorageType, VacmViewTreeFamilyTableStatus, VacmAccessTableStatus, SnmpTagList, SnmpTagValue, SnmpEngineID, SimRowStatus, SimMibLeaf, snmpTargetAddrParams, SnmpDisplayString, snmpTargetAddrTAddress, and snmpTargetAddrTDomain.
|
virtual |
Let the receiver commit a SNMP SET subrequest.
req | - A pointer to the whole SNMP SET request. |
ind | - The index of the subrequest to be processed. |
Reimplemented from MibEntry.
Reimplemented in agentppSimDeleteTableContents, and agentppSimDeleteRow.
|
virtual |
Read the value of the receiver from a byte stream.
buf | a pointer to the input byte stream. |
sz | the size of the input buffer. On output it contains the size remaining unread in the input buffer. |
Reimplemented from MibEntry.
|
protected |
Frees the receiver's value and sets it to NULL.
|
virtual |
Let the receiver process a SNMP GETNEXT subrequest.
req | - A pointer to the whole SNMP GETNEXT request. |
ind | - The index of the subrequest to be processed. |
Reimplemented from MibEntry.
|
inline |
Get the instance OID of the MibLeaf object.
If the leaf object is a columnar object then the instancce OID will be computed from the table's OID, plus the subidentifier of the leaf's column, and the row's index OID.
|
inline |
Return a pointer to the row the receiver belongs to.
|
inline |
Return a pointer to the table the receiver belongs to.
|
virtual |
Interface methods dispatch table <-> instrumentation.
Let the receiver process a SNMP GET subrequest
req | - A pointer to the whole SNMP GET request. |
ind | - The index of the subrequest to be processed. |
Reimplemented from MibEntry.
Reimplemented in snmpProxyDrops, snmpSilentDrops, snmpOutTraps, snmpOutGetResponses, snmpOutSetRequests, snmpOutGetNexts, snmpOutGetRequests, snmpOutGenErrs, snmpOutBadValues, snmpOutNoSuchNames, snmpOutTooBigs, snmpInTraps, snmpInGetResponses, snmpInSetRequests, snmpInGetNexts, snmpInGetRequests, snmpInTotalSetVars, simSysUpTime, snmpInTotalReqVars, snmpInGenErrs, snmpInReadOnlys, snmpInBadValues, snmpInNoSuchNames, snmpInTooBigs, snmpInASNParseErrs, snmpInBadCommunityUses, snmpInBadCommunityNames, snmpInBadVersions, snmpOutPkts, snmpInPkts, and sysUpTime.
|
virtual |
Get the syntax of the receiver's value.
|
virtual |
Get the value of the receiver.
|
inlinevirtual |
Get the value of the receiver.
s | - A reference to a SnmpSyntax object to hold a copy of the receiver's value. |
|
inlinevirtual |
Get the value of the receiver.
i | - A reference to an int the receiver's value will be copied in. |
|
inlinevirtual |
Get the value of the receiver.
i | - A reference to a long the receiver's value will be copied in. |
|
inlinevirtual |
Get the value of the receiver.
i | - A reference to an unsigned long the receiver's value will be copied in. |
|
inlinevirtual |
Get the value of the receiver.
c | - A pointer to a string the receiver's value will be copied in. |
|
inlineprotected |
Return the value handle mode.
|
inline |
Return whether the receiver has a default value.
|
virtual |
Initialize a MibLeaf object.
This method is typically called either from a constructor with value or when loading a value from persistent storage.
initialValue | a pointer to a SnmpSyntax object which will hold the value of this MibLeaf object. |
valueMode | contains an ored value of one or more of the following modes: VMODE_DEFAULT: the value of the object pointed by value will be used as default value, otherwise the managed object has no default value. VMODE_LOCKED: value is locked (cannot be modified) while the row status of the receiver's row is active(1). This mode has no effect, if the the leaf is a scalar or otherwise if the receiver's row has no snmpRowStatus. |
Reimplemented in agentppSimMode.
|
inline |
Return whether the receiver has a default value.
|
inlinevirtual |
Return the immediate successor of the greatest object identifier within the receiver's scope.
Reimplemented from MibEntry.
|
virtual |
Let the receiver prepare a SNMP SET subrequest.
req | - A pointer to the whole SNMP SET request. |
ind | - The index of the subrequest to be processed. |
Reimplemented from MibEntry.
Reimplemented in OctetStrMinMax, snmpRowStatus, TestAndIncr, SnmpTagValue, SnmpEngineID, snmpTargetAddrParams, agentppSimDeleteTableContents, SnmpDisplayString, agentppSimDeleteRow, and snmpTargetAddrTAddress.
|
virtual |
Set the value of the receiver by reference.
v | - A pointer to the new value. |
|
virtual |
Serialize the value of the receiver.
buf | - A pointer to byte stream buffer returned. |
sz | - The size of the buffer returned. |
Reimplemented from MibEntry.
|
virtual |
Set the receiver's value and backup its old value for a later undo.
vb | - The variable binding that holds the new value. |
Reimplemented in snmpRowStatus, VacmViewTreeFamilyTableStatus, TestAndIncr, and agentppSimMode.
|
inline |
Set the maximum access rights of the receiver.
a | - The maximum access rights. |
|
inline |
Set the receiver's reference to its row.
t | - A pointer to a MibTableRow instance. |
|
inline |
Set the receiver's reference to its table.
t | - A pointer to a MibTable instance. |
|
protected |
Set the syntax of the receiver's value and delete the old value.
syntax | - The syntax of a MibLeaf object's value. |
|
inlineprotected |
Sets the flags (bits) that determine the type/stage of validity of the leaf's value.
If any bit is set the leaf is supposed to contain a valid value. AGENT++ only uses the first 4 bits (0-3). The other bits can be used by the API programmer to track internal states of the leaf.
flags | an integer value representing the validity of the receiver. |
|
virtual |
Set the value of the receiver by value.
v | - The value. |
|
virtual |
Set the unsigned integer value of the receiver.
Caution: The syntax of this MibLeaf instance will be set to sNMP_SYNTAX_INT32! Thus, it should be only used for objects with an INTEGER syntax.
l | - The new integer value. |
|
virtual |
Set the value of the receiver from a variable binding and checks for validity of the variable binding and compatible syntax and oid.
vb | - The variable binding including the new value. |
|
virtual |
|
virtual |
Let the receiver undo a SNMP SET subrequest.
req | - A pointer to the whole SNMP SET request. |
ind | - The index of the subrequest to be processed. |
Reimplemented from MibEntry.
|
virtual |
Undo a previous set.
Reimplemented in snmpRowStatus.
|
inline |
Gets the flags (bits) that determine the type/stage of validity of the leaf's value.
If any bit is set the leaf is supposed to contain a valid value. AGENT++ only uses the first 4 bits (0-3). The other bits can be used by the API programmer to track internal states of the leaf.
|
inlinevirtual |
Check whether the receiver's value may be set to the given new value.
v | - A new value. |
Reimplemented in SnmpInt32MinMax, snmpRowStatus, StorageType, TestAndIncr, snmpEnableAuthenTraps, SnmpTagList, SnmpTagValue, snmpTargetAddrParams, SnmpDisplayString, agentppSimMode, and snmpTargetAddrTDomain.
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
Set of flags (bits) that determine the type/stage of validity of the leaf's value.
If any bit is set the leaf is supposed to contain a valid value. AGENT++ only uses the first 4 bits (0-3). The other bits can be used by the API programmer to track internal states of the leaf.
|
protected |
|
protected |