replace osmo_counter with stat_items

osmo_counter will be soon deprecated. Use the newer and more flexible
osmo_stat_item instead.

Depends on: Id2462c4866bd22bc2338c9c8f69b775f88ae7511 (libosmocore)
Change-Id: I6a20123b263f4f808153794ee8a735092deb399e
diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 6050113..e926b3f 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -10,6 +10,7 @@
 #include <osmocom/core/rate_ctr.h>
 #include <osmocom/core/select.h>
 #include <osmocom/core/stats.h>
+#include <osmocom/core/stat_item.h>
 #include <osmocom/gsm/gsm48.h>
 #include <osmocom/crypt/auth.h>
 
@@ -96,6 +97,11 @@
 	[MSC_CTR_BSSMAP_CIPHER_MODE_COMPLETE] =	{"bssmap:cipher_mode_complete", "Number of CIPHER MODE COMPLETE messages processed by BSSMAP layer"},
 };
 
+enum {
+	MSC_STAT_ACTIVE_CALLS,
+	MSC_STAT_ACTIVE_NC_SS,
+};
+
 static const struct rate_ctr_group_desc msc_ctrg_desc = {
 	"msc",
 	"mobile switching center",
@@ -104,6 +110,19 @@
 	msc_ctr_description,
 };
 
+static const struct osmo_stat_item_desc msc_stat_item_description[] = {
+	[MSC_STAT_ACTIVE_CALLS] = { "msc.active_calls", "Currently active calls "          , OSMO_STAT_ITEM_NO_UNIT, 4, 0},
+	[MSC_STAT_ACTIVE_NC_SS]        = { "msc.active_nc_ss", "Currently active SS/USSD sessions", OSMO_STAT_ITEM_NO_UNIT, 4, 0},
+};
+
+static const struct osmo_stat_item_group_desc msc_statg_desc = {
+	"net",
+	"network statistics",
+	OSMO_STATS_CLASS_GLOBAL,
+	ARRAY_SIZE(msc_stat_item_description),
+	msc_stat_item_description,
+};
+
 #define MSC_PAGING_RESPONSE_TIMER_DEFAULT 10
 
 struct gsm_tz {
@@ -131,8 +150,7 @@
 	int send_mm_info;
 
 	struct rate_ctr_group *msc_ctrs;
-	struct osmo_counter *active_calls;
-	struct osmo_counter *active_nc_ss;
+	struct osmo_stat_item_group *statg;
 
 	/* layer 4 */
 	char *mncc_sock_path;