2 % * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 % * Use is subject to license terms.
7 % * The contents of this file are subject to the terms of the
8 % * Common Development and Distribution License, Version 1.0 only
9 % * (the "License"). You may not use this file except in compliance
12 % * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
13 % * or http://www.opensolaris.org/os/licensing.
14 % * See the License for the specific language governing permissions
15 % * and limitations under the License.
17 % * When distributing Covered Code, include this CDDL HEADER in each
18 % * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
19 % * If applicable, add the following below this CDDL HEADER, with the
20 % * fields enclosed by brackets "[]" replaced with your own identifying
21 % * information: Portions Copyright [yyyy] [name of copyright owner]
26 %#pragma ident "%Z%%M% %I% %E% SMI"
28 %#include <sys/types.h>
29 %#include <sys/errno.h>
30 %#include <sys/utsname.h>
35 %#include <sys/lvm/md_basic.h>
44 % * mediator (med) errors, definition of MDE_MED_HOSTNOMED must be changed
45 % * when new errors are added, since MDE_MED_NOERROR has to come out to
49 MDE_MED_HOSTNOMED = -16,
64 MDE_MED_DBARGSMISMATCH,
69 int med_errno; /* errno or negative error code */
70 string med_node<>; /* associated node */
71 string med_misc<>; /* misc text */
77 % * Null error structure initializer.
79 %#define MED_NULL_ERR { 0, NULL, NULL }
80 %#define MD_MED_DEF_TO {2, 0} /* 2 seconds */
81 %#define MD_MED_PMAP_TO {5, 0} /* 5 seconds */
84 % * Mediator Magic Number and Data Revision String
86 %#define MED_DATA_MAGIC 0x6d656461
87 %#define MED_DATA_REV 0x10000000
89 %#define MED_REC_MAGIC 0x6d657265
90 %#define MED_REC_REV 0x10000000
92 %#define MED_DB_MAGIC 0x6d656462
93 %#define MED_DB_REV 0x10000000
95 %#define METAETCDIR "/etc/lvm/"
96 %#define MED_DB_FILE METAETCDIR "meddb"
98 %extern char *med_errnum_to_str(int errnum);
101 %/* Mediator records in MN diskset have all callers set to multiowner */
102 %#define MED_MN_CALLER "multiowner"
107 %/* Start - Avoid duplicate definitions, but get the xdr calls right */
109 #include "meta_arr.x"
111 %/* End - Avoid duplicate definitions, but get the xdr calls right */
116 struct med_db_hdr_t {
125 % * Flags for the mediator data
128 %#define MED_DFL_GOLDEN 0x0001
129 %#define MED_DFL_ERROR 0x0002
141 struct timeval med_dat_id;
148 % * List of mediator data
151 struct med_data_lst_t {
152 med_data_lst_t *mdl_nx;
158 % * Flags for the mediator record
161 %#define MED_RFL_DEL 0x0001
173 md_set_nm_t med_rec_snm;
174 md_node_nm_arr_t med_rec_nodes;
175 md_h_arr_t med_rec_meds;
176 med_data_t med_rec_data;
179 #endif /* !_KERNEL */
183 string med_setname<>;
192 med_err_t med_status;
196 struct med_get_data_res_t {
197 med_err_t med_status;
201 struct med_upd_data_args_t {
207 struct med_get_rec_res_t {
208 med_err_t med_status;
213 struct med_upd_rec_args_t {
218 #endif /* !_KERNEL */
220 struct med_hnm_res_t {
221 med_err_t med_status;
228 % * Constant null error struct.
230 %const med_err_t med_null_err = MED_NULL_ERR;
231 %const struct timeval md_med_def_timeout = MD_MED_DEF_TO;
232 %const struct timeval md_med_pmap_timeout = MD_MED_PMAP_TO;
238 % * External reference to constant null error struct. (declared in med_xdr.c)
240 %extern const med_err_t med_null_err;
241 %extern const struct timeval md_med_def_timeout;
242 %extern const struct timeval md_med_pmap_timeout;
245 % * Some useful defines
247 %#define MED_SERVNAME "rpc.metamedd"
248 %#define MED_SVC "metamed"
251 % * authorization info
253 const MED_GID = 14; /* mag sysadmin group */
258 med_err_t MED_NULL(void) = 0;
259 med_err_t MED_UPD_DATA(med_upd_data_args_t) = 1;
260 med_get_data_res_t MED_GET_DATA(med_args_t) = 2;
262 med_err_t MED_UPD_REC(med_upd_rec_args_t) = 3;
263 med_get_rec_res_t MED_GET_REC(med_args_t) = 4;
265 med_hnm_res_t MED_HOSTNAME(void) = 5;
272 %extern int upd_med_hosts(md_hi_arr_t *mp, char *setname,
273 % med_data_t *meddp, char *caller);
274 %extern med_data_lst_t *get_med_host_data(md_hi_arr_t *mp, char *setname,
276 #endif /* ! _KERNEL */