/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <errno.h>
#include <zone.h>
#include <sasinfo.h>
/*
* Version number:
* MAJOR - This should only change when there is an incompatible change made
* to the interfaces or the output.
*
* MINOR - This should change whenever there is a new command or new feature
* with no incompatible change.
*/
/* globals */
static char *cmdName;
/* forward declarations */
static int listHbaFunc(int, char **, cmdOptions_t *, void *);
static int listHbaPortFunc(int, char **, cmdOptions_t *, void *);
static int listExpanderFunc(int, char **, cmdOptions_t *, void *);
static int listTargetPortFunc(int, char **, cmdOptions_t *, void *);
static int listLogicalUnitFunc(int, char **, cmdOptions_t *, void *);
static char *getExecBasename(char *);
/*
* Add new options here
*
* Optional option-arguments are not allowed by CLIP
*/
{NULL, 0, 0}
};
/*
* Add new subcommands here
*/
OPERAND_OPTIONAL_MULTIPLE, "HBA Name"},
OPERAND_OPTIONAL_MULTIPLE, "HBA Port Name"},
OPERAND_OPTIONAL_MULTIPLE, "Expander Device SAS Address"},
OPERAND_OPTIONAL_MULTIPLE, "Target Port SAS Address"},
OPERAND_OPTIONAL_MULTIPLE, "OS Device Name"},
OPERAND_OPTIONAL_MULTIPLE, "OS Device Name"},
};
/*
*/
/*ARGSUSED*/
static int
{
}
/*ARGSUSED*/
static int
{
}
/*
*/
/*ARGSUSED*/
static int
void *addArgs)
{
}
/*ARGSUSED*/
static int
void *addArgs)
{
}
/*
*/
/*ARGSUSED*/
static int
void *addArgs)
{
}
/*
* input:
* execFullName - exec name of program (argv[0])
*
* Returns:
* command name portion of execFullName
*/
static char *
{
/* guard against '/' at end of command invocation */
for (;;) {
break;
} else {
if (*execBasename == '\0') {
*lastSlash = '\0';
continue;
}
break;
}
}
return (execBasename);
}
/*
* main calls a parser that checks syntax of the input command against
* various rules tables.
*
* The return value from the function is placed in funcRet
*/
int
{
int ret;
int funcRet;
/* to support locale */
#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
#endif
(void) textdomain(TEXT_DOMAIN);
/* set global command name */
/* check if is global zone */
if (getzoneid() != GLOBAL_ZONEID) {
return (1);
}
/* call the CLI parser */
if (ret == 1) {
return (1);
} else if (ret == -1) {
return (1);
}
if (funcRet != 0) {
return (1);
}
return (0);
}