28 #include <netlink-local.h>
29 #include <netlink/netlink.h>
30 #include <netlink/cache.h>
31 #include <netlink/utils.h>
51 for (ops = cache_ops; ops; ops = ops->
co_next)
52 if (!strcmp(ops->
co_name, name))
74 for (ops = cache_ops; ops; ops = ops->
co_next) {
78 for (i = 0; ops->co_msgtypes[i].
mt_id >= 0; i++)
79 if (ops->co_msgtypes[i].
mt_id == msgtype)
100 for (i = 0; ops->co_msgtypes[i].
mt_id >= 0; i++)
101 if (ops->co_msgtypes[i].
mt_id == msgtype)
102 return &ops->co_msgtypes[i];
111 for (ops = cache_ops; ops; ops = ops->
co_next)
128 for (ops = cache_ops; ops; ops = ops->
co_next)
152 NL_DBG(1,
"Registered cache operations %s\n", ops->
co_name);
172 for (tp = &cache_ops; (t=*tp) != NULL; tp = &t->
co_next)
179 NL_DBG(1,
"Unregistered cache operations %s\n", ops->
co_name);
204 ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops);
208 ops->co_major_cache = cache;
223 ops = cache_ops_lookup_for_obj(cache->c_ops->co_obj_ops);
226 else if (ops->co_major_cache == cache)
227 ops->co_major_cache = NULL;
230 struct nl_cache *__nl_cache_mngt_require(
const char *name)
236 return ops->co_major_cache;
253 struct nl_cache *cache;
255 if (!(cache = __nl_cache_mngt_require(name)))
256 fprintf(stderr,
"Application BUG: Your application must "
257 "call nl_cache_mngt_provide() and\nprovide a valid "
258 "%s cache to be used for internal lookups.\nSee the "
259 " API documentation for more details.\n", name);