class SnmpEventLoop

A singleton EventLoop capable of exporting events to the snmp agent. More...

Definition#include <xorpevents.hh>
InheritsEventLoop (libxorp) [public ], SelectorListObserverBase (libxorp) [public ], TimerListObserverBase (libxorp) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Static Methods

Protected Members


Detailed Description

The SnmpEventLoop class provides an EventLoop to all the MIB modules that need to communicate with XORP. The modules will use the EventLoop to instanciate listeners required for asyncronous inter-process communication with XORP.

typedef std::set<int> FdSet

FdSet

typedef std::map<TimeVal, unsigned int> AlarmMap

AlarmMap

SnmpEventLoop&  the_instance ()

the_instance

[static]

This function provides the only way to instantiate this class, since all other constructors are private. Use it like this:


 SnmpEventLoop& e = SnmpEventLoop::the_instance();

Now use 'e' anywhere you would use an event loop in Xorp modules, for instance:


 XorpTimer xt = e.new_periodic(100, callback);

NOTE: typically you would never need to call e.run(). If you do, you should set a short timeout, since while your MIB module is blocked, you cannot process any other SNMP requests.

Returns: reference to the SnmpEventLoop used by all XORP MIB modules.

void  destroy ()

destroy

This will free the one and only instance

void  set_log_name (const char * n)

set_log_name

[static]

This is the name this class will use to identify itself in the snmpd log. Only used for debugging

const char *  get_log_name ()

get_log_name

[static]

AlarmMap _pending_alarms

_pending_alarms

[protected]

FdSet _exported_readfds

_exported_readfds

[protected]

FdSet _exported_writefds

_exported_writefds

[protected]

FdSet _exported_exceptfds

_exported_exceptfds

[protected]


Generated by: pavlin on possum.icir.org on Thu Aug 28 12:52:18 2003, using kdoc 2.0a54+XORP.