aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gb_proxy.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-04 17:10:08 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-05 15:02:06 +0200
commit0196c9936c5a0ddbfd62bfc0f19bf628f11470ee (patch)
tree783e98118dcd11fa3251b0a23b1ae79d7f7db87d /openbsc/src/gprs/gb_proxy.c
parentd8a7e22709607abb61d79f214e0b5f5f440d9a48 (diff)
gbproxy/test: Test TLLI expiry
This adds a unit test for gbprox_register_tlli() and gbprox_remove_stale_tllis(). The dump_peers() function is extended by a cfg parameter to support a non-global gbproxy_config. Done with Jacob
Diffstat (limited to 'openbsc/src/gprs/gb_proxy.c')
-rw-r--r--openbsc/src/gprs/gb_proxy.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index 72014b1a6..c6d028fcc 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -196,7 +196,7 @@ static int check_peer_nsei(struct gbproxy_peer *peer, uint16_t nsei)
return 1;
}
-static struct gbproxy_peer *peer_alloc(struct gbproxy_config *cfg, uint16_t bvci)
+struct gbproxy_peer *gbproxy_peer_alloc(struct gbproxy_config *cfg, uint16_t bvci)
{
struct gbproxy_peer *peer;
@@ -215,7 +215,7 @@ static struct gbproxy_peer *peer_alloc(struct gbproxy_config *cfg, uint16_t bvci
return peer;
}
-static void peer_free(struct gbproxy_peer *peer)
+void gbproxy_peer_free(struct gbproxy_peer *peer)
{
rate_ctr_group_free(peer->ctrg);
llist_del(&peer->list);
@@ -393,7 +393,7 @@ static struct gbproxy_tlli_info *gbprox_find_tlli(struct gbproxy_peer *peer,
return NULL;
}
-static struct gbproxy_tlli_info *gbprox_find_tlli_by_mi(
+struct gbproxy_tlli_info *gbprox_find_tlli_by_mi(
struct gbproxy_peer *peer,
const uint8_t *mi_data,
size_t mi_data_len)
@@ -530,7 +530,7 @@ int gbprox_remove_stale_tllis(struct gbproxy_peer *peer, time_t now)
return deleted_count;
}
-static void gbprox_register_tlli(struct gbproxy_peer *peer, uint32_t tlli,
+void gbprox_register_tlli(struct gbproxy_peer *peer, uint32_t tlli,
const uint8_t *imsi, size_t imsi_len)
{
struct gbproxy_patch_state *state = &peer->patch_state;
@@ -1456,7 +1456,7 @@ static int gbprox_rx_sig_from_bss(struct gbproxy_config *cfg,
* PTP-BVCI yet, we should allocate a new peer */
LOGP(DGPRS, LOGL_INFO, "Allocationg new peer for "
"BVCI=%u via NSEI=%u\n", bvci, nsei);
- from_peer = peer_alloc(cfg, bvci);
+ from_peer = gbproxy_peer_alloc(cfg, bvci);
from_peer->nsei = nsei;
}
@@ -1845,7 +1845,7 @@ void gbprox_reset(struct gbproxy_config *cfg)
struct gbproxy_peer *peer, *tmp;
llist_for_each_entry_safe(peer, tmp, &cfg->bts_peers, list)
- peer_free(peer);
+ gbproxy_peer_free(peer);
rate_ctr_group_free(cfg->ctrg);
gbproxy_init_config(cfg);
@@ -1862,7 +1862,7 @@ int gbprox_cleanup_peers(struct gbproxy_config *cfg, uint16_t nsei, uint16_t bvc
if (bvci && peer->bvci != bvci)
continue;
- peer_free(peer);
+ gbproxy_peer_free(peer);
counter += 1;
}