1 /* Copyright (C) 1996 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If
16 not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
20 #include <netinet/if_ether.h>
22 /* Because the `ethers' lookup does not fit so well in the scheme so
23 we define a dummy struct here which helps us to use the available
28 struct ether_addr e_addr
;
30 struct etherent_data
{};
32 #define ENTNAME etherent
33 #define DATAFILE "/etc/ethers"
34 #include "files-parse.c"
38 /* Read the ethernet address: 6 x 8bit hexadecimal number. */
42 for (cnt
= 0; cnt
< 6; ++cnt
)
47 INT_FIELD (number
, ISCOLON
, 0, 16, (unsigned int))
49 INT_FIELD (number
, isspace
, 0, 16, (unsigned int))
53 result
->e_addr
.ether_addr_octet
[cnt
] = number
;
56 STRING_FIELD (result
->e_name
, isspace
, 1);
60 #include "files-XXX.c"
64 if (strcmp (result
->e_name
, name
) == 0)
70 if (memcmp (&result
->e_addr
, addr
,
71 sizeof (struct ether_addr
)) == 0)
73 }, struct ether_addr
*addr
)