Kamailio statistics handling. More...
#include "kstats_wrapper.h"

Go to the source code of this file.
Definition in file lib/kcore/statistics.h.
| int get_socket_list_from_proto | ( | int ** | ipList, | |
| int | protocol | |||
| ) |
The first parameter, ipList, is a pointer to a pointer. It will be assigned a new block of memory holding the IP Addresses and ports being listened to with respect to 'protocol'. The array maps a 2D array into a 1 dimensional space, and is layed out as follows:
The first NUM_IP_OCTETS indices will be the IP address, and the next index the port. So if NUM_IP_OCTETS is equal to 4 and there are two IP addresses found, then:
The function will return the number of sockets which were found. This can be used to index into ipList.
returnedValue * (NUM_IP_OCTETS + 1) * sizeof(int);
Therefore it is CRUCIAL that you free ipList when you are done with its contents, to avoid a nasty memory leak.
Definition at line 115 of file lib/kcore/statistics.c.
Referenced by get_total_bytes_waiting().

| int get_total_bytes_waiting | ( | void | ) |
Note: This currently only works on systems supporting the /proc/net/[tcp|udp] interface. On other systems, zero will always be returned. Details of why this is so can be found in network_stats.c
Note: This currently only works on systems supporting the /proc/net/[tcp|udp] interface. On other systems, zero will always be returned. To change this in the future, add an equivalent for get_used_waiting_queue().
Definition at line 395 of file lib/kcore/statistics.c.
References get_socket_list_from_proto(), and get_used_waiting_queue().
Referenced by check_msg_queue_alarm().


1.7.1