xref: /titanic_41/usr/src/cmd/listen/lserror.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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 #ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.7.1.1	*/
27 
28 /*
29  * lserror.h:	Network listener error exit codes.
30  *		The codes in the defines index the table below to
31  *		give the actual exit code. (The table is in lsdata.c)
32  *
33  *		An exit code of 1 means initialization problem
34  *			before logging is available
35  *
36  *		An exit code of 0 means the listener got past
37  *		it's initialization and made itself independent
38  *		of it's parent.
39  *
40  *		Not all of the errors listed below will cause error exits.
41  */
42 
43 #ifndef lserror_h	/* avoid multiple inclusions of lserror.h */
44 #define lserror_h
45 
46 /*
47  * parameters to error/exit routines
48  */
49 
50 #define EXIT		0x80		/* error routines will exit	*/
51 #define NOCORE		0x40
52 #define NORMAL		0x20		/* exit is a 'normal' exit	*/
53 #define NO_MSG		0x10		/* message already logged	*/
54 #define CONTINUE	0
55 
56 
57 #define E_CMDLINE	1		/* cmd line arguments		*/
58 #define E_CDHOME	2		/* can't chdir to home dir	*/
59 #define E_CREAT		3		/* can't create a file		*/
60 #define E_ACCESS	4		/* can't access/exec file	*/
61 #define E_OPEN		5		/* can't open a file		*/
62 #define E_LSFORK	6		/* can't fork myself		*/
63 #define E_PIDWRITE	7		/* error writing process id file */
64 
65 #define	E_FD1OPEN	8		/* fd 1 net device open		*/
66 #define	E_FD2OPEN	9		/* fd 2 net device open		*/
67 #define	E_FD3OPEN	10		/* fd 3 net device open		*/
68 #define E_UNAME		11		/* uname system call		*/
69 #define	E_SIGTERM	12		/* signal SIGTERM caught	*/
70 /*
71  * E_INCONSISTENT should only be seen by developers/integrators/etc.
72  * Cmd line/data base problem. Hopefully only a debug error.
73  * In the listener, in check_files(), where cmd line args
74  * and the data base file entries are merged, a pathname
75  * of a required file (e.g.: pidfile, logfile) was NULL.
76  * Make sure the data base/cmd line has all the required entries.
77  */
78 
79 #define E_INCONSISTENT	13
80 
81 
82 /*
83  * TLI errors.
84  *	E_T_ALLOC: probably couldn't malloc() (out of memory?)
85  *	E_T_BIND:  Couldn't bind nodename or netnodename!!!
86  *	E_BIND_REQ: TLI didn't bind the requested name!!!
87  *		    (someone else on the machine/net took it?)
88  *	E_T_FREE:  t_free failed -- listener/tli bug or reboot
89  *	E_IN_TLI:  System call failed in a TLI routine.
90  *
91  */
92 
93 #define E_T_ALLOC	14		/* TLI: t_alloc failed		*/
94 #define	E_T_BIND	15		/* TLI couldn't bind		*/
95 #define	E_BIND_REQ	16		/* tli bound a different name!	*/
96 #define E_T_FREE	17		/* tli couldn't free memory?	*/
97 #define E_IN_TLI	18		/* system call failed in tli	*/
98 #define E_T_LISTEN	19		/* t_listen error		*/
99 #define E_T_ACCEPT	20		/* t_accept			*/
100 #define	E_T_SNDDIS	21		/* t_snddis			*/
101 #define	E_T_RCV		22		/* t_rcv			*/
102 #define	E_T_SND		23		/* t_snd			*/
103 
104 /* miscellaneous errors 						*/
105 
106 #define E_CANT_HAPPEN	24		/* transport provider bug	*/
107 
108 #define E_NOINTERMEDIARY 25		/* login service requested, but
109 					   listener doesn't have an
110 					   intermediary to 'exec'	*/
111 
112 #define	E_FORK_SERVICE	26		/* error occurred when the listener
113 					   tried to fork itself to start
114 					   a service.			*/
115 
116 #define E_RCV_MSG	27		/* error in t_rcv		*/
117 #define E_RCV_TMO	28		/* t_rcv timed out		*/
118 
119 /*
120  * E_OPENBIND: problem during t_open in initialization
121  * actually means the driver ran out of minor devices or the
122  * system file table is full -- reboot or wait recommended
123  */
124 
125 #define E_OPENBIND	29		/* open/bind err during init	*/
126 
127 #define E_DBF_IO	30		/* data base file i/o error	*/
128 #define E_SCAN_DBF	E_DBF_IO
129 #define E_READ_DBF	E_DBF_IO
130 
131 #define	E_BAD_VERSION	31		/* attservice: bad version	*/
132 #define E_BAD_FORMAT	32		/* attservice: bad msg format	*/
133 
134 #define E_SYS_ERROR	33		/* sys call problem; i.e. in exec */
135 
136 #define E_DBF_ALLOC	34		/* calloc's for dbf failed	*/
137 #define E_POLL		35		/* poll call failed		*/
138 #define E_MALLOC	36		/* generic failed malloc	*/
139 #define E_T_RCVDIS	37		/* t_rcvdis (should be above but
140 					   renumbering is bad) */
141 #define E_T_LOOK	38		/* t_look (should be above but
142 					   renumbering is bad) */
143 #define E_DBF_CORRUPT	39		/* data base file corrupt */
144 #define E_BADVER	40		/* data base file at wrong version */
145 
146 #define E_FDNOMATCH	41		/* fd the call came in did not match
147 					   with fd in private_tab */
148 typedef struct {
149 	char	*err_msg;
150 	int	err_code;
151 } errlist;
152 
153 #ifndef	GLOBAL_DATA
154 extern char *Usage;
155 extern errlist err_list[];
156 #endif
157 
158 #endif	/* lserror_h */
159