1 /* $NetBSD: netconfig.h,v 1.6 2008/04/28 20:22:54 martin Exp $ */
4 * SPDX-License-Identifier: BSD-2-Clause
6 * Copyright (c) 2004 The NetBSD Foundation, Inc.
9 * This code is derived from software contributed to The NetBSD Foundation
10 * by Frank van der Linden.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
21 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
37 #include <sys/cdefs.h>
39 #define NETCONFIG "/etc/netconfig"
40 #define NETPATH "NETPATH"
43 char *nc_netid; /* Network ID */
44 unsigned long nc_semantics; /* Semantics (see below) */
45 unsigned long nc_flag; /* Flags (see below) */
46 char *nc_protofmly; /* Protocol family */
47 char *nc_proto; /* Protocol name */
48 char *nc_device; /* Network device pathname */
49 unsigned long nc_nlookups; /* Number of directory lookup libs */
50 char **nc_lookups; /* Names of the libraries */
51 unsigned long nc_unused[9]; /* reserved */
55 struct netconfig **nc_head;
56 struct netconfig **nc_curr;
62 #define NC_TPI_CLTS 1 /* Connectionless transport */
63 #define NC_TPI_COTS 2 /* Connection oriented transport */
64 #define NC_TPI_COTS_ORD 3 /* Connection oriented, ordered transport */
65 #define NC_TPI_RAW 4 /* Raw connection */
70 #define NC_NOFLAG 0x00
71 #define NC_VISIBLE 0x01
72 #define NC_BROADCAST 0x02
77 #define NC_NOPROTOFMLY "-"
78 #define NC_LOOPBACK "loopback"
79 #define NC_INET "inet"
80 #define NC_INET6 "inet6"
81 #define NC_IMPLINK "implink"
83 #define NC_CHAOS "chaos"
86 #define NC_ECMA "ecma"
87 #define NC_DATAKIT "datakit"
88 #define NC_CCITT "ccitt"
90 #define NC_DECNET "decnet"
93 #define NC_HYLINK "hylink"
94 #define NC_APPLETALK "appletalk"
96 #define NC_IEEE802 "ieee802"
99 #define NC_OSINET "osinet"
100 #define NC_GOSIP "gosip"
105 #define NC_NOPROTO "-"
108 #define NC_ICMP "icmp"
111 void *setnetconfig(void);
112 struct netconfig *getnetconfig(void *);
113 struct netconfig *getnetconfigent(const char *);
114 void freenetconfigent(struct netconfig *);
115 int endnetconfig(void *);
117 void *setnetpath(void);
118 struct netconfig *getnetpath(void *);
119 int endnetpath(void *);
121 void nc_perror(const char *);
122 char *nc_sperror(void);
125 #endif /* _NETCONFIG_H_ */