summaryrefslogtreecommitdiff
path: root/lib/affinitymap.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-01-18 23:27:56 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2024-01-19 03:46:56 +0200
commitfdd834b8cc69b1b8c9bdfcfa1f033f35affb4c09 (patch)
treee583ef8ad991140ef214508d1f50ec8cc93e25a9 /lib/affinitymap.c
parent6103c6251ac7986cda4d538d25efc5fcc2b6d1c7 (diff)
lib: validate affinity-map reference using yang model
Change the type of affinity leaf-list in frr-zebra to a leafref with "require-instance" property set to true. This change tells libyang to automatically check that affinity-map exists before usage and doesn't allow it to be deleted if it's referenced. It allows us to remove all the manual code that is doing the same thing. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/affinitymap.c')
-rw-r--r--lib/affinitymap.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/affinitymap.c b/lib/affinitymap.c
index 17e1b2cc01..b748e74884 100644
--- a/lib/affinitymap.c
+++ b/lib/affinitymap.c
@@ -47,7 +47,7 @@ DEFINE_MTYPE_STATIC(LIB, AFFINITY_MAP_INDEX, "Affinity map index");
DEFINE_QOBJ_TYPE(affinity_maps);
DEFINE_QOBJ_TYPE(affinity_map);
-struct affinity_maps affinity_map_master = {NULL, NULL, NULL, NULL};
+struct affinity_maps affinity_map_master = {NULL, NULL, NULL};
static void affinity_map_free(struct affinity_map *map)
{
@@ -121,13 +121,6 @@ char *affinity_map_name_get(int pos)
return NULL;
}
-bool affinity_map_check_use_hook(const char *affmap_name)
-{
- if (affinity_map_master.check_use_hook)
- return (*affinity_map_master.check_use_hook)(affmap_name);
- return false;
-}
-
bool affinity_map_check_update_hook(const char *affmap_name, uint16_t new_pos)
{
if (affinity_map_master.check_update_hook)
@@ -153,12 +146,6 @@ void affinity_map_update_hook(const char *affmap_name, uint16_t new_pos)
new_pos);
}
-
-void affinity_map_set_check_use_hook(bool (*func)(const char *affmap_name))
-{
- affinity_map_master.check_use_hook = func;
-}
-
void affinity_map_set_check_update_hook(bool (*func)(const char *affmap_name,
uint16_t new_pos))
{