xref: /titanic_41/usr/src/head/metacl.x (revision 6185db853e024a486ff8837e6784dd290d866112)
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 % */
25 %
26 %#pragma ident	"%Z%%M%	%I%	%E% SMI"
27 %
28 
29 #ifdef RPC_SVC
30 %
31 %int mdc_in_daemon = 1;
32 %#include <signal.h>
33 #endif /* RPC_SVC */
34 
35 #ifdef RPC_HDR
36 %#ifndef STRINGARRAY
37 #endif
38 typedef string stringarray<>;
39 #ifdef RPC_HDR
40 %#define STRINGARRAY
41 %#endif
42 #endif
43 
44 struct mdc_err_t {
45 	int			mdc_errno; /* errno or negative error code */
46 	int			mdc_exitcode;	/* child exit code. */
47 	string			mdc_node<>;	/* associated node */
48 	string			mdc_misc<>;	/* misc text */
49 };
50 
51 %
52 %/*
53 % * rpc argument and response structures
54 % */
55 struct mdc_bind_res_t {
56 	mdc_err_t	mdc_status;		/* status of RPC call */
57 };
58 
59 struct mdcrpc_proxy_args_t {
60 	stringarray		argvlist<>;
61 	stringarray		environment<>;
62 };
63 
64 #ifdef RPC_CLNT
65 %int _mdc_in_daemon = 0;
66 %#pragma weak mdc_in_daemon = _mdc_in_daemon
67 %void mdc_clrerror(mdc_err_t *mdcep);
68 
69 #endif /* RPC_CLNT */
70 
71 #ifdef RPC_HDR
72 %
73 %extern	int	mdc_in_daemon;
74 %
75 %/*
76 % * Null error structure initializer.
77 % */
78 %#define	MDC_NULL_ERR	{ 0, NULL, NULL }
79 %#define	MD_MDC_DEF_TO	{5, 0}		/* 5 seconds */
80 %#define	MD_MDC_PMAP_TO	{35, 0}		/* 35 seconds */
81 %#define	MD_MDC_PROXY_TO	{60 * 60, 0 }	/* 1hr */
82 %
83 %/*
84 % * various cluster errors, definition of MDC_NOTINCLUSTER must be changed
85 % * when new errors are added, since MDC_NOERROR has to come out to
86 % * be zero!
87 % */
88 enum mdc_errno_t {
89 	MDC_PROXYKILLED = -13,	/* remote was killed by signal */
90 	MDC_PROXYNOFORK,	/* could not fork remote */
91 	MDC_PROXYFAILED,	/* remote exited non-zero */
92 	MDC_NOTINCLUSTER,	/* host is not a node */
93 	MDC_NOACCESS,
94 	MDC_NOACCESS_CCR,
95 	MDC_RPCFAILED,
96 	BIND_LINKISDIR,
97 	BIND_NOACCESS_SHARED,
98 	BIND_LOCALSET,
99 	BIND_NODISKSETCLASS,
100 	BIND_NOACCESS_DEVICE,
101 	BIND_BADDEVICE,
102 	MDC_NOERROR
103 };
104 
105 %
106 %/*
107 % * Set MDC_THISVERS to the newest version of the protocol
108 % * This allows the preprocessor to force an error if the
109 % * protocol changes, since the kernel xdr routines may need to be
110 % * recoded.  Note that we can't explicitly set the version to a
111 % * symbol as rpcgen will then create erroneous routine names.
112 % */
113 %#define	MDC_V1			1
114 %#define	MDC_ORIGVERS		MDC_V1
115 %#define	MDC_THISVERS		1
116 %
117 %/* All powerful group 14 */
118 %#define	MDC_GID			14
119 %
120 %/*
121 % * External reference to constant null error struct. (declared in med_xdr.c)
122 % */
123 %extern	const	mdc_err_t		mdc_null_err;
124 %extern	const	struct	timeval		md_mdc_def_timeout;
125 %extern	const	struct	timeval		md_mdc_pmap_timeout;
126 %extern const	struct	timeval		md_mdc_proxy_timeout;
127 %
128 %/*
129 % * Some useful defines
130 % */
131 %#define	MDC_SERVNAME	"rpc.metacld"
132 %#define	MDC_SVC		"metacl"
133 %
134 #endif /* RPC_HDR */
135 
136 #ifdef	RPC_XDR
137 %
138 %/*
139 % * Constant null error struct.
140 % */
141 %const		mdc_err_t		mdc_null_err = MDC_NULL_ERR;
142 %const	struct	timeval			md_mdc_def_timeout = MD_MDC_DEF_TO;
143 %const	struct	timeval			md_mdc_pmap_timeout = MD_MDC_PMAP_TO;
144 %const	struct	timeval			md_mdc_proxy_timeout = MD_MDC_PROXY_TO;
145 
146 #endif	/* RPC_XDR */
147 
148 
149 %
150 %/*
151 % * services available
152 % */
153 program MDC_PROG {
154 	version MDC_VERS {
155 		mdc_bind_res_t	mdc_null(void)			= 0;
156 		mdc_bind_res_t	mdc_bind_devs(void)		= 1;
157 		mdc_bind_res_t	mdc_proxy(mdcrpc_proxy_args_t)	= 2;
158 	} = 1;
159 } = 100281;
160