/* Lookup neighbour table by name and optional interface index  */
struct rtnl_neightbl* rtnl_neightbl_get(struct nl_cache *cache, const char *name, int ifindex)
/* Lookup neighbour table by name and optional interface index  */
struct rtnl_neightbl* rtnl_neightbl_get(struct nl_cache *cache, const char *name, int ifindex)
{
	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;
}