aluaadm.c revision 293058931b0d2be50da82ce72d3249df01389444
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * CDDL HEADER START
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * The contents of this file are subject to the terms of the
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * Common Development and Distribution License (the "License").
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * You may not use this file except in compliance with the License.
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * See the License for the specific language governing permissions
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * and limitations under the License.
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * If applicable, add the following below this CDDL HEADER, with the
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * CDDL HEADER END
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * Use is subject to license terms.
450396635f70344c58b6b1e4db38cf17ff34445cJohn Fortestatic char *getExecBasename(char *);
450396635f70344c58b6b1e4db38cf17ff34445cJohn Fortestatic int setLuStandbyFunc(int, char **, cmdOptions_t *, void *);
450396635f70344c58b6b1e4db38cf17ff34445cJohn Fortestatic int disableAluaFunc(int, char **, cmdOptions_t *, void *);
450396635f70344c58b6b1e4db38cf17ff34445cJohn Fortestatic int enableAluaFunc(int, char **, cmdOptions_t *, void *);
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte/* tables set up based on cmdparse instructions */
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte/* add new options here */
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * Add new subcommands here
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte OPERAND_MANDATORY_SINGLE, OPERANDSTRING_LU, NULL},
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte OPERAND_MANDATORY_SINGLE, OPERANDSTRING_NODE_ID, NULL},
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte/* globals */
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * setLuStandbyFunc
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * Purpose: set lu to standby
450396635f70344c58b6b1e4db38cf17ff34445cJohn FortesetLuStandbyFunc(int operandLen, char *operands[], cmdOptions_t *options,
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte (void) fprintf(stderr, "%s: %s: %s %d %s\n", cmdName,
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte for (i = 0; i < GUID_INPUT; i++)
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte (void) sscanf(sGuid, "%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x",
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte &guid[0], &guid[1], &guid[2], &guid[3], &guid[4], &guid[5],
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte &guid[6], &guid[7], &guid[8], &guid[9], &guid[10], &guid[11],
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte for (i = 0; i < sizeof (stmfGuid); i++) {
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * disableAluaFunc
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * Purpose: disable alua mode
450396635f70344c58b6b1e4db38cf17ff34445cJohn FortedisableAluaFunc(int operandLen, char *operands[], cmdOptions_t *options,
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * enableAluaFunc
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * Purpose: enable alua mode
450396635f70344c58b6b1e4db38cf17ff34445cJohn ForteenableAluaFunc(int operandLen, char *operands[], cmdOptions_t *options,
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * execFullName - exec name of program (argv[0])
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * copied from usr/src/cmd/zoneadm/zoneadm.c in OS/Net
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * (changed name to lowerCamelCase to keep consistent with this file)
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * command name portion of execFullName
450396635f70344c58b6b1e4db38cf17ff34445cJohn Fortestatic char *
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte /* guard against '/' at end of command invocation */
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte /* set global command name */
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte (void) snprintf(versionString, VERSION_STRING_MAX_LEN, "%s.%s",
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte ret = cmdParse(argc, argv, synTables, subcommandArgs, &funcRet);
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte} /* end main */