imctr_get, imctr_free, imctr_load - MTA channel counters utilities.
#include <imta.h>
int imctr_load(imctr_t *ctr, char *channel);
int imctr_get(imctr_t ctr, int index, imctr_type_t counter, char **channel);
void imctr_free(imctr_t ctr);
The SIMS IMTA accumulates in the form of counters or message traffic statistics for each of its channels. These statistics, referred to as «channel counters,» correspond to those used by the Mail Monitoring MIB (RFC 1566) with an IMTA channel representing a «group» as defined by RFC 1566.
imctr_load() may be used to gather these counters for one or more channels specified by channel. To obtain counters for more than one channel at a time, use wild cards in the channel name. The only wild-card character available is «*". It stands for 0 or more characters. For instance, to obtain counters for all TCP/IP channels use the name «tcp_*". Similarly, to obtain counters for all channels, use the name «*". imctr_load() returns the number of channels matching channel for which counters were found.
Once the counters have been gathered, individual channel counters may then be obtained by calling imctr_get(). ctr is the imctr_t handle on the counters datastructures gathered with a previous call. If the channel argument passed to imctr_load() led to gathering counters for more than one channel, the counters corresponding to each of these channels can be retrieved by using values of index located between 0 and the value returned by imctr_load() less 1. each call places the name of the corresponding channel in a buffer referenced by channel. counter must be set to the type of counter desired. The available types are:
IMCTR_STORED_MSGS total number of messages currently stored for the channel
After the counters have been used, the memory allocated to store the counters must be freed with imctr_free(). The argument ctr points to the channel counters structure returned by a previous call to imctr_get().
If successful, imctr_load returns the number of channels matching channel for which counters were found.
If successful, imctr_get returns the requested counter value.
Otherwise, these functions can fail for one of the following reasons:
The counter requested via imctr_get() is unknown.
IMRC_LOCK_ERROR imctr_load() fails due to a contention to access counters information in the MTA.
center, box; c | c l | l .
Attribute Type Attribute Value
_