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