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