From 51a869c80c80fbbf8494992d8c2fa10ede537029 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Tue, 15 Oct 2013 12:00:26 +0200 Subject: 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 --- openbsc/src/gprs/gb_proxy.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'openbsc/src/gprs') 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 -- cgit v1.2.3