blob: 22b6f7f98c09a9ba7a6faaed4ae35d182af314fc [file] [log] [blame]
Bart De Schuymer832f09c2002-11-20 19:40:28 +00001/*
2* This program is free software; you can redistribute it and/or modify
3* it under the terms of the GNU General Public License as published by
4* the Free Software Foundation; either version 2 of the License, or
5* (at your option) any later version.
6*
7* This program is distributed in the hope that it will be useful,
8* but WITHOUT ANY WARRANTY; without even the implied warranty of
9* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10* GNU General Public License for more details.
11*
12* You should have received a copy of the GNU General Public License
13* along with this program; if not, write to the Free Software
14* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/
16
17/* All data returned by the network data base library are supplied in
18 host order and returned in network order (suitable for use in
19 system calls). */
20
21#ifndef _ETHERNETDB_H
22#define _ETHERNETDB_H 1
23
24#include <features.h>
25#include <netinet/in.h>
26#include <stdint.h>
27
28/* Absolute file name for network data base files. */
29#ifndef _PATH_ETHERTYPES
fnm3fd0a3e22002-11-21 10:33:53 +000030#define _PATH_ETHERTYPES "/etc/ethertypes"
Bart De Schuymer832f09c2002-11-20 19:40:28 +000031#endif /* _PATH_ETHERTYPES */
32
Niranjan Pendharkard675c8a2013-02-14 09:22:00 -080033#define __THROW
34
Bart De Schuymer832f09c2002-11-20 19:40:28 +000035struct ethertypeent {
36 char *e_name; /* Official ethernet type name. */
37 char **e_aliases; /* Alias list. */
38 int e_ethertype; /* Ethernet type number. */
39};
40
41/* Open ethertype data base files and mark them as staying open even
42 after a later search if STAY_OPEN is non-zero. */
43extern void setethertypeent(int __stay_open) __THROW;
44
45/* Close ethertype data base files and clear `stay open' flag. */
46extern void endethertypeent(void) __THROW;
47
48/* Get next entry from ethertype data base file. Open data base if
49 necessary. */
50extern struct ethertypeent *getethertypeent(void) __THROW;
51
52/* Return entry from ethertype data base for network with NAME. */
53extern struct ethertypeent *getethertypebyname(__const char *__name)
54 __THROW;
55
56/* Return entry from ethertype data base which number is PROTO. */
57extern struct ethertypeent *getethertypebynumber(int __ethertype) __THROW;
58
59
60#endif /* ethernetdb.h */