diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2013-10-18 22:12:16 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-10-19 12:10:21 +0200 |
commit | da890c77330cd2e0f63ab0731fcc9cd2b2366c3c (patch) | |
tree | 0f5d50497ff9102b8c68df685eaf8cc207ffadd6 /openbsc/src | |
parent | bc555742aa774a3d7b744213c558e90b6617d9e7 (diff) |
gbproxy: Test invalid BVCI from SGSN
This adds a test with a UNITDATA SGSN message that is addressed to an
invalid (unknown) BVCI. The test shows, that the message is echoed to
the SGSN.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/gprs/gb_proxy.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index ddc9e0aaf..a25a9f57b 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -800,6 +800,37 @@ int gbprox_signal(unsigned int subsys, unsigned int signal, return 0; } +int gbprox_dump_global(FILE *stream, int indent, int verbose) +{ + unsigned int i; + const struct rate_ctr_group_desc *desc; + int rc; + + rc = fprintf(stream, "%*sGbproxy global:\n", indent, ""); + if (rc < 0) + return rc; + + if (!verbose) + return 0; + + desc = get_global_ctrg()->desc; + + for (i = 0; i < desc->num_ctr; i++) { + struct rate_ctr *ctr = &get_global_ctrg()->ctr[i]; + if (ctr->current) { + rc = fprintf(stream, "%*s %s: %llu\n", + indent, "", + desc->ctr_desc[i].description, + (long long)ctr->current); + + if (rc < 0) + return rc; + } + } + + return 0; +} + int gbprox_dump_peers(FILE *stream, int indent, int verbose) { struct gbprox_peer *peer; @@ -808,7 +839,10 @@ int gbprox_dump_peers(FILE *stream, int indent, int verbose) const struct rate_ctr_group_desc *desc; int rc; - fprintf(stream, "%*sPeers:\n", indent, ""); + rc = fprintf(stream, "%*sPeers:\n", indent, ""); + if (rc < 0) + return rc; + llist_for_each_entry(peer, &gbprox_bts_peers, list) { gsm48_parse_ra(&raid, peer->ra); |