/* This function is called at startup by init_etherarray() and then by etheraddr_string() as needed. To avoid doing an expensive fopen() on each call, the contents of 'etc_path("ethers")' is cached here in a linked-list 'eth0'.  */
int ether_ntohost(char *name, struct ether_addr *e)
/* This function is called at startup by init_etherarray() and then by etheraddr_string() as needed. To avoid doing an expensive fopen() on each call, the contents of 'etc_path("ethers")' is cached here in a linked-list 'eth0'.  */
int ether_ntohost(char *name, struct ether_addr *e)
{
  const struct ether_entry *cache;
  static int init = 0;
  if (!init) {
    init_ethers();
    init = 1;
  }
  for (cache = eth0; cache; cache = cache->next)
     if (!memcmp(&e->octet, &cache->eth_addr, ETHER_ADDR_LEN)) {
       strcpy (name,cache->name);
       return (0);
     }
  return (1);
}