mpathadm.c revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
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 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
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 * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mpathadm.c : MP API CLI program
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* helper functions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic char *getExecBasename(char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* object functions per subcommand */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int listFunc(int, char **, int, cmdOptions_t *, void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int showFunc(int, char **, int, cmdOptions_t *, void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int modifyFunc(int, char **, int, cmdOptions_t *, void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int enableFunc(int, char **, int, cmdOptions_t *, void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int disableFunc(int, char **, int, cmdOptions_t *, void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int failoverFunc(int, char **, int, cmdOptions_t *, void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int overrideFunc(int, char **, int, cmdOptions_t *, void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Version number: (copied from iscsiadm)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * MAJOR - This should only change when there is an incompatible change made
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to the interfaces or the output.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * MINOR - This should change whenever there is a new command or new feature
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * with no incompatible change.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* globals */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * getExecBasename - copied from iscsiadm code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * execFullName - exec name of program (argv[0])
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * command name portion of execFullName
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic char *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* guard against '/' at end of command invocation */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Add new options here
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* tables set up based on cmdparse instructions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte {"inqname", required_arg, 'n', OPTIONSTRING_NAME},
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte {"target-port", required_arg, 't', OPTIONSTRING_TPNAME},
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte {"autofailback", required_arg, 'a', OPTIONSTRING_ONOFF},
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte {"autoprobe", required_arg, 'p', OPTIONSTRING_ONOFF},
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte {"loadbalance", required_arg, 'b', OPTIONSTRING_LBTYPE},
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte {"initiator-port", required_arg, 'i', OPTIONSTRING_IPORT},
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte {"logical-unit", required_arg, 'l', OPTIONSTRING_LUNIT},
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte {"vendor-id", required_arg, 'd', OPTIONSTRING_VALUE},
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Add new subcommands here
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Add objects here
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Rules for subcommands and objects
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * reqOpCmd -> subcommands that must have an operand
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * optOpCmd -> subcommands that may have an operand
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * noOpCmd -> subcommands that will have no operand
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * invCmd -> subcommands that are invalid
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * multOpCmd -> subcommands that can accept multiple operands
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operandDefinition -> Usage definition for the operand of this object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ENABLE|DISABLE|FAILOVER|OVERRIDE, LIST|SHOW|MODIFY,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "mpath-support name"},
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MODIFY|ENABLE|DISABLE|FAILOVER|OVERRIDE|ADD|REMOVE, LIST|SHOW,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "initiator-port name"},
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ENABLE|DISABLE|OVERRIDE|ADD|REMOVE, LIST|SHOW|MODIFY,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "logical-unit name"},
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "initiator-port name"},
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte {0, 0, 0, 0, 0, NULL}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * list of objects, subcommands, valid short options, required flag and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * exclusive option string
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If it's not here, there are no options for that object.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte {0, 0, 0, 0, 0}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * listMpathSupport - mpathadm list mpath-support
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operandLen - number of operands user passed into the cli
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operand - pointer to operand list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* number of plugins listed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((mpstatus = MP_GetPluginOidList(&pPluginOidList))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((NULL == pPluginOidList) || (pPluginOidList->oidCount < 1)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* loop through operands first */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((0 == operandLen) && (B_FALSE == shown)); op++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* if no operands, list them all */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* if there is an operand... */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* ... compare and display if match */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * showMpathSupport - mpathadm show mpath-support <mpath-support name>, ...
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operandLen - number of operands user passed into the cli
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operand - pointer to operand list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((mpstatus = MP_GetPluginOidList(&pPluginOidList)) !=
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cmdName, getTextString(ERR_NO_MPATH_SUPPORT_LIST));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((NULL == pPluginOidList) || (pPluginOidList->oidCount < 1)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cmdName, getTextString(ERR_NO_MPATH_SUPPORT_LIST));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* if no operand, list it */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* ... compare and display if match */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* display the info for this plugin */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\t%s ", getTextString(TEXT_LB_VENDOR));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* don't ignore load balance type none. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* check each bit, display string if found set */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (pluginProps.supportedLoadBalanceTypes == 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (0 != (lb &
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* if only supports specific products, */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get device product properties supported */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* can't get any more info, */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* so we're done with this one */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (0 != (lb &
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for j */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* if only supports specified devices */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each plugin */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each operand */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * modifyMpathSupport -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mpathadm modify mpath-support [options] <mpath-support name>, ...
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operandLen - number of operands user passed into the cli
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operand - pointer to operand list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * options - pointer to option list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortemodifyMpathSupport(int operandLen, char *operand[], cmdOptions_t *options)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((mpstatus = MP_GetPluginOidList(&pPluginOidList))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((NULL == pPluginOidList) || (pPluginOidList->oidCount < 1)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (i < pPluginOidList->oidCount) && (B_TRUE != bFoundIt);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* begin back-up indentation */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* we found the plugin oid */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* now change the options requested */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* modify autofailback */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (0 ==
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* modify autoprobing */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (0 ==
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* modify loadbalance type */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* user of the cli sends text string, we need the int */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* value to pass to the mpapi */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbValue = getLbValueFromString(optionList->optarg);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* switch */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* end back-up indentation */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each plugin */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each operand */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * listLogicalUnit -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mpathadm list {logical-unit | LU} [options] [<logical-unit name>, ...]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operandLen - number of operands user passed into the cli
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operand - pointer to operand list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * options - pointer to option list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortelistLogicalUnit(int operandLen, char *operand[], cmdOptions_t *options)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* count number of options */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte bFoundOption = malloc((sizeof (boolean_t)) * opListCount);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* list to keep track of multiple options */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (opIndex = 0; opIndex < opListCount; opIndex++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* if no operands or options, list everything we find */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((mpstatus = MP_GetPluginOidList(&pPluginOidList))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get properties so we can list the name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* attempt to find this logical unit */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mpstatus = MP_GetMultipathLus(pPluginOidList->oids[i],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (lu = 0; lu < pLogicalUnitOidList->oidCount; lu++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get lu properties so we can check the name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each LU */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each plugin */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else { /* we have operands and/or options */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* check if we have operands */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* no operands */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* operands */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((mpstatus = MP_GetPluginOidList(&pPluginOidList))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (opoffset = opStart; opoffset < opEnd; opoffset++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* loop through operands */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * loop through plugin, and get properties
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * so we can list the name
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* attempt to find this logical unit */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get lu props & check the name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * compare operand - is it a match?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If so, continue
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* check options */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* begin backup indentation */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefor (opIndex = 0; optionList->optval; optionList++, opIndex++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte compareLUName(optionList->optarg, luProps.name)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get TPG list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MP_GetAssociatedTPGOidList(pLogicalUnitOidList->oids[lu],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get target ports */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MP_GetTargetPortOidList(pTpgOidListArray->oids[tpg],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get target port properties for the name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* check the name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each target port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each tpg */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* end switch */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} /* loop through options */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* end back-up indentation */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * if no options,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* end bContinue check */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* end LU loop */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* end plugin loop */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* option/operand combo not found */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (opIndex = 0; optionList->optval; optionList++,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* end loop through operands */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* we have operands and/or options */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * compareLUName -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * compare names directly and via devid if no match directly
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cmpString - first string to compare
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * deviceProperty - string from properties
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sizeToCompare - size of deviceProperty
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * returns B_TRUE if the strings match either directly or via devid
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * B_FALSE otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortecompareLUName(MP_CHAR *cmpString, MP_CHAR *deviceProperty)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* user input didn't match, try via devid */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * I don't see a reason to print the error for
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * any of these since they'll get the error at
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the end anyway
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (((fd1 = open(cmpString, O_RDONLY|O_NDELAY)) >= 0) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((fd2 = open(deviceProperty, O_RDONLY|O_NDELAY)) >= 0) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* compare */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * listIndivudualLogicalUnit -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Used by list logical unit cli.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Displays info about an LU
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * luOid - LU to list
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * luProps - properties of he LU to list
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte displayArray(luProps.deviceFileName, sizeof (luProps.deviceFileName));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(ERR_NO_LU_PATH_INFO_WITH_MISSING_LU_STR),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(TEXT_LB_PATH_COUNT), pPathOidListArray->oidCount);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (pa = 0; pa < pPathOidListArray->oidCount; pa++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* cycle through and check status of each for */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* operation path count */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(TEXT_LB_OP_PATH_COUNT), numOperationalPaths);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * showLogicalUnit -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mpathadm show {logical-unit | LU} <logical-unit name>, ...
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operandLen - number of operands user passed into the cli
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operand - pointer to operand list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (B_TRUE == getLogicalUnitOid(operand[op], &luOid)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each operand */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * showIndivudualLogicalUnit -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Used by show logical unit cli.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Displays info about an LU
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * luOid - LU to show
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * luProps - properties of he LU to show
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pluginProps - propertis of the plugin this LU belongs to
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("%s ", getTextString(TEXT_LB_LOGICAL_UNIT));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte displayArray(luProps.deviceFileName, sizeof (luProps.deviceFileName));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\t%s %s\n", getTextString(TEXT_LB_MPATH_SUPPORT),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\t%s ", getTextString(TEXT_LB_VENDOR));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\n\t%s ", getTextString(TEXT_LB_PRODUCT));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\n\t%s ", getTextString(TEXT_LB_REVISION));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\n\t%s ", getTextString(TEXT_LB_INQUIRY_NAME_TYPE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte displayLogicalUnitNameTypeString(luProps.nameType);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\n\t%s ", getTextString(TEXT_LB_INQUIRY_NAME));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte displayArray(luProps.name, sizeof (luProps.name));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\n\t%s %s\n", getTextString(TEXT_LB_ASYMMETRIC),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\t%s ", getTextString(TEXT_LB_CURR_LOAD_BALANCE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* don't ignore load balance type none. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("%s", getTextString(TEXT_LBTYPE_NONE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte displayLoadBalanceString(luProps.currentLoadBalanceType);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\t%s ", getTextString(TEXT_LB_LU_GROUP_ID));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("0x%x\n", luProps.logicalUnitGroupID);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\t%s ", getTextString(TEXT_LB_AUTO_FB));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (MP_FALSE == pluginProps.autoFailbackSupport) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("%s\n", (MP_TRUE == luProps.autoFailbackEnabled)?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\t%s ", getTextString(TEXT_LB_AUTO_PROB));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (MP_FALSE == pluginProps.autoProbingSupport) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("%s\n", (MP_TRUE == luProps.autoProbingEnabled)?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get path info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mpstatus = MP_GetAssociatedPathOidList(luOid, &pPathOidListArray);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\n\t%s \n", getTextString(TEXT_LB_PATH_INFO));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (pa = 0; pa < pPathOidListArray->oidCount; pa++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MP_GetInitiatorPortProperties(pathProps.initiatorPortOid,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("%s\n", getTextString(TEXT_UNKNOWN));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MP_GetTargetPortProperties(pathProps.targetPortOid,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("%s\n", getTextString(TEXT_UNKNOWN));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\t\t%s ", getTextString(TEXT_LB_OVERRIDE_PATH));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (luProps.overridePath.objectSequenceNumber ==
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pPathOidListArray->oids[pa].objectSequenceNumber) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\t\t%s %s\n", getTextString(TEXT_LB_PATH_STATE),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\t\t%s %s\n\n", getTextString(TEXT_LB_DISABLED),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get tpg info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mpstatus = MP_GetAssociatedTPGOidList(luOid, &pTPGOidListArray);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* display tpg info only if is assymetric */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\t%s \n", getTextString(TEXT_LB_TPG_INFO));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (tpg = 0; tpg < pTPGOidListArray->oidCount; tpg++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* display tpg info only if is assymetric */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* display label for each tpg. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* display label once for symmetric. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get target port info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* begin back-up indentation */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (tport = 0; tport < pTportOidListArray->oidCount; tport++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MP_GetTargetPortProperties(pTportOidListArray->oids[tport],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* insert blank line if not the last target port. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (!(tport == (pTportOidListArray->oidCount - 1))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each target port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* end back-up indentation */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* else got target port props */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* else got TPG props */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each TPG */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* else got tpg list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * modifyLogicalUnit -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mpathadm modify {logical-unit | LU} [options] <logical-unit name>, ...
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operandLen - number of operands user passed into the cli
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operand - pointer to operand list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * options - pointer to option list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortemodifyLogicalUnit(int operandLen, char *operand[], cmdOptions_t *options)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (B_TRUE != getLogicalUnitOid(operand[op], &luOid)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(ERR_LU_NOT_FOUND_WITH_MISSING_LU_STR),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* we found the lu oid, now change the options requested */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* modify autofailback */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* modify autoprobing */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* modify loadbalance type */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* switch */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each operand */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * failoverLogicalUnit -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mpathadm failover {logical-unit | LU} <logical-unit name>, ...
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operand - pointer to operand list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (B_TRUE != getLogicalUnitOid(operand[0], &luOid)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get LUN properties and check to be sure it's asymmetric */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get TPGs for this LUN */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MP_GetAssociatedTPGOidList(luOid, &pTpgOidListArray);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* pick a TPG whose state is active or standby, and change it */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* to opposite via MP_SetTPGAccessState */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (tpg = 0; tpg < pTpgOidListArray->oidCount; tpg++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cmdName, getTextString(ERR_NO_FAILOVER_ALLOWED));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* find one that is standby */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte tpgProps.accessState) && (B_FALSE == bFoundIt)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each tpg */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cmdName, getTextString(ERR_LU_ACCESS_STATE_UNCHANGED));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * getLogicalUnitOid -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Search through all plugins and get the OID for specified logical unit
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * luFileName - file name of LU (specified by the user) to find
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pLuOid - OID to return
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortegetLogicalUnitOid(MP_CHAR *luFileName, MP_OID *pluOid)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* print some kind of error msg here - should never happen */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stderr, getTextString(ERR_MEMORY_ALLOCATION));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((mpstatus = MP_GetPluginOidList(&pPluginOidList))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((NULL == pPluginOidList) || (pPluginOidList->oidCount < 1)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get properties so we can list the name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) memset(&pluginProps, 0, sizeof (MP_PLUGIN_PROPERTIES));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* attempt to find this logical unit */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mpstatus = MP_GetMultipathLus(pPluginOidList->oids[i],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (lu = 0; (lu < pLogicalUnitOidList->oidCount) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get lu properties so we can check the name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (0 == strcmp(luFileName, luProps.deviceFileName)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* user input didn't match, try via devid */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * I don't see a reason to print the error for
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * any of these since they'll get the error at
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the end anyway
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * listInitiatorPort -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mpathadm list initiator-port [<initiator-port name>, ...]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operandLen - number of operands user passed into the cli
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operand - pointer to operand list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortelistInitiatorPort(int operandLen, char *operand[])
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte foundOp = malloc((sizeof (boolean_t)) * operandLen);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((mpstatus = MP_GetPluginOidList(&pPluginOidList))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((NULL == pPluginOidList) || (pPluginOidList->oidCount < 1)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MP_GetInitiatorPortOidList(pPluginOidList->oids[i],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(ERR_NO_INIT_PORT_LIST_WITH_REASON),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* if no operands listed, */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* list all we find */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* check each operand */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* the one we want to list? */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* list It */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each initiator port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* else found an init port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each plugin */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * listIndividualInitiatorPort -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * used by listInitiatorPort to list info for one init port
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * initProps - properties of initiator port to list
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortelistIndividualInitiatorPort(MP_INITIATOR_PORT_PROPERTIES initProps)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("%s ", getTextString(TEXT_LB_INITATOR_PORT));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * showInitiatorPort -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mpathadm show initiator-port <initiator-port name>, ...
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operandLen - number of operands user passed into the cli
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operand - pointer to operand list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteshowInitiatorPort(int operandLen, char *operand[])
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((mpstatus = MP_GetPluginOidList(&pPluginOidList))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((NULL == pPluginOidList) || (pPluginOidList->oidCount < 1)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MP_GetInitiatorPortOidList(pPluginOidList->oids[i],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* list It */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each initiator port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* else found an init port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each plugin */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* need temp string here since we need to fill in a */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* name in the error string */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each operand */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * showIndividualInitiatorPort -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * used by showInitiatorPort to show info for one init port
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * initProps - properties of initiator port to show
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteshowIndividualInitiatorPort(MP_INITIATOR_PORT_PROPERTIES initProps)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("%s ", getTextString(TEXT_LB_INITATOR_PORT));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\n\t%s ", getTextString(TEXT_LB_TRANSPORT_TYPE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) printf("\t%s ", getTextString(TEXT_LB_OS_DEVICE_FILE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * enablePath -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mpathadm enable path -i <initiator-port>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * -t <target-port name> -l <logical-unit name>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * options - pointer to option list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* have init port name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* have target port id */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* have LU name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(ERR_FAILED_TO_ENABLE_PATH_WITH_REASON),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(ERR_FAILED_TO_ENABLE_PATH_WITH_REASON),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(ERR_FAILED_TO_ENABLE_PATH_WITH_REASON),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(ERR_FAILED_TO_ENABLE_PATH_WITH_REASON),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* found the path, attempt to enable it */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(ERR_FAILED_TO_ENABLE_PATH_WITH_REASON),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * disablePath -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mpathadm disable path -i <initiator-port>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * -t <target-port name> -l <logical-unit name>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * options - pointer to option list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* have init port name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* have target port id */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* have LU name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(ERR_FAILED_TO_DISABLE_PATH_WITH_REASON),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(ERR_FAILED_TO_DISABLE_PATH_WITH_REASON),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(ERR_FAILED_TO_DISABLE_PATH_WITH_REASON),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(ERR_FAILED_TO_DISABLE_PATH_WITH_REASON),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* found the path, attempt to enable it */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * overridePath -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mpathadm override path {-i <initiator-port>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * -t <target-port name> | -c} <logical-unit name>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * options - pointer to option list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* First check to see if we have the cancel option, */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* May as well save off the lun while we're at it */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* we have a cancel */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* we have a lun- save it while we're here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* if we have the cancel option, */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (getLogicalUnitOid(pLuDeviceFileName, &luOid) == B_FALSE) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* cancel the override path for the specified LU */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* must be wanting to override the path */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (getLogicalUnitOid(pLuDeviceFileName, &luOid) == B_FALSE) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* attempt to set the override path */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * getPathOid -
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Search through all plugins and get the OID for specified path
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * operand - pointer to operand list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * options - pointer to option list from user
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortegetPathOid(cmdOptions_t *options, MP_OID *pPathOid)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* save init port name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* save target port id */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* save LU name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* if we don't have all three pieces, we can't find the path */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get the plugin ist */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((mpstatus = MP_GetPluginOidList(&pPluginOidList))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((NULL == pPluginOidList) || (pPluginOidList->oidCount < 1)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get Logical Unit list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mpstatus = MP_GetMultipathLus(pPluginOidList->oids[i],
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (lu = 0; (lu < pLogicalUnitOidList->oidCount) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get lu properties so we can check the name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get paths for this LU and search from here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* LINTED E_SEC_PRINTF_VAR_FMT */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * get properties of iniator port and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * target port to see if we have the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * right path
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* lu and init port matches, check target port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mpstatus = MP_GetTargetPortProperties(pathProps.targetPortOid,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (0 == strcmp(targetPortID, targProps.portID)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* we found our path */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pPathOid->ownerId = pathOidListArray->oids[pa].ownerId;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* init port matched */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each path associated with this lu */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* lu matched */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each lu */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } /* for each plugin */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * getLbValueFromString
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Gets the MP_LOAD_BALANCE_TYPE specified load balance type string
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * lbStr - load balance string defined in the .h file
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This is what users will be required to feed into the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * modify lu command.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte MP_LOAD_BALANCE_TYPE lbVal = MP_LOAD_BALANCE_TYPE_UNKNOWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (0 == strcmp(lbStr, getTextString(TEXT_LBTYPE_ROUNDROBIN))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (0 == strcmp(lbStr, getTextString(TEXT_LBTYPE_LEASTBLOCKS))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (0 == strcmp(lbStr, getTextString(TEXT_LBTYPE_LEASTIO))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (0 == strcmp(lbStr, getTextString(TEXT_LBTYPE_DEVICEPROD))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (0 == strcmp(lbStr, getTextString(TEXT_LBTYPE_LBAREGION))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (0 == strcmp(lbStr, getTextString(TEXT_LBTYPE_UNKNOWN))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (0 == strcmp(lbStr, getTextString(TEXT_LBTYPE_NONE))) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} /* end getLbValueFromString */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * displayLogicalUnitNameTypeString
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Displays the text equivalent string for the MP_LOGICAL_UNIT_NAME_TYPE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * specified load balance type
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * typeVal - load balance type defined in the MPAPI spec
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortedisplayLogicalUnitNameTypeString(MP_LOGICAL_UNIT_NAME_TYPE typeVal)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte typeString = getTextString(TEXT_NAME_TYPE_UNKNOWN);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte typeString = getTextString(TEXT_NAME_TYPE_VPD83_TYPE1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte typeString = getTextString(TEXT_NAME_TYPE_VPD83_TYPE2);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte typeString = getTextString(TEXT_NAME_TYPE_VPD83_TYPE3);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} /* end displayLogicalUnitNameTypeString */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * displayLoadBalanceString
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Displays the text equivalent string for the MP_LOAD_BALANCE_TYPE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * specified load balance type
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * lbVal - load balance type defined in the MPAPI spec
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortedisplayLoadBalanceString(MP_LOAD_BALANCE_TYPE lbVal)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_ROUNDROBIN);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_LEASTBLOCKS);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_DEVICEPROD);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_FAILOVER_ONLY);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY2);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY3);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY4);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY5);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY6);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY7);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY8);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY9);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY10);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY11);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY12);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY13);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY14);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY15);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lbString = getTextString(TEXT_LBTYPE_PROPRIETARY16);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} /* end displayLoadBalanceString */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * displayTransportTypeString
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Displays the text equivalent string for the MP_PORT_TRANSPORT_TYPE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * specified load balance type
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * transportTypeVal - transport type defined in the MPAPI spec
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortedisplayTransportTypeString(MP_PORT_TRANSPORT_TYPE transportTypeVal)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ttypeString = getTextString(TEXT_TRANS_PORT_TYPE_FC);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ttypeString = getTextString(TEXT_TRANS_PORT_TYPE_SPI);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ttypeString = getTextString(TEXT_TRANS_PORT_TYPE_ISCSI);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ttypeString = getTextString(TEXT_TRANS_PORT_TYPE_IFB);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} /* end displayTransportTypeString */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * getMpStatusStr
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Gets the string description for the specified load balance type value
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * mpstatus - MP_STATUS value
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte statString = getTextString(TEXT_MPSTATUS_SUCCESS);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte statString = getTextString(TEXT_MPSTATUS_INV_PARAMETER);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte statString = getTextString(TEXT_MPSTATUS_UNKNOWN_FN);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte statString = getTextString(TEXT_MPSTATUS_FAILED);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte statString = getTextString(TEXT_MPSTATUS_INSUFF_MEMORY);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte statString = getTextString(TEXT_MPSTATUS_INV_OBJ_TYPE);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte statString = getTextString(TEXT_MPSTATUS_UNSUPPORTED);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte statString = getTextString(TEXT_MPSTATUS_OBJ_NOT_FOUND);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte statString = getTextString(TEXT_MPSTATUS_UNSUPPORTED);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte statString = getTextString(TEXT_MPSTATUS_FN_REPLACED);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte statString = getTextString(TEXT_MPSTATUS_PATH_NONOP);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte statString = getTextString(TEXT_MPSTATUS_TRY_AGAIN);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte statString = getTextString(TEXT_MPSTATUS_NOT_PERMITTED);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} /* end getMpStatusStr */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * GetPathStateStr
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Gets the string description for the specified path state type value
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pathState - MP_PATH_STATE values
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pathString = getTextString(TEXT_PATH_STATE_OKAY);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pathString = getTextString(TEXT_PATH_STATE_PATH_ERR);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pathString = getTextString(TEXT_PATH_STATE_LU_ERR);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pathString = getTextString(TEXT_PATH_STATE_RESERVED);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pathString = getTextString(TEXT_PATH_STATE_REMOVED);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(TEXT_PATH_STATE_OPERATIONAL_CLOSED);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} /* end getPathStateStr */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * getAccessStateStr
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Gets the string description for the specified access state type value
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * accessState - MP_ACCESS_STATE_TYPE values
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortegetAccessStateStr(MP_ACCESS_STATE_TYPE accessState)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte getTextString(TEXT_ACCESS_STATE_ACTIVE_OPTIMIZED);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte accessString = getTextString(TEXT_ACCESS_STATE_ACTIVE);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} /* end getAccessStateStr */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * displayArray
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Print out the specified array.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arrayToDisplay - array to display
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arraySize - size of array to display
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortedisplayArray(MP_CHAR *arrayToDisplay, int arraySize)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < arraySize; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * getStringArray
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Return a null terminated array for the specified array as a string,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This is used for inputting into the %s in formatted strings.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arrayToDisplay - array to display
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arraySize - size of array to display
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortegetStringArray(MP_CHAR *arrayToDisplay, int arraySize)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte newStr = malloc(((sizeof (MP_CHAR)) * arraySize) + 1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < arraySize; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * displayWideArray
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Print out the specified wide character array as a string,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * adding the null termination
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arrayToDisplay - array to display
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * arraySize - size of array to display
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortedisplayWideArray(MP_WCHAR *arrayToDisplay, int arraySize)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 0; i < numChars; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stdout, "%wc", arrayToDisplay[i]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Used by cmdparse for list clis
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortelistFunc(int operandLen, char *operand[], int object, cmdOptions_t *options,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = listLogicalUnit(operandLen, operand, options);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * used bycmdparse for show clis
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteshowFunc(int operandLen, char *operand[], int object, cmdOptions_t *options,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * modifyFunc
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Used by cmdparse for midify clis
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortemodifyFunc(int operandLen, char *operand[], int object, cmdOptions_t *options,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = modifyMpathSupport(operandLen, operand, options);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = modifyLogicalUnit(operandLen, operand, options);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * enableFunc
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Used by cmdpars for enable clis
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteenableFunc(int operandLen, char *operand[], int object, cmdOptions_t *options,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * disableFunc
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Used by cmdpars for disable clis
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortedisableFunc(int operandLen, char *operand[], int object, cmdOptions_t *options,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * failoverFunc
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Used by cmdpars for failover clis
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortefailoverFunc(int operandLen, char *operand[], int object, cmdOptions_t *options,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * overrideFunc
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Used by cmdpars for override clis
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * *************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * *************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* set global command name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = cmdParse(argc, argv, /* SUB_COMMAND_ISSUED, */ synTables,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte argv[0], getTextString(TEXT_UNABLE_TO_COMPLETE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} /* end main */