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

struct rtnl_neigh* rtnl_neigh_get ( struct nl_cache *  cache,
int  ifindex,
struct nl_addr *  dst 
) [read]

Look up a neighbour by interface index and destination address

  • cache neighbour cache
  • ifindex interface index the neighbour is on
  • dst destination address of the neighbour
    neighbour handle or NULL if no match was found.

Definition at line 475 of file neigh.c.

References nl_addr_cmp(), and nl_object_get().

      struct rtnl_neigh *neigh;

      nl_list_for_each_entry(neigh, &cache->c_items, ce_list) {
            if (neigh->n_ifindex == ifindex &&
                !nl_addr_cmp(neigh->n_dst, dst)) {
                  nl_object_get((struct nl_object *) neigh);
                  return neigh;

      return NULL;

Generated by  Doxygen 1.6.0   Back to index