fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <libintl.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include "isns_utils.h"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include "isns_protocol.h"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortechar *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteresult_code_to_str(int code)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte switch (code) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_SUCCESSFUL:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Successful Operation"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_UNKNOWN_ERROR:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Unknown Error"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_MSG_FORMAT_ERROR:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Message Format Error"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_INVALID_REGIS:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Invalid Registration"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_INVALID_QRY:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Invalid Query"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_SRC_UNKNOWN:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Source Unknown"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_SRC_ABSENT:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Source Absent"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_SRC_UNAUTHORIZED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Source Unauthorized"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_NO_SUCH_ENTRY:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("No Such Entry"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_VER_NOT_SUPPORTED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Version Not Supported"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_INTERNAL_ERROR:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Internal Error"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_BUSY:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Busy"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_OPTION_NOT_UNDERSTOOD:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Option Not Understood"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_INVALID_UPDATE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Invalid Update"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_MSG_NOT_SUPPORTED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Message Not Supported"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_SCN_EVENT_REJECTED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("SCN Event Rejected"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_SCN_REGIS_REJECTED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("SCN Registration Rejected"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_ATTR_NOT_IMPL:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Attribute Not Implemented"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_ESI_NOT_AVAILABLE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("ESI Not Available"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_INVALID_DEREGIS:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Invalid Deregistration"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_RSP_REGIS_NOT_SUPPORTED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Registration Not Supported"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case PARTIAL_SUCCESS:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Partial_success"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case PARTIAL_FAILURE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Partial failure"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_DOOR_ALREADY_RUNNING:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("iSNS managemnet door is already "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "running"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_DOOR_CREATE_FAILED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Failed to create iSNS managemnet "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "door"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_DOOR_MORE_SPACE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("More space needed to return the "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "response"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_INVALID_MGMT_REQUEST:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Invalid managmenet request"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_NULL_XML_MESSAGE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Null XML request"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_XML_VALID_OPERATION_NOT_FOUND:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("XML Doc error: no valid operation "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "found"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_XML_VALID_OBJECT_NOT_FOUND:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("XML Doc error: no valid object "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "found"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_XML_FAIL_TO_CREATE_WRITE_BUFFER:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("failed to create XML witer buffer."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_XML_FAIL_TO_GET_WRITEPTR:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("failed to get XML writer pointer."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_XML_INIT_READER_FAILED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("failed to initialize XML reader."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_XML_PARSE_MEMORY_FAILED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("failed to parse XML doc in memory."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_XML_FAILED_TO_SET_XPATH_CONTEXT:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("failed to get XPATH context."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_XML_FAILED_TO_REGISTER_NAMESPACE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("failed to register name space."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_SYNTAX_MISSING_ROOT:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("XML Syntax error: "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "isnsRequest root element missing"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_SYNTAX_MISSING_NAME_ATTR:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("XML Syntax error: missing a required "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte " name attribute"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_XML_OP_FAILED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("XML operation failed."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_XML_STRDUP_FAILED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("XML strndup operation failed."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_MALLOC_FAILED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("malloc failed."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_DOOR_SERVER_DETECTED_INVALID_USER:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Door server detected invalid user."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_DOOR_SERVER_DETECTED_NOT_AUTHORIZED_USER:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Door server detected unauthorized "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "user."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_MATCHING_ISCSI_NODE_NOT_FOUND:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Matching iSCSI Node not found."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_MATCHING_NETWORK_ENTITY_NOT_FOUND:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Network Entity not found."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_NO_PORTAL_GROUP_FOUND:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("No Portal Group not found."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_MATCHING_PORTAL_NOT_FOUND:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Matching Portal not found."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_MATCHING_DD_NOT_FOUND:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Matching Discovery Domain not "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "found."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_MATCHING_DDSET_NOT_FOUND:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Matching Discovery Domain Set "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "not found."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_NO_ASSOCIATED_DD_FOUND:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("No associated Discovery Domain "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "found."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_NO_ASSOCIATED_DDSET_FOUND:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("No associated Discovery Domain Set "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "found."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_NO_SUCH_ASSOCIATION:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("No such association."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_ALREADY_ASSOCIATED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Member is already created."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_NAME_IN_USE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Name is already in use."));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ERR_DOOR_UCRED_FAILED:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Failed to acquire user credentials "
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "of management door caller"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte default:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return ((char *)gettext("Unknown error code"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}