xref: /utopia/UTPA2-700.0.x/projects/tools/lint/mips-linux-gnu_include/rpcsvc/sm_inter.x (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1*53ee8cc1Swenshuai.xi /* @(#)sm_inter.x	2.2 88/08/01 4.0 RPCSRC */
2*53ee8cc1Swenshuai.xi /* @(#)sm_inter.x 1.7 87/06/24 Copyr 1987 Sun Micro */
3*53ee8cc1Swenshuai.xi 
4*53ee8cc1Swenshuai.xi /*
5*53ee8cc1Swenshuai.xi  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
6*53ee8cc1Swenshuai.xi  * unrestricted use provided that this legend is included on all tape
7*53ee8cc1Swenshuai.xi  * media and as a part of the software program in whole or part.  Users
8*53ee8cc1Swenshuai.xi  * may copy or modify Sun RPC without charge, but are not authorized
9*53ee8cc1Swenshuai.xi  * to license or distribute it to anyone else except as part of a product or
10*53ee8cc1Swenshuai.xi  * program developed by the user.
11*53ee8cc1Swenshuai.xi  *
12*53ee8cc1Swenshuai.xi  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
13*53ee8cc1Swenshuai.xi  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
14*53ee8cc1Swenshuai.xi  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
15*53ee8cc1Swenshuai.xi  *
16*53ee8cc1Swenshuai.xi  * Sun RPC is provided with no support and without any obligation on the
17*53ee8cc1Swenshuai.xi  * part of Sun Microsystems, Inc. to assist in its use, correction,
18*53ee8cc1Swenshuai.xi  * modification or enhancement.
19*53ee8cc1Swenshuai.xi  *
20*53ee8cc1Swenshuai.xi  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
21*53ee8cc1Swenshuai.xi  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
22*53ee8cc1Swenshuai.xi  * OR ANY PART THEREOF.
23*53ee8cc1Swenshuai.xi  *
24*53ee8cc1Swenshuai.xi  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
25*53ee8cc1Swenshuai.xi  * or profits or other special, indirect and consequential damages, even if
26*53ee8cc1Swenshuai.xi  * Sun has been advised of the possibility of such damages.
27*53ee8cc1Swenshuai.xi  *
28*53ee8cc1Swenshuai.xi  * Sun Microsystems, Inc.
29*53ee8cc1Swenshuai.xi  * 2550 Garcia Avenue
30*53ee8cc1Swenshuai.xi  * Mountain View, California  94043
31*53ee8cc1Swenshuai.xi  */
32*53ee8cc1Swenshuai.xi 
33*53ee8cc1Swenshuai.xi /*
34*53ee8cc1Swenshuai.xi  * Status monitor protocol specification
35*53ee8cc1Swenshuai.xi  * Copyright (C) 1986 Sun Microsystems, Inc.
36*53ee8cc1Swenshuai.xi  *
37*53ee8cc1Swenshuai.xi  */
38*53ee8cc1Swenshuai.xi 
39*53ee8cc1Swenshuai.xi 
40*53ee8cc1Swenshuai.xi program SM_PROG {
41*53ee8cc1Swenshuai.xi 	version SM_VERS  {
42*53ee8cc1Swenshuai.xi 		/* res_stat = stat_succ if status monitor agrees to monitor */
43*53ee8cc1Swenshuai.xi 		/* res_stat = stat_fail if status monitor cannot monitor */
44*53ee8cc1Swenshuai.xi 		/* if res_stat == stat_succ, state = state number of site sm_name */
45*53ee8cc1Swenshuai.xi 		struct sm_stat_res			 SM_STAT(struct sm_name) = 1;
46*53ee8cc1Swenshuai.xi 
47*53ee8cc1Swenshuai.xi 		/* res_stat = stat_succ if status monitor agrees to monitor */
48*53ee8cc1Swenshuai.xi 		/* res_stat = stat_fail if status monitor cannot monitor */
49*53ee8cc1Swenshuai.xi 		/* stat consists of state number of local site */
50*53ee8cc1Swenshuai.xi 		struct sm_stat_res			 SM_MON(struct mon) = 2;
51*53ee8cc1Swenshuai.xi 
52*53ee8cc1Swenshuai.xi 		/* stat consists of state number of local site */
53*53ee8cc1Swenshuai.xi 		struct sm_stat				 SM_UNMON(struct mon_id) = 3;
54*53ee8cc1Swenshuai.xi 
55*53ee8cc1Swenshuai.xi 		/* stat consists of state number of local site */
56*53ee8cc1Swenshuai.xi 		struct sm_stat				 SM_UNMON_ALL(struct my_id) = 4;
57*53ee8cc1Swenshuai.xi 
58*53ee8cc1Swenshuai.xi 		void					 SM_SIMU_CRASH(void) = 5;
59*53ee8cc1Swenshuai.xi 
60*53ee8cc1Swenshuai.xi 	} = 1;
61*53ee8cc1Swenshuai.xi } = 100024;
62*53ee8cc1Swenshuai.xi 
63*53ee8cc1Swenshuai.xi const	SM_MAXSTRLEN = 1024;
64*53ee8cc1Swenshuai.xi 
65*53ee8cc1Swenshuai.xi struct sm_name {
66*53ee8cc1Swenshuai.xi 	string mon_name<SM_MAXSTRLEN>;
67*53ee8cc1Swenshuai.xi };
68*53ee8cc1Swenshuai.xi 
69*53ee8cc1Swenshuai.xi struct my_id {
70*53ee8cc1Swenshuai.xi 	string	 my_name<SM_MAXSTRLEN>;		/* name of the site initiating the monitoring request*/
71*53ee8cc1Swenshuai.xi 	int	my_prog;			/* rpc program # of the requesting process */
72*53ee8cc1Swenshuai.xi 	int	my_vers;			/* rpc version # of the requesting process */
73*53ee8cc1Swenshuai.xi 	int	my_proc;			/* rpc procedure # of the requesting process */
74*53ee8cc1Swenshuai.xi };
75*53ee8cc1Swenshuai.xi 
76*53ee8cc1Swenshuai.xi struct mon_id {
77*53ee8cc1Swenshuai.xi 	string	mon_name<SM_MAXSTRLEN>;		/* name of the site to be monitored */
78*53ee8cc1Swenshuai.xi 	struct my_id my_id;
79*53ee8cc1Swenshuai.xi };
80*53ee8cc1Swenshuai.xi 
81*53ee8cc1Swenshuai.xi 
82*53ee8cc1Swenshuai.xi struct mon{
83*53ee8cc1Swenshuai.xi 	struct mon_id mon_id;
84*53ee8cc1Swenshuai.xi 	opaque priv[16]; 		/* private information to store at monitor for requesting process */
85*53ee8cc1Swenshuai.xi };
86*53ee8cc1Swenshuai.xi 
87*53ee8cc1Swenshuai.xi 
88*53ee8cc1Swenshuai.xi /*
89*53ee8cc1Swenshuai.xi  * state # of status monitor monotonically increases each time
90*53ee8cc1Swenshuai.xi  * status of the site changes:
91*53ee8cc1Swenshuai.xi  * an even number (>= 0) indicates the site is down and
92*53ee8cc1Swenshuai.xi  * an odd number (> 0) indicates the site is up;
93*53ee8cc1Swenshuai.xi  */
94*53ee8cc1Swenshuai.xi struct sm_stat {
95*53ee8cc1Swenshuai.xi 	int state;		/* state # of status monitor */
96*53ee8cc1Swenshuai.xi };
97*53ee8cc1Swenshuai.xi 
98*53ee8cc1Swenshuai.xi enum res {
99*53ee8cc1Swenshuai.xi 	stat_succ = 0,		/* status monitor agrees to monitor */
100*53ee8cc1Swenshuai.xi 	stat_fail = 1		/* status monitor cannot monitor */
101*53ee8cc1Swenshuai.xi };
102*53ee8cc1Swenshuai.xi 
103*53ee8cc1Swenshuai.xi struct sm_stat_res {
104*53ee8cc1Swenshuai.xi 	res res_stat;
105*53ee8cc1Swenshuai.xi 	int state;
106*53ee8cc1Swenshuai.xi };
107*53ee8cc1Swenshuai.xi 
108*53ee8cc1Swenshuai.xi /*
109*53ee8cc1Swenshuai.xi  * structure of the status message sent back by the status monitor
110*53ee8cc1Swenshuai.xi  * when monitor site status changes
111*53ee8cc1Swenshuai.xi  */
112*53ee8cc1Swenshuai.xi struct status {
113*53ee8cc1Swenshuai.xi 	string mon_name<SM_MAXSTRLEN>;
114*53ee8cc1Swenshuai.xi 	int state;
115*53ee8cc1Swenshuai.xi 	opaque priv[16];		/* stored private information */
116*53ee8cc1Swenshuai.xi };
117