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