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