AGENT++  4.0.3
Classes | Macros | Functions | Variables
mib.h File Reference
#include <libagent.h>
#include <agent_pp/agent++.h>
#include <agent_pp/List.h>
#include <agent_pp/threads.h>
#include <agent_pp/mib_avl_map.h>
#include <agent_pp/snmp_pp_ext.h>
#include <agent_pp/mib_entry.h>
#include <agent_pp/oidx_ptr.h>
#include <agent_pp/tools.h>
#include <agent_pp/request.h>
#include <agent_pp/mib_context.h>

Go to the source code of this file.

Classes

class  MibLeaf
 An instance of the class MibLeaf represents a leaf object in the managed object registration tree. More...
 
class  snmpRowStatus
 The snmpRowStatus class is derived from MibLeaf and provides functionality to control the manipulation of MibTable rows. More...
 
class  MibTableRow
 
class  MibTableVoter
 The MibTableVoter class defines an interface for objects that want to be ask before a status transition of a MibTableRow is performed by a MibTable instance. More...
 
struct  index_info
 
class  MibTable
 
class  NotificationSender
 The abstract class NotificationSender defines the interface for all classes capable of sending notifications or inform requests. More...
 
class  NotificationType
 The abstract class NotificationType defines the interface for all classes implementing a NOTIFICATION-TYPE or TRAP-TYPE SMI construct. More...
 
class  MibConfigFormat
 The MibConfigFormat is a pure virtual class that defines the interface for configuration formats that can be used to load and store persistent Mib data. More...
 
class  MibConfigBER
 The MibConfigBER implements the default persistent data configuration format that is using BER encoding for platform independent storage. More...
 
class  Mib
 

Macros

#define DEFAULT_PATH_PERSISTENT_MO   "config/"
 
#define VARIABLE_INDEX_LENGTH   0
 
#define DEFAULT_ROW_CREATION_TIMEOUT   300
 
#define VMODE_NONE   0
 
#define VMODE_DEFAULT   1
 
#define VMODE_LOCKED   2
 
#define LEAF_VALUE_INITIALIZED   1
 
#define LEAF_VALUE_SET   2
 
#define rowEmpty   0
 
#define rowActive   1
 
#define rowNotInService   2
 
#define rowNotReady   3
 
#define rowCreateAndGo   4
 
#define rowCreateAndWait   5
 
#define rowDestroy   6
 
#define AGENTPP_DECL_TEMPL_LIST_MIBLEAF
 The MibTableRow class is a container class for MibLeaf objects.
 
#define AGENTPP_DECL_TEMPL_ORDEREDLIST_MIBLEAF
 
#define AGENTPP_DECL_TEMPL_ORDEREDARRAY_MIBLEAF
 
#define AGENTPP_DECL_TEMPL_LIST_MIBTABLE
 Instances of MibTable represent SNMP tables.
 
#define AGENTPP_DECL_TEMPL_LIST_MIBTABLEROW
 
#define AGENTPP_DECL_TEMPL_LIST_MIBTABLEVOTER
 
#define AGENTPP_DECL_TEMPL_OIDLIST_MIBTABLEROW
 
#define AGENTPP_DECL_TEMPL_ORDEREDLIST_MIBTABLEROW
 
#define AGENTPP_DECL_TEMPL_ARRAY_MIBCONFIGFORMAT
 The AGENT++ Mib class represents a central part of any agent - the Management Information Base (MIB).
 
#define AGENTPP_DECL_TEMPL_OIDLIST_MIBCONTEXT
 

Functions

void * mib_method_routine_caller (void *)
 

Variables

class AGENTPP_DECL MibTableRow
 
class AGENTPP_DECL MibTable
 
AGENTPP_DECL_TEMPL template
class AGENTPP_DECL 
List< MibLeaf >
 
AGENTPP_DECL_TEMPL template
class AGENTPP_DECL 
OrderedList< MibLeaf >
 
AGENTPP_DECL_TEMPL template
class AGENTPP_DECL 
OrderedArray< MibLeaf >
 
AGENTPP_DECL_TEMPL template
class AGENTPP_DECL 
List< MibTable >
 
AGENTPP_DECL_TEMPL template
class AGENTPP_DECL 
List< MibTableRow >
 
AGENTPP_DECL_TEMPL template
class AGENTPP_DECL 
List< MibTableVoter >
 
AGENTPP_DECL_TEMPL template
class AGENTPP_DECL 
OidList< MibTableRow >
 
AGENTPP_DECL_TEMPL template
class AGENTPP_DECL 
OrderedList< MibTableRow >
 
AGENTPP_DECL_TEMPL template
class AGENTPP_DECL 
Array< MibConfigFormat >
 
AGENTPP_DECL_TEMPL template
class AGENTPP_DECL 
OidList< MibContext >
 

Macro Definition Documentation

#define AGENTPP_DECL_TEMPL_ARRAY_MIBCONFIGFORMAT

The AGENT++ Mib class represents a central part of any agent - the Management Information Base (MIB).

The MIB of a SNMP agent is a conceptual database rather than a real database. An Agent has exactly one MIB, thus the Mib class is a singleton. Mib has three main functional areas:

(a) Registration of MIB objects

Use the add member functions to add a MIB object (any C++ object derived from MibEntry) to the agent�s MIB. Use the remove member functions to remove a MIB object from the agent�s MIB. Both functions can be used while the agent is running.

(b) Receive and Process SNMP Requests

Incoming SNMP requests are accepted by using the receive member function. The receive function waits for such a request until a given timeout is reached. The timeout is given in seconds and if it is zero receive looks for a pending request and returns it immediately or if is not such a request receive returns the null pointer.

A request is processed by the agent by calling the process_request member function of the agent's MIB. Depending of the request type the get_request, get_next_request, or prepare_set_request, commit_set_request, undo_set_request, and cleanup_set_request of each target MIB object is called. Because the targets of SNMP requests are managed objects, but the MIB contains only MIB objects the mib object determines which MIB object manages which managed object. So, process_request calls the appropriate of the above mentioned functions for each target managed object.

When the agent ist multi-threaded the method routines called by a request are executed within the same thread. This thread is then different from the master thread accepting new request.

(c) Sending notifications

To send a notification (trap) or inform request, use the notify method. By default Mib uses a NotificationOriginator instance to send notifications. You can override this behavior by assigning a different NotificationSender with set_notification_sender.

Proxy Forwared Applications

Since version 3.4.2 of AGENT++ proxy forwarder applications (including trap forwarding) are supported through the ProxyForwarder class. A proxy forwarder application is registered by calling the register_proxy method. It then can be unregistered with unregister_proxy. Please refer to RFC2573 for more information about proxy forwarding.

Author
Frank Fock
Version
3.5.22
#define AGENTPP_DECL_TEMPL_LIST_MIBLEAF

The MibTableRow class is a container class for MibLeaf objects.

A MibTableRow instance represents a row of a SNMP table. The MibTableRow class provides functions to add MibLeaf objects to a row and functions to find and get them again. Normally a user of the AGENT++ API does not have to be concerned with MibTableRow as the MibTable class provides the corresponding wrapper member functions for the above listed operations on rows.

Author
Frank Fock
Version
3.5.22
#define AGENTPP_DECL_TEMPL_LIST_MIBTABLE

Instances of MibTable represent SNMP tables.

The MibTable class is a container class for MibTableRow objects, but seen from the users view point a MibTable seems to contain only MibLeaf objects. A MibTable object must be initialised by adding to it a set of MibLeaf objects called columnar objects. This is best done in the constructor of a sub-class of MibTable by using the add_col member function.

Each columnar object is the master copy for any columnar object instance of its column. Whenever a new row is created MibTable will clone each columnar object once to build the new row. Hence, it is necessary to redefine the clone method of every class derived from MibLeaf.

The index of a SNMP table may consist of a fixed or a variable size object identifier representing one or more string, unsigned integer, IP address, or object identifier values. If the size of an object (oid or string) is of variable length, then this object is converted into an oid value by first encoding the length of the object value and then its value. For example

"012" is encoded as .3.48.49.50 "1.3.6.1" is encoded as .4.1.3.6.1

In SMIv2 the last variable length string or oid value of an index may be of implied length. Thus, the length subidentifier can be omitted.

In AGENT++, the structure of a table's index is given by an array of index_info structures. Each element represents an object of the index. The type attribute denotes the SNMP type of the sub-index object. The implied flag may be true for the last sub-index object only. In addition, only variable length sub-index objects may have implied length. Variable length sub-index objects may be strings or OIDs. These objects may have a minimum length which is less than their maximum length. For fixed length sub-index objects the minimum length equals the maximum length. In either case, the length is measured in subidentifiers.

As soon as all columnar objects have been added, rows can be added to the empty table by using the add_row member function. The add_row member function needs an object identifier representing the row's index as single parameter. The MibLeaf objects cloned from the columnar objects are then responsible for answering SNMP requests. Rows can be added automatically by SNMP SET requests if the MibTable object contains a snmpRowStatus columnar object. See snmpRowStatus for more information about the SMIv2 row status mechanism. Rows can be removed with the remove_row member function.

Whenever the status of a row is changed the fire_row_changed method is called. This calls the row_added, row_delete, row_activated, or row_deactivated method of the owner (accordingly to the ocurred event) and same method for of all registered listeners.

Author
Frank Fock
Version
3.5.22
#define AGENTPP_DECL_TEMPL_LIST_MIBTABLEROW
#define AGENTPP_DECL_TEMPL_LIST_MIBTABLEVOTER
#define AGENTPP_DECL_TEMPL_OIDLIST_MIBCONTEXT
#define AGENTPP_DECL_TEMPL_OIDLIST_MIBTABLEROW
#define AGENTPP_DECL_TEMPL_ORDEREDARRAY_MIBLEAF
#define AGENTPP_DECL_TEMPL_ORDEREDLIST_MIBLEAF
#define AGENTPP_DECL_TEMPL_ORDEREDLIST_MIBTABLEROW
#define DEFAULT_PATH_PERSISTENT_MO   "config/"
#define DEFAULT_ROW_CREATION_TIMEOUT   300
#define LEAF_VALUE_INITIALIZED   1
#define LEAF_VALUE_SET   2
#define rowActive   1
#define rowCreateAndGo   4
#define rowCreateAndWait   5
#define rowDestroy   6
#define rowEmpty   0
#define rowNotInService   2
#define rowNotReady   3
#define VARIABLE_INDEX_LENGTH   0
#define VMODE_DEFAULT   1
#define VMODE_LOCKED   2
#define VMODE_NONE   0

Function Documentation

void* mib_method_routine_caller ( void *  )

Variable Documentation

AGENTPP_TEMPL template class AGENTPP_DECL List< MibLeaf >
AGENTPP_TEMPL template class AGENTPP_DECL OrderedList< MibLeaf >