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