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

void nl_cache_dump_filter ( struct nl_cache *  cache,
struct nl_dump_params params,
struct nl_object *  filter 
)

Dump all elements of a cache (filtered).

  • cache cache to dump
  • params dumping parameters (optional)
  • filter filter object
Dumps all elements of the cache to the file descriptor fd given they match the given filter filter.

Definition at line 468 of file cache.c.

References nl_dump_params::dp_type, and NL_DUMP_FULL.

Referenced by nl_cache_dump().

{
      int type = params ? params->dp_type : NL_DUMP_FULL;
      struct nl_cache_ops *ops = cache->c_ops;
      struct nl_object *obj;

      if (type > NL_DUMP_MAX || type < 0)
            BUG();

      if (!ops->co_dump[type])
            return;

      nl_list_for_each_entry(obj, &cache->c_items, ce_list) {
            if (filter && obj->ce_ops != filter->ce_ops)
                  continue;
            
            if (filter && ops->co_filter && !ops->co_filter(obj, filter))
                  continue;

            dump_from_ops(obj, params);
      }
}


Generated by  Doxygen 1.6.0   Back to index