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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2000-2002 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _RDR_PARAM_TYPES_H
28 #define	_RDR_PARAM_TYPES_H
29 
30 /*
31  * WARNING: The contents of this file are shared by all projects
32  * that  wish to  perform  remote  Dynamic Reconfiguration  (DR)
33  * operations. Copies of this file can be found in the following
34  * locations:
35  *
36  *	Project	    Location
37  *	-------	    --------
38  *	Solaris	    usr/src/cmd/dcs/sparc/sun4u/%M%
39  *	SMS	    src/sms/lib/librdr/%M%
40  *
41  * In order for proper communication to occur,  the files in the
42  * above locations must match exactly. Any changes that are made
43  * to this file should  be made to all of the files in the list.
44  */
45 
46 /*
47  * This file contains the structures that are exposed to the clients
48  * of the Remote DR (RDR) module. They represent the data that is
49  * required for the various RDR operations. They are passed into
50  * the rdr_snd_msg() function and returned from the rdr_rcv_msg()
51  * function.
52  */
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 #include <sys/param.h>
59 #include <config_admin.h>
60 #include <time.h>
61 
62 #ifdef SMSLIB_TARGET
63 #include <libscri/rsrc_info.h>
64 #else
65 #include "rsrc_info.h"
66 #endif /* SMSLIB_TARGET */
67 
68 
69 typedef time_t timeout_t;
70 
71 
72 typedef struct {
73 	char			*locale_str;
74 	unsigned long		session_id;
75 } ses_req_params_t;
76 
77 
78 typedef struct {
79 	unsigned int		error_code;
80 } ses_end_params_t;
81 
82 
83 typedef struct {
84 	cfga_cmd_t 		state_change;
85 	int			num_ap_ids;
86 	char *const 		*ap_ids;
87 	char  			*options;	/* const */
88 	struct cfga_confirm 	*confp;
89 	struct cfga_msg		*msgp;
90 	char			**errstring;
91 	cfga_flags_t 		flags;
92 	timeout_t 		timeval;
93 	int 			retries;
94 } change_state_params_t;
95 
96 
97 typedef struct {
98 	char			*function;	/* const */
99 	int			num_ap_ids;
100 	char *const		*ap_ids;
101 	char 			*options;	/* const */
102 	struct cfga_confirm 	*confp;
103 	struct cfga_msg		*msgp;
104 	char			**errstring;
105 	cfga_flags_t 		flags;
106 } private_func_params_t;
107 
108 
109 typedef struct {
110 	int			num_ap_ids;
111 	char *const		*ap_ids;
112 	char			*options;	/* const */
113 	struct cfga_msg		*msgp;
114 	char			**errstring;
115 	cfga_flags_t 		flags;
116 } test_params_t;
117 
118 
119 /*
120  * A wrapper around the cfga_list_data_t
121  * that allows sorting information to be
122  * associated with each ap_id in an array.
123  */
124 typedef struct {
125 	uint64_t		sort_order;
126 	cfga_list_data_t	ap_id_info;
127 } rdr_list_t;
128 
129 
130 typedef struct {
131 	int 			num_ap_ids;
132 	char			**ap_ids;
133 	rdr_list_t		**ap_id_list;
134 	int			*nlist;
135 	char			*options;
136 	char			*listopts;
137 	char			**errstring;
138 	int 			flags;
139 	unsigned int		permissions;
140 } list_ext_params_t;
141 
142 
143 typedef struct {
144 	int			num_ap_ids;
145 	char			**ap_ids;
146 	struct cfga_msg		*msgp;
147 	char 			*options;	/* const */
148 	cfga_flags_t 		flags;
149 } help_params_t;
150 
151 
152 typedef struct {
153 	char			*ap_log_id1;
154 	char			*ap_log_id2;
155 } ap_id_cmp_params_t;
156 
157 
158 typedef struct {
159 	unsigned long		session_id;
160 } abort_cmd_params_t;
161 
162 
163 typedef struct {
164 	struct cfga_confirm	*confp;
165 	char			*message;
166 	int 			response;
167 } confirm_callback_params_t;
168 
169 
170 typedef struct {
171 	struct cfga_msg		*msgp;
172 	char			*message;
173 } msg_callback_params_t;
174 
175 
176 typedef struct {
177 	int			num_ap_ids;
178 	char			**ap_ids;
179 	int			flags;
180 	ri_hdl_t		*hdl;
181 } rsrc_info_params_t;
182 
183 
184 typedef union {
185 	ses_req_params_t	req;
186 	ses_end_params_t	end;
187 	change_state_params_t	change;
188 	private_func_params_t	priv;
189 	test_params_t		test;
190 	list_ext_params_t	list_ext;
191 	help_params_t		help;
192 	ap_id_cmp_params_t	cmp;
193 	abort_cmd_params_t	abort;
194 	confirm_callback_params_t  conf_cb;
195 	msg_callback_params_t	msg_cb;
196 	rsrc_info_params_t	rsrc_info;
197 } cfga_params_t;
198 
199 
200 #ifdef __cplusplus
201 }
202 #endif
203 
204 #endif	/* _RDR_PARAM_TYPES_H */
205