diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-06-06 18:49:23 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-07-22 16:56:33 +0200 |
commit | 7c101d922e54af3b990a2a8d86ded18c3f3b89c7 (patch) | |
tree | c4ac8dd4f4ac0d7024a81de5f87e89f4bc2f66d7 /openbsc/tests/gbproxy/gbproxy_test.c | |
parent | 006c038212e1d79938810812c218a4fe4aad737c (diff) |
gprs: Track IMSI/TLLI to control APN patching
This patch adds IMSI/TLLI connection tracking and uses it to control
APN patching based on the IMSI. TLLI entries can expire based on age
and/or by limiting the TLLI list size.
VTY config-gbproxy:
no core-access-point-name disable APN patching
core-access-point-name none remove APN if present
core-access-point-name APN replace APN if present
core-access-point-name none match-imsi RE remove if IMSI matches
core-access-point-name APN match-imsi RE replace if IMSI matches
tlli-list max-age SECONDS expire after SECONDS
no tlli-list max-age don't expire by age
tlli-list max-length N keep N entries only
no tlli-list max-length don't limit list length
RE is an extended regular expression, e.g. ^12345|^23456
Ticket: OW#1192
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/tests/gbproxy/gbproxy_test.c')
-rw-r--r-- | openbsc/tests/gbproxy/gbproxy_test.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c index fa7e0bb12..a9d06551b 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.c +++ b/openbsc/tests/gbproxy/gbproxy_test.c @@ -842,6 +842,7 @@ static void test_gbproxy_ra_patching() {.mcc = 123, .mnc = 456, .lac = 16464, .rac = 96}; struct gprs_ra_id rai_unknown = {.mcc = 1, .mnc = 99, .lac = 99, .rac = 96}; + const char *err_msg = NULL; bssgp_nsi = nsi; gbcfg.nsi = bssgp_nsi; @@ -854,6 +855,14 @@ static void test_gbproxy_ra_patching() configure_sgsn_peer(&sgsn_peer); configure_bss_peers(bss_peer, ARRAY_SIZE(bss_peer)); + gbcfg.match_re = talloc_strdup(NULL, "^9898|^121314"); + if (gbprox_set_patch_filter(gbcfg.match_re, &err_msg) != 0) { + fprintf(stderr, "Failed to compile RE '%s': %s\n", + gbcfg.match_re, err_msg); + exit(1); + } + + printf("=== %s ===\n", __func__); printf("--- Initialise SGSN ---\n\n"); @@ -917,7 +926,7 @@ static void test_gbproxy_ra_patching() printf("--- Bad cases ---\n\n"); - printf("Invalid BVCI, shouldn't patch\n"); + printf("TLLI is already detached, shouldn't patch\n"); send_ns_unitdata(nsi, "ACT PDP CTX REQ", &bss_peer[0], 0x1002, bssgp_act_pdp_ctx_req, sizeof(bssgp_act_pdp_ctx_req)); |