xref: /onnv-gate/usr/src/cmd/svr4pkg/libinst/qreason.c (revision 9781:ccf49524d5dc)
1*9781SMoriah.Waterland@Sun.COM /*
2*9781SMoriah.Waterland@Sun.COM  * CDDL HEADER START
3*9781SMoriah.Waterland@Sun.COM  *
4*9781SMoriah.Waterland@Sun.COM  * The contents of this file are subject to the terms of the
5*9781SMoriah.Waterland@Sun.COM  * Common Development and Distribution License (the "License").
6*9781SMoriah.Waterland@Sun.COM  * You may not use this file except in compliance with the License.
7*9781SMoriah.Waterland@Sun.COM  *
8*9781SMoriah.Waterland@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*9781SMoriah.Waterland@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*9781SMoriah.Waterland@Sun.COM  * See the License for the specific language governing permissions
11*9781SMoriah.Waterland@Sun.COM  * and limitations under the License.
12*9781SMoriah.Waterland@Sun.COM  *
13*9781SMoriah.Waterland@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*9781SMoriah.Waterland@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*9781SMoriah.Waterland@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*9781SMoriah.Waterland@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*9781SMoriah.Waterland@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*9781SMoriah.Waterland@Sun.COM  *
19*9781SMoriah.Waterland@Sun.COM  * CDDL HEADER END
20*9781SMoriah.Waterland@Sun.COM  */
21*9781SMoriah.Waterland@Sun.COM 
22*9781SMoriah.Waterland@Sun.COM /*
23*9781SMoriah.Waterland@Sun.COM  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*9781SMoriah.Waterland@Sun.COM  * Use is subject to license terms.
25*9781SMoriah.Waterland@Sun.COM  */
26*9781SMoriah.Waterland@Sun.COM 
27*9781SMoriah.Waterland@Sun.COM /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28*9781SMoriah.Waterland@Sun.COM /* All Rights Reserved */
29*9781SMoriah.Waterland@Sun.COM 
30*9781SMoriah.Waterland@Sun.COM 
31*9781SMoriah.Waterland@Sun.COM /*
32*9781SMoriah.Waterland@Sun.COM  * System includes
33*9781SMoriah.Waterland@Sun.COM  */
34*9781SMoriah.Waterland@Sun.COM #include <stdio.h>
35*9781SMoriah.Waterland@Sun.COM #include <stdlib.h>
36*9781SMoriah.Waterland@Sun.COM #include <unistd.h>
37*9781SMoriah.Waterland@Sun.COM #include <locale.h>
38*9781SMoriah.Waterland@Sun.COM #include <libintl.h>
39*9781SMoriah.Waterland@Sun.COM 
40*9781SMoriah.Waterland@Sun.COM /*
41*9781SMoriah.Waterland@Sun.COM  * local pkg command library includes
42*9781SMoriah.Waterland@Sun.COM  */
43*9781SMoriah.Waterland@Sun.COM 
44*9781SMoriah.Waterland@Sun.COM #include "libinst.h"
45*9781SMoriah.Waterland@Sun.COM #include "messages.h"
46*9781SMoriah.Waterland@Sun.COM 
47*9781SMoriah.Waterland@Sun.COM /*
48*9781SMoriah.Waterland@Sun.COM  * forward declarations
49*9781SMoriah.Waterland@Sun.COM  */
50*9781SMoriah.Waterland@Sun.COM 
51*9781SMoriah.Waterland@Sun.COM static char	*qreasonNoZonename(int caller, int retcode, int started);
52*9781SMoriah.Waterland@Sun.COM static char	*qreasonWithZonename(int caller, int retcode, int started);
53*9781SMoriah.Waterland@Sun.COM 
54*9781SMoriah.Waterland@Sun.COM /*
55*9781SMoriah.Waterland@Sun.COM  * *****************************************************************************
56*9781SMoriah.Waterland@Sun.COM  * global external (public) functions
57*9781SMoriah.Waterland@Sun.COM  * *****************************************************************************
58*9781SMoriah.Waterland@Sun.COM  */
59*9781SMoriah.Waterland@Sun.COM 
60*9781SMoriah.Waterland@Sun.COM /*
61*9781SMoriah.Waterland@Sun.COM  * Name:	qreason
62*9781SMoriah.Waterland@Sun.COM  * Description:	return message describing specified "quit reason"
63*9781SMoriah.Waterland@Sun.COM  * Arguments:	caller - integer describing the "caller:
64*9781SMoriah.Waterland@Sun.COM  *			Caller identities:
65*9781SMoriah.Waterland@Sun.COM  *			0 - pkginstall - pkgask
66*9781SMoriah.Waterland@Sun.COM  *			1 - pkginstall - pkgadd
67*9781SMoriah.Waterland@Sun.COM  *			2 - pkginstall - mailmsg
68*9781SMoriah.Waterland@Sun.COM  *			3 - pkgremove - quitmsg
69*9781SMoriah.Waterland@Sun.COM  *			4 - pkgremove - mailmsg
70*9781SMoriah.Waterland@Sun.COM  *		retcode - integer return code describing "reason"
71*9781SMoriah.Waterland@Sun.COM  *		includeZonename - integer describing zone for reason
72*9781SMoriah.Waterland@Sun.COM  *			== 0 - do not include a zone name in the message
73*9781SMoriah.Waterland@Sun.COM  *			!= 0 - include a zone name in the message
74*9781SMoriah.Waterland@Sun.COM  * Returns:	char *
75*9781SMoriah.Waterland@Sun.COM  * NOTE:	all messages are returned from static space that does not need
76*9781SMoriah.Waterland@Sun.COM  *		to be free()ed when no longer needed
77*9781SMoriah.Waterland@Sun.COM  * NOTE:	imbedded "%s"s in returned messages are consistent with the
78*9781SMoriah.Waterland@Sun.COM  *		caller and zone name inclusion:
79*9781SMoriah.Waterland@Sun.COM  *			0 - no %s's
80*9781SMoriah.Waterland@Sun.COM  *			1 - one %s - package name
81*9781SMoriah.Waterland@Sun.COM  *			2 - three %s - package name, rootpath, package instance
82*9781SMoriah.Waterland@Sun.COM  *			3 - one %s - package name
83*9781SMoriah.Waterland@Sun.COM  *			4 - two %s - package name, rootpath
84*9781SMoriah.Waterland@Sun.COM  *		If "includeZonename" is true, an extra "%s" is added at the
85*9781SMoriah.Waterland@Sun.COM  *		end of each message for the zone name to be included.
86*9781SMoriah.Waterland@Sun.COM  */
87*9781SMoriah.Waterland@Sun.COM 
88*9781SMoriah.Waterland@Sun.COM char *
qreason(int caller,int retcode,int started,int includeZonename)89*9781SMoriah.Waterland@Sun.COM qreason(int caller, int retcode, int started, int includeZonename)
90*9781SMoriah.Waterland@Sun.COM {
91*9781SMoriah.Waterland@Sun.COM 	if (includeZonename == 0) {
92*9781SMoriah.Waterland@Sun.COM 		return (qreasonNoZonename(caller, retcode, started));
93*9781SMoriah.Waterland@Sun.COM 	}
94*9781SMoriah.Waterland@Sun.COM 
95*9781SMoriah.Waterland@Sun.COM 	return (qreasonWithZonename(caller, retcode, started));
96*9781SMoriah.Waterland@Sun.COM }
97*9781SMoriah.Waterland@Sun.COM 
98*9781SMoriah.Waterland@Sun.COM /*
99*9781SMoriah.Waterland@Sun.COM  * *****************************************************************************
100*9781SMoriah.Waterland@Sun.COM  * static internal (private) functions
101*9781SMoriah.Waterland@Sun.COM  * *****************************************************************************
102*9781SMoriah.Waterland@Sun.COM  */
103*9781SMoriah.Waterland@Sun.COM 
104*9781SMoriah.Waterland@Sun.COM static char *
qreasonNoZonename(int caller,int retcode,int started)105*9781SMoriah.Waterland@Sun.COM qreasonNoZonename(int caller, int retcode, int started)
106*9781SMoriah.Waterland@Sun.COM {
107*9781SMoriah.Waterland@Sun.COM 	switch (retcode) {
108*9781SMoriah.Waterland@Sun.COM 	    case  0:
109*9781SMoriah.Waterland@Sun.COM 	    case 10:
110*9781SMoriah.Waterland@Sun.COM 	    case 20:
111*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
112*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
113*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_SUC);
114*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
115*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_SUC0);
116*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
117*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_SUC1);
118*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
119*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_SUC0);
120*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
121*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_SUC1);
122*9781SMoriah.Waterland@Sun.COM 		    default:
123*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ);
124*9781SMoriah.Waterland@Sun.COM 		}
125*9781SMoriah.Waterland@Sun.COM 
126*9781SMoriah.Waterland@Sun.COM 	    case  1:
127*9781SMoriah.Waterland@Sun.COM 	    case 11:
128*9781SMoriah.Waterland@Sun.COM 	    case 21:
129*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
130*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
131*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_FAIL);
132*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
133*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_FAIL0);
134*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
135*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_FAIL1);
136*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
137*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_FAIL0);
138*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
139*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_FAIL1);
140*9781SMoriah.Waterland@Sun.COM 		    default:
141*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ);
142*9781SMoriah.Waterland@Sun.COM 		}
143*9781SMoriah.Waterland@Sun.COM 
144*9781SMoriah.Waterland@Sun.COM 	    case  2:
145*9781SMoriah.Waterland@Sun.COM 	    case 12:
146*9781SMoriah.Waterland@Sun.COM 	    case 22:
147*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
148*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
149*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_PARFAIL);
150*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
151*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_PARFAIL0);
152*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
153*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_PARFAIL1);
154*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
155*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_PARFAIL0);
156*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
157*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_PARFAIL1);
158*9781SMoriah.Waterland@Sun.COM 		    default:
159*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ);
160*9781SMoriah.Waterland@Sun.COM 		}
161*9781SMoriah.Waterland@Sun.COM 
162*9781SMoriah.Waterland@Sun.COM 	    case  3:
163*9781SMoriah.Waterland@Sun.COM 	    case 13:
164*9781SMoriah.Waterland@Sun.COM 	    case 23:
165*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
166*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
167*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_USER);
168*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
169*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_USER0);
170*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
171*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_USER1);
172*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
173*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_USER0);
174*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
175*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_USER1);
176*9781SMoriah.Waterland@Sun.COM 		    default:
177*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ);
178*9781SMoriah.Waterland@Sun.COM 		}
179*9781SMoriah.Waterland@Sun.COM 
180*9781SMoriah.Waterland@Sun.COM 	    case  4:
181*9781SMoriah.Waterland@Sun.COM 	    case 14:
182*9781SMoriah.Waterland@Sun.COM 	    case 24:
183*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
184*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
185*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_SUA);
186*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
187*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_SUA0);
188*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
189*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_SUA1);
190*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
191*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_SUA0);
192*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
193*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_SUA1);
194*9781SMoriah.Waterland@Sun.COM 		    default:
195*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ);
196*9781SMoriah.Waterland@Sun.COM 		}
197*9781SMoriah.Waterland@Sun.COM 
198*9781SMoriah.Waterland@Sun.COM 	    case  5:
199*9781SMoriah.Waterland@Sun.COM 	    case 15:
200*9781SMoriah.Waterland@Sun.COM 	    case 25:
201*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
202*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
203*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_SUI);
204*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
205*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_SUI0);
206*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
207*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_SUI1);
208*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
209*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_SUI0);
210*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
211*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_SUI1);
212*9781SMoriah.Waterland@Sun.COM 		    default:
213*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ);
214*9781SMoriah.Waterland@Sun.COM 		}
215*9781SMoriah.Waterland@Sun.COM 
216*9781SMoriah.Waterland@Sun.COM 	    case 99:
217*9781SMoriah.Waterland@Sun.COM 		if (started) {
218*9781SMoriah.Waterland@Sun.COM 			switch (caller) {
219*9781SMoriah.Waterland@Sun.COM 			    case 0: /* pkginstall - pkgask */
220*9781SMoriah.Waterland@Sun.COM 				return (MSG_RE_IEPI);
221*9781SMoriah.Waterland@Sun.COM 			    case 1: /* pkginstall - pkgadd */
222*9781SMoriah.Waterland@Sun.COM 				return (MSG_IN_IEPI0);
223*9781SMoriah.Waterland@Sun.COM 			    case 2: /* pkginstall - mailmsg */
224*9781SMoriah.Waterland@Sun.COM 				return (MSG_IN_IEPI1);
225*9781SMoriah.Waterland@Sun.COM 			    case 3: /* pkgremove - quitmsg */
226*9781SMoriah.Waterland@Sun.COM 				return (MSG_RM_IEPI0);
227*9781SMoriah.Waterland@Sun.COM 			    case 4: /* pkgremove - mailmsg */
228*9781SMoriah.Waterland@Sun.COM 				return (MSG_RM_IEPI1);
229*9781SMoriah.Waterland@Sun.COM 			    default:
230*9781SMoriah.Waterland@Sun.COM 				return (MSG_UNKREQ);
231*9781SMoriah.Waterland@Sun.COM 			}
232*9781SMoriah.Waterland@Sun.COM 		}
233*9781SMoriah.Waterland@Sun.COM 
234*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
235*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
236*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_IE);
237*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
238*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_IE0);
239*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
240*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_IE1);
241*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
242*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_IE0);
243*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
244*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_IE1);
245*9781SMoriah.Waterland@Sun.COM 		    default:
246*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ);
247*9781SMoriah.Waterland@Sun.COM 		}
248*9781SMoriah.Waterland@Sun.COM 
249*9781SMoriah.Waterland@Sun.COM 	    default:
250*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
251*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
252*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_UNK);
253*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
254*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_UNK0);
255*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
256*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_UNK1);
257*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
258*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_UNK0);
259*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
260*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_UNK1);
261*9781SMoriah.Waterland@Sun.COM 		    default:
262*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ);
263*9781SMoriah.Waterland@Sun.COM 		}
264*9781SMoriah.Waterland@Sun.COM 	}
265*9781SMoriah.Waterland@Sun.COM }
266*9781SMoriah.Waterland@Sun.COM 
267*9781SMoriah.Waterland@Sun.COM static char *
qreasonWithZonename(int caller,int retcode,int started)268*9781SMoriah.Waterland@Sun.COM qreasonWithZonename(int caller, int retcode, int started)
269*9781SMoriah.Waterland@Sun.COM {
270*9781SMoriah.Waterland@Sun.COM 	switch (retcode) {
271*9781SMoriah.Waterland@Sun.COM 	    case  0:
272*9781SMoriah.Waterland@Sun.COM 	    case 10:
273*9781SMoriah.Waterland@Sun.COM 	    case 20:
274*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
275*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
276*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_SUC_ZONE);
277*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
278*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_SUC0_ZONE);
279*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
280*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_SUC1_ZONE);
281*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
282*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_SUC0_ZONE);
283*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
284*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_SUC1_ZONE);
285*9781SMoriah.Waterland@Sun.COM 		    default:
286*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ_ZONE);
287*9781SMoriah.Waterland@Sun.COM 		}
288*9781SMoriah.Waterland@Sun.COM 
289*9781SMoriah.Waterland@Sun.COM 	    case  1:
290*9781SMoriah.Waterland@Sun.COM 	    case 11:
291*9781SMoriah.Waterland@Sun.COM 	    case 21:
292*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
293*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
294*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_FAIL_ZONE);
295*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
296*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_FAIL0_ZONE);
297*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
298*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_FAIL1_ZONE);
299*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
300*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_FAIL0_ZONE);
301*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
302*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_FAIL1_ZONE);
303*9781SMoriah.Waterland@Sun.COM 		    default:
304*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ_ZONE);
305*9781SMoriah.Waterland@Sun.COM 		}
306*9781SMoriah.Waterland@Sun.COM 
307*9781SMoriah.Waterland@Sun.COM 	    case  2:
308*9781SMoriah.Waterland@Sun.COM 	    case 12:
309*9781SMoriah.Waterland@Sun.COM 	    case 22:
310*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
311*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
312*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_PARFAIL_ZONE);
313*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
314*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_PARFAIL0_ZONE);
315*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
316*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_PARFAIL1_ZONE);
317*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
318*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_PARFAIL0_ZONE);
319*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
320*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_PARFAIL1_ZONE);
321*9781SMoriah.Waterland@Sun.COM 		    default:
322*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ_ZONE);
323*9781SMoriah.Waterland@Sun.COM 		}
324*9781SMoriah.Waterland@Sun.COM 
325*9781SMoriah.Waterland@Sun.COM 	    case  3:
326*9781SMoriah.Waterland@Sun.COM 	    case 13:
327*9781SMoriah.Waterland@Sun.COM 	    case 23:
328*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
329*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
330*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_USER_ZONE);
331*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
332*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_USER0_ZONE);
333*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
334*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_USER1_ZONE);
335*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
336*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_USER0_ZONE);
337*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
338*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_USER1_ZONE);
339*9781SMoriah.Waterland@Sun.COM 		    default:
340*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ_ZONE);
341*9781SMoriah.Waterland@Sun.COM 		}
342*9781SMoriah.Waterland@Sun.COM 
343*9781SMoriah.Waterland@Sun.COM 	    case  4:
344*9781SMoriah.Waterland@Sun.COM 	    case 14:
345*9781SMoriah.Waterland@Sun.COM 	    case 24:
346*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
347*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
348*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_SUA_ZONE);
349*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
350*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_SUA0_ZONE);
351*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
352*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_SUA1_ZONE);
353*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
354*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_SUA0_ZONE);
355*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
356*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_SUA1_ZONE);
357*9781SMoriah.Waterland@Sun.COM 		    default:
358*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ_ZONE);
359*9781SMoriah.Waterland@Sun.COM 		}
360*9781SMoriah.Waterland@Sun.COM 
361*9781SMoriah.Waterland@Sun.COM 	    case  5:
362*9781SMoriah.Waterland@Sun.COM 	    case 15:
363*9781SMoriah.Waterland@Sun.COM 	    case 25:
364*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
365*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
366*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_SUI_ZONE);
367*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
368*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_SUI0_ZONE);
369*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
370*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_SUI1_ZONE);
371*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
372*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_SUI0_ZONE);
373*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
374*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_SUI1_ZONE);
375*9781SMoriah.Waterland@Sun.COM 		    default:
376*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ_ZONE);
377*9781SMoriah.Waterland@Sun.COM 		}
378*9781SMoriah.Waterland@Sun.COM 
379*9781SMoriah.Waterland@Sun.COM 	    case 99:
380*9781SMoriah.Waterland@Sun.COM 		if (started) {
381*9781SMoriah.Waterland@Sun.COM 			switch (caller) {
382*9781SMoriah.Waterland@Sun.COM 			    case 0: /* pkginstall - pkgask */
383*9781SMoriah.Waterland@Sun.COM 				return (MSG_RE_IEPI_ZONE);
384*9781SMoriah.Waterland@Sun.COM 			    case 1: /* pkginstall - pkgadd */
385*9781SMoriah.Waterland@Sun.COM 				return (MSG_IN_IEPI0_ZONE);
386*9781SMoriah.Waterland@Sun.COM 			    case 2: /* pkginstall - mailmsg */
387*9781SMoriah.Waterland@Sun.COM 				return (MSG_IN_IEPI1_ZONE);
388*9781SMoriah.Waterland@Sun.COM 			    case 3: /* pkgremove - quitmsg */
389*9781SMoriah.Waterland@Sun.COM 				return (MSG_RM_IEPI0_ZONE);
390*9781SMoriah.Waterland@Sun.COM 			    case 4: /* pkgremove - mailmsg */
391*9781SMoriah.Waterland@Sun.COM 				return (MSG_RM_IEPI1_ZONE);
392*9781SMoriah.Waterland@Sun.COM 			    default:
393*9781SMoriah.Waterland@Sun.COM 				return (MSG_UNKREQ_ZONE);
394*9781SMoriah.Waterland@Sun.COM 			}
395*9781SMoriah.Waterland@Sun.COM 		}
396*9781SMoriah.Waterland@Sun.COM 
397*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
398*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
399*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_IE_ZONE);
400*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
401*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_IE0_ZONE);
402*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
403*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_IE1_ZONE);
404*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
405*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_IE0_ZONE);
406*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
407*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_IE1_ZONE);
408*9781SMoriah.Waterland@Sun.COM 		    default:
409*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ_ZONE);
410*9781SMoriah.Waterland@Sun.COM 		}
411*9781SMoriah.Waterland@Sun.COM 
412*9781SMoriah.Waterland@Sun.COM 	    default:
413*9781SMoriah.Waterland@Sun.COM 		switch (caller) {
414*9781SMoriah.Waterland@Sun.COM 		    case 0: /* pkginstall - pkgask */
415*9781SMoriah.Waterland@Sun.COM 			return (MSG_RE_UNK_ZONE);
416*9781SMoriah.Waterland@Sun.COM 		    case 1: /* pkginstall - pkgadd */
417*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_UNK0_ZONE);
418*9781SMoriah.Waterland@Sun.COM 		    case 2: /* pkginstall - mailmsg */
419*9781SMoriah.Waterland@Sun.COM 			return (MSG_IN_UNK1_ZONE);
420*9781SMoriah.Waterland@Sun.COM 		    case 3: /* pkgremove - quitmsg */
421*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_UNK0_ZONE);
422*9781SMoriah.Waterland@Sun.COM 		    case 4: /* pkgremove - mailmsg */
423*9781SMoriah.Waterland@Sun.COM 			return (MSG_RM_UNK1_ZONE);
424*9781SMoriah.Waterland@Sun.COM 		    default:
425*9781SMoriah.Waterland@Sun.COM 			return (MSG_UNKREQ_ZONE);
426*9781SMoriah.Waterland@Sun.COM 		}
427*9781SMoriah.Waterland@Sun.COM 	}
428*9781SMoriah.Waterland@Sun.COM }
429