class SnmpEventLoop

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

Definition#include <xorpevents.hh>
InheritsEventLoop (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);

Before returning from your MIB module, you should export the event loop events to the snmp agent.


 e.export_events();

NOTE: typically you would never need to call e.run(), since the MIB modules should not block.

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

void  export_events ()

export_events

This function transfers the timers and file descriptors from the XORP event list onto the snmp agent registry. This way the snmp agent will be able to monitor their activity and invoke the appropriate callback function in one of XORP's MIB modules.

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 Mon Jun 9 13:24:00 2003, using kdoc 2.0a54+XORP.