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

int nl_cache_update ( struct nl_handle *  handle,
struct nl_cache *  cache 
)

Update (synchronize) a local cache with the kernel.

  • handle netlink handle
  • cache cache to update
Updates the local cache cache with the state in the kernel. During this process the cache gets emptied and refilled with the new content received from the kernel.

Returns:
0 or a negative error code.

Definition at line 422 of file cache.c.

References nl_cache_destroy(), and nl_cache_pickup().

Referenced by rtnl_addr_alloc_cache(), rtnl_class_alloc_cache(), rtnl_cls_alloc_cache(), rtnl_link_alloc_cache(), rtnl_neigh_alloc_cache(), rtnl_neightbl_alloc_cache(), rtnl_qdisc_alloc_cache(), rtnl_route_alloc_cache(), and rtnl_rule_alloc_cache_by_family().

{
      int err;
      struct nl_cache_ops *ops = cache->c_ops;

      err = ops->co_request_update(cache, handle);
      if (err < 0)
            return err;

      NL_DBG(2, "Upading cache %p, request sent, waiting for dump...\n",
             cache);

      nl_cache_destroy(cache);

      return nl_cache_pickup(handle, cache);
}


Generated by  Doxygen 1.6.0   Back to index