AgentX++
2.0.5
|
#include <agentx_master.h>
Public Member Functions | |
MasterAgentXMib () | |
Default Constructor. | |
MasterAgentXMib (const NS_SNMP OctetStr &) | |
Constructor with path where persistent MIB objects should be stored to and loaded from. | |
virtual | ~MasterAgentXMib () |
Destructor. | |
virtual void | set_agentx (AgentXMaster *) |
Set the AgentXMaster that will process AgentX messages. | |
AgentXMaster * | get_agentx () |
Get the AgentXMaster used by the receiver to process AgentX messages. | |
void | set_session_admin_status_writable (bool) |
Set the access mode for agentxSessionAdminStatus. | |
virtual MibEntry * | add (MibEntry *) |
Register a MIB object for the agent³s MIB. | |
virtual MibEntry * | add (const NS_SNMP OctetStr &, MibEntry *) |
Register a MIB object within a given context. | |
virtual bool | init () |
Start the master agent thread and initialize master MIB. | |
virtual void | process_agentx () |
Wait for an incoming AgentX request and process it. | |
virtual void | answer (AgentXPdu &) |
Answer an AgentX request. | |
virtual bool | is_dupl_reg (const AgentXRegEntry &) |
Check whether the given region would be a duplicate registration (a registration that would result in a duplicate region with the same priority and within the same context is termed a duplicate registration) | |
virtual void | add_get_subrequest (u_int, unsigned long, const AgentXSearchRange &, u_char, u_char, const NS_SNMP OctetStr &, int=0, int=0) |
Add a get-type sub-request to an AgentX transaction. | |
virtual void | add_set_subrequest (u_int, unsigned long, const AgentXSearchRange &, const Vbx &, u_char, u_char, const NS_SNMP OctetStr &) |
Add a set-type sub-request to an AgentX transaction. | |
virtual void | close_session (u_int, u_char) |
Close a session. | |
virtual void | set_auto_context (bool enabled) |
Enable or disable automatic context creation. | |
virtual Oidx | get_upper_session_boundary (const NS_SNMP OctetStr &, AgentXNode *) |
Gets the upper boundary of the AgentX session that the given node's active registration belongs to. | |
Protected Member Functions | |
virtual void | add_new_context (const NS_SNMP OctetStr &) |
Add a new context to the master. | |
AgentXIndexDB * | get_index_database (const NS_SNMP OctetStr &) |
Get index database for a given context. | |
virtual time_t | timeout_requests (time_t) |
Timeout old requests and return the time until next request will timeout. | |
virtual void | process_set_request (Request *) |
Process a set request. | |
virtual void | do_process_request (Request *) |
virtual void | finalize (Request *) |
Finalize a request. | |
virtual void | delete_request (Request *req) |
Unlocks the supplied request before it calls it corresponding super class method to actually delete the request. | |
virtual bool | send_pending_ax (unsigned long) |
Send pending AgentX requests for a given transaction id. | |
virtual bool | cancel_pending_ax (unsigned long) |
Cancel pending AgentX requests for a given transaction id. | |
virtual void | process_ax_request (AgentXPdu &) |
Process AgentX requests. | |
virtual void | process_ax_response (AgentXPdu &, bool) |
virtual bool | process_ax_search_response (AgentXPdu &, const AgentXPdu &, int *, Request *) |
virtual void | process_ax_set_response (AgentXPdu &, const AgentXPdu &, int *, Request *) |
virtual bool | process_ax_getbulk_response (AgentXPdu &, const AgentXPdu &, int *, Request *) |
virtual void | process_ax_open (AgentXPdu &) |
virtual void | process_ax_registration (AgentXPdu &) |
virtual void | process_ax_unregistration (AgentXPdu &) |
virtual void | process_ax_notify (AgentXPdu &) |
virtual void | process_ax_master_request (fd_set *, int *) |
virtual void | process_ax_addagentcaps (AgentXPdu &) |
virtual void | process_ax_removeagentcaps (AgentXPdu &) |
virtual void | process_ax_indexallocate (AgentXPdu &) |
virtual void | process_ax_indexdeallocate (AgentXPdu &) |
virtual AgentXPdu * | create_response (AgentXPdu &, AgentXSession &) |
Create a response and answer it if either the session id does not correspond to a currently established session or if the NON_DEFAULT_CONTEXT bit is set and the master agent only supports the default context. | |
virtual bool | get_affected_regs (const AgentXRegEntry &, const AgentXRegion &, List< AgentXNode > &) |
Get the affected registrations when trying to add a new one. | |
virtual bool | has_conflict (const AgentXRegEntry &) |
Check whether a new registration will result in a conflict with existing registrations. | |
virtual void | add_entry (AgentXRegEntry *) |
Add a registration entry (a single region or a range) to the MIB. | |
virtual bool | remove_entry (u_int, const AgentXRegEntry &) |
Remove a registration entry. | |
virtual void | remove_entries (u_int, u_int) |
Remove all registration entries of a given session. | |
virtual bool | add_ax_agent_caps (const NS_SNMP OctetStr &, const Oidx &, const NS_SNMP OctetStr &, AgentXSession &) |
Add Agent Capabilities to a context. | |
virtual void | remove_ax_agent_caps (const NS_SNMP OctetStr &, const Oidx &, AgentXSession &) |
Remove Agent Capabilities from a context. | |
Friends | |
class | AgentXResponseTask |
class | AgentXCloseTask |
class | AgentXTask |
MasterAgentXMib::MasterAgentXMib | ( | ) |
Default Constructor.
MasterAgentXMib::MasterAgentXMib | ( | const NS_SNMP OctetStr & | ) |
Constructor with path where persistent MIB objects should be stored to and loaded from.
path | the directory to store persistent objects. |
|
virtual |
Destructor.
|
virtual |
Register a MIB object for the agent³s MIB.
item | - A pointer to a MibEntry object (i.e., MibLeaf, MibTable, MibGroup, ...). |
|
virtual |
Register a MIB object within a given context.
If the given context is a new context, it will be added to the list of known contexts.
Note: This method is synchronized using ::lock_mib()
context | an OctetStr instance specifiying the target context. |
item | a pointer to a MibEntry object (i.e., MibLeaf, MibTable, MibGroup, ...). |
|
protectedvirtual |
Add Agent Capabilities to a context.
context | a context. An empty string denotes the default context. |
sysORID | an authoritative identification of a capabilities statement with respect to various MIB modules supported by the local SNMPv2 entity acting in an agent role. |
sysORDescr | a textual description of the capabilities identified by the corresponding instance of sysORID. |
session | the session that will be associated with this capabilities registration. |
|
protectedvirtual |
Add a registration entry (a single region or a range) to the MIB.
newReg | a pointer to a new registration entry (do not delete the pointer - this is done by remove_entry()) |
|
virtual |
Add a get-type sub-request to an AgentX transaction.
sessionID | |
transactionID | |
searchRange | |
timeout | |
type | |
repeater | |
repetitions |
|
protectedvirtual |
Add a new context to the master.
This method is never called when auto context creation is disabled (default). Overwrite this method if you want to dynamically create view and user configuration for the new context.
newContext | an OctetStr representing the new context name. |
|
virtual |
Add a set-type sub-request to an AgentX transaction.
sessionID | |
transactionID | |
searchRange | |
vb | |
timeout | |
type |
|
virtual |
Answer an AgentX request.
pdu | the PDU to be sent as response |
|
protectedvirtual |
Cancel pending AgentX requests for a given transaction id.
transactionID | a transaction ID. |
|
virtual |
Close a session.
sid | a session ID. |
reason | the reason |
|
protectedvirtual |
Create a response and answer it if either the session id does not correspond to a currently established session or if the NON_DEFAULT_CONTEXT bit is set and the master agent only supports the default context.
request | a AgentX request. |
session | returns the session corresponding to the session id in request. |
|
inlineprotectedvirtual |
Unlocks the supplied request before it calls it corresponding super class method to actually delete the request.
request | a pointer to the Request to delete. |
|
protectedvirtual |
|
protectedvirtual |
Finalize a request.
The finalize method is called if all sub-requests have been successfully processed.
request | the request to finalize. |
|
protectedvirtual |
Get the affected registrations when trying to add a new one.
newReg | a new AgentX registration |
actualRegion | the region to be registered. This may be a subregion of newReg.region. |
list | all affected MibEntry instances will be added to list |
AgentXMaster* MasterAgentXMib::get_agentx | ( | ) |
Get the AgentXMaster used by the receiver to process AgentX messages.
|
protected |
Get index database for a given context.
context | a context string (<128 character). |
|
virtual |
Gets the upper boundary of the AgentX session that the given node's active registration belongs to.
"Upper boundary" in this is context is defined as the upper bound (max_key) of the AgentXNode with the greatest key following the given one where all intermediate MibEntry instances are AgentXNodes whose active registration belongs to the same session as the start node.
context | the MibContext name of the context to search. |
node | a pointer to an AgentXNode that denotes the lower bound of the search. |
|
protectedvirtual |
Check whether a new registration will result in a conflict with existing registrations.
registration | the registration to test |
|
virtual |
Start the master agent thread and initialize master MIB.
|
virtual |
Check whether the given region would be a duplicate registration (a registration that would result in a duplicate region with the same priority and within the same context is termed a duplicate registration)
registration | the registration to test |
|
virtual |
Wait for an incoming AgentX request and process it.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Process AgentX requests.
pdu | the request PDU. |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Process a set request.
rep | the set request to process. |
|
protectedvirtual |
Remove Agent Capabilities from a context.
context | a context. An empty string denotes the default context. |
sysORID | an authoritative identification of a capabilities statement with respect to various MIB modules supported by the local SNMPv2 entity acting in an agent role. |
session | the session that is associated with this capabilities registration. |
|
protectedvirtual |
Remove all registration entries of a given session.
(SYNCHRONIZED on registrations)
connectionID | a connection ID (AgentX MIB) |
sessionID | a session id. |
|
protectedvirtual |
Remove a registration entry.
(NOT SYNCHRONIZED)
connectionID | a connection ID (AgentX MIB) |
victim | a registration entry |
|
protectedvirtual |
Send pending AgentX requests for a given transaction id.
transactionID | a transaction ID. |
|
virtual |
Set the AgentXMaster that will process AgentX messages.
agentXMaster | a pointer to an AgentXMaster instance. |
|
inlinevirtual |
Enable or disable automatic context creation.
If enabled and the master receives a registration request for an unknown subagent it will add the unknown context to its Mib and to the VACM. The default is FALSE (auto context creation disabled).
enable | If TRUE auto context creation is enabled, otherwise disabled. |
void MasterAgentXMib::set_session_admin_status_writable | ( | bool | ) |
Set the access mode for agentxSessionAdminStatus.
writable | if TRUE the agentxSessionAdminStatus MIB object of the AgentX MIB may be written and thus an AgentX session may be closed via SNMP. If FALSE agentxSessionAdminStatus is read-only. |
|
protectedvirtual |
Timeout old requests and return the time until next request will timeout.
timeout | a time value. All requests with a timeout value less than timeout will be deleted from the queue. |
|
friend |
|
friend |
|
friend |