diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-01-22 16:34:16 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-01-22 16:34:16 +0100 |
commit | a310e532438196778b554132d69e78da933aaa81 (patch) | |
tree | 8790698cc402eec776862f2c037c04d9e36cae1e | |
parent | fbfe8eb81de7900a5241528ca4087be8211bd259 (diff) |
vty: Classify the application that we run and provide different options
The VTY interface is used for three different application and not
every option will make sense for every app. In the long run we will
split the vty interface but for now we just qualify the application.
-rw-r--r-- | include/bsc_data.h | 8 | ||||
-rw-r--r-- | src/main.c | 1 | ||||
-rw-r--r-- | src/main_stp.c | 1 | ||||
-rw-r--r-- | src/main_udt.c | 1 | ||||
-rw-r--r-- | src/vty_interface.c | 9 |
5 files changed, 16 insertions, 4 deletions
diff --git a/include/bsc_data.h b/include/bsc_data.h index 1092d6e..134a5b0 100644 --- a/include/bsc_data.h +++ b/include/bsc_data.h @@ -63,7 +63,15 @@ struct mtp_udp_link { struct llist_head entry; }; +enum { + APP_CELLMGR, + APP_RELAY, + APP_STP, +}; + struct bsc_data { + int app; + /* MSC */ char *msc_address; struct write_queue msc_connection; @@ -626,6 +626,7 @@ int main(int argc, char **argv) int rc; INIT_LLIST_HEAD(&bsc.sccp_connections); + bsc.app = APP_CELLMGR; bsc.dpc = 1; bsc.opc = 0; bsc.sccp_opc = -1; diff --git a/src/main_stp.c b/src/main_stp.c index 36e04d6..328eabe 100644 --- a/src/main_stp.c +++ b/src/main_stp.c @@ -184,6 +184,7 @@ int main(int argc, char **argv) struct mtp_m2ua_link *lnk; INIT_LLIST_HEAD(&bsc.sccp_connections); + bsc.app = APP_STP; bsc.dpc = 1; bsc.opc = 0; bsc.sccp_opc = -1; diff --git a/src/main_udt.c b/src/main_udt.c index b47ea66..436ae1b 100644 --- a/src/main_udt.c +++ b/src/main_udt.c @@ -183,6 +183,7 @@ int main(int argc, char **argv) int rc; INIT_LLIST_HEAD(&bsc.sccp_connections); + bsc.app = APP_RELAY; bsc.dpc = 1; bsc.opc = 0; bsc.sccp_opc = -1; diff --git a/src/vty_interface.c b/src/vty_interface.c index 3ad2fe0..f5eb0f1 100644 --- a/src/vty_interface.c +++ b/src/vty_interface.c @@ -1,7 +1,7 @@ /* VTY code for the Cellmgr */ /* - * (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org> - * (C) 2010 by On-Waves + * (C) 2010-2011 by Holger Hans Peter Freyther <zecke@selfish.org> + * (C) 2010-2011 by On-Waves * All Rights Reserved * * This program is free software: you can redistribute it and/or modify @@ -295,7 +295,7 @@ DEFUN(show_stats, show_stats_cmd, { if (bsc.link_set) dump_stats(vty, bsc.link_set); - if (bsc.m2ua_set) + if (bsc.m2ua_set && bsc.app == APP_STP) dump_stats(vty, bsc.m2ua_set); return CMD_SUCCESS; } @@ -328,7 +328,8 @@ DEFUN(show_linksets, show_linksets_cmd, SHOW_STR "Display current state of linksets\n") { dump_state(vty, "MTP ", bsc.link_set); - dump_state(vty, "M2UA", bsc.m2ua_set); + if (bsc.app == APP_STP) + dump_state(vty, "M2UA", bsc.m2ua_set); return CMD_SUCCESS; } |