18 #include <netlink-local.h>
19 #include <netlink/netlink.h>
20 #include <netlink/cache.h>
21 #include <netlink/utils.h>
41 for (ops = cache_ops; ops; ops = ops->
co_next)
42 if (!strcmp(ops->
co_name, name))
64 for (ops = cache_ops; ops; ops = ops->
co_next) {
68 for (i = 0; ops->co_msgtypes[i].
mt_id >= 0; i++)
69 if (ops->co_msgtypes[i].
mt_id == msgtype)
90 for (i = 0; ops->co_msgtypes[i].
mt_id >= 0; i++)
91 if (ops->co_msgtypes[i].
mt_id == msgtype)
92 return &ops->co_msgtypes[i];
101 for (ops = cache_ops; ops; ops = ops->
co_next)
118 for (ops = cache_ops; ops; ops = ops->
co_next)
142 NL_DBG(1,
"Registered cache operations %s\n", ops->
co_name);
162 for (tp = &cache_ops; (t=*tp) != NULL; tp = &t->
co_next)
169 NL_DBG(1,
"Unregistered cache operations %s\n", ops->
co_name);
194 ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops);
198 ops->co_major_cache = cache;
213 ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops);
216 else if (ops->co_major_cache == cache)
217 ops->co_major_cache = NULL;
220 struct nl_cache *__nl_cache_mngt_require(
const char *name)
226 return ops->co_major_cache;
243 struct nl_cache *cache;
245 if (!(cache = __nl_cache_mngt_require(name)))
246 fprintf(stderr,
"Application BUG: Your application must "
247 "call nl_cache_mngt_provide() and\nprovide a valid "
248 "%s cache to be used for internal lookups.\nSee the "
249 " API documentation for more details.\n", name);