aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gb_proxy.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-06-27 11:55:04 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-07-22 17:03:23 +0200
commitaa3e334608d0101c8e98b5bc65d4cd9fd2bc82ea (patch)
tree7f6eef3fd6916be5d54b3ca7c901af871e756b2e /openbsc/src/gprs/gb_proxy.c
parent25049b93b1363246b4099f2dca748b191ae1742d (diff)
gprs/test: Rearrange for PTMSI parsing
Add TLLI cache output to gbprox_dump_peers() to include this info into the test output. Separate RA Update Req message handling from Attach Request handling. Note: There is no test case for the P-TMSI Reallocation Command yet. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/gb_proxy.c')
-rw-r--r--openbsc/src/gprs/gb_proxy.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index 88f727ed2..00acb629a 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -1845,12 +1845,15 @@ int gbprox_dump_peers(FILE *stream, int indent)
unsigned int i;
const struct rate_ctr_group_desc *desc;
int rc;
+ time_t now = time(NULL);
rc = fprintf(stream, "%*sPeers:\n", indent, "");
if (rc < 0)
return rc;
llist_for_each_entry(peer, &gbprox_bts_peers, list) {
+ struct gbprox_tlli_info *tlli_info;
+ struct gbprox_patch_state *state = &peer->patch_state;
gsm48_parse_ra(&raid, peer->ra);
rc = fprintf(stream, "%*s NSEI %u, BVCI %u, %sblocked, "
@@ -1877,6 +1880,23 @@ int gbprox_dump_peers(FILE *stream, int indent)
return rc;
}
}
+
+ fprintf(stream, "%*s TLLI-Cache: %d\n",
+ indent, "", state->enabled_tllis_count);
+ llist_for_each_entry(tlli_info, &state->enabled_tllis, list) {
+ char mi_buf[200];
+ time_t age = now - tlli_info->timestamp;
+ snprintf(mi_buf, sizeof(mi_buf), "(invalid)");
+ gsm48_mi_to_string(mi_buf, sizeof(mi_buf),
+ tlli_info->mi_data,
+ tlli_info->mi_data_len);
+ rc = fprintf(stream,
+ "%*s TLLI %08x, IMSI %s, AGE %d\n",
+ indent, "",
+ tlli_info->tlli, mi_buf, (int)age);
+ if (rc < 0)
+ return rc;
+ }
}
return 0;