xref: /titanic_50/usr/src/cmd/isns/isnsadm/isnsadm_msg.c (revision fcf3ce441efd61da9bb2884968af01cb7c1452cc)
1*fcf3ce44SJohn Forte /*
2*fcf3ce44SJohn Forte  * CDDL HEADER START
3*fcf3ce44SJohn Forte  *
4*fcf3ce44SJohn Forte  * The contents of this file are subject to the terms of the
5*fcf3ce44SJohn Forte  * Common Development and Distribution License (the "License").
6*fcf3ce44SJohn Forte  * You may not use this file except in compliance with the License.
7*fcf3ce44SJohn Forte  *
8*fcf3ce44SJohn Forte  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*fcf3ce44SJohn Forte  * or http://www.opensolaris.org/os/licensing.
10*fcf3ce44SJohn Forte  * See the License for the specific language governing permissions
11*fcf3ce44SJohn Forte  * and limitations under the License.
12*fcf3ce44SJohn Forte  *
13*fcf3ce44SJohn Forte  * When distributing Covered Code, include this CDDL HEADER in each
14*fcf3ce44SJohn Forte  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*fcf3ce44SJohn Forte  * If applicable, add the following below this CDDL HEADER, with the
16*fcf3ce44SJohn Forte  * fields enclosed by brackets "[]" replaced with your own identifying
17*fcf3ce44SJohn Forte  * information: Portions Copyright [yyyy] [name of copyright owner]
18*fcf3ce44SJohn Forte  *
19*fcf3ce44SJohn Forte  * CDDL HEADER END
20*fcf3ce44SJohn Forte  */
21*fcf3ce44SJohn Forte /*
22*fcf3ce44SJohn Forte  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23*fcf3ce44SJohn Forte  * Use is subject to license terms.
24*fcf3ce44SJohn Forte  */
25*fcf3ce44SJohn Forte 
26*fcf3ce44SJohn Forte /*
27*fcf3ce44SJohn Forte  * isnsadm_msg.c : handles the text message.
28*fcf3ce44SJohn Forte  *
29*fcf3ce44SJohn Forte  */
30*fcf3ce44SJohn Forte 
31*fcf3ce44SJohn Forte 
32*fcf3ce44SJohn Forte #include "isnsadm.h"
33*fcf3ce44SJohn Forte 
getTextMessage(msg_code_t code)34*fcf3ce44SJohn Forte char *getTextMessage(msg_code_t code) {
35*fcf3ce44SJohn Forte 	switch (code) {
36*fcf3ce44SJohn Forte 		case UNKNOWN:
37*fcf3ce44SJohn Forte 		    return (gettext("Error: Unknown Failure"));
38*fcf3ce44SJohn Forte 		case ERROR_PARTIAL_SUCCESS:
39*fcf3ce44SJohn Forte 		    return (gettext("\nError: one or more objects failed to "
40*fcf3ce44SJohn Forte 		    "be processed.\nCheck the missing object from the "
41*fcf3ce44SJohn Forte 		    "response and issue the operation individaully to get "
42*fcf3ce44SJohn Forte 		    "the specific error information."));
43*fcf3ce44SJohn Forte 		case ERROR_PARTIAL_FAILURE:
44*fcf3ce44SJohn Forte 		    return (gettext("Error: one or more objects failed to "
45*fcf3ce44SJohn Forte 		    "be processed.\nCheck the following failed object "
46*fcf3ce44SJohn Forte 		    "and issue the operation individaully to get the specific "
47*fcf3ce44SJohn Forte 		    "error information."));
48*fcf3ce44SJohn Forte 		case ERROR_NO_ADDITIONAL_PARTIAL_FAILIRE_INFO:
49*fcf3ce44SJohn Forte 		    return (gettext("No additional information avaialble from "
50*fcf3ce44SJohn Forte 			"the response."));
51*fcf3ce44SJohn Forte 		case ERROR_XML_READER_NULL:
52*fcf3ce44SJohn Forte 		    return (gettext
53*fcf3ce44SJohn Forte 			("Error: XML reader not set for respone document."));
54*fcf3ce44SJohn Forte 		case ERROR_XML_RESPONSE_ERROR:
55*fcf3ce44SJohn Forte 		    return (gettext
56*fcf3ce44SJohn Forte 			("Error: Failed to get expected XML element."));
57*fcf3ce44SJohn Forte 		case ERROR_XML_NAME_ATTR_NOT_FOUND:
58*fcf3ce44SJohn Forte 		    return (gettext
59*fcf3ce44SJohn Forte 			("Error: Name attribute not found in reponse."));
60*fcf3ce44SJohn Forte 		case ERROR_XML_ID_ATTR_NOT_FOUND:
61*fcf3ce44SJohn Forte 		    return (gettext
62*fcf3ce44SJohn Forte 			("Error: Index attribute not found in reponse."));
63*fcf3ce44SJohn Forte 		case ERROR_XML_TYPE_ATTR_NOT_FOUND:
64*fcf3ce44SJohn Forte 		    return (gettext
65*fcf3ce44SJohn Forte 			("Error: Node type not found in reponse."));
66*fcf3ce44SJohn Forte 		case ERROR_XML_ALIAS_ATTR_NOT_FOUND:
67*fcf3ce44SJohn Forte 		    return (gettext
68*fcf3ce44SJohn Forte 			("Error: Node Alias not found in reponse."));
69*fcf3ce44SJohn Forte 		case ERROR_XML_DD_OBJECT_NOT_FOUND:
70*fcf3ce44SJohn Forte 		    return (gettext
71*fcf3ce44SJohn Forte 		    ("Error: Discovery Domain object not found in reponse."));
72*fcf3ce44SJohn Forte 		case ERROR_XML_DD_SET_OBJECT_NOT_FOUND:
73*fcf3ce44SJohn Forte 		    return (gettext
74*fcf3ce44SJohn Forte 		    ("Error: Discovery Domain Set object not found in "
75*fcf3ce44SJohn Forte 		    "reponse."));
76*fcf3ce44SJohn Forte 		case ERROR_XML_STATUS_ELEM_NOT_FOUND:
77*fcf3ce44SJohn Forte 		    return (gettext
78*fcf3ce44SJohn Forte 			("Error: Failed to get the status from the server."));
79*fcf3ce44SJohn Forte 		case ERROR_XML_MESSAGE_ELEM_NOT_FOUND:
80*fcf3ce44SJohn Forte 		    return (gettext
81*fcf3ce44SJohn Forte 			("Error: Failed to get the error information."));
82*fcf3ce44SJohn Forte 		case ERROR_XML_ISNSSERVER_ELEM_NOT_FOUND:
83*fcf3ce44SJohn Forte 		    return (gettext
84*fcf3ce44SJohn Forte 			("Error: Config information not found in reponse."));
85*fcf3ce44SJohn Forte 		case ERROR_XML_CREATE_WRITER_FAILED:
86*fcf3ce44SJohn Forte 		    return (gettext
87*fcf3ce44SJohn Forte 			("Error: Failed to create the xml writer."));
88*fcf3ce44SJohn Forte 		case ERROR_XML_CREATE_BUFFER_FAILED:
89*fcf3ce44SJohn Forte 		    return (gettext
90*fcf3ce44SJohn Forte 			("Error: Creating the buffer for XML writer."));
91*fcf3ce44SJohn Forte 		case ERROR_XML_START_DOC_FAILED:
92*fcf3ce44SJohn Forte 		    return (gettext
93*fcf3ce44SJohn Forte 			("Error: Failed to create xml start doc."));
94*fcf3ce44SJohn Forte 		case ERROR_XML_END_DOC_FAILED:
95*fcf3ce44SJohn Forte 		    return (gettext
96*fcf3ce44SJohn Forte 			("Error: Failed to create xml end doc."));
97*fcf3ce44SJohn Forte 		case ERROR_XML_START_ELEMENT_FAILED:
98*fcf3ce44SJohn Forte 		    return (gettext
99*fcf3ce44SJohn Forte 			("Error: Failed to create xml start element."));
100*fcf3ce44SJohn Forte 		case ERROR_XML_WRITE_ELEMENT_FAILED:
101*fcf3ce44SJohn Forte 		    return (gettext
102*fcf3ce44SJohn Forte 			("Error: Failed to create xml write element."));
103*fcf3ce44SJohn Forte 		case ERROR_XML_END_ELEMENT_FAILED:
104*fcf3ce44SJohn Forte 		    return (gettext
105*fcf3ce44SJohn Forte 			("Error: Failed to create xml end element."));
106*fcf3ce44SJohn Forte 		case ERROR_XML_WRITE_ATTRIBUTE_FAILED:
107*fcf3ce44SJohn Forte 		    return (gettext
108*fcf3ce44SJohn Forte 			("Error: Failed to write an xml attribute."));
109*fcf3ce44SJohn Forte 		case ERROR_XML_STRDUP_FAILED:
110*fcf3ce44SJohn Forte 		    return (gettext
111*fcf3ce44SJohn Forte 			("Error: xml strdup failed."));
112*fcf3ce44SJohn Forte 		case ERROR_XML_PARSE_MEMORY_FAILED:
113*fcf3ce44SJohn Forte 		    return (gettext
114*fcf3ce44SJohn Forte 			("Error: xml parse memory failed."));
115*fcf3ce44SJohn Forte 		case ERROR_XML_XPATH_NEW_CONTEXT_FAILED:
116*fcf3ce44SJohn Forte 		    return (gettext
117*fcf3ce44SJohn Forte 			("Error: xml xpath context setup failed."));
118*fcf3ce44SJohn Forte 		case ERROR_XML_ADD_CHILD_FAILED:
119*fcf3ce44SJohn Forte 		    return (gettext
120*fcf3ce44SJohn Forte 			("Error: xml add child failed."));
121*fcf3ce44SJohn Forte 		case ERROR_DOOR_CALL_FAILED:
122*fcf3ce44SJohn Forte 		    return (gettext
123*fcf3ce44SJohn Forte 			("Error: call on the door to send a request to the "
124*fcf3ce44SJohn Forte 			"server failed."));
125*fcf3ce44SJohn Forte 		case ERROR_DOOR_OPEN_FAILED:
126*fcf3ce44SJohn Forte 		    return (gettext
127*fcf3ce44SJohn Forte 			("Error: open on the door to communicate to the "
128*fcf3ce44SJohn Forte 			"server failed."));
129*fcf3ce44SJohn Forte 		case ERROR_ISNS_SMF_SERVICE_NOT_ONLINE:
130*fcf3ce44SJohn Forte 		    return (gettext
131*fcf3ce44SJohn Forte 			("Error: network/isns_server smf(5) "
132*fcf3ce44SJohn Forte 			"service is not online."));
133*fcf3ce44SJohn Forte 		case ERROR_MALLOC_FAILED:
134*fcf3ce44SJohn Forte 		    return (gettext
135*fcf3ce44SJohn Forte 			("Error: memory allocation failed."));
136*fcf3ce44SJohn Forte 		case ERROR_DDMEMBER_NOT_FOUND:
137*fcf3ce44SJohn Forte 		    return (gettext
138*fcf3ce44SJohn Forte 			("Error: no such Discovery Domain membership exist."));
139*fcf3ce44SJohn Forte 		case ERROR_DDSETMEMBER_NOT_FOUND:
140*fcf3ce44SJohn Forte 		    return (gettext
141*fcf3ce44SJohn Forte 			("Error: no such Discovery Domain Set "
142*fcf3ce44SJohn Forte 			"membership exist."));
143*fcf3ce44SJohn Forte 		case ERROR_DDMEMBER_ALREADY_EXIST:
144*fcf3ce44SJohn Forte 		    return (gettext
145*fcf3ce44SJohn Forte 			("Error: Discovery Domain membership already exist."));
146*fcf3ce44SJohn Forte 		case ERROR_DDSETMEMBER_ALREADY_EXIST:
147*fcf3ce44SJohn Forte 		    return (gettext
148*fcf3ce44SJohn Forte 			("Error: Discovery Domain Set membership "
149*fcf3ce44SJohn Forte 			"already exist."));
150*fcf3ce44SJohn Forte 		case ERROR_OPERATION_NOT_ALLOWED_FOR_DEFAULT_DD:
151*fcf3ce44SJohn Forte 		    return (gettext
152*fcf3ce44SJohn Forte 			("Error: operation not allowed for the Default "
153*fcf3ce44SJohn Forte 			"Discovery Domain."));
154*fcf3ce44SJohn Forte 		case ERROR_OPERATION_NOT_ALLOWED_FOR_DEFAULT_DDSET:
155*fcf3ce44SJohn Forte 		    return (gettext
156*fcf3ce44SJohn Forte 			("Error: operation not allowed for the Default "
157*fcf3ce44SJohn Forte 			"Discovery Domain Set."));
158*fcf3ce44SJohn Forte 		case ERROR_DD_NAME_IN_USE:
159*fcf3ce44SJohn Forte 		    return (gettext
160*fcf3ce44SJohn Forte 			("Error: Discovery Domain name already exists."));
161*fcf3ce44SJohn Forte 		case ERROR_DDSET_NAME_IN_USE:
162*fcf3ce44SJohn Forte 		    return (gettext
163*fcf3ce44SJohn Forte 			("Error: Discovery Domain Set name already exist."));
164*fcf3ce44SJohn Forte 		case ERROR_SERVER_BUSY:
165*fcf3ce44SJohn Forte 		    return (gettext
166*fcf3ce44SJohn Forte 			("Error: server reported busy status."));
167*fcf3ce44SJohn Forte 		case ERROR_SERVER_INTERNAL_ERROR:
168*fcf3ce44SJohn Forte 		    return (gettext
169*fcf3ce44SJohn Forte 			("Error: server reported internal error status."));
170*fcf3ce44SJohn Forte 		default:
171*fcf3ce44SJohn Forte 		    return (gettext
172*fcf3ce44SJohn Forte 			("Unknown error."));
173*fcf3ce44SJohn Forte 	}
174*fcf3ce44SJohn Forte }
175