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

int nl_cache_refill ( struct nl_sock *  sk,
struct nl_cache *  cache 
)

(Re)fill a cache with the contents in the kernel.

  • sk Netlink socket.
  • cache cache to update
Clears the specified cache and fills it with the current state in the kernel.

Returns:
0 or a negative error code.

Definition at line 680 of file cache.c.

References nl_cache_clear(), nl_cache_pickup(), and nl_cache_request_full_dump().

Referenced by nl_cache_mngr_add(), rtnl_class_alloc_cache(), rtnl_cls_alloc_cache(), rtnl_route_alloc_cache(), and rtnl_rule_alloc_cache().

{
      int err;

      err = nl_cache_request_full_dump(sk, cache);
      if (err < 0)
            return err;

      NL_DBG(2, "Upading cache %p <%s>, request sent, waiting for dump...\n",
             cache, nl_cache_name(cache));
      nl_cache_clear(cache);

      return nl_cache_pickup(sk, cache);
}


Generated by  Doxygen 1.6.0   Back to index