#include "hash_func.h"
#include "atomic.h"


Go to the source code of this file.
Data Structures | |
| struct | module_stats_ |
| struct | stat_export_ |
| struct | stat_var_ |
| struct | stats_collector_ |
Defines | |
| #define | destroy_stats_collector() |
| #define | get_stat(_name) 0 |
| #define | get_stat_val(_var) 0 |
| #define | get_stat_var_from_num_code(_n_code, _in_code) NULL |
| #define | if_reset_stat(_c, _var) |
| #define | if_update_stat(_c, _var, _n) |
| #define | init_stats_collector() 0 |
| #define | NUM_IP_OCTETS 4 |
| #define | register_module_stats(_mod, _stats) 0 |
| #define | register_stat(_mod, _name, _pvar, _flags) 0 |
| #define | reset_stat(_var) |
| #define | STAT_IS_FUNC (1<<3) |
| #define | STAT_NO_RESET (1<<0) |
| #define | STAT_NO_SYNC (1<<1) |
| #define | STAT_SHM_NAME (1<<2) |
| #define | STATS_HASH_POWER 8 |
| #define | STATS_HASH_SIZE (1<<(STATS_HASH_POWER)) |
| #define | update_stat(_var, _n) |
Typedefs | |
| typedef struct module_stats_ | module_stats |
| typedef struct stat_export_ | stat_export_t |
| typedef unsigned long(* | stat_function )(void) |
| typedef unsigned int | stat_val |
| typedef struct stat_var_ | stat_var |
| typedef struct stats_collector_ | stats_collector |
Functions | |
| int | get_socket_list_from_proto (int **ipList, int protocol) |
| int | get_total_bytes_waiting (void) |
Definition in file statistics.h.
| #define destroy_stats_collector | ( | ) |
| #define get_stat | ( | _name | ) | 0 |
Definition at line 130 of file statistics.h.
Referenced by fixup_stat(), get_statistic(), w_reset_stat(), and w_update_stat().
| #define get_stat_val | ( | _var | ) | 0 |
Definition at line 131 of file statistics.h.
Referenced by get_number_of_users(), get_statistic(), and pv_get_dlg_count().
| #define get_stat_var_from_num_code | ( | _n_code, | |||
| _in_code | ) | NULL |
Definition at line 132 of file statistics.h.
Referenced by openserSIPStatusCodesTable_create_row(), openserSIPStatusCodesTable_get_value(), and update_sl_reply_stat().
| #define if_reset_stat | ( | _c, | |||
| _var | ) |
Definition at line 196 of file statistics.h.
| #define if_update_stat | ( | _c, | |||
| _var, | |||||
| _n | ) |
Definition at line 195 of file statistics.h.
Referenced by bye_reply_cb(), child_init(), dlg_new_dialog(), dlg_onreply(), dlg_onroute(), dlg_ontimeout(), mem_delete_ucontact(), mem_insert_ucontact(), remove_from_hash_table_unsafe(), reply_received(), sl_filter_ACK(), and sl_reply_error().
| #define init_stats_collector | ( | ) | 0 |
| #define NUM_IP_OCTETS 4 |
Definition at line 44 of file statistics.h.
Referenced by createIndex(), createRowsFromIPList(), and getRow().
| #define register_module_stats | ( | _mod, | |||
| _stats | ) | 0 |
| #define register_stat | ( | _mod, | |||
| _name, | |||||
| _pvar, | |||||
| _flags | ) | 0 |
Definition at line 129 of file statistics.h.
Referenced by new_udomain(), register_all_mod_stats(), and register_message_code_statistics().
| #define reset_stat | ( | _var | ) |
| #define STAT_IS_FUNC (1<<3) |
Definition at line 49 of file statistics.h.
| #define STAT_NO_RESET (1<<0) |
| #define STAT_NO_SYNC (1<<1) |
Definition at line 47 of file statistics.h.
| #define STAT_SHM_NAME (1<<2) |
| #define STATS_HASH_POWER 8 |
Definition at line 41 of file statistics.h.
| #define STATS_HASH_SIZE (1<<(STATS_HASH_POWER)) |
Definition at line 42 of file statistics.h.
| #define update_stat | ( | _var, | |||
| _n | ) |
Definition at line 193 of file statistics.h.
Referenced by child_init(), dlg_new_dialog(), forward_reply(), forward_request(), get_hdr_field(), m_clean_silo(), m_store(), mem_delete_urecord(), mem_insert_urecord(), NAT_Contact_del(), NAT_Contact_new(), nodb_timer(), parse_method(), parse_uri(), receive_msg(), save(), SIP_Dialog_del(), SIP_Dialog_end(), SIP_Dialog_new(), SIP_Registration_expire(), SIP_Registration_update(), SIP_Subscription_expire(), SIP_Subscription_update(), sip_trace(), trace_onreply_in(), trace_onreply_out(), trace_onreq_out(), trace_sl_onreply_out(), update_sl_reply_stat(), w_update_stat(), wb_timer(), and wt_timer().
| typedef struct module_stats_ module_stats |
| typedef struct stat_export_ stat_export_t |
| typedef unsigned long(* stat_function)(void) |
Definition at line 57 of file statistics.h.
| typedef unsigned int stat_val |
Definition at line 52 of file statistics.h.
| typedef struct stats_collector_ stats_collector |
| int get_socket_list_from_proto | ( | int ** | ipList, | |
| int | protocol | |||
| ) |
This function will retrieve a list of all ip addresses and ports that OpenSER is listening on, with respect to the transport protocol specified with '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.
Therefore it is CRUCIAL that you free ipList when you are done with its contents, to avoid a nasty memory leak.
Referenced by init_openserSIPPortTable().
| int get_total_bytes_waiting | ( | void | ) |
Returns the sum of the number of bytes waiting to be consumed on all network interfaces and transports that OpenSER is listening on.
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
Referenced by check_msg_queue_alarm(), handle_openserMsgQueueDepth(), and rl_timer().
1.5.6