aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-10-15 12:00:26 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-15 15:10:22 +0200
commit51a869c80c80fbbf8494992d8c2fa10ede537029 (patch)
tree799f60fcf8def741ff15a6768c06eae63c26b2a4 /openbsc/src/gprs
parent475f513aea18be2e5d6e1d27853f4deada99697b (diff)
gbproxy: Add test program to test gbproxy message handling
This program tests the gbproxy implementation by passing NS messages to a modified gbproxy that dumps the resulting messages, signals, and state. It focusses on testing abnormal situations like port changes. Ticket: OW#874 Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs')
-rw-r--r--openbsc/src/gprs/gb_proxy.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index b99c455e2..3a9fe8152 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -658,6 +658,29 @@ int gbprox_signal(unsigned int subsys, unsigned int signal,
return 0;
}
+int gbprox_dump_peers(FILE *stream, int indent)
+{
+ struct gbprox_peer *peer;
+ struct gprs_ra_id raid;
+ int rc;
+
+ fprintf(stream, "%*sPeers:\n", indent, "");
+ llist_for_each_entry(peer, &gbprox_bts_peers, list) {
+ gsm48_parse_ra(&raid, peer->ra);
+
+ rc = fprintf(stream, "%*s NSEI %u, BVCI %u, %sblocked, "
+ "RAC %u-%u-%u-%u\n",
+ indent, "",
+ peer->nsvc->nsei, peer->bvci,
+ peer->blocked ? "" : "not ",
+ raid.mcc, raid.mnc, raid.lac, raid.rac);
+
+ if (rc < 0)
+ return rc;
+ }
+
+ return 0;
+}
#include <osmocom/vty/command.h>