xref: /titanic_50/usr/src/uts/common/sys/fs/ufs_prot.h (revision dbed73cbda2229fd1aa6dc5743993cae7f0a7ee9)
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 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * Please do not edit this file.
29  * It was generated using rpcgen.
30  */
31 
32 #ifndef _SYS_FS_UFS_PROT_H
33 #define	_SYS_FS_UFS_PROT_H
34 
35 #pragma ident	"%Z%%M%	%I%	%E% SMI"
36 
37 #include <rpc/rpc.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 #include <sys/fs/ufs_fs.h>
44 #include <sys/types.h>
45 #include <sys/errno.h>
46 
47 enum ufsdrc_t {
48 	UFSDRC_OK = 0,
49 	UFSDRC_NOENT = ENOENT,
50 	UFSDRC_PERM = EPERM,
51 	UFSDRC_INVAL = EINVAL,
52 	UFSDRC_NOEXEC = ENOEXEC,
53 	UFSDRC_NODEV = ENODEV,
54 	UFSDRC_NXIO = ENXIO,
55 	UFSDRC_BUSY = EBUSY,
56 	UFSDRC_OPNOTSUP = EOPNOTSUPP,
57 	UFSDRC_EXECERR = 254,
58 	UFSDRC_ERR = 255
59 };
60 typedef enum ufsdrc_t ufsdrc_t;
61 
62 struct fs_identity_t {
63 	dev32_t fs_dev;
64 	char *fs_name;
65 };
66 typedef struct fs_identity_t fs_identity_t;
67 
68 struct ufsd_repairfs_args_t {
69 	fs_identity_t ua_fsid;
70 	uint_t ua_attempts;
71 };
72 typedef struct ufsd_repairfs_args_t ufsd_repairfs_args_t;
73 
74 struct ufsd_repairfs_list_t {
75 	int ual_listlen;
76 	ufsd_repairfs_args_t *ual_list;
77 };
78 typedef struct ufsd_repairfs_list_t ufsd_repairfs_list_t;
79 
80 enum ufsd_event_t {
81 	UFSDEV_NONE = 0,
82 	UFSDEV_REBOOT = 0 + 1,
83 	UFSDEV_FSCK = 0 + 2,
84 	UFSDEV_LOG_OP = 0 + 3
85 };
86 typedef enum ufsd_event_t ufsd_event_t;
87 
88 enum ufsd_boot_type_t {
89 	UFSDB_NONE = 0,
90 	UFSDB_CLEAN = 0 + 1,
91 	UFSDB_POSTPANIC = 0 + 2
92 };
93 typedef enum ufsd_boot_type_t ufsd_boot_type_t;
94 
95 enum ufsd_log_op_t {
96 	UFSDLO_NONE = 0,
97 	UFSDLO_COMMIT = 0 + 1,
98 	UFSDLO_GET = 0 + 2,
99 	UFSDLO_PUT = 0 + 3,
100 	UFSDLO_RESET = 0 + 4
101 };
102 typedef enum ufsd_log_op_t ufsd_log_op_t;
103 
104 enum ufsd_fsck_state_t {
105 	UFSDFS_NONE = 0,
106 	UFSDFS_DISPATCH = 0 + 1,
107 	UFSDFS_ERREXIT = 0 + 2,
108 	UFSDFS_SUCCESS = 0 + 3
109 };
110 typedef enum ufsd_fsck_state_t ufsd_fsck_state_t;
111 #define	UFSD_VARMSGMAX 1024
112 #define	UFSD_SPAREMSGBYTES 4
113 
114 struct ufsd_log_data_t {
115 	int umld_eob;
116 	int umld_seq;
117 	struct {
118 		uint_t umld_buf_len;
119 		char *umld_buf_val;
120 	} umld_buf;
121 };
122 typedef struct ufsd_log_data_t ufsd_log_data_t;
123 
124 struct ufsd_log_msg_t {
125 	ufsd_log_op_t um_lop;
126 	union {
127 		ufsd_log_data_t um_logdata;
128 	} ufsd_log_msg_t_u;
129 };
130 typedef struct ufsd_log_msg_t ufsd_log_msg_t;
131 
132 struct ufsd_msg_vardata_t {
133 	ufsd_event_t umv_ev;
134 	union {
135 		ufsd_boot_type_t umv_b;
136 		ufsd_fsck_state_t umv_fs;
137 		ufsd_log_msg_t umv_lm;
138 	} ufsd_msg_vardata_t_u;
139 };
140 typedef struct ufsd_msg_vardata_t ufsd_msg_vardata_t;
141 
142 struct ufsd_msg_t {
143 	time32_t um_time;
144 	uint_t um_from;
145 	struct {
146 		uint_t um_spare_len;
147 		char *um_spare_val;
148 	} um_spare;
149 	ufsd_msg_vardata_t um_var;
150 };
151 typedef struct ufsd_msg_t ufsd_msg_t;
152 #define	UFSD_SERVNAME	"ufsd"
153 #define	xdr_dev_t	xdr_u_int
154 #define	xdr_time_t	xdr_int
155 /*
156  * Set UFSD_THISVERS to the newest version of the protocol
157  * This allows the preprocessor to force an error if the
158  * protocol changes, since the kernel xdr routines may need to be
159  * recoded.  Note that we can't explicitly set the version to a
160  * symbol as rpcgen will then create erroneous routine names.
161  */
162 #define	UFSD_V1			1
163 #define	UFSD_ORIGVERS		UFSD_V1
164 #define	UFSD_THISVERS		1
165 
166 #define	UFSD_PROG ((unsigned long)(100233))
167 #define	UFSD_VERS ((unsigned long)(1))
168 
169 #if defined(__STDC__) || defined(__cplusplus)
170 #define	UFSD_NULL ((unsigned long)(0))
171 extern  ufsdrc_t *ufsd_null_1(void *, CLIENT *);
172 extern  ufsdrc_t *ufsd_null_1_svc(void *, struct svc_req *);
173 #define	UFSD_REPAIRFS ((unsigned long)(1))
174 extern  ufsdrc_t *ufsd_repairfs_1(ufsd_repairfs_args_t *, CLIENT *);
175 extern  ufsdrc_t *
176 		ufsd_repairfs_1_svc(ufsd_repairfs_args_t *, struct svc_req *);
177 #define	UFSD_REPAIRFSLIST ((unsigned long)(2))
178 extern  ufsdrc_t *ufsd_repairfslist_1(ufsd_repairfs_list_t *, CLIENT *);
179 extern  ufsdrc_t *
180 	ufsd_repairfslist_1_svc(ufsd_repairfs_list_t *, struct svc_req *);
181 #define	UFSD_SEND ((unsigned long)(3))
182 extern  ufsdrc_t *ufsd_send_1(ufsd_msg_t *, CLIENT *);
183 extern  ufsdrc_t *ufsd_send_1_svc(ufsd_msg_t *, struct svc_req *);
184 #define	UFSD_RECV ((unsigned long)(4))
185 extern  ufsdrc_t *ufsd_recv_1(ufsd_msg_t *, CLIENT *);
186 extern  ufsdrc_t *ufsd_recv_1_svc(ufsd_msg_t *, struct svc_req *);
187 #define	UFSD_EXIT ((unsigned long)(5))
188 extern  ufsdrc_t *ufsd_exit_1(void *, CLIENT *);
189 extern  ufsdrc_t *ufsd_exit_1_svc(void *, struct svc_req *);
190 extern int ufsd_prog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
191 
192 #else /* K&R C */
193 #define	UFSD_NULL ((unsigned long)(0))
194 extern  ufsdrc_t *ufsd_null_1();
195 extern  ufsdrc_t *ufsd_null_1_svc();
196 #define	UFSD_REPAIRFS ((unsigned long)(1))
197 extern  ufsdrc_t *ufsd_repairfs_1();
198 extern  ufsdrc_t *ufsd_repairfs_1_svc();
199 #define	UFSD_REPAIRFSLIST ((unsigned long)(2))
200 extern  ufsdrc_t *ufsd_repairfslist_1();
201 extern  ufsdrc_t *ufsd_repairfslist_1_svc();
202 #define	UFSD_SEND ((unsigned long)(3))
203 extern  ufsdrc_t *ufsd_send_1();
204 extern  ufsdrc_t *ufsd_send_1_svc();
205 #define	UFSD_RECV ((unsigned long)(4))
206 extern  ufsdrc_t *ufsd_recv_1();
207 extern  ufsdrc_t *ufsd_recv_1_svc();
208 #define	UFSD_EXIT ((unsigned long)(5))
209 extern  ufsdrc_t *ufsd_exit_1();
210 extern  ufsdrc_t *ufsd_exit_1_svc();
211 extern int ufsd_prog_1_freeresult();
212 #endif /* K&R C */
213 
214 /* the xdr functions */
215 
216 #if defined(__STDC__) || defined(__cplusplus)
217 extern  bool_t xdr_ufsdrc_t(XDR *, ufsdrc_t *);
218 extern  bool_t xdr_fs_identity_t(XDR *, fs_identity_t *);
219 extern  bool_t xdr_ufsd_repairfs_args_t(XDR *, ufsd_repairfs_args_t *);
220 extern  bool_t xdr_ufsd_repairfs_list_t(XDR *, ufsd_repairfs_list_t *);
221 extern  bool_t xdr_ufsd_event_t(XDR *, ufsd_event_t *);
222 extern  bool_t xdr_ufsd_boot_type_t(XDR *, ufsd_boot_type_t *);
223 extern  bool_t xdr_ufsd_log_op_t(XDR *, ufsd_log_op_t *);
224 extern  bool_t xdr_ufsd_fsck_state_t(XDR *, ufsd_fsck_state_t *);
225 extern  bool_t xdr_ufsd_log_data_t(XDR *, ufsd_log_data_t *);
226 extern  bool_t xdr_ufsd_log_msg_t(XDR *, ufsd_log_msg_t *);
227 extern  bool_t xdr_ufsd_msg_vardata_t(XDR *, ufsd_msg_vardata_t *);
228 extern  bool_t xdr_ufsd_msg_t(XDR *, ufsd_msg_t *);
229 
230 #else /* K&R C */
231 extern bool_t xdr_ufsdrc_t();
232 extern bool_t xdr_fs_identity_t();
233 extern bool_t xdr_ufsd_repairfs_args_t();
234 extern bool_t xdr_ufsd_repairfs_list_t();
235 extern bool_t xdr_ufsd_event_t();
236 extern bool_t xdr_ufsd_boot_type_t();
237 extern bool_t xdr_ufsd_log_op_t();
238 extern bool_t xdr_ufsd_fsck_state_t();
239 extern bool_t xdr_ufsd_log_data_t();
240 extern bool_t xdr_ufsd_log_msg_t();
241 extern bool_t xdr_ufsd_msg_vardata_t();
242 extern bool_t xdr_ufsd_msg_t();
243 
244 #endif /* K&R C */
245 
246 #ifdef __cplusplus
247 }
248 #endif
249 
250 #endif /* !_SYS_FS_UFS_PROT_H */
251