Sync usage with man page.
[netbsd-mini2440.git] / include / netconfig.h
blob4bb24b935c94942094bd7712fbc3e0bae6d41463
1 /* $NetBSD: netconfig.h,v 1.5 2006/11/09 10:04:40 yamt Exp $ */
3 /*-
4 * Copyright (c) 2004 The NetBSD Foundation, Inc.
5 * All rights reserved.
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
12 * are met:
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.
32 #ifndef _NETCONFIG_H_
33 #define _NETCONFIG_H_
35 #include <sys/cdefs.h>
37 #define NETCONFIG "/etc/netconfig"
38 #define NETPATH "NETPATH"
40 struct netconfig {
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 */
52 typedef struct {
53 struct netconfig **nc_head;
54 struct netconfig **nc_curr;
55 } NCONF_HANDLE;
58 * nc_semantics values
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 */
66 * nc_flag values
68 #define NC_NOFLAG 0x00
69 #define NC_VISIBLE 0x01
70 #define NC_BROADCAST 0x02
73 * nc_protofmly values
75 #define NC_NOPROTOFMLY "-"
76 #define NC_LOOPBACK "loopback"
77 #define NC_INET "inet"
78 #define NC_INET6 "inet6"
79 #define NC_IMPLINK "implink"
80 #define NC_PUP "pup"
81 #define NC_CHAOS "chaos"
82 #define NC_NS "ns"
83 #define NC_NBS "nbs"
84 #define NC_ECMA "ecma"
85 #define NC_DATAKIT "datakit"
86 #define NC_CCITT "ccitt"
87 #define NC_SNA "sna"
88 #define NC_DECNET "decnet"
89 #define NC_DLI "dli"
90 #define NC_LAT "lat"
91 #define NC_HYLINK "hylink"
92 #define NC_APPLETALK "appletalk"
93 #define NC_NIT "nit"
94 #define NC_IEEE802 "ieee802"
95 #define NC_OSI "osi"
96 #define NC_X25 "x25"
97 #define NC_OSINET "osinet"
98 #define NC_GOSIP "gosip"
101 * nc_proto values
103 #define NC_NOPROTO "-"
104 #define NC_TCP "tcp"
105 #define NC_UDP "udp"
106 #define NC_ICMP "icmp"
108 __BEGIN_DECLS
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);
121 __END_DECLS
123 #endif /* _NETCONFIG_H_ */