sm_inter.x revision 74462
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%#ifndef lint
41%static const char rcsid[] =
42%  "$FreeBSD: head/include/rpcsvc/sm_inter.x 74462 2001-03-19 12:50:13Z alfred $";
43%#endif /* not lint */
44#endif
45
46program SM_PROG {
47	version SM_VERS  {
48		/* res_stat = stat_succ if status monitor agrees to monitor */
49		/* res_stat = stat_fail if status monitor cannot monitor */
50		/* if res_stat == stat_succ, state = state number of site sm_name */
51		struct sm_stat_res			 SM_STAT(struct sm_name) = 1;
52
53		/* res_stat = stat_succ if status monitor agrees to monitor */
54		/* res_stat = stat_fail if status monitor cannot monitor */
55		/* stat consists of state number of local site */
56		struct sm_stat_res			 SM_MON(struct mon) = 2;
57
58		/* stat consists of state number of local site */
59		struct sm_stat				 SM_UNMON(struct mon_id) = 3;
60
61		/* stat consists of state number of local site */
62		struct sm_stat				 SM_UNMON_ALL(struct my_id) = 4;
63
64		void					 SM_SIMU_CRASH(void) = 5;
65		void					 SM_NOTIFY(struct stat_chge) = 6;
66
67	} = 1;
68} = 100024;
69
70const	SM_MAXSTRLEN = 1024;
71
72struct sm_name {
73	string mon_name<SM_MAXSTRLEN>;
74};
75
76struct my_id {
77	string	 my_name<SM_MAXSTRLEN>;		/* name of the site iniates the monitoring request*/
78	int	my_prog;			/* rpc program # of the requesting process */
79	int	my_vers;			/* rpc version # of the requesting process */
80	int	my_proc;			/* rpc procedure # of the requesting process */
81};
82
83struct mon_id {
84	string	mon_name<SM_MAXSTRLEN>;		/* name of the site to be monitored */
85	struct my_id my_id;
86};
87
88
89struct mon{
90	struct mon_id mon_id;
91	opaque priv[16]; 		/* private information to store at monitor for requesting process */
92};
93
94struct stat_chge {
95	string  mon_name<SM_MAXSTRLEN>;         /* name of the site that had the state change */
96	int state;
97};
98
99/*
100 * state # of status monitor monitonically increases each time
101 * status of the site changes:
102 * an even number (>= 0) indicates the site is down and
103 * an odd number (> 0) indicates the site is up;
104 */
105struct sm_stat {
106	int state;		/* state # of status monitor */
107};
108
109enum res {
110	stat_succ = 0,		/* status monitor agrees to monitor */
111	stat_fail = 1		/* status monitor cannot monitor */
112};
113
114struct sm_stat_res {
115	res res_stat;
116	int state;
117};
118
119/*
120 * structure of the status message sent back by the status monitor
121 * when monitor site status changes
122 */
123struct status {
124	string mon_name<SM_MAXSTRLEN>;
125	int state;
126	opaque priv[16];		/* stored private information */
127};
128