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

struct nl_cache* rtnl_neigh_alloc_cache ( struct nl_handle *  handle  )  [read]

Build a neighbour cache including all neighbours currently configured in the kernel.

  • handle netlink handle
Allocates a new neighbour cache, initializes it properly and updates it to include all neighbours currently configured in the kernel.

Note:
The caller is responsible for destroying and freeing the cache after using it. (nl_cache_destroy_and_free())
Returns:
The new cache or NULL if an error occured.

Definition at line 459 of file neigh.c.

References nl_cache_alloc_from_ops(), nl_cache_destroy_and_free(), and nl_cache_update().

{
      struct nl_cache *cache = nl_cache_alloc_from_ops(&rtnl_neigh_ops);

      if (cache == NULL)
            return NULL;

      if (nl_cache_update(handle, cache) < 0) {
            nl_cache_destroy_and_free(cache);
            return NULL;
      }

      NL_DBG(2, "Returning new cache %p\n", cache);

      return cache;
}


Generated by  Doxygen 1.6.0   Back to index