The C Statistics API provides the following functions for statistics handling:
ba_get_class_stats() returns statistics for a given class of network traffic for a given interface. The information returned includes:
Number of packets sent
Number of bytes sent
Number of attempts made to borrow bandwidth
Number of packets dropped
Number of bytes dropped
ba_reset_class_stats() is used to reset the statistics information for a given class and all its children. The process calling ba_reset_class_stats() must be privileged.
ba_get_flow_stats() returns flow level statistics for the specified class.