xref: /illumos-gate/usr/src/uts/common/rpcsvc/sm_inter.x (revision 581cede61ac9c14d8d4ea452562a567189eead78)
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 (c) 1986, 1994 by Sun Microsystems, Inc.
24 % * All rights reserved.
25 % */
26 
27 %/* from sm_inter.x */
28 
29 #ifdef RPC_HDR
30 %
31 %#pragma ident	"%Z%%M%	%I%	%E% SMI"
32 %
33 #endif
34 
35 /*
36  * Status monitor protocol specification
37  */
38 
39 program SM_PROG {
40 	version SM_VERS  {
41 		/* res_stat = stat_succ if status monitor agrees to monitor */
42 		/* res_stat = stat_fail if status monitor cannot monitor */
43 		/* if res_stat == stat_succ, state = state number of site */
44                 /* sm_name */
45 		struct sm_stat_res	SM_STAT(struct sm_name) = 1;
46 
47 		/* res_stat = stat_succ if status monitor agrees to monitor */
48 		/* res_stat = stat_fail if status monitor cannot monitor */
49 		/* stat consists of state number of local site */
50 		struct sm_stat_res	SM_MON(struct mon) = 2;
51 
52 		/* stat consists of state number of local site */
53 		struct sm_stat		SM_UNMON(struct mon_id) = 3;
54 
55 		/* stat consists of state number of local site */
56 		struct sm_stat		SM_UNMON_ALL(struct my_id) = 4;
57 
58 		void			SM_SIMU_CRASH(void) = 5;
59 
60 		void			SM_NOTIFY(struct stat_chge) = 6;
61 	} = 1;
62 } = 100024;
63 
64 const	SM_MAXSTRLEN = 1024;
65 
66 struct sm_name {
67 	string mon_name<SM_MAXSTRLEN>;
68 };
69 
70 struct my_id {
71 	string	 my_name<SM_MAXSTRLEN>;	/* name of the site iniates the */
72 					/* monitoring request */
73 	int	my_prog;	/* rpc program # of the requesting process */
74 	int	my_vers;	/* rpc version # of the requesting process */
75 	int	my_proc;	/* rpc procedure # of the requesting process */
76 };
77 
78 struct mon_id {
79 	string	mon_name<SM_MAXSTRLEN>;	/* name of the site to be monitored */
80 	struct my_id my_id;
81 };
82 
83 
84 struct mon{
85 	struct mon_id mon_id;
86 	opaque priv[16]; 	/* private information to store at monitor */
87 				/* for requesting process */
88 };
89 
90 
91 /*
92  * state # of status monitor monitonically increases each time
93  * status of the site changes:
94  * an even number (>= 0) indicates the site is down and
95  * an odd number (> 0) indicates the site is up;
96  */
97 struct sm_stat {
98 	int state;		/* state # of status monitor */
99 };
100 
101 enum res {
102 	stat_succ = 0,		/* status monitor agrees to monitor */
103 	stat_fail = 1		/* status monitor cannot monitor */
104 };
105 
106 struct sm_stat_res {
107 	res res_stat;
108 	int state;
109 };
110 
111 /*
112  * structure of the status message sent by the status monitor to the
113  * requesting program when a monitored site changes status.
114  */
115 struct status {
116 	string mon_name<SM_MAXSTRLEN>;
117 	int state;
118 	opaque priv[16];		/* stored private information */
119 };
120 
121 /*
122  * structure sent between statd's to announce a state change (e.g.,
123  * reboot).
124  */
125 struct stat_chge {
126 	string mon_name<SM_MAXSTRLEN>;
127 	int state;
128 };
129