xref: /illumos-gate/usr/src/uts/common/sys/netconfig.h (revision dd23d762c65e503874085a3893fbd3df9688da30)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23 /*	  All Rights Reserved	*/
24 
25 
26 /*
27  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
28  *
29  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
30  * Use is subject to license terms.
31  */
32 
33 #ifndef	_SYS_NETCONFIG_H
34 #define	_SYS_NETCONFIG_H
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 #define	NETCONFIG "/etc/netconfig"
41 #define	NETPATH   "NETPATH"
42 
43 struct  netconfig {
44 	char		*nc_netid;	/* network identifier		*/
45 	unsigned int	nc_semantics;	/* defined below		*/
46 	unsigned int	nc_flag;	/* defined below		*/
47 	char		*nc_protofmly;	/* protocol family name		*/
48 	char		*nc_proto;	/* protocol name		*/
49 	char		*nc_device;	/* device name for network id	*/
50 	unsigned int	nc_nlookups;	/* # of entries in nc_lookups	*/
51 	char		**nc_lookups;	/* list of lookup directories	*/
52 	unsigned int	nc_unused[8];	/* borrowed for lockd etc.	*/
53 };
54 
55 typedef struct {
56 	struct netconfig **nc_head;
57 	struct netconfig **nc_curr;
58 } NCONF_HANDLE;
59 
60 /*
61  *	Values of nc_semantics
62  */
63 
64 #define	NC_TPI_CLTS	1
65 #define	NC_TPI_COTS	2
66 #define	NC_TPI_COTS_ORD	3
67 #define	NC_TPI_RAW	4
68 /*
69  * NOT FOR PUBLIC USE, Solaris internal only.
70  * This value of nc_semantics is strictly for use of Remote Direct
71  * Memory Access provider interfaces in Solaris only and not for
72  * general use. Do not use this value for general purpose user or
73  * kernel programming. If used the behavior is undefined.
74  * This is a PRIVATE interface to be used by Solaris kRPC only.
75  */
76 #define	NC_TPI_RDMA	5
77 
78 /*
79  *	Values of nc_flag
80  */
81 
82 #define	NC_NOFLAG	00
83 #define	NC_VISIBLE	01
84 #define	NC_BROADCAST	02
85 
86 /*
87  *	Values of nc_protofmly
88  */
89 
90 #define	NC_NOPROTOFMLY	"-"
91 #define	NC_LOOPBACK	"loopback"
92 #define	NC_INET		"inet"
93 #define	NC_INET6	"inet6"
94 #define	NC_IMPLINK	"implink"
95 #define	NC_PUP		"pup"
96 #define	NC_CHAOS	"chaos"
97 #define	NC_NS		"ns"
98 #define	NC_NBS		"nbs"
99 #define	NC_ECMA		"ecma"
100 #define	NC_DATAKIT	"datakit"
101 #define	NC_CCITT	"ccitt"
102 #define	NC_SNA		"sna"
103 #define	NC_DECNET	"decnet"
104 #define	NC_DLI		"dli"
105 #define	NC_LAT		"lat"
106 #define	NC_HYLINK	"hylink"
107 #define	NC_APPLETALK	"appletalk"
108 #define	NC_NIT		"nit"
109 #define	NC_IEEE802	"ieee802"
110 #define	NC_OSI		"osi"
111 #define	NC_X25		"x25"
112 #define	NC_OSINET	"osinet"
113 #define	NC_GOSIP	"gosip"
114 /*
115  * NOT FOR PUBLIC USE, Solaris internal only.
116  * This value of nc_semantics is strictly for use of Remote Direct
117  * Memory Access provider interfaces in Solaris only and not for
118  * general use. Do not use this value for general purpose user or
119  * kernel programming. If used the behavior is undefined.
120  * This is a PRIVATE interface to be used by Solaris kRPC only.
121  */
122 #define	NC_RDMA		"rdma"
123 
124 /*
125  *	Values for nc_proto
126  */
127 
128 #define	NC_NOPROTO	"-"
129 #define	NC_TCP		"tcp"
130 #define	NC_UDP		"udp"
131 #define	NC_ICMP		"icmp"
132 
133 /*
134  * 	Values for nc_proto for "rdma" protofmly
135  */
136 #define	NC_KVIPL	"kvipl"
137 #define	NC_IBTF		"ibtf"
138 #define	NC_KDAPL	"kdapl"
139 
140 extern void		*setnetconfig(void);
141 extern int		endnetconfig(void *);
142 extern struct netconfig	*getnetconfig(void *);
143 extern struct netconfig	*getnetconfigent(const char *);
144 extern void		freenetconfigent(struct netconfig *);
145 extern void		*setnetpath(void);
146 extern int		endnetpath(void *);
147 extern struct netconfig *getnetpath(void *);
148 extern void		nc_perror(const char *);
149 extern char		*nc_sperror(void);
150 
151 #ifdef	__cplusplus
152 }
153 #endif
154 
155 #endif	/* _SYS_NETCONFIG_H */
156