7712 mandoc -Tlint does always exit with error code 0
[unleashed.git] / usr / src / uts / common / sys / lvm / metamed.x
blob51582310a01be41f0cf87a047b8b4d7ef12a4ad0
1 %/*
2 % * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
3 % * Use is subject to license terms.
4 % *
5 % * CDDL HEADER START
6 % *
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
10 % * with the License.
11 % *
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.
16 % *
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]
22 % *
23 % * CDDL HEADER END
24 % */
26 %#pragma ident  "%Z%%M% %I%     %E% SMI"
28 %#include <sys/types.h>
29 %#include <sys/errno.h>
30 %#include <sys/utsname.h>
31 #ifndef _KERNEL
32 %#include <netdb.h>
33 #endif
35 %#include <sys/lvm/md_basic.h>
37 #ifdef  RPC_SVC
39 %#include <signal.h>
40 #endif  /* RPC_SVC */
43 %/*
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
46 % * be zero!
47 % */
48 enum md_med_errno_t {
49         MDE_MED_HOSTNOMED = -16,
50         MDE_MED_DBNOTINIT,
51         MDE_MED_DBSZBAD,
52         MDE_MED_DBKEYADDFAIL,
53         MDE_MED_DBKEYDELFAIL,
54         MDE_MED_DBHDRSZBAD,
55         MDE_MED_DBHDRMAGBAD,
56         MDE_MED_DBHDRREVBAD,
57         MDE_MED_DBHDRCKSBAD,
58         MDE_MED_DBRECSZBAD,
59         MDE_MED_DBRECMAGBAD,
60         MDE_MED_DBRECREVBAD,
61         MDE_MED_DBRECCKSBAD,
62         MDE_MED_DBRECOFFBAD,
63         MDE_MED_DBRECNOENT,
64         MDE_MED_DBARGSMISMATCH,
65         MDE_MED_NOERROR
68 struct med_err_t {
69         int                     med_errno; /* errno or negative error code */
70         string                  med_node<>;     /* associated node */
71         string                  med_misc<>;     /* misc text */
74 #ifdef  RPC_HDR
76 %/*
77 % * Null error structure initializer.
78 % */
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 */
83 %/*
84 % * Mediator Magic Number and Data Revision String
85 % */
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);
99 #endif  /* RPC_HDR */
101 %/* Mediator records in MN diskset have all callers set to multiowner */
102 %#define        MED_MN_CALLER   "multiowner"
105 #ifdef  RPC_XDR
107 %/* Start - Avoid duplicate definitions, but get the xdr calls right */
108 %#if 0
109 #include "meta_arr.x"
110 %#endif /* 0 */
111 %/* End   - Avoid duplicate definitions, but get the xdr calls right */
113 #endif  /* RPC_XDR */
115 #ifdef  RPC_HDR
116 struct  med_db_hdr_t    {
117         u_int                   med_dbh_mag;
118         u_int                   med_dbh_rev;
119         u_int                   med_dbh_cks;
120         u_int                   med_dbh_nm;
125 % * Flags for the mediator data
126 % */
128 %#define        MED_DFL_GOLDEN          0x0001
129 %#define        MED_DFL_ERROR           0x0002
131 #endif  /* RPC_HDR */
134 struct  med_data_t      {
135         u_int                   med_dat_mag;
136         u_int                   med_dat_rev;
137         u_int                   med_dat_cks;
138         u_int                   med_dat_fl;
139         u_int                   med_dat_cc;
140         set_t                   med_dat_sn;
141         struct  timeval         med_dat_id;
142         int                     med_dat_spare;
145 #ifdef  RPC_HDR
148 % * List of mediator data
149 % */
151 struct med_data_lst_t   {
152         med_data_lst_t          *mdl_nx;
153         med_data_t              *mdl_med;
158 % * Flags for the mediator record
159 % */
161 %#define        MED_RFL_DEL             0x0001
163 #endif  /* RPC_HDR */
166 #ifndef _KERNEL
167 struct  med_rec_t       {
168         u_int                   med_rec_mag;
169         u_int                   med_rec_rev;
170         u_int                   med_rec_cks;
171         u_int                   med_rec_fl;
172         set_t                   med_rec_sn;
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;
177         off_t                   med_rec_foff;
179 #endif /* !_KERNEL */
181 struct  med_med_t       {
182         set_t                   med_setno;
183         string                  med_setname<>;
184         string                  med_caller<>;
187 struct  med_args_t      {
188         med_med_t               med;
191 struct  med_res_t       {
192         med_err_t               med_status;
193         med_med_t               med;
196 struct  med_get_data_res_t      {
197         med_err_t               med_status;
198         med_data_t              med_data;
201 struct  med_upd_data_args_t     {
202         med_med_t               med;
203         med_data_t              med_data;
206 #ifndef _KERNEL
207 struct  med_get_rec_res_t       {
208         med_err_t               med_status;
209         med_med_t               med;
210         med_rec_t               med_rec;
213 struct  med_upd_rec_args_t      {
214         u_int                   med_flags;
215         med_med_t               med;
216         med_rec_t               med_rec;
218 #endif /* !_KERNEL */
220 struct med_hnm_res_t {
221         med_err_t               med_status;
222         string                  med_hnm<>;
225 #ifdef  RPC_XDR
228 % * Constant null error struct.
229 % */
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;
233 #endif  /* RPC_XDR */
235 #ifdef  RPC_HDR
238 % * External reference to constant null error struct. (declared in med_xdr.c)
239 % */
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
246 % */
247 %#define        MED_SERVNAME    "rpc.metamedd"
248 %#define        MED_SVC         "metamed"
251 % * authorization info
252 % */
253 const   MED_GID = 14;           /* mag sysadmin group */
254 #endif  /* RPC_HDR */
256 program MED_PROG {
257         version MED_VERS {
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;
261 #ifndef _KERNEL
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;
264 #endif
265                 med_hnm_res_t MED_HOSTNAME(void)                        = 5;
266         } = 1;
267 } = 100242;
269 #ifdef  RPC_HDR
270 #ifdef  _KERNEL
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, 
275 %                           set_t setno);
276 #endif  /* ! _KERNEL */
277 #endif  /* RPC_HDR */