xref: /titanic_41/usr/src/cmd/mpathadm/mpathadm.h (revision 2b24ab6b3865caeede9eeb9db6b83e1d89dcd1ea)
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
30 extern "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 
54 int listMpathSupport(int operandLen, char *operand[]);
55 int showMpathSupport(int operandLen, char *operand[]);
56 int modifyMpathSupport(int operandLen, char *operand[], cmdOptions_t *options);
57 
58 int listLogicalUnit(int operandLen, char *operand[], cmdOptions_t *options);
59 int listIndividualLogicalUnit(MP_OID luOid,
60     MP_MULTIPATH_LOGICAL_UNIT_PROPERTIES luProps);
61 int showLogicalUnit(int operandLen, char *operand[]);
62 int showIndividualLogicalUnit(MP_OID luOid,
63     MP_MULTIPATH_LOGICAL_UNIT_PROPERTIES luProps, MP_PLUGIN_PROPERTIES);
64 int modifyLogicalUnit(int operandLen, char *operand[], cmdOptions_t *options);
65 int failoverLogicalUnit(char *operand[]);
66 boolean_t getLogicalUnitOid(MP_CHAR *luFileName, MP_OID *pluOid);
67 
68 int listInitiatorPort(int operandLen, char *operand[]);
69 int listIndividualInitiatorPort(MP_INITIATOR_PORT_PROPERTIES initProps);
70 int showInitiatorPort(int operandLen, char *operand[]);
71 int showIndividualInitiatorPort(MP_INITIATOR_PORT_PROPERTIES initProps);
72 
73 int enablePath(cmdOptions_t *options);
74 int disablePath(cmdOptions_t *options);
75 int overridePath(cmdOptions_t *options);
76 
77 boolean_t getPathOid(cmdOptions_t *options, MP_OID *pPathOid);
78 MP_LOAD_BALANCE_TYPE getLbValueFromString(char *str);
79 
80 char *getMpStatusStr(MP_STATUS mpstatus);
81 void displayArray(MP_CHAR *arrayToDisplay, int arraySize);
82 void displayWideArray(MP_WCHAR *arrayToDisplay, int arraySize);
83 char *getPathStateStr(MP_PATH_STATE pathState);
84 char *getAccessStateStr(MP_ACCESS_STATE_TYPE accessState);
85 MP_CHAR *getStringArray(MP_CHAR *arrayToDisplay, int arraySize);
86 boolean_t compareLUName(MP_CHAR *cmpString, MP_CHAR *deviceFileName);
87 void displayLoadBalanceString(MP_LOAD_BALANCE_TYPE lbVal);
88 void displayLogicalUnitNameTypeString(MP_LOGICAL_UNIT_NAME_TYPE typeVal);
89 void displayTransportTypeString(MP_PORT_TRANSPORT_TYPE transportTypeVal);
90 
91 #ifdef	__cplusplus
92 }
93 #endif
94 
95 #endif /* _MPATHADM_H */
96