aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-09-19 16:03:07 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-10-09 17:45:14 +0200
commitf8562e362b2cafe15a9b10be0f3b0d8be831c1ee (patch)
treec8b564ca8275efe5c20b045b22320907f87dff51 /openbsc/src
parent91d2f8a7048bfed3519026bb2f821bbe417c0eec (diff)
gbproxy: Rename the field 'enabled_tllis' to 'logical_links'
This field in struct gbproxy_patch_state has involved and holds a list of all tracked logical links now. Thus the name is modified accordingly. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/gprs/gb_proxy_peer.c2
-rw-r--r--openbsc/src/gprs/gb_proxy_tlli.c46
-rw-r--r--openbsc/src/gprs/gb_proxy_vty.c6
3 files changed, 27 insertions, 27 deletions
diff --git a/openbsc/src/gprs/gb_proxy_peer.c b/openbsc/src/gprs/gb_proxy_peer.c
index 8f9066567..ce6690e5b 100644
--- a/openbsc/src/gprs/gb_proxy_peer.c
+++ b/openbsc/src/gprs/gb_proxy_peer.c
@@ -163,7 +163,7 @@ struct gbproxy_peer *gbproxy_peer_alloc(struct gbproxy_config *cfg, uint16_t bvc
llist_add(&peer->list, &cfg->bts_peers);
- INIT_LLIST_HEAD(&peer->patch_state.enabled_tllis);
+ INIT_LLIST_HEAD(&peer->patch_state.logical_links);
return peer;
}
diff --git a/openbsc/src/gprs/gb_proxy_tlli.c b/openbsc/src/gprs/gb_proxy_tlli.c
index 14ce7d86b..f5d7ef6a7 100644
--- a/openbsc/src/gprs/gb_proxy_tlli.c
+++ b/openbsc/src/gprs/gb_proxy_tlli.c
@@ -38,7 +38,7 @@ struct gbproxy_link_info *gbproxy_link_info_by_tlli(struct gbproxy_peer *peer,
struct gbproxy_link_info *link_info;
struct gbproxy_patch_state *state = &peer->patch_state;
- llist_for_each_entry(link_info, &state->enabled_tllis, list)
+ llist_for_each_entry(link_info, &state->logical_links, list)
if (link_info->tlli.current == tlli ||
link_info->tlli.assigned == tlli)
return link_info;
@@ -53,7 +53,7 @@ struct gbproxy_link_info *gbproxy_link_info_by_ptmsi(
struct gbproxy_link_info *link_info;
struct gbproxy_patch_state *state = &peer->patch_state;
- llist_for_each_entry(link_info, &state->enabled_tllis, list)
+ llist_for_each_entry(link_info, &state->logical_links, list)
if (link_info->tlli.ptmsi == ptmsi)
return link_info;
@@ -68,7 +68,7 @@ struct gbproxy_link_info *gbproxy_link_info_by_any_sgsn_tlli(
struct gbproxy_patch_state *state = &peer->patch_state;
/* Don't care about the NSEI */
- llist_for_each_entry(link_info, &state->enabled_tllis, list)
+ llist_for_each_entry(link_info, &state->logical_links, list)
if (link_info->sgsn_tlli.current == tlli ||
link_info->sgsn_tlli.assigned == tlli)
return link_info;
@@ -83,7 +83,7 @@ struct gbproxy_link_info *gbproxy_link_info_by_sgsn_tlli(
struct gbproxy_link_info *link_info;
struct gbproxy_patch_state *state = &peer->patch_state;
- llist_for_each_entry(link_info, &state->enabled_tllis, list)
+ llist_for_each_entry(link_info, &state->logical_links, list)
if ((link_info->sgsn_tlli.current == tlli ||
link_info->sgsn_tlli.assigned == tlli) &&
link_info->sgsn_nsei == sgsn_nsei)
@@ -103,7 +103,7 @@ struct gbproxy_link_info *gbproxy_link_info_by_imsi(
if (!gprs_is_mi_imsi(imsi, imsi_len))
return NULL;
- llist_for_each_entry(link_info, &state->enabled_tllis, list) {
+ llist_for_each_entry(link_info, &state->logical_links, list) {
if (link_info->imsi_len != imsi_len)
continue;
if (memcmp(link_info->imsi, imsi, imsi_len) != 0)
@@ -134,10 +134,10 @@ void gbproxy_delete_link_info(struct gbproxy_peer *peer,
llist_del(&link_info->list);
talloc_free(link_info);
- state->enabled_tllis_count -= 1;
+ state->logical_link_count -= 1;
peer->ctrg->ctr[GBPROX_PEER_CTR_TLLI_CACHE_SIZE].current =
- state->enabled_tllis_count;
+ state->logical_link_count;
}
void gbproxy_delete_link_infos(struct gbproxy_peer *peer)
@@ -145,11 +145,11 @@ void gbproxy_delete_link_infos(struct gbproxy_peer *peer)
struct gbproxy_link_info *link_info, *nxt;
struct gbproxy_patch_state *state = &peer->patch_state;
- llist_for_each_entry_safe(link_info, nxt, &state->enabled_tllis, list)
+ llist_for_each_entry_safe(link_info, nxt, &state->logical_links, list)
gbproxy_delete_link_info(peer, link_info);
- OSMO_ASSERT(state->enabled_tllis_count == 0);
- OSMO_ASSERT(llist_empty(&state->enabled_tllis));
+ OSMO_ASSERT(state->logical_link_count == 0);
+ OSMO_ASSERT(llist_empty(&state->logical_links));
}
void gbproxy_attach_link_info(struct gbproxy_peer *peer, time_t now,
@@ -158,11 +158,11 @@ void gbproxy_attach_link_info(struct gbproxy_peer *peer, time_t now,
struct gbproxy_patch_state *state = &peer->patch_state;
link_info->timestamp = now;
- llist_add(&link_info->list, &state->enabled_tllis);
- state->enabled_tllis_count += 1;
+ llist_add(&link_info->list, &state->logical_links);
+ state->logical_link_count += 1;
peer->ctrg->ctr[GBPROX_PEER_CTR_TLLI_CACHE_SIZE].current =
- state->enabled_tllis_count;
+ state->logical_link_count;
}
int gbproxy_remove_stale_link_infos(struct gbproxy_peer *peer, time_t now)
@@ -174,29 +174,29 @@ int gbproxy_remove_stale_link_infos(struct gbproxy_peer *peer, time_t now)
if (peer->cfg->tlli_max_len > 0)
exceeded_max_len =
- state->enabled_tllis_count - peer->cfg->tlli_max_len;
+ state->logical_link_count - peer->cfg->tlli_max_len;
check_for_age = peer->cfg->tlli_max_age > 0;
for (; exceeded_max_len > 0; exceeded_max_len--) {
struct gbproxy_link_info *link_info;
- OSMO_ASSERT(!llist_empty(&state->enabled_tllis));
- link_info = llist_entry(state->enabled_tllis.prev,
+ OSMO_ASSERT(!llist_empty(&state->logical_links));
+ link_info = llist_entry(state->logical_links.prev,
struct gbproxy_link_info,
list);
LOGP(DGPRS, LOGL_INFO,
"Removing TLLI %08x from list "
"(stale, length %d, max_len exceeded)\n",
- link_info->tlli.current, state->enabled_tllis_count);
+ link_info->tlli.current, state->logical_link_count);
gbproxy_delete_link_info(peer, link_info);
deleted_count += 1;
}
- while (check_for_age && !llist_empty(&state->enabled_tllis)) {
+ while (check_for_age && !llist_empty(&state->logical_links)) {
time_t age;
struct gbproxy_link_info *link_info;
- link_info = llist_entry(state->enabled_tllis.prev,
+ link_info = llist_entry(state->logical_links.prev,
struct gbproxy_link_info,
list);
age = now - link_info->timestamp;
@@ -238,11 +238,11 @@ void gbproxy_detach_link_info(
struct gbproxy_patch_state *state = &peer->patch_state;
llist_del(&link_info->list);
- OSMO_ASSERT(state->enabled_tllis_count > 0);
- state->enabled_tllis_count -= 1;
+ OSMO_ASSERT(state->logical_link_count > 0);
+ state->logical_link_count -= 1;
peer->ctrg->ctr[GBPROX_PEER_CTR_TLLI_CACHE_SIZE].current =
- state->enabled_tllis_count;
+ state->logical_link_count;
}
void gbproxy_update_link_info(struct gbproxy_link_info *link_info,
@@ -422,7 +422,7 @@ static void gbproxy_remove_matching_link_infos(
struct gbproxy_patch_state *state = &peer->patch_state;
/* Make sure that there is no second entry with the same P-TMSI or TLLI */
- llist_for_each_entry_safe(info, nxt, &state->enabled_tllis, list) {
+ llist_for_each_entry_safe(info, nxt, &state->logical_links, list) {
if (info == link_info)
continue;
diff --git a/openbsc/src/gprs/gb_proxy_vty.c b/openbsc/src/gprs/gb_proxy_vty.c
index 313cd9b3d..fefe8ebab 100644
--- a/openbsc/src/gprs/gb_proxy_vty.c
+++ b/openbsc/src/gprs/gb_proxy_vty.c
@@ -458,7 +458,7 @@ DEFUN(show_gbproxy_tllis, show_gbproxy_tllis_cmd, "show gbproxy tllis",
gbprox_vty_print_peer(vty, peer);
- llist_for_each_entry(link_info, &state->enabled_tllis, list) {
+ llist_for_each_entry(link_info, &state->logical_links, list) {
time_t age = now - link_info->timestamp;
int stored_msgs = 0;
struct llist_head *iter;
@@ -620,7 +620,7 @@ DEFUN(delete_gb_tlli_by_id, delete_gb_tlli_by_id_cmd,
state = &peer->patch_state;
- llist_for_each_entry_safe(link_info, nxt, &state->enabled_tllis, list) {
+ llist_for_each_entry_safe(link_info, nxt, &state->logical_links, list) {
switch (match) {
case MATCH_TLLI:
if (link_info->tlli.current != ident)
@@ -686,7 +686,7 @@ DEFUN(delete_gb_tlli, delete_gb_tlli_cmd,
found, found == 1 ? "" : "s", VTY_NEWLINE);
} else {
llist_for_each_entry_safe(link_info, nxt,
- &state->enabled_tllis, list) {
+ &state->logical_links, list) {
if (!link_info->is_deregistered)
continue;