aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-11 05:49:43 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-11 05:49:43 +0200
commit85801d02940833729b6057d48b41df3ed0816207 (patch)
tree6772ffe9ec36a0d5e15037346a2aff591b3dbcbd /openbsc
parent1c0de6802c9b4ba77a110d96509b1de50eea3c7e (diff)
[gprs] gb_proxy: More VTY 'show' information
The 'show gbproxy' now actually shows information about the Gb proxy BTS peers, whereas 'show ns' shows information about existing NS links.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gb_proxy.h2
-rw-r--r--openbsc/src/gprs/gb_proxy.c25
-rw-r--r--openbsc/src/gprs/gb_proxy_vty.c5
3 files changed, 30 insertions, 2 deletions
diff --git a/openbsc/include/openbsc/gb_proxy.h b/openbsc/include/openbsc/gb_proxy.h
index 60dd5ca80..3b695e52a 100644
--- a/openbsc/include/openbsc/gb_proxy.h
+++ b/openbsc/include/openbsc/gb_proxy.h
@@ -6,6 +6,7 @@
#include <osmocore/msgb.h>
#include <openbsc/gprs_ns.h>
+#include <vty/command.h>
struct gbproxy_config {
/* parsed from config file */
@@ -23,6 +24,7 @@ struct gbproxy_config {
};
extern struct gbproxy_config gbcfg;
+extern struct cmd_element show_gbproxy_cmd;
/* gb_proxy_vty .c */
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index fe5ad702f..3ed7fdfde 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -414,3 +414,28 @@ int gbprox_rcvmsg(struct msgb *msg, struct gprs_nsvc *nsvc, uint16_t ns_bvci)
return rc;
}
+
+
+#include <vty/command.h>
+
+gDEFUN(show_gbproxy, show_gbproxy_cmd, "show gbproxy",
+ SHOW_STR "Display information about the Gb proxy")
+{
+ struct gbprox_peer *peer;
+
+ llist_for_each_entry(peer, &gbprox_bts_peers, list) {
+ struct gprs_nsvc *nsvc = peer->nsvc;
+ struct gprs_ra_id raid;
+ gsm48_parse_ra(&raid, &peer->ra);
+
+ vty_out(vty, "NSEI %5u, NS-VC %5u, PTP-BVCI %u, "
+ "RAC %u-%u-%u-%u%s",
+ nsvc->nsei, nsvc->nsvci, peer->bvci,
+ raid.mcc, raid.mnc, raid.lac, raid.rac, VTY_NEWLINE);
+ if (nsvc->nsi->ll == GPRS_NS_LL_UDP)
+ vty_out(vty, " remote address %s:%u%s",
+ inet_ntoa(nsvc->ip.bts_addr.sin_addr),
+ ntohs(nsvc->ip.bts_addr.sin_port), VTY_NEWLINE);
+ }
+ return CMD_SUCCESS;
+}
diff --git a/openbsc/src/gprs/gb_proxy_vty.c b/openbsc/src/gprs/gb_proxy_vty.c
index 16f6a1e0e..a40392b90 100644
--- a/openbsc/src/gprs/gb_proxy_vty.c
+++ b/openbsc/src/gprs/gb_proxy_vty.c
@@ -70,8 +70,8 @@ static int config_write_gbproxy(struct vty *vty)
return CMD_SUCCESS;
}
-DEFUN(show_gbproxy, show_gbproxy_cmd, "show gbproxy",
- SHOW_STR "Display information about the Gb proxy")
+DEFUN(show_ns, show_ns_cmd, "show ns",
+ SHOW_STR "Display information about the NS protocol")
{
/* FIXME: iterate over list of NS-VC's and display their state */
struct gprs_ns_inst *nsi = g_cfg->nsi;
@@ -176,6 +176,7 @@ DEFUN(cfg_nsip_sgsn_nsvci,
int gbproxy_vty_init(void)
{
+ install_element(VIEW_NODE, &show_ns_cmd);
install_element(VIEW_NODE, &show_gbproxy_cmd);
install_element(CONFIG_NODE, &cfg_gbproxy_cmd);