blob: 78c687b75994bc8d1d9224922a7686f4e3e33b3b [file] [log] [blame]
Philipp Maierc66ab2c2020-06-02 20:55:34 +02001#pragma once
2
Philipp Maier3d5a2dd2020-06-17 12:48:29 +02003/* Global MCGP general rate counters */
4enum {
5 MGCP_GENERAL_RX_MSGS_TOTAL,
6 MGCP_GENERAL_RX_MSGS_RETRANSMITTED,
7 MGCP_GENERAL_RX_MSGS_HANDLED,
8 MGCP_GENERAL_RX_MSGS_UNHANDLED,
9 MGCP_GENERAL_RX_FAIL_MSG_PARSE,
10 MGCP_GENERAL_RX_FAIL_NO_ENDPOINT,
11};
12
Philipp Maier113141d2020-08-10 21:12:49 +020013/* Trunk-global MCGP CRCX related rate counters */
Philipp Maier3d5a2dd2020-06-17 12:48:29 +020014enum {
15 MGCP_CRCX_SUCCESS,
16 MGCP_CRCX_FAIL_BAD_ACTION,
17 MGCP_CRCX_FAIL_UNHANDLED_PARAM,
18 MGCP_CRCX_FAIL_MISSING_CALLID,
19 MGCP_CRCX_FAIL_INVALID_MODE,
20 MGCP_CRCX_FAIL_LIMIT_EXCEEDED,
21 MGCP_CRCX_FAIL_UNKNOWN_CALLID,
22 MGCP_CRCX_FAIL_ALLOC_CONN,
23 MGCP_CRCX_FAIL_NO_REMOTE_CONN_DESC,
24 MGCP_CRCX_FAIL_START_RTP,
25 MGCP_CRCX_FAIL_REJECTED_BY_POLICY,
26 MGCP_CRCX_FAIL_NO_OSMUX,
27 MGCP_CRCX_FAIL_INVALID_CONN_OPTIONS,
28 MGCP_CRCX_FAIL_CODEC_NEGOTIATION,
29 MGCP_CRCX_FAIL_BIND_PORT,
Philipp Maier8d6a1932020-06-18 12:19:31 +020030 MGCP_CRCX_FAIL_AVAIL,
Philipp Maier889fe7f2020-07-06 17:44:12 +020031 MGCP_CRCX_FAIL_CLAIM,
Philipp Maier3d5a2dd2020-06-17 12:48:29 +020032};
33
Philipp Maier113141d2020-08-10 21:12:49 +020034/* Trunk-global MCGP MDCX related rate counters */
Philipp Maier3d5a2dd2020-06-17 12:48:29 +020035enum {
36 MGCP_MDCX_SUCCESS,
37 MGCP_MDCX_FAIL_WILDCARD,
38 MGCP_MDCX_FAIL_NO_CONN,
39 MGCP_MDCX_FAIL_INVALID_CALLID,
40 MGCP_MDCX_FAIL_INVALID_CONNID,
41 MGCP_MDCX_FAIL_UNHANDLED_PARAM,
42 MGCP_MDCX_FAIL_NO_CONNID,
43 MGCP_MDCX_FAIL_CONN_NOT_FOUND,
44 MGCP_MDCX_FAIL_INVALID_MODE,
45 MGCP_MDCX_FAIL_INVALID_CONN_OPTIONS,
46 MGCP_MDCX_FAIL_NO_REMOTE_CONN_DESC,
47 MGCP_MDCX_FAIL_START_RTP,
48 MGCP_MDCX_FAIL_REJECTED_BY_POLICY,
Philipp Maier8d6a1932020-06-18 12:19:31 +020049 MGCP_MDCX_DEFERRED_BY_POLICY,
50 MGCP_MDCX_FAIL_AVAIL,
Philipp Maier3d5a2dd2020-06-17 12:48:29 +020051};
52
Philipp Maier113141d2020-08-10 21:12:49 +020053/* Trunk-global MCGP DLCX related rate counters */
Philipp Maier3d5a2dd2020-06-17 12:48:29 +020054enum {
55 MGCP_DLCX_SUCCESS,
56 MGCP_DLCX_FAIL_WILDCARD,
57 MGCP_DLCX_FAIL_NO_CONN,
58 MGCP_DLCX_FAIL_INVALID_CALLID,
59 MGCP_DLCX_FAIL_INVALID_CONNID,
60 MGCP_DLCX_FAIL_UNHANDLED_PARAM,
61 MGCP_DLCX_FAIL_REJECTED_BY_POLICY,
62 MGCP_DLCX_DEFERRED_BY_POLICY,
Philipp Maier8d6a1932020-06-18 12:19:31 +020063 MGCP_DLCX_FAIL_AVAIL,
Philipp Maier3d5a2dd2020-06-17 12:48:29 +020064};
65
Philipp Maier889fe7f2020-07-06 17:44:12 +020066/* Trunk-global E1 related counters */
67enum {
68 E1_I460_TRAU_RX_FAIL_CTR,
69 E1_I460_TRAU_TX_FAIL_CTR,
70 E1_I460_TRAU_MUX_EMPTY_CTR,
71};
72
Philipp Maierc66ab2c2020-06-02 20:55:34 +020073/* NOTE: When adding counters, also the dump_ratectr_* routines in vty.c must be updated. */
74
75struct mgcp_ratectr_global {
76 /* Rate counter group which contains stats for generic MGCP events. */
77 struct rate_ctr_group *mgcp_general_ctr_group;
78};
79
80struct mgcp_ratectr_trunk {
81 /* Rate counter group which contains stats for processed CRCX commands. */
82 struct rate_ctr_group *mgcp_crcx_ctr_group;
83 /* Rate counter group which contains stats for processed MDCX commands. */
84 struct rate_ctr_group *mgcp_mdcx_ctr_group;
85 /* Rate counter group which contains stats for processed DLCX commands. */
86 struct rate_ctr_group *mgcp_dlcx_ctr_group;
87 /* Rate counter group which aggregates stats of individual RTP connections. */
88 struct rate_ctr_group *all_rtp_conn_stats;
Philipp Maier889fe7f2020-07-06 17:44:12 +020089 /* Rate counter group which contains stats for E1 events (only valid for E1 trunks) */
90 struct rate_ctr_group *e1_stats;
Philipp Maierc66ab2c2020-06-02 20:55:34 +020091};
92
Philipp Maiera065e632021-07-09 13:22:42 +020093struct mgcp_config;
94struct mgcp_trunk;
95
96int mgcp_ratectr_global_alloc(struct mgcp_config *cfg);
97int mgcp_ratectr_trunk_alloc(struct mgcp_trunk *trunk);