1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23 * Use is subject to license terms.
24 */
25
26#ifndef	_MPATHADM_H
27#define	_MPATHADM_H
28
29#ifdef	__cplusplus
30extern "C" {
31#endif
32
33#define	LIST					SUBCOMMAND(0)
34#define	SHOW					SUBCOMMAND(1)
35#define	MODIFY					SUBCOMMAND(2)
36#define	ENABLE					SUBCOMMAND(3)
37#define	DISABLE					SUBCOMMAND(4)
38#define	FAILOVER				SUBCOMMAND(5)
39#define	OVERRIDE				SUBCOMMAND(6)
40#define	ADD					SUBCOMMAND(7)
41#define	REMOVE					SUBCOMMAND(8)
42
43
44#define	MPATH_SUPPORT				OBJECT(0)
45#define	LOGICAL_UNIT				OBJECT(1)
46#define	INITIATOR_PORT				OBJECT(2)
47#define	PATH					OBJECT(3)
48
49#define	MAX_PLUGINNAME_LEN			256
50
51#define	ERROR_CLI_FAILED			99
52
53
54int listMpathSupport(int operandLen, char *operand[]);
55int showMpathSupport(int operandLen, char *operand[]);
56int modifyMpathSupport(int operandLen, char *operand[], cmdOptions_t *options);
57
58int listLogicalUnit(int operandLen, char *operand[], cmdOptions_t *options);
59int listIndividualLogicalUnit(MP_OID luOid,
60    MP_MULTIPATH_LOGICAL_UNIT_PROPERTIES luProps);
61int showLogicalUnit(int operandLen, char *operand[]);
62int showIndividualLogicalUnit(MP_OID luOid,
63    MP_MULTIPATH_LOGICAL_UNIT_PROPERTIES luProps, MP_PLUGIN_PROPERTIES);
64int modifyLogicalUnit(int operandLen, char *operand[], cmdOptions_t *options);
65int failoverLogicalUnit(char *operand[]);
66boolean_t getLogicalUnitOid(MP_CHAR *luFileName, MP_OID *pluOid);
67
68int listInitiatorPort(int operandLen, char *operand[]);
69int listIndividualInitiatorPort(MP_INITIATOR_PORT_PROPERTIES initProps);
70int showInitiatorPort(int operandLen, char *operand[]);
71int showIndividualInitiatorPort(MP_INITIATOR_PORT_PROPERTIES initProps);
72
73int enablePath(cmdOptions_t *options);
74int disablePath(cmdOptions_t *options);
75int overridePath(cmdOptions_t *options);
76
77boolean_t getPathOid(cmdOptions_t *options, MP_OID *pPathOid);
78MP_LOAD_BALANCE_TYPE getLbValueFromString(char *str);
79
80char *getMpStatusStr(MP_STATUS mpstatus);
81void displayArray(MP_CHAR *arrayToDisplay, int arraySize);
82void displayWideArray(MP_WCHAR *arrayToDisplay, int arraySize);
83char *getPathStateStr(MP_PATH_STATE pathState);
84char *getAccessStateStr(MP_ACCESS_STATE_TYPE accessState);
85MP_CHAR *getStringArray(MP_CHAR *arrayToDisplay, int arraySize);
86boolean_t compareLUName(MP_CHAR *cmpString, MP_CHAR *deviceFileName);
87void displayLoadBalanceString(MP_LOAD_BALANCE_TYPE lbVal);
88void displayLogicalUnitNameTypeString(MP_LOGICAL_UNIT_NAME_TYPE typeVal);
89void displayTransportTypeString(MP_PORT_TRANSPORT_TYPE transportTypeVal);
90
91#ifdef	__cplusplus
92}
93#endif
94
95#endif /* _MPATHADM_H */
96