source: trunk/minix/lib/ip/etherh2n.c@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 490 bytes
Line 
1/*
2etherh2n.c
3
4Created: May 20, 1992 by Philip Homburg
5*/
6
7#include <stdio.h>
8#include <string.h>
9#include <net/gen/if_ether.h>
10
11int
12ether_hostton(hostname, e)
13char *hostname;
14struct ether_addr *e;
15{
16 FILE *etherf;
17 char b[256], hn[256];
18
19 etherf= fopen(_PATH_ETHERS, "r");
20 if (etherf == NULL)
21 return 1;
22
23 while(fgets(b, sizeof(b), etherf) != NULL)
24 {
25 if (ether_line(b, e, hn) == 0 && strcmp(hn, hostname) == 0)
26 {
27 fclose(etherf);
28 return 0;
29 }
30 }
31 fclose(etherf);
32 return 1;
33}
Note: See TracBrowser for help on using the repository browser.