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

struct rtnl_neightbl* rtnl_neightbl_get ( struct nl_cache *  cache,
const char *  name,
int  ifindex 
) [read]

Lookup neighbour table by name and optional interface index

  • cache neighbour table cache
  • name name of table
  • ifindex optional interface index
Looks up the neighbour table matching the specified name and optionally the specified ifindex to retrieve device specific parameter sets.

Returns:
ptr to neighbour table inside the cache or NULL if no match was found.

Definition at line 452 of file neightbl.c.

References nl_object_get(), rtnl_neightbl::nt_name, and rtnl_neightbl::nt_parms.

{
      struct rtnl_neightbl *nt;

      if (cache->c_ops != &rtnl_neightbl_ops)
            return NULL;

      nl_list_for_each_entry(nt, &cache->c_items, ce_list) {
            if (!strcasecmp(nt->nt_name, name) &&
                ((!ifindex && !nt->nt_parms.ntp_ifindex) ||
                 (ifindex && ifindex == nt->nt_parms.ntp_ifindex))) {
                  nl_object_get((struct nl_object *) nt);
                  return nt;
            }
      }

      return NULL;
}


Generated by  Doxygen 1.6.0   Back to index