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