Logo Search packages:      
Sourcecode: libnl2 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 745 of file cache.c.

References nl_dump_params::dp_type, NL_DUMP_DETAILS, nl_object_match_filter(), and nl_object_ops::oo_dump.

Referenced by nl_cache_dump().

{
      int type = params ? params->dp_type : NL_DUMP_DETAILS;
      struct nl_object_ops *ops;
      struct nl_object *obj;

      NL_DBG(2, "Dumping cache %p <%s> filter %p\n",
             cache, nl_cache_name(cache), filter);

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

      if (cache->c_ops == NULL)
            BUG();

      ops = cache->c_ops->co_obj_ops;
      if (!ops->oo_dump[type])
            return;

      nl_list_for_each_entry(obj, &cache->c_items, ce_list) {
            if (filter && !nl_object_match_filter(obj, filter))
                  continue;

            NL_DBG(4, "Dumping object %p...\n", obj);
            dump_from_ops(obj, params);
      }
}


Generated by  Doxygen 1.6.0   Back to index