17836SJohn.Forte@Sun.COM /* 27836SJohn.Forte@Sun.COM * CDDL HEADER START 37836SJohn.Forte@Sun.COM * 47836SJohn.Forte@Sun.COM * The contents of this file are subject to the terms of the 57836SJohn.Forte@Sun.COM * Common Development and Distribution License (the "License"). 67836SJohn.Forte@Sun.COM * You may not use this file except in compliance with the License. 77836SJohn.Forte@Sun.COM * 87836SJohn.Forte@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97836SJohn.Forte@Sun.COM * or http://www.opensolaris.org/os/licensing. 107836SJohn.Forte@Sun.COM * See the License for the specific language governing permissions 117836SJohn.Forte@Sun.COM * and limitations under the License. 127836SJohn.Forte@Sun.COM * 137836SJohn.Forte@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 147836SJohn.Forte@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157836SJohn.Forte@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 167836SJohn.Forte@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 177836SJohn.Forte@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 187836SJohn.Forte@Sun.COM * 197836SJohn.Forte@Sun.COM * CDDL HEADER END 207836SJohn.Forte@Sun.COM */ 217836SJohn.Forte@Sun.COM /* 227836SJohn.Forte@Sun.COM * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 237836SJohn.Forte@Sun.COM * Use is subject to license terms. 247836SJohn.Forte@Sun.COM */ 257836SJohn.Forte@Sun.COM 267836SJohn.Forte@Sun.COM /* 277836SJohn.Forte@Sun.COM * mpathadm_text.c : MP API CLI program 287836SJohn.Forte@Sun.COM * 297836SJohn.Forte@Sun.COM */ 307836SJohn.Forte@Sun.COM 317836SJohn.Forte@Sun.COM #include <libintl.h> 327836SJohn.Forte@Sun.COM 337836SJohn.Forte@Sun.COM #include <mpapi.h> 347836SJohn.Forte@Sun.COM #include "mpathadm_text.h" 357836SJohn.Forte@Sun.COM 367836SJohn.Forte@Sun.COM getTextString(int stringVal)377836SJohn.Forte@Sun.COMMP_CHAR * getTextString(int stringVal) { 387836SJohn.Forte@Sun.COM switch (stringVal) { 397836SJohn.Forte@Sun.COM case TEXT_UNKNOWN: 407836SJohn.Forte@Sun.COM return (gettext("unknown")); 417836SJohn.Forte@Sun.COM 427836SJohn.Forte@Sun.COM /* load balance types for display and input to cli */ 437836SJohn.Forte@Sun.COM case TEXT_LBTYPE_FAILOVER_ONLY: 447836SJohn.Forte@Sun.COM return ("failover-only"); 457836SJohn.Forte@Sun.COM case TEXT_LBTYPE_LBAREGION: 467836SJohn.Forte@Sun.COM return ("logical-block"); 477836SJohn.Forte@Sun.COM case TEXT_LBTYPE_DEVICEPROD: 487836SJohn.Forte@Sun.COM return ("device-product-specific"); 497836SJohn.Forte@Sun.COM case TEXT_LBTYPE_LEASTIO: 507836SJohn.Forte@Sun.COM return ("least-used"); 517836SJohn.Forte@Sun.COM case TEXT_LBTYPE_LEASTBLOCKS: 527836SJohn.Forte@Sun.COM return ("least-blocks"); 537836SJohn.Forte@Sun.COM case TEXT_LBTYPE_ROUNDROBIN: 547836SJohn.Forte@Sun.COM return ("round-robin"); 557836SJohn.Forte@Sun.COM case TEXT_LBTYPE_UNKNOWN: 567836SJohn.Forte@Sun.COM return ("unknown"); 577836SJohn.Forte@Sun.COM case TEXT_LBTYPE_NONE: 587836SJohn.Forte@Sun.COM return ("none"); 597836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY1: 607836SJohn.Forte@Sun.COM return ("proprietary1"); 617836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY2: 627836SJohn.Forte@Sun.COM return ("proprietary2"); 637836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY3: 647836SJohn.Forte@Sun.COM return ("proprietary3"); 657836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY4: 667836SJohn.Forte@Sun.COM return ("proprietary4"); 677836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY5: 687836SJohn.Forte@Sun.COM return ("proprietary5"); 697836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY6: 707836SJohn.Forte@Sun.COM return ("proprietary6"); 717836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY7: 727836SJohn.Forte@Sun.COM return ("proprietary7"); 737836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY8: 747836SJohn.Forte@Sun.COM return ("proprietary8"); 757836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY9: 767836SJohn.Forte@Sun.COM return ("proprietary9"); 777836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY10: 787836SJohn.Forte@Sun.COM return ("proprietary10"); 797836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY11: 807836SJohn.Forte@Sun.COM return ("proprietary11"); 817836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY12: 827836SJohn.Forte@Sun.COM return ("proprietary12"); 837836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY13: 847836SJohn.Forte@Sun.COM return ("proprietary13"); 857836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY14: 867836SJohn.Forte@Sun.COM return ("proprietary14"); 877836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY15: 887836SJohn.Forte@Sun.COM return ("proprietary15"); 897836SJohn.Forte@Sun.COM case TEXT_LBTYPE_PROPRIETARY16: 907836SJohn.Forte@Sun.COM return ("proprietary16"); 917836SJohn.Forte@Sun.COM 927836SJohn.Forte@Sun.COM /* used for display */ 937836SJohn.Forte@Sun.COM case TEXT_NA: 947836SJohn.Forte@Sun.COM return (gettext("NA")); 957836SJohn.Forte@Sun.COM 967836SJohn.Forte@Sun.COM /* used for displaying of state and comparing input into cli */ 977836SJohn.Forte@Sun.COM case TEXT_YES: 987836SJohn.Forte@Sun.COM return (gettext("yes")); 997836SJohn.Forte@Sun.COM case TEXT_NO: 1007836SJohn.Forte@Sun.COM return (gettext("no")); 1017836SJohn.Forte@Sun.COM case TEXT_ON: 1027836SJohn.Forte@Sun.COM return ("on"); 1037836SJohn.Forte@Sun.COM case TEXT_OFF: 1047836SJohn.Forte@Sun.COM return ("off"); 1057836SJohn.Forte@Sun.COM 1067836SJohn.Forte@Sun.COM /* labels for display */ 1077836SJohn.Forte@Sun.COM case TEXT_LB_VENDOR: 1087836SJohn.Forte@Sun.COM return ("Vendor:"); 1097836SJohn.Forte@Sun.COM case TEXT_LB_DRIVER_NAME: 1107836SJohn.Forte@Sun.COM return ("Driver Name:"); 1117836SJohn.Forte@Sun.COM case TEXT_LB_DEFAULT_LB: 1127836SJohn.Forte@Sun.COM return ("Default Load Balance:"); 1137836SJohn.Forte@Sun.COM case TEXT_LB_SUPPORTED_LB: 1147836SJohn.Forte@Sun.COM return ("Supported Load Balance Types:"); 1157836SJohn.Forte@Sun.COM case TEXT_LB_ALLOWS_ACT_TPG: 1167836SJohn.Forte@Sun.COM return ("Allows To Activate Target Port Group Access:"); 1177836SJohn.Forte@Sun.COM case TEXT_LB_ALLOWS_PATH_OV: 1187836SJohn.Forte@Sun.COM return ("Allows Path Override:"); 1197836SJohn.Forte@Sun.COM case TEXT_LB_SUPP_AUTO_FB: 1207836SJohn.Forte@Sun.COM return ("Supported Auto Failback Config:"); 1217836SJohn.Forte@Sun.COM case TEXT_LB_AUTO_FB: 1227836SJohn.Forte@Sun.COM return ("Auto Failback:"); 1237836SJohn.Forte@Sun.COM case TEXT_LB_FB_POLLING_RATE: 1247836SJohn.Forte@Sun.COM return ("Failback Polling Rate (current/max):"); 1257836SJohn.Forte@Sun.COM case TEXT_LB_SUPP_AUTO_P: 1267836SJohn.Forte@Sun.COM return ("Supported Auto Probing Config:"); 1277836SJohn.Forte@Sun.COM case TEXT_LB_AUTO_PROB: 1287836SJohn.Forte@Sun.COM return ("Auto Probing:"); 1297836SJohn.Forte@Sun.COM case TEXT_LB_PR_POLLING_RATE: 1307836SJohn.Forte@Sun.COM return ("Probing Polling Rate (current/max):"); 1317836SJohn.Forte@Sun.COM case TEXT_LB_SUPP_DEVICES: 1327836SJohn.Forte@Sun.COM return ("Supported Devices:"); 1337836SJohn.Forte@Sun.COM case TEXT_LB_PRODUCT: 1347836SJohn.Forte@Sun.COM return ("Product:"); 1357836SJohn.Forte@Sun.COM case TEXT_LB_REVISION: 1367836SJohn.Forte@Sun.COM return ("Revision:"); 1377836SJohn.Forte@Sun.COM case TEXT_LB_LOGICAL_UNIT: 1387836SJohn.Forte@Sun.COM return ("Logical Unit:"); 1397836SJohn.Forte@Sun.COM case TEXT_LB_INQUIRY_NAME_TYPE: 1407836SJohn.Forte@Sun.COM return ("Name Type:"); 1417836SJohn.Forte@Sun.COM case TEXT_NAME_TYPE_UNKNOWN: 1427836SJohn.Forte@Sun.COM return ("unknown type"); 1437836SJohn.Forte@Sun.COM case TEXT_NAME_TYPE_VPD83_TYPE1: 1447836SJohn.Forte@Sun.COM return ("SCSI Inquiry VPD Page83 Type1"); 1457836SJohn.Forte@Sun.COM case TEXT_NAME_TYPE_VPD83_TYPE2: 1467836SJohn.Forte@Sun.COM return ("SCSI Inquiry VPD Page83 Type2"); 1477836SJohn.Forte@Sun.COM case TEXT_NAME_TYPE_VPD83_TYPE3: 1487836SJohn.Forte@Sun.COM return ("SCSI Inquiry VPD Page83 Type3"); 1497836SJohn.Forte@Sun.COM case TEXT_NAME_TYPE_DEVICE_SPECIFIC: 1507836SJohn.Forte@Sun.COM return ("device specific type"); 1517836SJohn.Forte@Sun.COM case TEXT_LB_INQUIRY_NAME: 1527836SJohn.Forte@Sun.COM return ("Name:"); 1537836SJohn.Forte@Sun.COM case TEXT_LB_ASYMMETRIC: 1547836SJohn.Forte@Sun.COM return ("Asymmetric:"); 1557836SJohn.Forte@Sun.COM case TEXT_LB_EXPLICIT_FAILOVER: 1567836SJohn.Forte@Sun.COM return ("Explicit Failover:"); 1577836SJohn.Forte@Sun.COM case TEXT_LB_CURR_LOAD_BALANCE: 1587836SJohn.Forte@Sun.COM return ("Current Load Balance:"); 1597836SJohn.Forte@Sun.COM case TEXT_LB_LU_GROUP_ID: 1607836SJohn.Forte@Sun.COM return ("Logical Unit Group ID:"); 1617836SJohn.Forte@Sun.COM case TEXT_LB_PATH_INFO: 1627836SJohn.Forte@Sun.COM return ("Paths:"); 1637836SJohn.Forte@Sun.COM case TEXT_LB_INIT_PORT_NAME: 1647836SJohn.Forte@Sun.COM return ("Initiator Port Name:"); 1657836SJohn.Forte@Sun.COM case TEXT_LB_TARGET_PORT_NAME: 1667836SJohn.Forte@Sun.COM return ("Target Port Name:"); 1677836SJohn.Forte@Sun.COM case TEXT_LB_OVERRIDE_PATH: 1687836SJohn.Forte@Sun.COM return ("Override Path:"); 1697836SJohn.Forte@Sun.COM case TEXT_LB_PATH_STATE: 1707836SJohn.Forte@Sun.COM return ("Path State:"); 1717836SJohn.Forte@Sun.COM case TEXT_LB_TPG_INFO: 1727836SJohn.Forte@Sun.COM return ("Target Port Groups:"); 1737836SJohn.Forte@Sun.COM case TEXT_LB_ACCESS_STATE: 1747836SJohn.Forte@Sun.COM return ("Access State:"); 1757836SJohn.Forte@Sun.COM case TEXT_LB_ID: 1767836SJohn.Forte@Sun.COM return ("ID:"); 1777836SJohn.Forte@Sun.COM case TEXT_TPORT_LIST: 1787836SJohn.Forte@Sun.COM return ("Target Ports:"); 1797836SJohn.Forte@Sun.COM case TEXT_LB_NAME: 1807836SJohn.Forte@Sun.COM return ("Name:"); 1817836SJohn.Forte@Sun.COM case TEXT_LB_RELATIVE_ID: 1827836SJohn.Forte@Sun.COM return ("Relative ID:"); 1837836SJohn.Forte@Sun.COM case TEXT_LB_INITATOR_PORT: 1847836SJohn.Forte@Sun.COM return ("Initiator Port:"); 1857836SJohn.Forte@Sun.COM case TEXT_LB_TRANSPORT_TYPE: 1867836SJohn.Forte@Sun.COM return ("Transport Type:"); 1877836SJohn.Forte@Sun.COM case TEXT_LB_OS_DEVICE_FILE: 1887836SJohn.Forte@Sun.COM return ("OS Device File:"); 1897836SJohn.Forte@Sun.COM case TEXT_LB_MPATH_SUPPORT: 1907836SJohn.Forte@Sun.COM return ("mpath-support:"); 1917836SJohn.Forte@Sun.COM case TEXT_LB_PATH_COUNT: 1927836SJohn.Forte@Sun.COM return ("Total Path Count:"); 1937836SJohn.Forte@Sun.COM case TEXT_LB_OP_PATH_COUNT: 1947836SJohn.Forte@Sun.COM return ("Operational Path Count:"); 1957836SJohn.Forte@Sun.COM 1967836SJohn.Forte@Sun.COM case TEXT_LB_ENABLED: 1977836SJohn.Forte@Sun.COM return ("Enabled:"); 1987836SJohn.Forte@Sun.COM case TEXT_LB_DISABLED: 1997836SJohn.Forte@Sun.COM return ("Disabled:"); 2007836SJohn.Forte@Sun.COM 2017836SJohn.Forte@Sun.COM case TEXT_UNKNOWN_OBJECT: 2027836SJohn.Forte@Sun.COM return (gettext("unknown object")); 2037836SJohn.Forte@Sun.COM 2047836SJohn.Forte@Sun.COM /* status strings used in error messages */ 2057836SJohn.Forte@Sun.COM case TEXT_MPSTATUS_SUCCESS: 2067836SJohn.Forte@Sun.COM return (gettext("success")); 2077836SJohn.Forte@Sun.COM case TEXT_MPSTATUS_INV_PARAMETER: 2087836SJohn.Forte@Sun.COM return (gettext("invalid parameter")); 2097836SJohn.Forte@Sun.COM case TEXT_MPSTATUS_UNKNOWN_FN: 2107836SJohn.Forte@Sun.COM return (gettext("unknown client function")); 2117836SJohn.Forte@Sun.COM case TEXT_MPSTATUS_FAILED: 2127836SJohn.Forte@Sun.COM return (gettext("failed")); 2137836SJohn.Forte@Sun.COM case TEXT_MPSTATUS_INSUFF_MEMORY: 2147836SJohn.Forte@Sun.COM return (gettext("insufficient memory")); 2157836SJohn.Forte@Sun.COM case TEXT_MPSTATUS_INV_OBJ_TYPE: 2167836SJohn.Forte@Sun.COM return (gettext("invalid object type")); 2177836SJohn.Forte@Sun.COM case TEXT_MPSTATUS_OBJ_NOT_FOUND: 2187836SJohn.Forte@Sun.COM return (gettext("object not found")); 2197836SJohn.Forte@Sun.COM case TEXT_MPSTATUS_UNSUPPORTED: 2207836SJohn.Forte@Sun.COM return (gettext("unsupported")); 2217836SJohn.Forte@Sun.COM case TEXT_MPSTATUS_FN_REPLACED: 2227836SJohn.Forte@Sun.COM return (gettext("function replaced")); 2237836SJohn.Forte@Sun.COM case TEXT_MPSTATUS_ACC_STATE_INVAL: 2247836SJohn.Forte@Sun.COM return (gettext("invalid access state")); 2257836SJohn.Forte@Sun.COM case TEXT_MPSTATUS_PATH_NONOP: 2267836SJohn.Forte@Sun.COM return (gettext("path not operational")); 2277836SJohn.Forte@Sun.COM case TEXT_MPSTATUS_TRY_AGAIN: 2287836SJohn.Forte@Sun.COM return (gettext("try again")); 2297836SJohn.Forte@Sun.COM case TEXT_MPSTATUS_NOT_PERMITTED: 2307836SJohn.Forte@Sun.COM return (gettext("not permitted")); 2317836SJohn.Forte@Sun.COM 2327836SJohn.Forte@Sun.COM /* error messages */ 2337836SJohn.Forte@Sun.COM case ERR_NO_MPATH_SUPPORT_LIST: 2347836SJohn.Forte@Sun.COM return (gettext("Error: Unable to get mpath-support " 2357836SJohn.Forte@Sun.COM "list.")); 2367836SJohn.Forte@Sun.COM case ERR_CANT_FIND_MPATH_SUPPORT_WITH_NAME: 2377836SJohn.Forte@Sun.COM return (gettext("Error: Unable to find mpath-support " 2387836SJohn.Forte@Sun.COM "%s.")); 2397836SJohn.Forte@Sun.COM case ERR_NO_PROPERTIES: 2407836SJohn.Forte@Sun.COM return (gettext("Error: Unable to get configuration " 2417836SJohn.Forte@Sun.COM "information.")); 2427836SJohn.Forte@Sun.COM case ERR_NO_SUPP_DEVICE_INFO: 2437836SJohn.Forte@Sun.COM return (gettext("Error: Unable to get supported " 2447836SJohn.Forte@Sun.COM "device product information.")); 2457836SJohn.Forte@Sun.COM case ERR_NO_LU_LIST: 2467836SJohn.Forte@Sun.COM return (gettext("Error: Unable to get the logical " 2477836SJohn.Forte@Sun.COM "unit list.")); 2487836SJohn.Forte@Sun.COM case ERR_NO_ASSOCIATED_LU: 2497836SJohn.Forte@Sun.COM return (gettext("Error: Unable to find an " 2507836SJohn.Forte@Sun.COM "associated logical-unit.")); 2517836SJohn.Forte@Sun.COM case ERR_LU_NOT_FOUND_WITH_MISSING_LU_STR: 2527836SJohn.Forte@Sun.COM return (gettext("Error: Logical-unit %s is not " 2537836SJohn.Forte@Sun.COM "found.")); 2547836SJohn.Forte@Sun.COM case ERR_NO_LU_PATH_INFO_WITH_MISSING_LU_STR: 2557836SJohn.Forte@Sun.COM return (gettext("Error: Failed to get path info for " 2567836SJohn.Forte@Sun.COM "logical-unit %s.")); 2577836SJohn.Forte@Sun.COM case ERR_NO_ASSOC_TPGS: 2587836SJohn.Forte@Sun.COM return (gettext("Error: Unable to get associated " 2597836SJohn.Forte@Sun.COM "target port groups .")); 2607836SJohn.Forte@Sun.COM case ERR_NO_ASSOC_TPORTS: 2617836SJohn.Forte@Sun.COM return (gettext("Error: Unable to get associated " 2627836SJohn.Forte@Sun.COM "target ports.")); 2637836SJohn.Forte@Sun.COM case ERR_NO_INIT_PORTS: 2647836SJohn.Forte@Sun.COM return (gettext("Error: Unable to get the " 2657836SJohn.Forte@Sun.COM "initiator-port list.")); 2667836SJohn.Forte@Sun.COM case ERR_NO_INIT_PORT_LIST_WITH_REASON: 2677836SJohn.Forte@Sun.COM return (gettext("Error: Unable to get the " 2687836SJohn.Forte@Sun.COM "initiator-port list: %s.")); 2697836SJohn.Forte@Sun.COM case ERR_INIT_PORT_NOT_FOUND_WITH_MISSING_LU_STR: 2707836SJohn.Forte@Sun.COM return (gettext("Error: Initiator port %s is not " 2717836SJohn.Forte@Sun.COM "found.")); 2727836SJohn.Forte@Sun.COM case ERR_FAILED_TO_REGISTER_PLUGIN_NAME_WITH_REASON: 2737836SJohn.Forte@Sun.COM return (gettext("Error: Failed to register %s: %s.")); 2747836SJohn.Forte@Sun.COM case ERR_FAILED_TO_DEREGISTER_PLUGIN_NAME_WITH_REASON: 2757836SJohn.Forte@Sun.COM return (gettext("Error: Failed to deregister " 2767836SJohn.Forte@Sun.COM "%ls: %s.")); 2777836SJohn.Forte@Sun.COM case ERR_FAILED_TO_CHANGE_OPTION_WITH_REASON: 2787836SJohn.Forte@Sun.COM return (gettext("Error: Failed to change %s: %s.")); 2797836SJohn.Forte@Sun.COM case ERR_FAILED_TO_ENABLE_PATH_WITH_REASON: 2807836SJohn.Forte@Sun.COM return (gettext("Error: Failed to enable path: %s.")); 2817836SJohn.Forte@Sun.COM case ERR_FAILED_TO_DISABLE_PATH_WITH_REASON: 2827836SJohn.Forte@Sun.COM return (gettext("Error: Failed to disable path: %s.")); 2837836SJohn.Forte@Sun.COM case ERR_FAILED_TO_OVERRIDE_PATH_WITH_REASON: 2847836SJohn.Forte@Sun.COM return (gettext("Error: Failed to override path: " 2857836SJohn.Forte@Sun.COM "%s.")); 2867836SJohn.Forte@Sun.COM case ERR_LU_NOT_ASYMMETRIC: 2877836SJohn.Forte@Sun.COM return (gettext("Error: The logical unit is not " 2887836SJohn.Forte@Sun.COM "asymmetric.")); 2897836SJohn.Forte@Sun.COM case ERR_NO_FAILOVER_ALLOWED: 2907836SJohn.Forte@Sun.COM return (gettext("Error: The logical unit doesn't " 2917836SJohn.Forte@Sun.COM "support explicit state change.")); 2927836SJohn.Forte@Sun.COM case ERR_FAILED_TO_FAILOVER_WITH_LU_AND_REASON: 2937836SJohn.Forte@Sun.COM return (gettext("Error: Failover failed %s: %s.")); 2947836SJohn.Forte@Sun.COM case ERR_FAILED_TO_FAILOVER_WITH_REASON: 2957836SJohn.Forte@Sun.COM return (gettext("Error: Failover failed: %s.")); 2967836SJohn.Forte@Sun.COM case ERR_FAILED_TO_CANCEL_OVERRIDE_PATH_WITH_REASON: 2977836SJohn.Forte@Sun.COM return (gettext("Error: Failed to cancel the " 2987836SJohn.Forte@Sun.COM "overriding setting: %s.")); 2997836SJohn.Forte@Sun.COM case ERR_FAILED_TO_FIND_PATH: 3007836SJohn.Forte@Sun.COM return (gettext("Error: Unable to find path.")); 3017836SJohn.Forte@Sun.COM case LU_NOT_FOUND: 3027836SJohn.Forte@Sun.COM return (gettext("logical-unit not found")); 3037836SJohn.Forte@Sun.COM case FAILED_TO_FIND_PATH: 3047836SJohn.Forte@Sun.COM return (gettext("Unable to find path")); 3057836SJohn.Forte@Sun.COM case MISSING_LU_NAME: 3067836SJohn.Forte@Sun.COM return (gettext("Missing logical-unit name")); 3077836SJohn.Forte@Sun.COM case MISSING_INIT_PORT_NAME: 3087836SJohn.Forte@Sun.COM return (gettext("Missing initiator-port name")); 3097836SJohn.Forte@Sun.COM case MISSING_TARGET_PORT_NAME: 3107836SJohn.Forte@Sun.COM return (gettext("Missing target-port name")); 3117836SJohn.Forte@Sun.COM case TEXT_AUTO_FAILBACK: 3127836SJohn.Forte@Sun.COM return (gettext("auto failback")); 3137836SJohn.Forte@Sun.COM case TEXT_AUTO_PROBING: 3147836SJohn.Forte@Sun.COM return (gettext("auto probing")); 3157836SJohn.Forte@Sun.COM case TEXT_LOAD_BALANCE: 3167836SJohn.Forte@Sun.COM return (gettext("load balance")); 3177836SJohn.Forte@Sun.COM case TEXT_ILLEGAL_ARGUMENT: 3187836SJohn.Forte@Sun.COM return (gettext("illegal argument")); 3197836SJohn.Forte@Sun.COM case TEXT_MPATH_SUPPORT_NOT_FOUND: 3207836SJohn.Forte@Sun.COM return (gettext("unable to find specified " 3217836SJohn.Forte@Sun.COM "mpath-support")); 3227836SJohn.Forte@Sun.COM case ERR_MEMORY_ALLOCATION: 3237836SJohn.Forte@Sun.COM return (gettext("Error: Memory allocation failure")); 3247836SJohn.Forte@Sun.COM case TEXT_MORE_INFO: 3257836SJohn.Forte@Sun.COM return (gettext("For more information, please see")); 3267836SJohn.Forte@Sun.COM case TEXT_UNABLE_TO_COMPLETE: 3277836SJohn.Forte@Sun.COM return (gettext("Unable to complete operation")); 3287836SJohn.Forte@Sun.COM case ERR_FILE_DESCRIPTOR: 3297836SJohn.Forte@Sun.COM return (gettext("ERROR: Failed getting file " 3307836SJohn.Forte@Sun.COM "descriptor")); 3317836SJohn.Forte@Sun.COM case ERR_DEVID: 3327836SJohn.Forte@Sun.COM return (gettext("ERROR: Failed attempt to get devid " 3337836SJohn.Forte@Sun.COM "information")); 3347836SJohn.Forte@Sun.COM case ERR_LU_ACCESS_STATE_UNCHANGED: 3357836SJohn.Forte@Sun.COM return (gettext("ERROR: LU access state unchanged. " 336*7916SHyon.Kim@Sun.COM "No standby TPG found.")); 3377836SJohn.Forte@Sun.COM 3387836SJohn.Forte@Sun.COM /* strings to display info */ 3397836SJohn.Forte@Sun.COM case TEXT_PATH_STATE_OKAY: 3407836SJohn.Forte@Sun.COM return ("OK"); 3417836SJohn.Forte@Sun.COM case TEXT_PATH_STATE_PATH_ERR: 3427836SJohn.Forte@Sun.COM return ("path error"); 3437836SJohn.Forte@Sun.COM case TEXT_PATH_STATE_LU_ERR: 3447836SJohn.Forte@Sun.COM return ("LU error"); 3457836SJohn.Forte@Sun.COM case TEXT_PATH_STATE_RESERVED: 3467836SJohn.Forte@Sun.COM return ("reserved"); 3477836SJohn.Forte@Sun.COM case TEXT_PATH_STATE_REMOVED: 3487836SJohn.Forte@Sun.COM return ("unavailable"); 3497836SJohn.Forte@Sun.COM case TEXT_PATH_STATE_TRANSITIONING: 3507836SJohn.Forte@Sun.COM return ("transitioning"); 3517836SJohn.Forte@Sun.COM case TEXT_PATH_STATE_OPERATIONAL_CLOSED: 3527836SJohn.Forte@Sun.COM return ("operational but closed"); 3537836SJohn.Forte@Sun.COM case TEXT_PATH_STATE_INVALID_CLOSED: 3547836SJohn.Forte@Sun.COM return ("invalid closed"); 3557836SJohn.Forte@Sun.COM case TEXT_PATH_STATE_OFFLINE_CLOSED: 3567836SJohn.Forte@Sun.COM return ("operational but closed"); 3577836SJohn.Forte@Sun.COM case TEXT_ACCESS_STATE_ACTIVE_OPTIMIZED: 3587836SJohn.Forte@Sun.COM return ("active optimized"); 3597836SJohn.Forte@Sun.COM case TEXT_ACCESS_STATE_ACTIVE_NONOPTIMIZED: 3607836SJohn.Forte@Sun.COM return ("active not optimized"); 3617836SJohn.Forte@Sun.COM case TEXT_ACCESS_STATE_STANDBY: 3627836SJohn.Forte@Sun.COM return ("standby"); 3637836SJohn.Forte@Sun.COM case TEXT_ACCESS_STATE_UNAVAILABLE: 3647836SJohn.Forte@Sun.COM return ("unavailable"); 3657836SJohn.Forte@Sun.COM case TEXT_ACCESS_STATE_TRANSITIONING: 3667836SJohn.Forte@Sun.COM return ("transitioning"); 3677836SJohn.Forte@Sun.COM case TEXT_ACCESS_STATE_ACTIVE: 3687836SJohn.Forte@Sun.COM return ("active"); 3697836SJohn.Forte@Sun.COM case TEXT_ANY_DEVICE: 3707836SJohn.Forte@Sun.COM return ("any device"); 3717836SJohn.Forte@Sun.COM 3727836SJohn.Forte@Sun.COM case TEXT_TRANS_PORT_TYPE_MPNODE: 3737836SJohn.Forte@Sun.COM return ("Logical Multipath Port"); 3747836SJohn.Forte@Sun.COM case TEXT_TRANS_PORT_TYPE_FC: 3757836SJohn.Forte@Sun.COM return ("Fibre Channel"); 3767836SJohn.Forte@Sun.COM case TEXT_TRANS_PORT_TYPE_SPI: 3777836SJohn.Forte@Sun.COM return ("parallel SCSI"); 3787836SJohn.Forte@Sun.COM case TEXT_TRANS_PORT_TYPE_ISCSI: 3797836SJohn.Forte@Sun.COM return ("iSCSI"); 3807836SJohn.Forte@Sun.COM case TEXT_TRANS_PORT_TYPE_IFB: 3817836SJohn.Forte@Sun.COM return ("InfiniBand-Fibre Channel"); 3827836SJohn.Forte@Sun.COM 3837836SJohn.Forte@Sun.COM 3847836SJohn.Forte@Sun.COM default: 3857836SJohn.Forte@Sun.COM return (""); 3867836SJohn.Forte@Sun.COM } 3877836SJohn.Forte@Sun.COM } 388