mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-pcu.git
synced 2025-11-02 21:23:33 +00:00
neigh_cache: make neigh_cache_lookup_entry static
The function neigh_cache_lookup_entry() is only used from within neigh_cache.c. Let's make it static and move it, so that we do not need the prototype declaration. Change-Id: I1ea72ad9c79bfeaa06391cf8f62b284fbfea8efc
This commit is contained in:
@@ -89,6 +89,26 @@ void neigh_cache_set_keep_time_interval(struct neigh_cache *cache, unsigned int
|
||||
neigh_cache_schedule_cleanup(cache);
|
||||
}
|
||||
|
||||
static struct neigh_cache_entry *neigh_cache_lookup_entry(struct neigh_cache *cache,
|
||||
const struct neigh_cache_entry_key *key)
|
||||
{
|
||||
struct neigh_cache_entry *tmp;
|
||||
llist_for_each_entry(tmp, &cache->list, list) {
|
||||
if (neigh_cache_entry_key_eq(&tmp->key, key))
|
||||
return tmp;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const struct osmo_cell_global_id_ps *neigh_cache_lookup_value(struct neigh_cache *cache,
|
||||
const struct neigh_cache_entry_key *key)
|
||||
{
|
||||
struct neigh_cache_entry *it = neigh_cache_lookup_entry(cache, key);
|
||||
if (it)
|
||||
return &it->value;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct neigh_cache_entry *neigh_cache_add(struct neigh_cache *cache,
|
||||
const struct neigh_cache_entry_key *key,
|
||||
const struct osmo_cell_global_id_ps *value)
|
||||
@@ -119,26 +139,6 @@ struct neigh_cache_entry *neigh_cache_add(struct neigh_cache *cache,
|
||||
return it;
|
||||
}
|
||||
|
||||
struct neigh_cache_entry *neigh_cache_lookup_entry(struct neigh_cache *cache,
|
||||
const struct neigh_cache_entry_key *key)
|
||||
{
|
||||
struct neigh_cache_entry *tmp;
|
||||
llist_for_each_entry(tmp, &cache->list, list) {
|
||||
if (neigh_cache_entry_key_eq(&tmp->key, key))
|
||||
return tmp;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const struct osmo_cell_global_id_ps *neigh_cache_lookup_value(struct neigh_cache *cache,
|
||||
const struct neigh_cache_entry_key *key)
|
||||
{
|
||||
struct neigh_cache_entry *it = neigh_cache_lookup_entry(cache, key);
|
||||
if (it)
|
||||
return &it->value;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void neigh_cache_free(struct neigh_cache *cache)
|
||||
{
|
||||
struct neigh_cache_entry *it, *tmp;
|
||||
|
||||
@@ -65,8 +65,6 @@ void neigh_cache_set_keep_time_interval(struct neigh_cache *cache, unsigned int
|
||||
struct neigh_cache_entry *neigh_cache_add(struct neigh_cache *cache,
|
||||
const struct neigh_cache_entry_key *key,
|
||||
const struct osmo_cell_global_id_ps *value);
|
||||
struct neigh_cache_entry *neigh_cache_lookup_entry(struct neigh_cache *cache,
|
||||
const struct neigh_cache_entry_key *key);
|
||||
const struct osmo_cell_global_id_ps *neigh_cache_lookup_value(struct neigh_cache *cache,
|
||||
const struct neigh_cache_entry_key *key);
|
||||
void neigh_cache_free(struct neigh_cache *cache);
|
||||
|
||||
Reference in New Issue
Block a user