xref: /onnv-gate/usr/src/cmd/isns/isnsadm/isnsadm.h (revision 7836:4e95154b5b7a)
1*7836SJohn.Forte@Sun.COM /*
2*7836SJohn.Forte@Sun.COM  * CDDL HEADER START
3*7836SJohn.Forte@Sun.COM  *
4*7836SJohn.Forte@Sun.COM  * The contents of this file are subject to the terms of the
5*7836SJohn.Forte@Sun.COM  * Common Development and Distribution License (the "License").
6*7836SJohn.Forte@Sun.COM  * You may not use this file except in compliance with the License.
7*7836SJohn.Forte@Sun.COM  *
8*7836SJohn.Forte@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*7836SJohn.Forte@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*7836SJohn.Forte@Sun.COM  * See the License for the specific language governing permissions
11*7836SJohn.Forte@Sun.COM  * and limitations under the License.
12*7836SJohn.Forte@Sun.COM  *
13*7836SJohn.Forte@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*7836SJohn.Forte@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*7836SJohn.Forte@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*7836SJohn.Forte@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*7836SJohn.Forte@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*7836SJohn.Forte@Sun.COM  *
19*7836SJohn.Forte@Sun.COM  * CDDL HEADER END
20*7836SJohn.Forte@Sun.COM  */
21*7836SJohn.Forte@Sun.COM /*
22*7836SJohn.Forte@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23*7836SJohn.Forte@Sun.COM  * Use is subject to license terms.
24*7836SJohn.Forte@Sun.COM  */
25*7836SJohn.Forte@Sun.COM 
26*7836SJohn.Forte@Sun.COM #ifndef _ISNSADM_H
27*7836SJohn.Forte@Sun.COM #define	_ISNSADM_H
28*7836SJohn.Forte@Sun.COM 
29*7836SJohn.Forte@Sun.COM #ifdef	__cplusplus
30*7836SJohn.Forte@Sun.COM extern "C" {
31*7836SJohn.Forte@Sun.COM #endif
32*7836SJohn.Forte@Sun.COM 
33*7836SJohn.Forte@Sun.COM #include <stdio.h>
34*7836SJohn.Forte@Sun.COM #include <stdlib.h>
35*7836SJohn.Forte@Sun.COM #include <string.h>
36*7836SJohn.Forte@Sun.COM #include <libintl.h>
37*7836SJohn.Forte@Sun.COM #include <unistd.h>
38*7836SJohn.Forte@Sun.COM #include <sys/types.h>
39*7836SJohn.Forte@Sun.COM #include <netinet/in.h>
40*7836SJohn.Forte@Sun.COM #include <inttypes.h>
41*7836SJohn.Forte@Sun.COM #include <cmdparse.h>
42*7836SJohn.Forte@Sun.COM 
43*7836SJohn.Forte@Sun.COM #ifdef _BIG_ENDIAN
44*7836SJohn.Forte@Sun.COM #define	htonll(x)   (x)
45*7836SJohn.Forte@Sun.COM #define	ntohll(x)   (x)
46*7836SJohn.Forte@Sun.COM #else
47*7836SJohn.Forte@Sun.COM #define	htonll(x)   ((((unsigned long long)htonl(x)) << 32) + htonl(x >> 32))
48*7836SJohn.Forte@Sun.COM #define	ntohll(x)   ((((unsigned long long)ntohl(x)) << 32) + ntohl(x >> 32))
49*7836SJohn.Forte@Sun.COM #endif
50*7836SJohn.Forte@Sun.COM 
51*7836SJohn.Forte@Sun.COM /* DEFINES */
52*7836SJohn.Forte@Sun.COM /* subcommands */
53*7836SJohn.Forte@Sun.COM #define	LISTNODE		SUBCOMMAND(0)
54*7836SJohn.Forte@Sun.COM #define	LISTDD			SUBCOMMAND(1)
55*7836SJohn.Forte@Sun.COM #define	LISTDDSET		SUBCOMMAND(2)
56*7836SJohn.Forte@Sun.COM #define	CREATEDD		SUBCOMMAND(3)
57*7836SJohn.Forte@Sun.COM #define	CREATEDDSET		SUBCOMMAND(4)
58*7836SJohn.Forte@Sun.COM #define	DELETEDD		SUBCOMMAND(5)
59*7836SJohn.Forte@Sun.COM #define	DELETEDDSET		SUBCOMMAND(6)
60*7836SJohn.Forte@Sun.COM #define	ADDNODE			SUBCOMMAND(7)
61*7836SJohn.Forte@Sun.COM #define	ADDDD			SUBCOMMAND(8)
62*7836SJohn.Forte@Sun.COM #define	REMOVENODE		SUBCOMMAND(9)
63*7836SJohn.Forte@Sun.COM #define	REMOVEDD		SUBCOMMAND(10)
64*7836SJohn.Forte@Sun.COM #define	MODIFYDD		SUBCOMMAND(11)
65*7836SJohn.Forte@Sun.COM #define	MODIFYDDSET		SUBCOMMAND(12)
66*7836SJohn.Forte@Sun.COM #define	ENABLEDDSET		SUBCOMMAND(13)
67*7836SJohn.Forte@Sun.COM #define	DISABLEDDSET		SUBCOMMAND(14)
68*7836SJohn.Forte@Sun.COM #define	SHOWCONFIG		SUBCOMMAND(15)
69*7836SJohn.Forte@Sun.COM 
70*7836SJohn.Forte@Sun.COM /* reader lookup return value definition */
71*7836SJohn.Forte@Sun.COM #define	NO_MATCH		0
72*7836SJohn.Forte@Sun.COM #define	READER_MATCH		1
73*7836SJohn.Forte@Sun.COM #define	END_READER_MATCH	2
74*7836SJohn.Forte@Sun.COM 
75*7836SJohn.Forte@Sun.COM /* Association Request type */
76*7836SJohn.Forte@Sun.COM typedef enum {
77*7836SJohn.Forte@Sun.COM 	dd_to_node,
78*7836SJohn.Forte@Sun.COM 	node_to_dd,
79*7836SJohn.Forte@Sun.COM 	dd_to_ddset,
80*7836SJohn.Forte@Sun.COM 	ddset_to_dd
81*7836SJohn.Forte@Sun.COM } association_t;
82*7836SJohn.Forte@Sun.COM 
83*7836SJohn.Forte@Sun.COM /* Modify Requet type */
84*7836SJohn.Forte@Sun.COM typedef enum {
85*7836SJohn.Forte@Sun.COM 	dd_name_change,
86*7836SJohn.Forte@Sun.COM 	ddset_name_change,
87*7836SJohn.Forte@Sun.COM 	dds_state_change,
88*7836SJohn.Forte@Sun.COM 	dd_bootlist_feature_change
89*7836SJohn.Forte@Sun.COM } modify_type;
90*7836SJohn.Forte@Sun.COM 
91*7836SJohn.Forte@Sun.COM #define	COMMAND_SYNTAX_FAILED	1
92*7836SJohn.Forte@Sun.COM 
93*7836SJohn.Forte@Sun.COM /*  msg code */
94*7836SJohn.Forte@Sun.COM typedef enum {
95*7836SJohn.Forte@Sun.COM     SUBCOMMAND_SUCCESS = 200,
96*7836SJohn.Forte@Sun.COM     SUCCESS_WITH_NO_OBJECT,
97*7836SJohn.Forte@Sun.COM     ERROR_PARTIAL_SUCCESS,
98*7836SJohn.Forte@Sun.COM     ERROR_PARTIAL_FAILURE,
99*7836SJohn.Forte@Sun.COM     ERROR_NO_ADDITIONAL_PARTIAL_FAILIRE_INFO,
100*7836SJohn.Forte@Sun.COM     ERROR_XML_READER_NULL,
101*7836SJohn.Forte@Sun.COM     ERROR_XML_RESPONSE_ERROR,
102*7836SJohn.Forte@Sun.COM     ERROR_XML_NAME_ATTR_NOT_FOUND,
103*7836SJohn.Forte@Sun.COM     ERROR_XML_ID_ATTR_NOT_FOUND,
104*7836SJohn.Forte@Sun.COM     ERROR_XML_TYPE_ATTR_NOT_FOUND,
105*7836SJohn.Forte@Sun.COM     ERROR_XML_ALIAS_ATTR_NOT_FOUND,
106*7836SJohn.Forte@Sun.COM     ERROR_XML_DD_OBJECT_NOT_FOUND,
107*7836SJohn.Forte@Sun.COM     ERROR_XML_DD_SET_OBJECT_NOT_FOUND,
108*7836SJohn.Forte@Sun.COM     ERROR_XML_STATUS_ELEM_NOT_FOUND,
109*7836SJohn.Forte@Sun.COM     ERROR_XML_MESSAGE_ELEM_NOT_FOUND,
110*7836SJohn.Forte@Sun.COM     ERROR_XML_ISNSSERVER_ELEM_NOT_FOUND,
111*7836SJohn.Forte@Sun.COM     ERROR_XML_CREATE_BUFFER_FAILED,
112*7836SJohn.Forte@Sun.COM     ERROR_XML_CREATE_WRITER_FAILED,
113*7836SJohn.Forte@Sun.COM     ERROR_XML_START_DOC_FAILED,
114*7836SJohn.Forte@Sun.COM     ERROR_XML_END_DOC_FAILED,
115*7836SJohn.Forte@Sun.COM     ERROR_XML_START_ELEMENT_FAILED,
116*7836SJohn.Forte@Sun.COM     ERROR_XML_WRITE_ELEMENT_FAILED,
117*7836SJohn.Forte@Sun.COM     ERROR_XML_END_ELEMENT_FAILED,
118*7836SJohn.Forte@Sun.COM     ERROR_XML_WRITE_ATTRIBUTE_FAILED,
119*7836SJohn.Forte@Sun.COM     ERROR_XML_STRDUP_FAILED,
120*7836SJohn.Forte@Sun.COM     ERROR_XML_ADD_CHILD_FAILED,
121*7836SJohn.Forte@Sun.COM     ERROR_XML_PARSE_MEMORY_FAILED,
122*7836SJohn.Forte@Sun.COM     ERROR_XML_XPATH_NEW_CONTEXT_FAILED,
123*7836SJohn.Forte@Sun.COM     ERROR_DOOR_CALL_FAILED,
124*7836SJohn.Forte@Sun.COM     ERROR_DOOR_OPEN_FAILED,
125*7836SJohn.Forte@Sun.COM     ERROR_ISNS_SMF_SERVICE_NOT_ONLINE,
126*7836SJohn.Forte@Sun.COM     ERROR_MALLOC_FAILED,
127*7836SJohn.Forte@Sun.COM     ERROR_DDMEMBER_NOT_FOUND,
128*7836SJohn.Forte@Sun.COM     ERROR_DDSETMEMBER_NOT_FOUND,
129*7836SJohn.Forte@Sun.COM     ERROR_DDMEMBER_ALREADY_EXIST,
130*7836SJohn.Forte@Sun.COM     ERROR_DDSETMEMBER_ALREADY_EXIST,
131*7836SJohn.Forte@Sun.COM     ERROR_OPERATION_NOT_ALLOWED_FOR_DEFAULT_DD,
132*7836SJohn.Forte@Sun.COM     ERROR_OPERATION_NOT_ALLOWED_FOR_DEFAULT_DDSET,
133*7836SJohn.Forte@Sun.COM     ERROR_DD_NAME_IN_USE,
134*7836SJohn.Forte@Sun.COM     ERROR_DDSET_NAME_IN_USE,
135*7836SJohn.Forte@Sun.COM     ERROR_SERVER_BUSY,
136*7836SJohn.Forte@Sun.COM     ERROR_SERVER_INTERNAL_ERROR,
137*7836SJohn.Forte@Sun.COM     UNKNOWN
138*7836SJohn.Forte@Sun.COM } msg_code_t;
139*7836SJohn.Forte@Sun.COM 
140*7836SJohn.Forte@Sun.COM /* proto type */
141*7836SJohn.Forte@Sun.COM char *getTextMessage(msg_code_t code);
142*7836SJohn.Forte@Sun.COM 
143*7836SJohn.Forte@Sun.COM #ifdef	__cplusplus
144*7836SJohn.Forte@Sun.COM }
145*7836SJohn.Forte@Sun.COM #endif
146*7836SJohn.Forte@Sun.COM 
147*7836SJohn.Forte@Sun.COM #endif /* _ISNSADM_H */
148