xref: /dragonfly/include/rpcsvc/sm_inter.x (revision cecb9aae)
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  * @(#)sm_inter.x	2.2 88/08/01 4.0 RPCSRC
30  * @(#)sm_inter.x 1.7 87/06/24 Copyr 1987 Sun Micro
31  * $FreeBSD: src/include/rpcsvc/sm_inter.x,v 1.8.2.1 2002/04/11 17:08:33 alfred Exp $
32  * $DragonFly: src/include/rpcsvc/sm_inter.x,v 1.2 2003/06/17 04:25:58 dillon Exp $
33  */
34 
35 /*
36  * Status monitor protocol specification
37  * Copyright (C) 1986 Sun Microsystems, Inc.
38  *
39  */
40 
41 program SM_PROG {
42 	version SM_VERS  {
43 		/* res_stat = stat_succ if status monitor agrees to monitor */
44 		/* res_stat = stat_fail if status monitor cannot monitor */
45 		/* if res_stat == stat_succ, state = state number of site sm_name */
46 		struct sm_stat_res			 SM_STAT(struct sm_name) = 1;
47 
48 		/* res_stat = stat_succ if status monitor agrees to monitor */
49 		/* res_stat = stat_fail if status monitor cannot monitor */
50 		/* stat consists of state number of local site */
51 		struct sm_stat_res			 SM_MON(struct mon) = 2;
52 
53 		/* stat consists of state number of local site */
54 		struct sm_stat				 SM_UNMON(struct mon_id) = 3;
55 
56 		/* stat consists of state number of local site */
57 		struct sm_stat				 SM_UNMON_ALL(struct my_id) = 4;
58 
59 		void					 SM_SIMU_CRASH(void) = 5;
60 		void					 SM_NOTIFY(struct stat_chge) = 6;
61 
62 	} = 1;
63 } = 100024;
64 
65 const	SM_MAXSTRLEN = 1024;
66 
67 struct sm_name {
68 	string mon_name<SM_MAXSTRLEN>;
69 };
70 
71 struct my_id {
72 	string	 my_name<SM_MAXSTRLEN>;		/* name of the site iniates the 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 for requesting process */
87 };
88 
89 struct stat_chge {
90 	string  mon_name<SM_MAXSTRLEN>;         /* name of the site that had the state change */
91 	int state;
92 };
93 
94 /*
95  * state # of status monitor monitonically increases each time
96  * status of the site changes:
97  * an even number (>= 0) indicates the site is down and
98  * an odd number (> 0) indicates the site is up;
99  */
100 struct sm_stat {
101 	int state;		/* state # of status monitor */
102 };
103 
104 enum sm_res {
105 	stat_succ = 0,		/* status monitor agrees to monitor */
106 	stat_fail = 1		/* status monitor cannot monitor */
107 };
108 
109 struct sm_stat_res {
110 	sm_res res_stat;
111 	int state;
112 };
113 
114 /*
115  * structure of the status message sent back by the status monitor
116  * when monitor site status changes
117  */
118 struct sm_status {
119 	string mon_name<SM_MAXSTRLEN>;
120 	int state;
121 	opaque priv[16];		/* stored private information */
122 };
123