keep some internal statistics inside OpenBSC

the statistics will give us some idea about the network load and
performance.
diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c
index b13dc5f..fa9b45d 100644
--- a/openbsc/src/vty_interface.c
+++ b/openbsc/src/vty_interface.c
@@ -761,6 +761,41 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(show_stats,
+      show_stats_cmd,
+      "show statistics",
+	SHOW_STR "Display network statistics\n")
+{
+	struct gsm_network *net = gsmnet;
+
+	vty_out(vty, "Channel Requests: %lu total, %lu no channel%s",
+		net->stats.chreq.total, net->stats.chreq.no_channel,
+		VTY_NEWLINE);
+	vty_out(vty, "Location Update: %lu attach, %lu normal, %lu periodic%s",
+		net->stats.loc_upd_type.attach, net->stats.loc_upd_type.normal,
+		net->stats.loc_upd_type.periodic, VTY_NEWLINE);
+	vty_out(vty, "IMSI Detach Indications: %lu%s\n",
+		net->stats.loc_upd_type.detach, VTY_NEWLINE);
+	vty_out(vty, "Location Update Response: %lu accept, %lu reject%s",
+		net->stats.loc_upd_resp.accept,
+		net->stats.loc_upd_resp.reject, VTY_NEWLINE);
+	vty_out(vty, "Paging: %lu attempted, %lu complete, %lu expired%s",
+		net->stats.paging.attempted, net->stats.paging.completed,
+		net->stats.paging.expired, VTY_NEWLINE);
+	vty_out(vty, "Handover: %lu attempted, %lu no_channel, %lu timeout, "
+		"%lu completed, %lu failed%s", net->stats.handover.attempted,
+		net->stats.handover.no_channel, net->stats.handover.timeout,
+		net->stats.handover.completed, net->stats.handover.failed,
+		VTY_NEWLINE);
+	vty_out(vty, "SMS MO: %lu submitted, %lu no receiver%s",
+		net->stats.sms.submitted, net->stats.sms.no_receiver,
+		VTY_NEWLINE);
+	vty_out(vty, "SMS MT: %lu delivered, %lu no memory, %lu other error%s",
+		net->stats.sms.delivered, net->stats.sms.rp_err_mem,
+		net->stats.sms.rp_err_other, VTY_NEWLINE);
+	return CMD_SUCCESS;
+}
+
 DEFUN(cfg_net,
       cfg_net_cmd,
       "network",
@@ -1435,6 +1470,7 @@
 	install_element(VIEW_NODE, &show_e1ts_cmd);
 
 	install_element(VIEW_NODE, &show_paging_cmd);
+	install_element(VIEW_NODE, &show_stats_cmd);
 
 	install_element(CONFIG_NODE, &cfg_net_cmd);
 	install_node(&net_node, config_write_net);