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