source: trunk/minix/lib/ip/ethern2h.c@ 12

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

Minix 3.1.2a

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