aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gb_proxy.h32
-rw-r--r--openbsc/src/gprs/gb_proxy.c4
-rw-r--r--openbsc/src/gprs/gb_proxy_peer.c2
-rw-r--r--openbsc/src/gprs/gb_proxy_tlli.c69
-rw-r--r--openbsc/src/gprs/gb_proxy_vty.c6
-rw-r--r--openbsc/tests/gbproxy/gbproxy_test.c184
6 files changed, 148 insertions, 149 deletions
diff --git a/openbsc/include/openbsc/gb_proxy.h b/openbsc/include/openbsc/gb_proxy.h
index 21a4f0542..0494df0ed 100644
--- a/openbsc/include/openbsc/gb_proxy.h
+++ b/openbsc/include/openbsc/gb_proxy.h
@@ -176,16 +176,8 @@ int gbprox_reset_persistent_nsvcs(struct gprs_ns_inst *nsi);
void gbprox_reset(struct gbproxy_config *cfg);
-/* TLLI state handling */
-void gbproxy_delete_tllis(struct gbproxy_peer *peer);
-int gbproxy_imsi_matches(
- struct gbproxy_peer *peer,
- struct gbproxy_tlli_info *tlli_info);
-struct gbproxy_tlli_info *gbprox_find_tlli_by_ptmsi(
- struct gbproxy_peer *peer,
- uint32_t ptmsi);
-uint32_t gbproxy_map_tlli(
- uint32_t other_tlli, struct gbproxy_tlli_info *tlli_info, int to_bss);
+/* TLLI info handling */
+void gbproxy_delete_tlli_infos(struct gbproxy_peer *peer);
struct gbproxy_tlli_info *gbproxy_update_tlli_state_ul(
struct gbproxy_peer *peer, time_t now,
struct gprs_gb_parse_context *parse_ctx);
@@ -195,8 +187,8 @@ struct gbproxy_tlli_info *gbproxy_update_tlli_state_dl(
void gbproxy_update_tlli_state_after(
struct gbproxy_peer *peer, struct gbproxy_tlli_info *tlli_info,
time_t now, struct gprs_gb_parse_context *parse_ctx);
-int gbproxy_remove_stale_tllis(struct gbproxy_peer *peer, time_t now);
-void gbproxy_delete_tlli(struct gbproxy_peer *peer,
+int gbproxy_remove_stale_tlli_infos(struct gbproxy_peer *peer, time_t now);
+void gbproxy_delete_tlli_info(struct gbproxy_peer *peer,
struct gbproxy_tlli_info *tlli_info);
void gbproxy_tlli_info_discard_messages(struct gbproxy_tlli_info *tlli_info);
@@ -208,19 +200,25 @@ void gbproxy_detach_tlli_info(struct gbproxy_peer *peer,
struct gbproxy_tlli_info *tlli_info);
struct gbproxy_tlli_info *gbproxy_tlli_info_alloc( struct gbproxy_peer *peer);
-struct gbproxy_tlli_info *gbproxy_find_tlli(
+struct gbproxy_tlli_info *gbproxy_tlli_info_by_tlli(
struct gbproxy_peer *peer, uint32_t tlli);
-struct gbproxy_tlli_info *gbproxy_find_tlli_by_imsi(
+struct gbproxy_tlli_info *gbproxy_tlli_info_by_imsi(
struct gbproxy_peer *peer, const uint8_t *imsi, size_t imsi_len);
-struct gbproxy_tlli_info *gbproxy_find_tlli_by_any_sgsn_tlli(
+struct gbproxy_tlli_info *gbproxy_tlli_info_by_any_sgsn_tlli(
struct gbproxy_peer *peer, uint32_t tlli);
-struct gbproxy_tlli_info *gbproxy_find_tlli_by_sgsn_tlli(
+struct gbproxy_tlli_info *gbproxy_tlli_info_by_sgsn_tlli(
struct gbproxy_peer *peer,
uint32_t tlli, uint32_t sgsn_nsei);
-struct gbproxy_tlli_info *gbproxy_find_tlli_by_ptmsi(
+struct gbproxy_tlli_info *gbproxy_tlli_info_by_ptmsi(
struct gbproxy_peer *peer,
uint32_t ptmsi);
+int gbproxy_imsi_matches(
+ struct gbproxy_peer *peer,
+ struct gbproxy_tlli_info *tlli_info);
+uint32_t gbproxy_map_tlli(
+ uint32_t other_tlli, struct gbproxy_tlli_info *tlli_info, int to_bss);
+
/* needed by gb_proxy_tlli.h */
uint32_t gbproxy_make_bss_ptmsi(struct gbproxy_peer *peer, uint32_t sgsn_ptmsi);
uint32_t gbproxy_make_sgsn_tlli(
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index 89617cefa..b5566e3d2 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -234,7 +234,7 @@ uint32_t gbproxy_make_bss_ptmsi(struct gbproxy_peer *peer,
bss_ptmsi = rand_r(&peer->cfg->bss_ptmsi_state);
bss_ptmsi = bss_ptmsi | 0xC0000000;
- if (gbproxy_find_tlli_by_ptmsi(peer, bss_ptmsi))
+ if (gbproxy_tlli_info_by_ptmsi(peer, bss_ptmsi))
bss_ptmsi = GSM_RESERVED_TMSI;
} while (bss_ptmsi == GSM_RESERVED_TMSI && max_retries--);
}
@@ -262,7 +262,7 @@ uint32_t gbproxy_make_sgsn_tlli(struct gbproxy_peer *peer,
sgsn_tlli = rand_r(&peer->cfg->sgsn_tlli_state);
sgsn_tlli = (sgsn_tlli & 0x7fffffff) | 0x78000000;
- if (gbproxy_find_tlli_by_any_sgsn_tlli(peer, sgsn_tlli))
+ if (gbproxy_tlli_info_by_any_sgsn_tlli(peer, sgsn_tlli))
sgsn_tlli = 0;
} while (!sgsn_tlli && max_retries--);
}
diff --git a/openbsc/src/gprs/gb_proxy_peer.c b/openbsc/src/gprs/gb_proxy_peer.c
index 820d8df87..335b46f16 100644
--- a/openbsc/src/gprs/gb_proxy_peer.c
+++ b/openbsc/src/gprs/gb_proxy_peer.c
@@ -172,7 +172,7 @@ void gbproxy_peer_free(struct gbproxy_peer *peer)
{
llist_del(&peer->list);
- gbproxy_delete_tllis(peer);
+ gbproxy_delete_tlli_infos(peer);
rate_ctr_group_free(peer->ctrg);
peer->ctrg = NULL;
diff --git a/openbsc/src/gprs/gb_proxy_tlli.c b/openbsc/src/gprs/gb_proxy_tlli.c
index 969bee76c..70f2bfb62 100644
--- a/openbsc/src/gprs/gb_proxy_tlli.c
+++ b/openbsc/src/gprs/gb_proxy_tlli.c
@@ -32,7 +32,7 @@
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/talloc.h>
-struct gbproxy_tlli_info *gbproxy_find_tlli(struct gbproxy_peer *peer,
+struct gbproxy_tlli_info *gbproxy_tlli_info_by_tlli(struct gbproxy_peer *peer,
uint32_t tlli)
{
struct gbproxy_tlli_info *tlli_info;
@@ -46,7 +46,7 @@ struct gbproxy_tlli_info *gbproxy_find_tlli(struct gbproxy_peer *peer,
return NULL;
}
-struct gbproxy_tlli_info *gbproxy_find_tlli_by_ptmsi(
+struct gbproxy_tlli_info *gbproxy_tlli_info_by_ptmsi(
struct gbproxy_peer *peer,
uint32_t ptmsi)
{
@@ -60,7 +60,7 @@ struct gbproxy_tlli_info *gbproxy_find_tlli_by_ptmsi(
return NULL;
}
-struct gbproxy_tlli_info *gbproxy_find_tlli_by_any_sgsn_tlli(
+struct gbproxy_tlli_info *gbproxy_tlli_info_by_any_sgsn_tlli(
struct gbproxy_peer *peer,
uint32_t tlli)
{
@@ -76,7 +76,7 @@ struct gbproxy_tlli_info *gbproxy_find_tlli_by_any_sgsn_tlli(
return NULL;
}
-struct gbproxy_tlli_info *gbproxy_find_tlli_by_sgsn_tlli(
+struct gbproxy_tlli_info *gbproxy_tlli_info_by_sgsn_tlli(
struct gbproxy_peer *peer,
uint32_t tlli, uint32_t sgsn_nsei)
{
@@ -92,7 +92,7 @@ struct gbproxy_tlli_info *gbproxy_find_tlli_by_sgsn_tlli(
return NULL;
}
-struct gbproxy_tlli_info *gbproxy_find_tlli_by_imsi(
+struct gbproxy_tlli_info *gbproxy_tlli_info_by_imsi(
struct gbproxy_peer *peer,
const uint8_t *imsi,
size_t imsi_len)
@@ -125,7 +125,7 @@ void gbproxy_tlli_info_discard_messages(struct gbproxy_tlli_info *tlli_info)
}
}
-void gbproxy_delete_tlli(struct gbproxy_peer *peer,
+void gbproxy_delete_tlli_info(struct gbproxy_peer *peer,
struct gbproxy_tlli_info *tlli_info)
{
struct gbproxy_patch_state *state = &peer->patch_state;
@@ -140,13 +140,13 @@ void gbproxy_delete_tlli(struct gbproxy_peer *peer,
state->enabled_tllis_count;
}
-void gbproxy_delete_tllis(struct gbproxy_peer *peer)
+void gbproxy_delete_tlli_infos(struct gbproxy_peer *peer)
{
struct gbproxy_tlli_info *tlli_info, *nxt;
struct gbproxy_patch_state *state = &peer->patch_state;
llist_for_each_entry_safe(tlli_info, nxt, &state->enabled_tllis, list)
- gbproxy_delete_tlli(peer, tlli_info);
+ gbproxy_delete_tlli_info(peer, tlli_info);
OSMO_ASSERT(state->enabled_tllis_count == 0);
OSMO_ASSERT(llist_empty(&state->enabled_tllis));
@@ -165,7 +165,7 @@ void gbproxy_attach_tlli_info(struct gbproxy_peer *peer, time_t now,
state->enabled_tllis_count;
}
-int gbproxy_remove_stale_tllis(struct gbproxy_peer *peer, time_t now)
+int gbproxy_remove_stale_tlli_infos(struct gbproxy_peer *peer, time_t now)
{
struct gbproxy_patch_state *state = &peer->patch_state;
int exceeded_max_len = 0;
@@ -189,7 +189,7 @@ int gbproxy_remove_stale_tllis(struct gbproxy_peer *peer, time_t now)
"(stale, length %d, max_len exceeded)\n",
tlli_info->tlli.current, state->enabled_tllis_count);
- gbproxy_delete_tlli(peer, tlli_info);
+ gbproxy_delete_tlli_info(peer, tlli_info);
deleted_count += 1;
}
@@ -211,7 +211,7 @@ int gbproxy_remove_stale_tllis(struct gbproxy_peer *peer, time_t now)
"(stale, age %d, max_age exceeded)\n",
tlli_info->tlli.current, (int)age);
- gbproxy_delete_tlli(peer, tlli_info);
+ gbproxy_delete_tlli_info(peer, tlli_info);
deleted_count += 1;
}
@@ -326,15 +326,16 @@ static void gbproxy_validate_tlli(struct gbproxy_tlli_state *tlli_state,
tlli_state->assigned = 0;
}
-void gbproxy_touch_tlli(struct gbproxy_peer *peer,
- struct gbproxy_tlli_info *tlli_info, time_t now)
+static void gbproxy_touch_tlli_info(struct gbproxy_peer *peer,
+ struct gbproxy_tlli_info *tlli_info,
+ time_t now)
{
gbproxy_detach_tlli_info(peer, tlli_info);
gbproxy_attach_tlli_info(peer, now, tlli_info);
}
-static void gbproxy_unregister_tlli(struct gbproxy_peer *peer,
- struct gbproxy_tlli_info *tlli_info)
+static void gbproxy_unregister_tlli_info(struct gbproxy_peer *peer,
+ struct gbproxy_tlli_info *tlli_info)
{
if (!tlli_info)
return;
@@ -343,7 +344,7 @@ static void gbproxy_unregister_tlli(struct gbproxy_peer *peer,
LOGP(DGPRS, LOGL_INFO,
"Removing TLLI %08x from list (P-TMSI or IMSI are not set)\n",
tlli_info->tlli.current);
- gbproxy_delete_tlli(peer, tlli_info);
+ gbproxy_delete_tlli_info(peer, tlli_info);
return;
}
@@ -374,7 +375,7 @@ void gbproxy_assign_imsi(struct gbproxy_peer *peer,
struct gbproxy_tlli_info *other_tlli_info;
/* Make sure that there is a second entry with the same IMSI */
- other_tlli_info = gbproxy_find_tlli_by_imsi(
+ other_tlli_info = gbproxy_tlli_info_by_imsi(
peer, parse_ctx->imsi, parse_ctx->imsi_len);
if (other_tlli_info && other_tlli_info != tlli_info) {
@@ -385,7 +386,7 @@ void gbproxy_assign_imsi(struct gbproxy_peer *peer,
LOGP(DGPRS, LOGL_INFO,
"Removing TLLI %08x from list (IMSI %s re-used)\n",
other_tlli_info->tlli.current, mi_buf);
- gbproxy_delete_tlli(peer, other_tlli_info);
+ gbproxy_delete_tlli_info(peer, other_tlli_info);
}
/* Update the IMSI field */
@@ -414,8 +415,8 @@ static int gbproxy_tlli_match(const struct gbproxy_tlli_state *a,
return 0;
}
-static void gbproxy_remove_matching_tllis(struct gbproxy_peer *peer,
- struct gbproxy_tlli_info *tlli_info)
+static void gbproxy_remove_matching_tlli_infos(
+ struct gbproxy_peer *peer, struct gbproxy_tlli_info *tlli_info)
{
struct gbproxy_tlli_info *info, *nxt;
struct gbproxy_patch_state *state = &peer->patch_state;
@@ -433,7 +434,7 @@ static void gbproxy_remove_matching_tllis(struct gbproxy_peer *peer,
LOGP(DGPRS, LOGL_INFO,
"Removing TLLI %08x from list (P-TMSI/TLLI re-used)\n",
info->tlli.current);
- gbproxy_delete_tlli(peer, info);
+ gbproxy_delete_tlli_info(peer, info);
}
}
@@ -444,10 +445,10 @@ struct gbproxy_tlli_info *gbproxy_get_tlli_info_ul(
struct gbproxy_tlli_info *tlli_info = NULL;
if (parse_ctx->tlli_enc)
- tlli_info = gbproxy_find_tlli(peer, parse_ctx->tlli);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, parse_ctx->tlli);
if (!tlli_info && parse_ctx->imsi)
- tlli_info = gbproxy_find_tlli_by_imsi(
+ tlli_info = gbproxy_tlli_info_by_imsi(
peer, parse_ctx->imsi, parse_ctx->imsi_len);
if (!tlli_info && parse_ctx->ptmsi_enc && !parse_ctx->old_raid_is_foreign) {
@@ -458,7 +459,7 @@ struct gbproxy_tlli_info *gbproxy_get_tlli_info_ul(
"Failed to parse P-TMSI (TLLI is %08x)\n",
parse_ctx->tlli);
else
- tlli_info = gbproxy_find_tlli_by_ptmsi(peer, bss_ptmsi);
+ tlli_info = gbproxy_tlli_info_by_ptmsi(peer, bss_ptmsi);
}
if (tlli_info)
@@ -495,7 +496,7 @@ struct gbproxy_tlli_info *gbproxy_update_tlli_state_ul(
tlli_info->sgsn_tlli.current =
gbproxy_make_sgsn_tlli(peer, tlli_info,
parse_ctx->tlli);
- gbproxy_touch_tlli(peer, tlli_info, now);
+ gbproxy_touch_tlli_info(peer, tlli_info, now);
} else {
sgsn_tlli = gbproxy_map_tlli(parse_ctx->tlli, tlli_info, 0);
if (!sgsn_tlli)
@@ -506,10 +507,10 @@ struct gbproxy_tlli_info *gbproxy_update_tlli_state_ul(
parse_ctx->tlli, 0);
gbproxy_validate_tlli(&tlli_info->sgsn_tlli,
sgsn_tlli, 0);
- gbproxy_touch_tlli(peer, tlli_info, now);
+ gbproxy_touch_tlli_info(peer, tlli_info, now);
}
} else if (tlli_info) {
- gbproxy_touch_tlli(peer, tlli_info, now);
+ gbproxy_touch_tlli_info(peer, tlli_info, now);
}
if (parse_ctx->imsi && tlli_info && tlli_info->imsi_len == 0)
@@ -526,7 +527,7 @@ struct gbproxy_tlli_info *gbproxy_update_tlli_state_dl(
struct gbproxy_tlli_info *tlli_info = NULL;
if (parse_ctx->tlli_enc)
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(
peer, parse_ctx->tlli, parse_ctx->peer_nsei);
if (parse_ctx->tlli_enc && parse_ctx->new_ptmsi_enc && tlli_info) {
@@ -608,9 +609,9 @@ struct gbproxy_tlli_info *gbproxy_update_tlli_state_dl(
tlli_info, 1);
gbproxy_validate_tlli(&tlli_info->sgsn_tlli, parse_ctx->tlli, 1);
gbproxy_validate_tlli(&tlli_info->tlli, bss_tlli, 1);
- gbproxy_touch_tlli(peer, tlli_info, now);
+ gbproxy_touch_tlli_info(peer, tlli_info, now);
} else if (tlli_info) {
- gbproxy_touch_tlli(peer, tlli_info, now);
+ gbproxy_touch_tlli_info(peer, tlli_info, now);
}
if (parse_ctx->imsi && tlli_info && tlli_info->imsi_len == 0)
@@ -635,11 +636,11 @@ void gbproxy_update_tlli_state_after(
if (keep_info) {
LOGP(DGPRS, LOGL_INFO, "Unregistering TLLI %08x\n",
tlli_info->tlli.current);
- gbproxy_unregister_tlli(peer, tlli_info);
+ gbproxy_unregister_tlli_info(peer, tlli_info);
} else {
LOGP(DGPRS, LOGL_INFO, "Removing TLLI %08x from list\n",
tlli_info->tlli.current);
- gbproxy_delete_tlli(peer, tlli_info);
+ gbproxy_delete_tlli_info(peer, tlli_info);
}
} else if (parse_ctx->to_bss && parse_ctx->tlli_enc &&
parse_ctx->new_ptmsi_enc && tlli_info) {
@@ -661,10 +662,10 @@ void gbproxy_update_tlli_state_after(
peer, new_sgsn_tlli);
gbproxy_reassign_tlli(&tlli_info->tlli,
peer, new_bss_tlli);
- gbproxy_remove_matching_tllis(peer, tlli_info);
+ gbproxy_remove_matching_tlli_infos(peer, tlli_info);
}
- gbproxy_remove_stale_tllis(peer, now);
+ gbproxy_remove_stale_tlli_infos(peer, now);
}
diff --git a/openbsc/src/gprs/gb_proxy_vty.c b/openbsc/src/gprs/gb_proxy_vty.c
index da615630e..72469da21 100644
--- a/openbsc/src/gprs/gb_proxy_vty.c
+++ b/openbsc/src/gprs/gb_proxy_vty.c
@@ -643,7 +643,7 @@ DEFUN(delete_gb_tlli_by_id, delete_gb_tlli_by_id_cmd,
vty_out(vty, "Deleting TLLI %08x%s", tlli_info->tlli.current,
VTY_NEWLINE);
- gbproxy_delete_tlli(peer, tlli_info);
+ gbproxy_delete_tlli_info(peer, tlli_info);
found += 1;
}
@@ -680,7 +680,7 @@ DEFUN(delete_gb_tlli, delete_gb_tlli_cmd,
state = &peer->patch_state;
if (match == MATCH_STALE) {
- found = gbproxy_remove_stale_tllis(peer, time(NULL));
+ found = gbproxy_remove_stale_tlli_infos(peer, time(NULL));
if (found)
vty_out(vty, "Deleted %d stale TLLI%s%s",
found, found == 1 ? "" : "s", VTY_NEWLINE);
@@ -690,7 +690,7 @@ DEFUN(delete_gb_tlli, delete_gb_tlli_cmd,
if (!tlli_info->is_deregistered)
continue;
- gbproxy_delete_tlli(peer, tlli_info);
+ gbproxy_delete_tlli_info(peer, tlli_info);
found += 1;
}
}
diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c
index b0a39c062..e32930065 100644
--- a/openbsc/tests/gbproxy/gbproxy_test.c
+++ b/openbsc/tests/gbproxy/gbproxy_test.c
@@ -1479,7 +1479,7 @@ static void test_gbproxy_ra_patching()
OSMO_ASSERT(gbproxy_peer_by_lac(&gbcfg, convert_ra(&rai_sgsn)) != NULL);
OSMO_ASSERT(gbproxy_peer_by_lac(&gbcfg, convert_ra(&rai_unknown)) == NULL);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_tlli, SGSN_NSEI);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_tlli);
OSMO_ASSERT(tlli_info->tlli.current != local_tlli);
@@ -1497,7 +1497,7 @@ static void test_gbproxy_ra_patching()
OSMO_ASSERT(6 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_BSS].current);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_tlli, SGSN_NSEI);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_tlli);
OSMO_ASSERT(tlli_info->tlli.current != local_tlli);
@@ -1516,7 +1516,7 @@ static void test_gbproxy_ra_patching()
OSMO_ASSERT(7 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_BSS].current);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_tlli, SGSN_NSEI);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_tlli);
OSMO_ASSERT(tlli_info->tlli.current != local_tlli);
@@ -1534,7 +1534,7 @@ static void test_gbproxy_ra_patching()
OSMO_ASSERT(2 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_SGSN].current);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_tlli, SGSN_NSEI);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == 0);
OSMO_ASSERT(tlli_info->tlli.current == local_tlli);
@@ -1734,8 +1734,8 @@ static void test_gbproxy_ptmsi_assignment()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli(peer, foreign_tlli1);
- tlli_info2 = gbproxy_find_tlli(peer, local_tlli);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, foreign_tlli1);
+ tlli_info2 = gbproxy_tlli_info_by_tlli(peer, local_tlli);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info == tlli_info2);
OSMO_ASSERT(tlli_info->tlli.assigned == local_tlli);
@@ -1751,7 +1751,7 @@ static void test_gbproxy_ptmsi_assignment()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli(peer, local_tlli);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, local_tlli);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_tlli);
OSMO_ASSERT(tlli_info->tlli.current == foreign_tlli1);
@@ -1767,12 +1767,12 @@ static void test_gbproxy_ptmsi_assignment()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.ptmsi == ptmsi);
- OSMO_ASSERT(!gbproxy_find_tlli_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2)));
+ OSMO_ASSERT(!gbproxy_tlli_info_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2)));
- tlli_info2 = gbproxy_find_tlli(peer, local_tlli);
+ tlli_info2 = gbproxy_tlli_info_by_tlli(peer, local_tlli);
OSMO_ASSERT(tlli_info == tlli_info2);
OSMO_ASSERT(tlli_info->tlli.assigned == 0);
OSMO_ASSERT(tlli_info->tlli.current == local_tlli);
@@ -1808,8 +1808,8 @@ static void test_gbproxy_ptmsi_assignment()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli(peer, foreign_tlli2);
- tlli_info2 = gbproxy_find_tlli(peer, local_tlli);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, foreign_tlli2);
+ tlli_info2 = gbproxy_tlli_info_by_tlli(peer, local_tlli);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info == tlli_info2);
OSMO_ASSERT(tlli_info->tlli.assigned == local_tlli);
@@ -1825,7 +1825,7 @@ static void test_gbproxy_ptmsi_assignment()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli(peer, local_tlli);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, local_tlli);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_tlli);
OSMO_ASSERT(tlli_info->tlli.current == foreign_tlli2);
@@ -1840,12 +1840,12 @@ static void test_gbproxy_ptmsi_assignment()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.ptmsi == ptmsi);
- OSMO_ASSERT(!gbproxy_find_tlli_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1)));
+ OSMO_ASSERT(!gbproxy_tlli_info_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1)));
- tlli_info2 = gbproxy_find_tlli(peer, local_tlli);
+ tlli_info2 = gbproxy_tlli_info_by_tlli(peer, local_tlli);
OSMO_ASSERT(tlli_info == tlli_info2);
OSMO_ASSERT(tlli_info->tlli.assigned == 0);
OSMO_ASSERT(tlli_info->tlli.current == local_tlli);
@@ -1967,7 +1967,7 @@ static void test_gbproxy_ptmsi_patching()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, random_sgsn_tlli, SGSN_NSEI);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, random_sgsn_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_bss_tlli);
OSMO_ASSERT(tlli_info->tlli.current == foreign_bss_tlli);
@@ -1987,7 +1987,7 @@ static void test_gbproxy_ptmsi_patching()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_bss_tlli);
OSMO_ASSERT(tlli_info->tlli.current == foreign_bss_tlli);
@@ -2005,7 +2005,7 @@ static void test_gbproxy_ptmsi_patching()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.current == local_bss_tlli);
OSMO_ASSERT(tlli_info->tlli.assigned == 0);
@@ -2053,8 +2053,8 @@ static void test_gbproxy_ptmsi_patching()
dump_peers(stdout, 0, 0, &gbcfg);
- OSMO_ASSERT(gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN_NSEI) != NULL);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
+ OSMO_ASSERT(gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN_NSEI) != NULL);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_bss_tlli2);
OSMO_ASSERT(tlli_info->tlli.current == local_bss_tlli);
@@ -2079,9 +2079,9 @@ static void test_gbproxy_ptmsi_patching()
dump_peers(stdout, 0, 0, &gbcfg);
- OSMO_ASSERT(gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN_NSEI) == NULL);
- OSMO_ASSERT(gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli3, SGSN_NSEI) != NULL);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
+ OSMO_ASSERT(gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN_NSEI) == NULL);
+ OSMO_ASSERT(gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli3, SGSN_NSEI) != NULL);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_bss_tlli3);
OSMO_ASSERT(tlli_info->tlli.current == local_bss_tlli);
@@ -2099,7 +2099,7 @@ static void test_gbproxy_ptmsi_patching()
GPRS_SAPI_GMM, bss_nu++,
dtap_ra_upd_complete, sizeof(dtap_ra_upd_complete));
- tlli_info = gbproxy_find_tlli(peer, local_bss_tlli3);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, local_bss_tlli3);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.bss_validated);
@@ -2114,7 +2114,7 @@ static void test_gbproxy_ptmsi_patching()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli3, SGSN_NSEI);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli3, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.current == local_bss_tlli3);
OSMO_ASSERT(tlli_info->tlli.assigned == 0);
@@ -2289,7 +2289,7 @@ static void test_gbproxy_imsi_acquisition()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, random_sgsn_tlli, SGSN_NSEI);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, random_sgsn_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_bss_tlli);
OSMO_ASSERT(tlli_info->tlli.current == foreign_bss_tlli);
@@ -2309,7 +2309,7 @@ static void test_gbproxy_imsi_acquisition()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_bss_tlli);
OSMO_ASSERT(tlli_info->tlli.current == foreign_bss_tlli);
@@ -2327,7 +2327,7 @@ static void test_gbproxy_imsi_acquisition()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.current == local_bss_tlli);
OSMO_ASSERT(tlli_info->tlli.assigned == 0);
@@ -2636,8 +2636,8 @@ static void test_gbproxy_secondary_sgsn()
dump_peers(stdout, 0, 0, &gbcfg);
- OSMO_ASSERT(!gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI));
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, random_sgsn_tlli, SGSN_NSEI);
+ OSMO_ASSERT(!gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI));
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, random_sgsn_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_bss_tlli);
OSMO_ASSERT(tlli_info->tlli.current == foreign_bss_tlli);
@@ -2657,8 +2657,8 @@ static void test_gbproxy_secondary_sgsn()
dump_peers(stdout, 0, 0, &gbcfg);
- OSMO_ASSERT(!gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI));
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
+ OSMO_ASSERT(!gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI));
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_bss_tlli);
OSMO_ASSERT(tlli_info->tlli.current == foreign_bss_tlli);
@@ -2676,8 +2676,8 @@ static void test_gbproxy_secondary_sgsn()
dump_peers(stdout, 0, 0, &gbcfg);
- OSMO_ASSERT(!gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI));
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
+ OSMO_ASSERT(!gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI));
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.current == local_bss_tlli);
OSMO_ASSERT(tlli_info->tlli.assigned == 0);
@@ -2761,8 +2761,8 @@ static void test_gbproxy_secondary_sgsn()
dump_peers(stdout, 0, 0, &gbcfg);
- OSMO_ASSERT(!gbproxy_find_tlli_by_sgsn_tlli(peer, random_sgsn_tlli2, SGSN_NSEI));
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, random_sgsn_tlli2, SGSN2_NSEI);
+ OSMO_ASSERT(!gbproxy_tlli_info_by_sgsn_tlli(peer, random_sgsn_tlli2, SGSN_NSEI));
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, random_sgsn_tlli2, SGSN2_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_bss_tlli2);
OSMO_ASSERT(tlli_info->tlli.current == foreign_bss_tlli2);
@@ -2782,8 +2782,8 @@ static void test_gbproxy_secondary_sgsn()
dump_peers(stdout, 0, 0, &gbcfg);
- OSMO_ASSERT(!gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN_NSEI));
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN2_NSEI);
+ OSMO_ASSERT(!gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN_NSEI));
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN2_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_bss_tlli2);
OSMO_ASSERT(tlli_info->tlli.current == foreign_bss_tlli2);
@@ -2801,8 +2801,8 @@ static void test_gbproxy_secondary_sgsn()
dump_peers(stdout, 0, 0, &gbcfg);
- OSMO_ASSERT(!gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN_NSEI));
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN2_NSEI);
+ OSMO_ASSERT(!gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN_NSEI));
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN2_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.current == local_bss_tlli2);
OSMO_ASSERT(tlli_info->tlli.assigned == 0);
@@ -2886,8 +2886,8 @@ static void test_gbproxy_secondary_sgsn()
dump_peers(stdout, 0, 0, &gbcfg);
- OSMO_ASSERT(!gbproxy_find_tlli_by_sgsn_tlli(peer, random_sgsn_tlli3, SGSN_NSEI));
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, random_sgsn_tlli3, SGSN2_NSEI);
+ OSMO_ASSERT(!gbproxy_tlli_info_by_sgsn_tlli(peer, random_sgsn_tlli3, SGSN_NSEI));
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, random_sgsn_tlli3, SGSN2_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_bss_tlli3);
OSMO_ASSERT(tlli_info->tlli.current == foreign_bss_tlli3);
@@ -2907,9 +2907,9 @@ static void test_gbproxy_secondary_sgsn()
dump_peers(stdout, 0, 0, &gbcfg);
- other_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
+ other_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
OSMO_ASSERT(other_info);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info != other_info);
OSMO_ASSERT(tlli_info->tlli.assigned == local_bss_tlli3);
@@ -2928,9 +2928,9 @@ static void test_gbproxy_secondary_sgsn()
dump_peers(stdout, 0, 0, &gbcfg);
- other_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
+ other_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
OSMO_ASSERT(other_info);
- tlli_info = gbproxy_find_tlli_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI);
+ tlli_info = gbproxy_tlli_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info != other_info);
OSMO_ASSERT(tlli_info->tlli.current == local_bss_tlli3);
@@ -3062,7 +3062,7 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli(peer, foreign_tlli);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, foreign_tlli);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->imsi_len == 0);
OSMO_ASSERT(!tlli_info->is_deregistered);
@@ -3075,7 +3075,7 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli(peer, foreign_tlli);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, foreign_tlli);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->imsi_len > 0);
OSMO_ASSERT(!tlli_info->imsi_acq_pending);
@@ -3094,10 +3094,10 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli(peer, foreign_tlli);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, foreign_tlli);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->imsi_len > 0);
- OSMO_ASSERT(gbproxy_find_tlli_by_imsi(peer, imsi, sizeof(imsi)));
+ OSMO_ASSERT(gbproxy_tlli_info_by_imsi(peer, imsi, sizeof(imsi)));
send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
foreign_tlli, 1, imsi, sizeof(imsi),
@@ -3120,7 +3120,7 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli(peer, local_tlli);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, local_tlli);
OSMO_ASSERT(tlli_info);
/* Detach (MO) */
@@ -3129,7 +3129,7 @@ static void test_gbproxy_keep_info()
GPRS_SAPI_GMM, bss_nu++,
dtap_detach_req, sizeof(dtap_detach_req));
- tlli_info = gbproxy_find_tlli(peer, local_tlli);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, local_tlli);
OSMO_ASSERT(tlli_info);
dump_peers(stdout, 0, 0, &gbcfg);
@@ -3141,8 +3141,8 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- OSMO_ASSERT(!gbproxy_find_tlli(peer, local_tlli));
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi, sizeof(imsi));
+ OSMO_ASSERT(!gbproxy_tlli_info_by_tlli(peer, local_tlli));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi, sizeof(imsi));
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->is_deregistered);
@@ -3154,8 +3154,8 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info2 = gbproxy_find_tlli_by_imsi(peer, imsi, sizeof(imsi));
- tlli_info = gbproxy_find_tlli(peer, foreign_tlli);
+ tlli_info2 = gbproxy_tlli_info_by_imsi(peer, imsi, sizeof(imsi));
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, foreign_tlli);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info == tlli_info2);
OSMO_ASSERT(tlli_info->imsi_len != 0);
@@ -3184,7 +3184,7 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli(peer, local_tlli);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, local_tlli);
OSMO_ASSERT(tlli_info);
send_llc_ul_ui(nsi, "DETACH ACC", &sgsn_peer, 0x1002,
@@ -3194,8 +3194,8 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- OSMO_ASSERT(!gbproxy_find_tlli(peer, local_tlli));
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi, sizeof(imsi));
+ OSMO_ASSERT(!gbproxy_tlli_info_by_tlli(peer, local_tlli));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi, sizeof(imsi));
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->is_deregistered);
@@ -3207,8 +3207,8 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info2 = gbproxy_find_tlli_by_imsi(peer, imsi, sizeof(imsi));
- tlli_info = gbproxy_find_tlli(peer, foreign_tlli);
+ tlli_info2 = gbproxy_tlli_info_by_imsi(peer, imsi, sizeof(imsi));
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, foreign_tlli);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info == tlli_info2);
OSMO_ASSERT(tlli_info->imsi_len != 0);
@@ -3237,7 +3237,7 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli(peer, local_tlli);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, local_tlli);
OSMO_ASSERT(tlli_info);
send_llc_ul_ui(nsi, "DETACH ACC", &sgsn_peer, 0x1002,
@@ -3247,8 +3247,8 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- OSMO_ASSERT(!gbproxy_find_tlli(peer, local_tlli));
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi, sizeof(imsi));
+ OSMO_ASSERT(!gbproxy_tlli_info_by_tlli(peer, local_tlli));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi, sizeof(imsi));
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->is_deregistered);
@@ -3260,8 +3260,8 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info2 = gbproxy_find_tlli_by_imsi(peer, imsi, sizeof(imsi));
- tlli_info = gbproxy_find_tlli(peer, foreign_tlli);
+ tlli_info2 = gbproxy_tlli_info_by_imsi(peer, imsi, sizeof(imsi));
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, foreign_tlli);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info == tlli_info2);
OSMO_ASSERT(tlli_info->imsi_len != 0);
@@ -3295,8 +3295,8 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- OSMO_ASSERT(!gbproxy_find_tlli(peer, local_tlli));
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi, sizeof(imsi));
+ OSMO_ASSERT(!gbproxy_tlli_info_by_tlli(peer, local_tlli));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi, sizeof(imsi));
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->is_deregistered);
@@ -3308,8 +3308,8 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info2 = gbproxy_find_tlli_by_imsi(peer, imsi, sizeof(imsi));
- tlli_info = gbproxy_find_tlli(peer, foreign_tlli);
+ tlli_info2 = gbproxy_tlli_info_by_imsi(peer, imsi, sizeof(imsi));
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, foreign_tlli);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info != tlli_info2);
OSMO_ASSERT(tlli_info->imsi_len == 0);
@@ -3327,8 +3327,8 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info2 = gbproxy_find_tlli_by_imsi(peer, imsi, sizeof(imsi));
- tlli_info = gbproxy_find_tlli(peer, foreign_tlli);
+ tlli_info2 = gbproxy_tlli_info_by_imsi(peer, imsi, sizeof(imsi));
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, foreign_tlli);
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info == tlli_info2);
OSMO_ASSERT(tlli_info->imsi_len >= 0);
@@ -3350,7 +3350,7 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- tlli_info = gbproxy_find_tlli(peer, local_tlli);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, local_tlli);
OSMO_ASSERT(tlli_info);
send_llc_ul_ui(nsi, "DETACH ACC", &sgsn_peer, 0x1002,
@@ -3360,8 +3360,8 @@ static void test_gbproxy_keep_info()
dump_peers(stdout, 0, 0, &gbcfg);
- OSMO_ASSERT(!gbproxy_find_tlli(peer, local_tlli));
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi, sizeof(imsi));
+ OSMO_ASSERT(!gbproxy_tlli_info_by_tlli(peer, local_tlli));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi, sizeof(imsi));
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->is_deregistered);
@@ -3622,10 +3622,10 @@ struct gbproxy_tlli_info *register_tlli(
return NULL;
}
- tlli_info = gbproxy_find_tlli(peer, tlli);
+ tlli_info = gbproxy_tlli_info_by_tlli(peer, tlli);
if (!tlli_info) {
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi, imsi_len);
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi, imsi_len);
if (tlli_info) {
/* TLLI has changed somehow, adjust it */
@@ -3710,10 +3710,10 @@ static void test_gbproxy_tlli_expire(void)
dump_peers(stdout, 2, now, &cfg);
/* verify that 5678 has survived */
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.current == tlli2);
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
OSMO_ASSERT(!tlli_info);
printf("\n");
@@ -3749,9 +3749,9 @@ static void test_gbproxy_tlli_expire(void)
dump_peers(stdout, 2, now, &cfg);
/* verify that 5678 has survived */
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
OSMO_ASSERT(!tlli_info);
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.current == tlli1);
@@ -3780,16 +3780,16 @@ static void test_gbproxy_tlli_expire(void)
register_tlli(peer, tlli2, imsi2, ARRAY_SIZE(imsi2), now);
OSMO_ASSERT(peer->patch_state.enabled_tllis_count == 2);
- num_removed = gbproxy_remove_stale_tllis(peer, time(NULL) + 2);
+ num_removed = gbproxy_remove_stale_tlli_infos(peer, time(NULL) + 2);
OSMO_ASSERT(num_removed == 1);
OSMO_ASSERT(peer->patch_state.enabled_tllis_count == 1);
dump_peers(stdout, 2, now, &cfg);
/* verify that 5678 has survived */
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
OSMO_ASSERT(!tlli_info);
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.current == tlli2);
@@ -3818,16 +3818,16 @@ static void test_gbproxy_tlli_expire(void)
now + 1);
OSMO_ASSERT(peer->patch_state.enabled_tllis_count == 2);
- num_removed = gbproxy_remove_stale_tllis(peer, now + 2);
+ num_removed = gbproxy_remove_stale_tlli_infos(peer, now + 2);
OSMO_ASSERT(num_removed == 1);
OSMO_ASSERT(peer->patch_state.enabled_tllis_count == 1);
dump_peers(stdout, 2, now + 2, &cfg);
/* verify that 5678 has survived */
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
OSMO_ASSERT(!tlli_info);
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.current == tlli2);
@@ -3864,18 +3864,18 @@ static void test_gbproxy_tlli_expire(void)
dump_peers(stdout, 2, now + 2, &cfg);
printf(" Remove stale TLLIs\n");
- num_removed = gbproxy_remove_stale_tllis(peer, now + 3);
+ num_removed = gbproxy_remove_stale_tlli_infos(peer, now + 3);
OSMO_ASSERT(num_removed == 2);
OSMO_ASSERT(peer->patch_state.enabled_tllis_count == 1);
dump_peers(stdout, 2, now + 2, &cfg);
/* verify that tlli3 has survived */
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
OSMO_ASSERT(!tlli_info);
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
OSMO_ASSERT(!tlli_info);
- tlli_info = gbproxy_find_tlli_by_imsi(peer, imsi3, ARRAY_SIZE(imsi3));
+ tlli_info = gbproxy_tlli_info_by_imsi(peer, imsi3, ARRAY_SIZE(imsi3));
OSMO_ASSERT(tlli_info);
OSMO_ASSERT(tlli_info->tlli.current == tlli3);