/* Find the first mapping in the list matching the one we want.  */
static struct if_mapping* mapping_find(struct if_mapping *target)
/* Find the first mapping in the list matching the one we want.  */
static struct if_mapping* mapping_find(struct if_mapping *target)
{
  struct if_mapping *	ifnode;
  int			i;
  for(ifnode = mapping_list; ifnode != NULL; ifnode = ifnode->next)
    {
      int		matches = 1;
      for(i = 0; i < SELECT_NUM; i++)
	{
	  if(ifnode->active[i] != 0)
	    {
	      if((target->active[i] == 0) ||
		 (selector_list[i].cmp_fn(ifnode, target) != 0))
		{
		  matches = 0;
		  break;
		}
	    }
	}
      if(matches)
	return(ifnode);
    }
  return(NULL);
}