Logo Search packages:      
Sourcecode: libnl version File versions  Download package

void nl_cache_foreach_filter ( struct nl_cache *  cache,
struct nl_object *  filter,
void(*)(struct nl_object *, void *)  cb,
void *  arg 

Call a callback on each element of the cache (filtered).

  • cache cache to iterate on
  • filter filter object
  • cb callback function
  • arg argument passed to callback function
Calls a callback function cb on each element of the cache that matches the filter. The argument arg is passed on to the callback function.

Definition at line 526 of file cache.c.

Referenced by nl_cache_foreach(), rtnl_class_foreach_child(), rtnl_class_foreach_cls(), rtnl_qdisc_foreach_child(), and rtnl_qdisc_foreach_cls().

      struct nl_object *obj, *tmp;
      struct nl_cache_ops *ops = cache->c_ops;

      nl_list_for_each_entry_safe(obj, tmp, &cache->c_items, ce_list) {
            if (filter && ops->co_filter && !ops->co_filter(obj, filter))

            cb(obj, arg);

Generated by  Doxygen 1.6.0   Back to index