Solaris Bandwidth Manager 1.6 Developer Guide

Event Handling

The C Statistics API can be used to detect when certain events occur at the level of the ipqos module, and to return information about the event that has occurred. There are three ways to detect that an event has occurred:


Note -

As events are buffered, if using poll(2) or select(3c), you must call ba_get_next_event() repeatedly in non-blocking mode to check that there are no outstanding events, to make sure that the next poll(2) works correctly.


Once you have detected that an event has occurred, for example, by using poll(2), call the function ba_get_next_event() to retrieve information about the event.

The C Statistics API provides the following functions for event handling:

Table 3-1 lists the event types reported to the user process.

Table 3-1 Event Types

Event Type 

Description 

BA_EVENT_CONFIG_STARTING

Generated when the Solaris Bandwidth Manager policy agent starts to read a new configuration 

BA_EVENT_CONFIG_ENDING

Generated when the Solaris Bandwidth Manager Policy Agent finishes reading a new configuration 

BA_EVENT_DAEMON_ENDING

Generated when the Solaris Bandwidth Manager policy agent stops or is killed 

BA_EVENT_FLOW_ACCOUNTING

Generated when a flow has timed out, or when the TOS field changes for a flow 

BA_EVENT_STATS_RESET

Generated when a class has been reset or removed 

To limit the number of events held in the buffer, edit the environment variable BA_EVENTBUFSIZE in the /etc/default/ba_info file. To buffer an unlimited number of events, set this value to 0, but note that this will lead to kernel memory exhaustion if all events are not retrieved.