. service tells you which device it couldn't stat
[minix3.git] / lib / ip / etherh2n.c
blobfa4b188f4f6c5673edcc8212bfbd8011bab42c81
1 /*
2 etherh2n.c
4 Created: May 20, 1992 by Philip Homburg
5 */
7 #include <stdio.h>
8 #include <string.h>
9 #include <net/gen/if_ether.h>
11 int
12 ether_hostton(hostname, e)
13 char *hostname;
14 struct ether_addr *e;
16 FILE *etherf;
17 char b[256], hn[256];
19 etherf= fopen(_PATH_ETHERS, "r");
20 if (etherf == NULL)
21 return 1;
23 while(fgets(b, sizeof(b), etherf) != NULL)
25 if (ether_line(b, e, hn) == 0 && strcmp(hn, hostname) == 0)
27 fclose(etherf);
28 return 0;
31 fclose(etherf);
32 return 1;