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