aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-04 10:23:24 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-04 19:25:21 +0200
commit8c15e1561e456930ece94b2844adc06311e14f9f (patch)
treebcac69b8fea9753d4a687c9e33ea0b2b61dbb535
parent98fc1c481feebe4b2fae8d70c87e130f5cccc4d8 (diff)
vty: Add 'show ms all' command (TODO)
-rw-r--r--src/gprs_ms_storage.h1
-rw-r--r--src/pcu_vty.c10
-rw-r--r--src/pcu_vty_functions.cpp21
-rw-r--r--src/pcu_vty_functions.h2
4 files changed, 34 insertions, 0 deletions
diff --git a/src/gprs_ms_storage.h b/src/gprs_ms_storage.h
index 35526025..ad1e6560 100644
--- a/src/gprs_ms_storage.h
+++ b/src/gprs_ms_storage.h
@@ -39,6 +39,7 @@ public:
GprsMs *get_ms(uint32_t tlli, uint32_t old_tlli = 0, const char *imsi = 0) const;
GprsMs *create_ms(uint32_t tlli, enum gprs_rlcmac_tbf_direction dir);
+ const LListHead<GprsMs>& ms_list() const {return m_list;}
private:
BTS *m_bts;
LListHead<GprsMs> m_list;
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 7add3930..8c2a8d8e 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -531,6 +531,15 @@ DEFUN(show_tbf,
return CMD_SUCCESS;
}
+DEFUN(show_ms_all,
+ show_ms_all_cmd,
+ "show ms all",
+ SHOW_STR "information about MSs\n" "All TBFs\n")
+{
+ struct gprs_rlcmac_bts *bts = bts_main_data();
+ return pcu_vty_show_ms_all(vty, bts);
+}
+
static const char pcu_copyright[] =
"Copyright (C) 2012 by Ivan Kluchnikov <kluchnikovi@gmail.com> and \r\n"
" Andreas Eversberg <jolly@eversberg.eu>\r\n"
@@ -587,6 +596,7 @@ int pcu_vty_init(const struct log_info *cat)
install_element_ve(&show_bts_stats_cmd);
install_element_ve(&show_tbf_cmd);
+ install_element_ve(&show_ms_all_cmd);
return 0;
}
diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp
index b43e3e47..9783c4d2 100644
--- a/src/pcu_vty_functions.cpp
+++ b/src/pcu_vty_functions.cpp
@@ -23,6 +23,10 @@
#include <stdint.h>
#include <stdlib.h>
#include "pcu_vty_functions.h"
+#include "bts.h"
+#include "gprs_ms_storage.h"
+#include "gprs_ms.h"
+#include "cxx_linuxlist.h"
extern "C" {
# include <osmocom/vty/command.h>
@@ -34,3 +38,20 @@ int pcu_vty_config_write_pcu_ext(struct vty *vty)
{
return CMD_SUCCESS;
}
+
+int pcu_vty_show_ms_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data)
+{
+ BTS *bts = bts_data->bts;
+ LListHead<GprsMs> *ms_iter;
+
+ llist_for_each(ms_iter, &bts->ms_store().ms_list()) {
+ GprsMs *ms = ms_iter->entry();
+
+ vty_out(vty, "MS TLLI=%08x, TA=%d, CS-UL=%d, CS-DL=%d, IMSI=%s%s",
+ ms->tlli(),
+ ms->ta(), ms->current_cs_ul(), ms->current_cs_dl(),
+ ms->imsi(),
+ VTY_NEWLINE);
+ }
+ return CMD_SUCCESS;
+}
diff --git a/src/pcu_vty_functions.h b/src/pcu_vty_functions.h
index 15006355..89c5f821 100644
--- a/src/pcu_vty_functions.h
+++ b/src/pcu_vty_functions.h
@@ -25,8 +25,10 @@ extern "C" {
#endif
struct vty;
+struct gprs_rlcmac_bts;
int pcu_vty_config_write_pcu_ext(struct vty *vty);
+int pcu_vty_show_ms_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data);
#ifdef __cplusplus
}